/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,700;1,400&display=swap');

/* --- Local Fonts --- */
/* This rule loads your custom font file */
@font-face {
    font-family: 'Baksheesh';
    /* Changed from 'fonts/...' to '../fonts/...' to go up one level */
    src: url('../fonts/baksheesh-bold.ttf') format('truetype'); 
    font-weight: 700;
    font-style: normal;
}

/* --- PAGE SPECIFIC OVERRIDES --- */

/* When on the Essay page, expand the container width */
body[data-page="essays"] .content {
    /* FORCE WIDTH: This is the key. */
    /* It tells the box to ignore the content size and fill the screen. */
    width: 100%; 
    max-width: 1200px;
    
    /* PREVENT BLOWOUT: This ensures padding doesn't add to the width */
    box-sizing: border-box;
}

/* --- Base Setup --- */
body {
    /* Font stack: 
      1. EB Garamond (classic serif) 
      2. Georgia (system serif fallback)
      3. serif (generic fallback)
    */
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.1em; /* Base font size */
    line-height: 1.7; /* Comfortable spacing for reading */
    margin: 0;
    padding: 0;
    
    /* "Parchment" text on a dark background */
    color: #d2c8b8; 
    background-color: #0f0a0a; /* Fallback color */
    
    /* Better font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* --- STICKY FOOTER FIX --- */
    /* 1. Set body to full height */
    min-height: 100vh; 
    /* 2. Use flexbox to stack header/main/footer vertically */
    display: flex;
    flex-direction: column;
}

/* --- Background Video / MP4 --- */
.background-video {
    position: fixed; /* Fixes to viewport */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2; /* Sits behind everything */
    overflow: hidden; /* Prevents scrollbars */
}

/* This styles the <video> element *inside* the div */
.background-video video {
    width: 100%;
    height: 100%;
    /* This ensures the video covers the screen without stretching */
    object-fit: cover;
    
    /* --- FIX --- */
    /* Give the video a position and z-index */
    position: relative;
    z-index: 1;
}

/* Dark overlay + scanlines */
.background-video::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* --- FIX --- */
    /* Set the z-index higher than the video */
    z-index: 2;
    
    /* Dark Sepia Overlay */
    background-color: rgba(30, 24, 18, 0.65); /* Dark brown, 65% opacity */

    /* Scanlines */
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.2) 2px, /* Faint dark line */
        rgba(0, 0, 0, 0.2) 3px
    );
    background-size: 100% 3px; /* Controls scanline thickness */
}


/* --- Header & Navigation --- */
.top-header {
    display: flex;
    justify-content: space-between; /* Pushes logo left, nav right */
    align-items: center;
    padding: 20px 40px; /* Padding top/bottom, left/right */
    
    /* "Muted Sepia" border */
    border-bottom: 1px solid #5a4a3a; 
    width: 100%;
    box-sizing: border-box; /* Includes padding in width */
    
    /* Ensures header stays on top of content */
    position: relative;
    z-index: 10;
}

.logo {
    font-family: 'Baksheesh', 'EB Garamond', serif;
    font-size: 1.5em; /* 1.5x base size */
    color: #ffffff; /* Bright white for high contrast */
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 1px;
}

.header-right-group {
    display: flex;
    align-items: center;
}

.navigation a {
    font-family: 'Baksheesh', 'EB Garamond', serif;
    color: #d2c8b8; /* "Parchment" */
    text-decoration: none;
    margin: 0 0 0 25px; /* Margin *left* of links */
    font-size: 1.0em; /* Reduced size */
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

.navigation a:hover {
    color: #ffffff; /* Brighten on hover */
}

/* --- Main Content Area --- */
.content {
    /* This is the main content column.
      - 900px max-width (good for reading)
      - auto horizontal margins (centers it)
      - 40px padding (space inside)
    */
    max-width: 900px;
    margin: 40px auto;
    padding: 0 40px;
    
    /* Sits on top of the background */
    position: relative;
    z-index: 5;

    /* --- STICKY FOOTER FIX --- */
    /* 3. Tell main content to "grow" and fill all empty space */
    flex-grow: 1;

    /* --- NEW: Transition --- */
    /* Add a transition for opacity. 400ms = 0.4s */
    opacity: 1;
    transition: opacity 0.4s ease-in-out;
}

/* --- NEW: Fading Class --- */
/* This class will be toggled by JS to trigger the fade */
.content.fading-out {
    opacity: 0;
}

/* --- Heading Style --- */
.content h2 {
    /* TYPOGRAPHY */
    font-family: 'Baksheesh', 'EB Garamond', serif;
    color: #ffffff; /* Bright white text */
    font-size: 2.2em; /* Increase size slightly */
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 0; /* Ensures it sits tightly under the header */
    margin-bottom: 25px; 

    /* VISUAL STRUCTURE: CRT Glow & Archive Line */
    
    /* Subtle Text Shadow for CRT Phosphor Bloom */
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.4); 

    /* A simple line below the title for definition */
    border-bottom: 2px solid #5a4a3a;
}

/* --- Body Text Elements --- */
/* Updated to target elements *inside* the loaded content */
.content p {
    margin-bottom: 1.0em; /* Space between paragraphs */
}

.content ul {
    list-style: none; /* Remove default bullets */
    padding-left: 0;
    margin-bottom: 1.0em;
}

.content li {
    position: relative;
    padding-left: 25px; /* Indent for custom bullet */
    margin-bottom: 10px;
}

/* Custom bullet to match theme */
.content li::before {
    content: "\2022"; /* This is the safe code for a bullet point */
    color: #5a4a3a;
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1.2em;
}

.content a {
    color: #ffffff; /* Bright white links */
    text-decoration: underline;
    font-weight: 700; /* Make links slightly bolder */
    text-decoration-color: #5a4a3a; /* Underline uses sepia */
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.content a:hover {
    color: #d2c8b8; /* "Parchment" on hover */
    text-decoration-color: #d2c8b8; /* Underline matches */
}

/* --- Footer --- */
.footer {
    width: 100%;
    box-sizing: border-box;
    padding: 20px 40px;
    margin-top: 60px;
    text-align: center;
    border-top: 1px solid #5a4a3a; /* "Muted Sepia" border */
    
    /* Sits on top of background */
    position: relative;
    z-index: 5;
}

.footer p {
    margin: 0;
    color: #8c7a6b; /* Brighter, more visible sepia */
    font-size: 0.9em;
    line-height: 1.5; /* Added for multi-line footer */
}

/* --- Audio Button --- */
#audio-toggle {
    background-color: transparent;
    border: 1px solid #5a4a3a; /* "Muted Sepia" border */
    color: #d2c8b8; /* "Parchment" color */
    
    /* Match the navigation links */
    font-family: 'Baksheesh', 'EB Garamond', serif;
    font-weight: 700;
    font-size: 1.0em; /* Matches nav */
    
    padding: 5px 12px;
    cursor: pointer;
    margin-left: 20px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#audio-toggle:hover {
    background-color: #5a4a3a;
    color: #ffffff;
}

/* This class "lights up" the button when audio is playing */
#audio-toggle.playing {
    background-color: #5a4a3a;
    color: #ffffff;
}

/* --- YouTube Player (Hidden) --- */
/* Hides the tiny 1x1 player */
#youtube-player {
    position: absolute;
    top: -9999px;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}