/* ============================================================
   River Stories Page
   ============================================================ */

/* Wrapper — full-bleed below the site shell */
.river-stories-page .page-main {
    gap: 0;
    margin-top: 0;
}

.river-wrapper {
    display: grid;
    gap: 0;
}

/* ── Hero ── */
.river-hero {
    position: relative;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    align-items: flex-end;
    background:
        linear-gradient(180deg, rgba(10,10,11,0.45) 0%, rgba(10,10,11,0.85) 100%),
        url('/assets/images/map-background.webp') center/cover no-repeat;
    background-color: #1a2a22;
    border-bottom: 1px solid var(--site-border);
    margin-bottom: var(--size-5);
    border-radius: var(--radius-4);
}

.river-hero-inner {
    padding: var(--size-6) var(--size-5) var(--size-5);
}

.river-hero h1 {
    margin: 0 0 var(--size-1);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: var(--font-weight-8);
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.river-hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.65);
    font-size: 1rem;
}

/* ── Three-column layout ── */
.river-layout {
    display: grid;
    grid-template-columns: 200px 1fr 1fr;
    grid-template-rows: auto;
    gap: var(--size-4);
    align-items: start;
}

/* ── Left: Story menu ── */
.story-menu {
    display: flex;
    flex-direction: column;
    gap: var(--size-3);
    padding: var(--size-4);
    border: 1px solid var(--site-border);
    border-radius: var(--radius-4);
    background: var(--site-panel);
    position: sticky;
    top: var(--size-4);
}

.menu-title {
    margin: 0;
    font-size: 0.72rem;
    font-weight: var(--font-weight-7);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--site-text-muted);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.story-btn {
    display: flex;
    align-items: center;
    gap: var(--size-2);
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid transparent;
    border-radius: var(--radius-2);
    background: transparent;
    color: var(--site-text-muted);
    font-family: inherit;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    line-height: 1.3;
}

.story-btn:hover,
.story-btn:focus-visible {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--btn-color, var(--site-accent));
    color: var(--site-text);
    outline: none;
}

.story-btn.active {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--btn-color, var(--site-accent));
    color: var(--site-text);
    font-weight: var(--font-weight-6);
}

.story-btn.active .story-dot {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.12);
}

.story-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: box-shadow 0.15s;
}

/* ── Centre: Map ── */
.map-column {
    border-radius: var(--radius-4);
    overflow: hidden;
    border: 1px solid var(--site-border);
    min-height: 520px;
    position: sticky;
    top: var(--size-4);
}

#river-map {
    width: 100%;
    height: 520px;
    display: block;
}

/* Leaflet popup theme */
.leaflet-popup-content-wrapper {
    background: #1e1e1f !important;
    color: var(--site-text) !important;
    border: 1px solid var(--site-border) !important;
    border-radius: var(--radius-2) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important;
}

.leaflet-popup-tip {
    background: #1e1e1f !important;
}

.leaflet-popup-content {
    margin: 10px 14px !important;
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
}

.leaflet-popup-close-button {
    color: var(--site-text-muted) !important;
}

/* ── Right: Story panel ── */
.story-panel {
    padding: var(--size-5);
    align-self: start;
    max-height: 80vh;
    overflow-y: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--site-border) transparent;
}

.story-panel h2 {
    margin: 0 0 var(--size-4);
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
    font-weight: var(--font-weight-7);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.story-panel p {
    margin: 0 0 var(--size-3);
    line-height: 1.8;
    color: var(--site-text);
    font-size: 0.95rem;
}

.story-panel p:last-child {
    margin-bottom: 0;
}

.story-panel a {
    color: var(--site-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s;
}

.story-panel a:hover {
    color: var(--site-accent-strong);
}

/* Story transition */
#story-content {
    transition: opacity 0.25s ease;
}

#story-content.fading {
    opacity: 0;
}

/* ── Mobile ── */
@media (max-width: 960px) {
    .river-layout {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
    }

    .story-menu {
        grid-column: 1 / -1;
        position: static;
    }

    .menu-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .story-btn {
        width: auto;
        flex: 0 0 auto;
    }

    .map-column {
        grid-column: 1 / 2;
        position: static;
        min-height: 320px;
    }

    #river-map {
        height: 320px;
    }

    .story-panel {
        grid-column: 2 / 3;
        max-height: 360px;
    }
}

@media (max-width: 620px) {
    .river-layout {
        grid-template-columns: 1fr;
    }

    .map-column {
        grid-column: 1;
    }

    .story-panel {
        grid-column: 1;
        max-height: none;
    }

    .river-hero {
        min-height: 130px;
    }
}
