/* ==========================================================================
   1. UNIVERSAL RESET & INITIALIZATION
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'SiyamRupali';
    src: url('../SiyamRupali.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --bg-dark-green: #06241b;
    --bg-light-gold: #fdf3cd;
    --text-gold: #e2b13c;
    --text-dark: #222222;
    --nav-green: #0a3a2b;
    --border-gold: #d4af37;
}

body {
    background-color: var(--bg-light-gold);
    font-family: 'SiyamRupali', sans-serif;
    color: var(--text-dark);
}

.top-ornate-border {
    background-color: #554411;
    background-image: repeating-linear-gradient(45deg, #e2b13c 0px, #e2b13c 10px, #06241b 10px, #06241b 20px);
    height: 12px;
    width: 100%;
}
html {
    scroll-behavior: smooth;
}

/* ==========================================================================
   2. PERFECT-FIT HERO BANNER ENGINE (ZERO CROPPING)
   ========================================================================== */
.main-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    color: #ffffff;
    width: 100%;
    
    /* Image path relative to the css/ folder */
    background-image: url('../images/header-banner.png');
    background-repeat: no-repeat;
    background-position: center center;
    
    /* DESKTOP FIX: Contain displays 100% of the image without any edge crops */
    background-size: contain; 
    background-color: var(--bg-dark-green);
    
    /* Matches standard wide-banner scaling dimensions */
    aspect-ratio: 1920 / 640; 
    border-bottom: 3px solid var(--border-gold);
}

.main-banner::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.banner-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

.titles-wrapper {
    text-align: center;
    width: 90%;
    max-width: 750px;
    padding: 2.5vw;
    background: rgba(6, 36, 27, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 12px;
    border: 1px solid rgba(226, 177, 60, 0.2);
}

/* Fluid typography clamps match shrinking image scale on smaller monitors */
.bengali-main-title {
    font-size: clamp(1.3rem, 3.5vw, 3.2rem);
    color: var(--text-gold);
    text-shadow: 2px 2px 8px rgba(0,0,0,0.9);
    margin-bottom: 4px;
    line-height: 1.2;
}

.bengali-subtitle {
    font-size: clamp(0.8rem, 1.6vw, 1.4rem);
    color: #ffffff;
    font-weight: 400;
}

.decorative-separator {
    color: var(--text-gold);
    margin: 0.5vw 0;
    font-size: clamp(0.6rem, 1.2vw, 0.9rem);
}

.english-main-title {
    font-size: clamp(0.8rem, 1.6vw, 1.4rem);
    font-weight: 400;
    font-style: italic;
    color: #f0f0f0;
}
.story-para {
    margin-bottom: 18px;
    line-height: 1.8;
}

.dialogue {
    margin: 16px 0;
    padding: 14px 18px;
    background: #fff4dc;
    border-left: 6px solid #b77716;
    border-radius: 10px;
}

.speaker {
    display: block;
    font-weight: bold;
    color: #7a3e00;
    margin-bottom: 6px;
}

.quote {
    display: block;
    font-style: italic;
}

.note-box {
    margin: 18px 0;
    padding: 15px 18px;
    background: #edf7df;
    border-left: 6px solid #4d8a22;
    border-radius: 10px;
}

.action-line {
    margin: 18px 0;
    padding: 12px 16px;
    background: #f8ead0;
    border-radius: 10px;
    color: #5a2d0a;
    font-weight: bold;
}

/* ==========================================================================
   3. NAVIGATION MENU & INTERACTIVE CONTROLS
   ========================================================================== */
.navbar {
    background-color: var(--nav-green);
    border-bottom: 3px solid var(--border-gold);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.nav-item {
    color: #ffffff;
    text-decoration: none;
    padding: 15px 20px;
    font-size: 0.95rem;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}

.nav-item:hover, .nav-item.active {
    background-color: var(--bg-dark-green);
    color: var(--text-gold);
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.toggle-label {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    border-radius: 34px;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px; width: 14px;
    left: 4px; bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

input:checked + .slider { background-color: var(--text-gold); }
input:checked + .slider:before { transform: translateX(22px); }

/* ==========================================================================
   4. MAIN CONTENT STORY LAYOUTS
   ========================================================================== */
.content-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.story-card {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 30px;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.story-visuals {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.story-image-box img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.audio-player-box audio {
    width: 100%;
}

.story-text-panel {
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.page-badge {
    background-color: var(--text-gold);
    color: var(--bg-dark-green);
    padding: 4px 12px;
    font-weight: bold;
    border-radius: 4px;
    font-size: 0.85rem;
}

.roman-btn {
    background: white;
    border: 1px solid #ccc;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.roman-btn.active {
    background-color: var(--text-gold);
    color: var(--bg-dark-green);
    border-color: var(--border-gold);
}

.bengali-text h2 {
    color: var(--bg-dark-green);
    font-size: 1.8rem;
    line-height: 1.4;
    margin-bottom: 15px;
}

.bengali-text p {
    font-size: 1.25rem;
    line-height: 1.7;
    color: #333333;
}

.english-text p {
    font-family: 'Lora', serif;
    font-size: 1.15rem;
    line-height: 1.7;
    color: #444444;
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
}

.page-nav-btn {
    background-color: var(--nav-green);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
}

.page-nav-btn.disabled {
    background-color: #ccc;
    pointer-events: none;
}

/* ==========================================================================
   5. INTERACTIVE LAYER UTILITIES
   ========================================================================== */
.hidden-lang {
    display: none !important;
}

.romanized-view {
    font-family: 'Lora', serif !important;
    font-style: italic;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   6. RESPONSIVE MOBILE DEVICE SAFETIES
   ========================================================================== */
@media (max-width: 850px) {
    /* MOBILE BANNER FIX: Shifts ratio to display full banner length across narrow displays */
    .main-banner {
        aspect-ratio: 1920 / 720;
        background-size: cover;
        background-position: center center;
    }
    .titles-wrapper {
        width: 95%;
        padding: 15px;
    }
    .story-card {
        grid-template-columns: 1fr;
    }
    .nav-container {
        flex-direction: column;
        padding: 10px 0;
    }
    .nav-right {
        margin: 10px auto 0 auto;
    }
}
