/* ==========================================================================
   STORY LAYOUTS CSS (ArcGIS-Style)
   Master Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   BASE TYPOGRAPHY
   -------------------------------------------------------------------------- */
.step h1, .step h2, .step h3 {
    font-family: 'Karla', sans-serif;
    margin: 0;
}
.step p {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
}

/* --------------------------------------------------------------------------
   1. COVER TITLE (Cinematic Day Transition)
   -------------------------------------------------------------------------- */
.layout-cover {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    text-align: center;
    position: relative;
    box-shadow: inset 0 0 0 1000px rgba(0,0,0,0.5); 
    color: white;
    padding: 0 5vw;
    opacity: 1 !important; /* Bypasses iframe throttling */
}
.cover-kicker {
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #e0ddd1;
    margin-bottom: 25px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.8);
}
.layout-cover h1 {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    max-width: 900px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.6);
}
.layout-cover .cover-subtitle {
    font-family: 'Karla', sans-serif;
    font-size: 1.6rem;
    font-style: italic;
    font-weight: 300;
    color: #f9f6ed;
    max-width: 600px;
    letter-spacing: 0.5px;
    margin-top: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

/* --------------------------------------------------------------------------
   2. MAP SLIDERS (Interactive Geographic Cards)
   -------------------------------------------------------------------------- */

/* A. Floating Map Card (Flush Left, Full Bleed Photo) */
.layout-floating-card {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0; 
    pointer-events: none; 
}
.floating-card {
    background-color: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(10px);
    width: 42vw;
    min-width: 350px;
    padding: 50px 40px; 
    border-radius: 0 8px 8px 0; 
    box-shadow: 15px 0 40px rgba(0,0,0,0.15); 
    pointer-events: auto; 
}
.floating-card h3 {
    font-size: 1.2rem;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}
.floating-square-img {
    width: calc(100% + 80px); 
    margin-left: -40px;
    margin-right: -40px;
    margin-top: 30px; 
    margin-bottom: -50px; 
    aspect-ratio: 1 / 1; 
    object-fit: cover;
    border-radius: 0 0 8px 0; 
    display: block;
}

/* B. Media Map Card (Classic Style) */
.layout-media-card {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0 5vw;
    pointer-events: none;
}
.media-card {
    background-color: #f9f6ed;
    width: 38vw;
    min-width: 350px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    pointer-events: auto;
    border-left: 4px solid #1e3a2a; 
}
.media-card h3 {
    font-size: 1.8rem;
    color: #1a1a1a;
    margin-bottom: 15px;
}
.media-standard-img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 20px;
    border-radius: 2px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* C. Split Layout */
.layout-split {
    background-color: transparent; /* Changed from solid color so the map can be clicked */
    display: grid;
    grid-template-columns: 30% 70%;
    min-height: 80vh;
    
    pointer-events: none; /* THE FIX: Lets the mouse click through the empty spaces */
}
.split-text {
    padding: 10vh 5vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: #f9f6ed; /* Keep the text box solid yellow */
    
    pointer-events: auto; /* Makes the text box clickable */
}
.split-text h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}
.split-text p {
    font-size: 1.1rem;
    line-height: 1.65;
}
.split-photo {
    background-size: cover;
    background-position: center;
    
    pointer-events: auto; /* Makes the photo clickable */
}

/* D. Immersive Left (National Geographic Style) */
.layout-immersive-left {
    min-height: 150vh; 
    display: flex;
    align-items: center; 
    justify-content: flex-start;
    padding: 0 5vw;
    background-size: cover;
    background-position: center;
    background-attachment: fixed; 
    position: relative;
    z-index: 20; 
    pointer-events: none;
}
.immersive-text-box {
    background-color: #111111; 
    color: #f9f6ed; 
    width: 35vw;
    min-width: 350px;
    padding: 50px 40px;
    box-shadow: 20px 20px 50px rgba(0,0,0,0.7); 
    pointer-events: auto;
}
.immersive-text-box h3 {
    color: #ffffff;
    font-size: 1.4rem;
    letter-spacing: 2px;
    margin-bottom: 20px;
}
.immersive-text-box .gps-tag {
    color: #aaaaaa;
    border-top-color: #444444;
}

/* --------------------------------------------------------------------------
   3. PROSE LAYOUT & ADVANCED EDITORIAL ELEMENTS
   -------------------------------------------------------------------------- */

/* Main Prose Container */
.layout-prose {
    background-color: #f9f6ed; 
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100vw;
    box-sizing: border-box;
    padding: 15vh 20px 25vh 20px; 
    position: relative;
    z-index: 10;
    pointer-events: auto; 
    opacity: 1 !important; 
}
.prose-container {
    max-width: 850px; 
    width: 100%;
    position: relative;
}
.prose-container h2 {
    font-family: 'Karla', sans-serif;
    font-size: 2.5rem; /* Slightly reduced for elegance */
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #1e3a2a;
    padding-bottom: 1rem;
}
.prose-container h3 {
    font-family: 'Karla', sans-serif;
    font-size: 1.6rem;
    color: #1e3a2a;
    margin-top: 3rem;
    margin-bottom: 1rem;
}
.prose-container p {
    font-size: 1.15rem;
    line-height: 1.65;
    color: #333;
    margin-bottom: 1.5rem;
}

