/* GoOHV park trail map page. */

.goohv-trail-map-page {
    display: flex;
    flex-direction: column;
}

.goohv-map-title {
    color: #1b1b1b;
    background: #f5f5f0;
    border-bottom: 1px solid #ddd;
}

.goohv-map-frame {
    position: relative;
    height: calc(100vh - 140px);
    height: calc(100dvh - 140px);
    min-height: 420px;
}

.goohv-map {
    position: absolute;
    inset: 0;
}

/* One column of controls on the right edge. */
.goohv-map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: calc(100% - 50px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.goohv-ctl {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: #1b1b1b;
    background: #fff;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    font: 600 13px/1 system-ui, sans-serif;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.goohv-ctl svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.goohv-ctl svg circle {
    fill: currentColor;
}

.goohv-ctl:focus-visible {
    outline: 3px solid #4285f4;
    outline-offset: 2px;
}

.goohv-ctl.active {
    color: #fff;
    background: #2e7d32;
}

.goohv-ctl-compass .goohv-needle {
    transform-origin: 12px 12px;
    transform-box: view-box;
}

.goohv-ctl-compass .goohv-needle-n {
    fill: #d32f2f;
    stroke: none;
}

.goohv-ctl-compass .goohv-needle-s {
    fill: currentColor;
    stroke: none;
    opacity: 0.45;
}

.goohv-ctl-badge {
    position: absolute;
    right: 3px;
    bottom: 2px;
    font-size: 10px;
}

.goohv-map-banner {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 64px;
    z-index: 2;
    padding: 8px 12px;
    color: #fff;
    background: rgba(183, 28, 28, 0.92);
    border-radius: 8px;
    font-weight: 600;
}

.goohv-map-legend {
    position: absolute;
    top: 10px;
    right: 64px;
    z-index: 3;
    width: min(280px, calc(100% - 84px));
    max-height: calc(100% - 50px);
    overflow-y: auto;
    padding: 10px 12px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.goohv-map-legend-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.goohv-map-legend-rows li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 0;
}

.goohv-legend-line {
    flex: 0 0 28px;
    height: 5px;
    border-radius: 3px;
}

.goohv-legend-icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
}

/* Once the page script has moved the toolbar and legend into Google's map
   controls, Google positions them. */
.goohv-map .goohv-map-controls,
.goohv-map .goohv-map-legend {
    position: static;
    margin: 10px;
}

.goohv-map .goohv-map-controls {
    max-height: none;
}

.goohv-map .goohv-map-legend {
    width: min(280px, calc(100vw - 104px));
    max-height: 50vh;
}

.goohv-map-info {
    font-weight: 600;
}

.goohv-map-nokey {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    color: #555;
    background: #f5f5f0;
}

/* Names: white with a dark outline, a steady size, never in the way of a tap. */
.goohv-map-labels {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
}

.goohv-map-label {
    position: absolute;
    left: 0;
    top: 0;
    white-space: nowrap;
    font: 600 13px/1.2 system-ui, sans-serif;
    -webkit-text-stroke: 3px rgba(0, 0, 0, 0.75);
    paint-order: stroke fill;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
    will-change: transform;
}

.goohv-map-label-trail {
    font-style: italic;
}

.goohv-rider-label {
    margin-top: 4px;
    -webkit-text-stroke: 3px rgba(0, 0, 0, 0.75);
    paint-order: stroke fill;
}
