body {
    background-color: var(--color-map-background);
}

nav {
    background-color: white;
    width: 100vw;
    position:absolute;
    z-index: 1;
}

main {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 0;
    pointer-events: none;
}

main > * {
    pointer-events: all;
}

.map-pane {
    background-color: var(--color-background);
    border-radius: 4px;
    box-shadow: 0 0 8px var(--color-shadow);
}
.map-pane > div {
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
}
.map-pane h1 {
    font-size: 1.9rem;
}
.map-pane h2 {
    font-size: 1.25rem;
}

.mountain-details {
    position: absolute;
    top: 28px;
    bottom: 0;
    left: 0;
    width: 400px;
    height: auto;
    overflow-y: scroll;
}
.mountain-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.mountain-title .mountain-location {
    font-size: 1.25rem;
    color: var(--color-tertiary);
}
.mountain-section {
    font-size: 1rem;
}
.mountain-section ul {
    margin-top: 8px;
}
.mountain-section ul li {
    padding: 8px 0;
    color: var(--color-primary);
    display: flex;
}

/* The overview's facts sit a little tighter than the trail/lift lists. */
.mountain-section.overview-section ul li {
    padding: 6px 0;
}

/* Bold label ("Trails:") before each value. The li is a flex container,
   so a plain space after the label would collapse -- the gap is a margin. */
.overview-section li strong {
    font-weight: bold;
    margin-right: .4em;
}
.sidebar-item {
    cursor: pointer;
}
.sidebar-item:hover {
    background-color: var(--color-map-background);
}

/* Legend section of the mountain details panel (map_page_base.jinja):
   compact two-column lists, each item led by a fixed-width marker --
   a difficulty/tag icon, or a line sample matching how that feature is
   drawn on the map -- so the labels line up. Filled top-to-bottom, then
   left-to-right (3 rows per column), so the difficulty scale reads in
   order; minmax(0, 1fr) keeps both columns equal so the two lists'
   columns line up despite long labels. */
.mountain-section ul.map-legend {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: repeat(3, auto);
    grid-auto-flow: column;
    column-gap: 1rem;
}

.mountain-section ul.map-legend + ul.map-legend {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--color-border);
}

.mountain-section .map-legend li {
    padding: 3px 0;
    align-items: center;
}

.map-legend li > :first-child {
    flex: none;
    margin: 0 .5em 0 0;
}

.map-legend li > .icon:first-child {
    margin-right: 1.75em; /* 1em icon + this = the 2.25em line samples + .5em */
}

.map-legend li > .icon:not(:first-child) {
    margin: 0 0 0 .4em;
}

.legend-line {
    width: 2.25em;
    height: 1em;
}

/* Gladed lines take their trail's difficulty color on the map, so the
   sample is drawn in the text color. */
.legend-line line:not([stroke]) {
    stroke: var(--color-primary);
}

.sidebar-badge {
    flex: 0 0 4.5em;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.sidebar-badge .icon {
    margin-left: 0;
}

.selected-details {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 256px;
}
.selected-details .selected-title {
    display: flex;
}
.selected-details table {
    width: 100%;
    color: var(--color-primary);
}
.selected-details td {
    padding-bottom: 16px;
}
.selected-details .selected-difficulty {
    color: var(--color-primary);
}

.hover-details {
    position: absolute;
    padding: 8px;
    font-size: 1.25rem;
    display: flex;
}

.icon{
    margin-left: 1ch
}

.icon.person{
    font-size: 1rem;
    margin-left: 0;
    margin-right: .5rem
}

.pass-icon {
    width: 2rem;
    height: 2rem;
    margin-right: .5rem;
}

.map-button a {
    color: white;
    text-decoration: none;
}

.map-button a:hover {
    opacity: 1;
}

#url a {
    color: white;
    text-decoration: none;
}

#url a:hover {
    opacity: 1;
}

#hideButton {
    display: none;
}

@media screen and (max-width: 1232px){
    .zoom-button {
        width: auto;
    }

    .map-button {
        width: auto;
    }

    #url {
        width: auto;
    }
}

@media screen and (max-width: 950px) {
    main {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    /* Inset 8px from the screen edges (and the nav bar above) so it reads
       as a panel over the map rather than a full-screen page. margin-top,
       not a new top, keeps whatever top each page already sets; it's 7px
       because the panel already sat 1px below the nav bar. */
    .mountain-details {
        float: none;
        display: none;
        left: 8px;
        right: 8px;
        bottom: 8px;
        width: auto;
        margin-top: 7px;
        z-index: 8;
    }

    /* While the panel is open, the Details button (which sits over the
       panel's top-right corner) moves in with the panel's 8px inset so it
       keeps the same 10px from the panel's corner. .details-open is set by
       the toggle script in map_page_base.jinja. */
    #hideButton.details-open {
        top: calc(38px + 7px); /* the panel's margin-top */
        right: 18px;
    }

    .mountain-title {
        display: block;
    }

    .mountain-title h1 {
        max-width: calc(100% - 111px);
    }

    .mountain-location {
        margin-top: 8px;
    }

    .map-button {
        left: 10px;
        right: auto;
        width: auto;
        font-size: 1rem;
        height: 34px
    }

    #hideButton {
        display: inline-flex;
        bottom: auto;
        top: 38px;
        left: auto;
        right: 10px;
        z-index: 10;
        align-items: flex-end;
    }
}