/* Base Image Styles */
figure { margin: 0; padding: 0; }
.prose-inline-container { margin: 2rem 0; text-align: center; }
.prose-inline-img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1); 
}

/* NEW: Thematic Wave Break */
hr.wavy-divider {
    border: none;
    height: 20px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20" preserveAspectRatio="none"><path d="M0,10 C25,20 25,0 50,10 C75,20 75,0 100,10" fill="none" stroke="%231e3a2a" stroke-width="1.5" stroke-miterlimit="10"/></svg>') repeat-x center;
    background-size: 50px 20px;
    margin: 4rem auto;
    width: 30%;
    opacity: 0.6;
}

/* NEW: Outset Images */
.prose-outset {
    width: calc(100% + 300px);
    margin-left: -150px;
    margin-right: -150px;
    margin-top: 3rem;
    margin-bottom: 3rem;
}
.prose-outset img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* The Full Bleed (Cinematic Wide Break) */
.prose-full-bleed {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-top: 4rem;
    margin-bottom: 4rem;
}
.prose-full-bleed img {
    width: 100vw;
    height: auto;
    max-height: 85vh;
    object-fit: cover;
    border-radius: 0; 
}

/* Diptychs */
.prose-diptych {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 20px;
    margin: 3rem 0;
}
.prose-diptych img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    border-radius: 4px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}
.prose-outset-diptych {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: calc(100% + 160px);
    margin-left: -80px;
    margin-right: -80px;
    margin-top: 3rem;
    margin-bottom: 3rem;
}
.prose-outset-diptych img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* NEW: Hanging Floats (Left and Right) */
.prose-hanging-left, 
.prose-hanging-right {
    width: 55%;
    margin-top: 10px;
    margin-bottom: 20px;
    z-index: 20;
    position: relative;
}
.prose-hanging-left {
    float: left;
    margin-left: -60px; /* Reduced to pull away from edge */
    margin-right: 55px; /* Increased to give text more breathing room */
}
.prose-hanging-right {
    float: right;
    margin-right: -150px; /* Reduced so it doesn't push too far right */
    margin-left: 55px; /* Increased to protect the text */
}
.prose-hanging-left img, 
.prose-hanging-right img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

/* NEW: Portrait Crop Modifier */
.portrait-crop img {
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

/* Elegant Technical Captions */
.prose-caption {
    font-family: 'Karla', sans-serif;
    font-size: 13px;
    color: #666;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --------------------------------------------------------------------------
   4. UI COMPONENTS (GPS, Navbar)
   -------------------------------------------------------------------------- */
.gps-tag {
    border-top: 1px solid rgb(224, 221, 209);
    color: rgb(136, 136, 136);
    display: block;
    font-family: "Open Sans", sans-serif;
    font-size: 12px;
    letter-spacing: 0.5px;
    margin-top: 25px;
    padding-top: 10px;
    text-transform: uppercase;
}
#top-nav {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 100;
    border-bottom: 1px solid #e0ddd1;
    padding: 15px 5vw;
    display: flex;
    gap: 30px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.nav-item { color: #888; cursor: pointer; transition: color 0.3s ease; }
.nav-item:hover, .nav-item.active { color: #1e3a2a; }

/* --------------------------------------------------------------------------
   5. MOBILE RESPONSIVE OVERRIDES
   -------------------------------------------------------------------------- */


@media (max-width: 800px) {
    
    /* --- NEW: Mobile Typography Fixes --- */
    .prose-container p { 
        font-size: 1.05rem; /* Shrinks the body text slightly */
        line-height: 1.55; 
    }
    .prose-container h2 { 
        font-size: 1.8rem; /* Shrinks the massive prose titles */
    }
    .split-text p {
        font-size: 1rem;
    }
    .split-text h2 {
        font-size: 1.6rem;
    }

    /* Cover */
    .layout-cover h1 { font-size: 2.2rem; } /* Shrunk from 2.5 */
    .layout-cover .cover-subtitle { font-size: 1.1rem; }
    
    /* Map Sliders */
    .layout-floating-card, .layout-media-card { justify-content: center; padding: 0 20px; }
    .floating-card, .media-card { width: 100%; margin-top: auto; margin-bottom: 5vh; }
    .layout-split { grid-template-columns: 1fr; }
    .split-photo { min-height: 40vh; }
    .layout-immersive-left { align-items: flex-end; padding: 0; min-height: 100vh; }
    .immersive-text-box { width: 100%; margin-bottom: 0; }

    /* Advanced Prose Layouts */
    .prose-diptych, .prose-outset-diptych { grid-template-columns: 1fr; }
    .prose-outset, .prose-outset-diptych {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    .prose-hanging-left, .prose-hanging-right {
        float: none;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    .portrait-crop img {
        aspect-ratio: auto; /* Return to original shape on mobile */
    }

    /* Navbar */
    #top-nav { overflow-x: auto; white-space: nowrap; padding: 15px; gap: 15px; }


    /* Fix for massive zoomed-in background photos on mobile */
    /* Option 1: Show the full photo, do not crop */
    .layout-cover, 
    .layout-immersive-left,
    .split-photo {
        background-attachment: scroll !important; 
        background-position: center top !important;
        background-size: contain !important; 
        background-repeat: no-repeat !important;
        background-color: #111111 !important; /* <--- Fixes the empty gap! */
    }
}