
.elev_info {
    height: 290px;
    width: 100%;
    padding: 0;
    margin: 0;
    font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
}

.elevation-control {
    height: 200px !important;
}

.elev_info .elevation-summary {
    position: relative;
}

.elev_info .elevation-summary .download {
    float: none;
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.image-container {
    position: relative;
    height: auto;
    overflow: hidden;
}

.image-container img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Photo descriptions slide up over the photo on hover. */
.image-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.85rem;
    line-height: 1.35;
    text-align: left;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.image-container:hover .image-caption,
.image-container:focus-within .image-caption {
    opacity: 1;
    transform: translateY(0);
}

/* Touch devices have no hover. */
@media (hover: none) {
    .image-caption {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .image-caption {
        transition: none;
    }
}

/* ---- Elevation plot colours in dark mode ---- */
[data-theme="dark"] .elevation-detached,
[data-theme="dark"] .elevation-control {
    --ele-bg: rgba(187, 134, 252, 0.12);
    --ele-axis: #e0e0e0;
    --ele-grid: #3a3a3a;
    --ele-area: #bb86fc;
    --ele-stroke: #bb86fc;
    --ele-poly: #bb86fc;
    --ele-line: #bb86fc;
    --ele-circle: #121212;
    --ele-brush: rgba(187, 134, 252, 0.35);
    --ele-sum-shadow: none;
}

[data-theme="dark"] .elevation-control .axis text,
[data-theme="dark"] .elevation-control .legend text,
[data-theme="dark"] .elevation-control .point text {
    fill: #e0e0e0;
    stroke: #121212;
}

[data-theme="dark"] .elevation-control .area {
    stroke: #bb86fc;
}

[data-theme="dark"] .elevation-summary {
    color: #e0e0e0;
    text-shadow: none;
}

[data-theme="dark"] .elevation-control .active .horizontal-drag-line {
    stroke: #e0e0e0;
}

[data-theme="dark"] .elevation-control .horizontal-drag-label {
    fill: #e0e0e0;
    stroke: #121212;
}

[data-theme="dark"] .elevation-control .mouse-focus-line {
    stroke: #e0e0e0;
}

[data-theme="dark"] .elevation-control .ruler {
    color: #e0e0e0;
}

[data-theme="dark"] .leaflet-elevation-pane .height-focus-label {
    fill: #e0e0e0;
    stroke: #121212;
}

[data-theme="dark"] .leaflet-elevation-pane .height-focus.line {
    stroke: #e0e0e0;
}

/* Bigger on desktop. */
@media (min-width: 70rem) {
    body {
        font-size: 20px;
    }

    .map-container {
        height: 520px;
    }

    .elev_info {
        height: 350px;
    }

    .elevation-control {
        height: 250px !important;
    }
}
