/* ==========================================================================
   Base & Fonts
   ========================================================================== */

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

/* Basic Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Body Defaults */
body {
    font-family: 'Lato', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f7f7f7;
    overscroll-behavior: none;
    overflow-anchor: auto;
}

/* ==========================================================================
   Overall Layout Structure
   ========================================================================== */

/* Initial Book Cover / Splash Screen */
#book-cover-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
    padding: 30px;
    background-color: #e8e8e8;
    position: relative;
    z-index: 5; /* Keep on top initially */
    overflow: hidden;
}



/* --- Language Switcher --- */
.language-switcher {
    position: absolute;
    top: 15px; /* Position near the top */
    right: 20px; /* Position on the right */
    z-index: 10; /* Ensure it's above other cover elements if needed */
}

.language-switcher a {
    display: inline-block;
    margin-left: 8px;
    font-size: 1.8em; /* Adjust flag size */
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.language-switcher a:hover {
    opacity: 1;
    transform: scale(1.1);
}
/* --- End Language Switcher --- */

#book-cover-image {
    display: block;
    max-height: 55vh;
    width: auto;
    max-width: 80%;
    object-fit: contain;
    margin-bottom: 25px;
    border-radius: 5px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

#book-main-title {
    font-family: 'Merriweather', serif;
    font-size: 2.5em;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.2;
}

#book-subtitle {
    font-family: 'Lato', sans-serif;
    font-size: 1.5em;
    color: #444;
    font-weight: normal;
    margin-top: -5px; /* Adjust spacing */
    margin-bottom: 15px;
}

#book-author {
    font-family: 'Lato', sans-serif;
    font-size: 1.1em;
    color: #555;
    margin-bottom: 40px;
}

.scroll-prompt {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #666;
    font-size: 0.9em;
    opacity: 0.7;
    animation: bounce 2s infinite ease-in-out;
}

.scroll-prompt svg { margin-top: 5px; }

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-10px); }
  60% { transform: translateX(-50%) translateY(-5px); }
}

/* Wrapper for Reading Interface (below cover) */
.layout-wrapper {
    position: relative;
    z-index: 1; /* Sits above potential body background, below cover */
}

/* Container for TOC + Content */
.book-container {
    display: flex;
    position: relative;
    z-index: 1; /* Above potential layout-wrapper background */
    margin-right: 280px; /* --- Make space for fixed QA panel --- */
    min-height: 100vh; /* Ensure it can fill height */
}

/* Fixed Background for Chapter Images (Subtle) */
#chapter-background {
    position: fixed;
    top: 0;
    left: 300px; /* --- MUST MATCH .toc-panel width --- */
    right: 280px; /* --- MUST MATCH .qa-panel width --- */
    bottom: 0;
    z-index: 0; /* --- BOTTOM layer --- */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-image: none;
    opacity: 0;
    transition: opacity 0.6s ease-in-out, background-image 0.1s linear;
    pointer-events: none;
}

/* 
==========================================================================
   Table of Contents Panel
   ==========================================================================
.toc-panel {
    width: 300px; Fixed width    background-color: #ffffff;
    border-right: 1px solid #d1d1d1;
    padding: 25px;
    height: 100vh; Full viewport height    overflow-y: auto;
    position: sticky; Sticks to top of .book-container    top: 0;
    flex-shrink: 0;
    z-index: 3; Highest}

.toc-panel h2 {
    font-family: 'Merriweather', serif;
    color: #444;
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

#toc-list { list-style: none; }
#toc-list ul { list-style: none; }

TOC Accordion Styling#toc-list ul { Nested lists    margin-left: 0;
    padding-left: 18px;
    padding-top: 5px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-out, max-height 0.4s ease-out;
}
#toc-list li.toc-parent-item.expanded > ul {
    max-height: 1000px; Adjust if needed    opacity: 1;
}
#toc-list li a {
    display: flex; align-items: center; justify-content: space-between;
    text-decoration: none; color: #337ab7; padding: 5px 5px 5px 10px;
    font-size: 0.9em; border-left: 3px solid transparent;
    transition: all 0.2s ease-in-out; cursor: pointer; position: relative;
}
#toc-list li a:hover { color: #23527c; background-color: #f5f5f5; border-left-color: #ccc; }
#toc-list li a.active { font-weight: bold; color: #c9302c; background-color: #fdf7f7; border-left-color: #c9302c; }
#toc-list li a span.toc-link-text { flex-grow: 1; margin-right: 5px; }
#toc-list > li > a { font-weight: bold; font-size: 1.05em; margin-top: 12px; padding-top: 7px; padding-bottom: 7px; } Book#toc-list > li > ul > li > a { font-weight: bold; font-size: 1em; } Chapter.toc-thumbnail { width: 30px; height: 30px; object-fit: cover; margin-right: 8px; border-radius: 3px; flex-shrink: 0; }
.toc-book-thumbnail { width: 35px; height: 35px; border: 1px solid #eee; }
.toc-toggle-icon { font-size: 0.8em; width: 16px; height: 16px; line-height: 16px; text-align: center; border: 1px solid #ccc; border-radius: 3px; background-color: #f0f0f0; color: #555; margin-left: 5px; flex-shrink: 0; transition: transform 0.3s ease, background-color 0.2s ease; }
#toc-list li.toc-parent-item.expanded > a .toc-toggle-icon { transform: rotate(45deg); background-color: #e0e0e0; }
.toc-loading { color: #888; font-style: italic; }
 */


/* ==========================================================================
   Compact TOC Styling
   ========================================================================== */

.toc-panel {
    width: 300px;
    background-color: #ffffff;
    border-right: 1px solid #d1d1d1;
    padding: 25px;
    height: 100vh; /* Stick to viewport height */
    overflow-y: auto; /* Allow internal scrolling */
    position: sticky; /* Stick to the top of its offset parent */
    top: 0; /* Stick at the very top */
    flex-shrink: 0;
    z-index: 3;
    align-self: flex-start; /* Align to the start of the cross axis (top) in flex container */
}

.toc-panel h2 {
    font-family: 'Merriweather', serif;
    color: #444;
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

/* Remove Thumbnail styles */
.toc-thumbnail, .toc-book-thumbnail {
    display: none; /* Hide thumbnails */
}

#toc-list li a {
    padding: 3px 5px 3px 10px; /* Reduced vertical padding */
    font-size: 0.85em; /* Slightly smaller font */
    /* Ensure flex properties are still set from previous steps */
    display: flex; align-items: center; justify-content: space-between;
}

/* Adjust level-specific styles for less margin */
#toc-list > li > a { /* Book */
    font-size: 1em;
    margin-top: 8px;
    padding-top: 5px;
    padding-bottom: 5px;
}
#toc-list > li > ul > li > a { /* Chapter */
    font-size: 0.9em;
    font-weight: bold;
}
#toc-list > li > ul > li > ul > li > a { /* Section */
     font-size: 0.85em;
     font-weight: normal; /* Sections not bold */
}
 #toc-list > li > ul > li > ul > li > ul > li > a { /* SubSection */
     font-size: 0.85em;
     color: #444; /* Dim subsections slightly */
 }


/* Adjust indentation */
#toc-list ul { /* Nested lists hidden by default */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-out, max-height 0.4s ease-out;
    /* margin/padding for indent */
    padding-left: 15px;
    padding-top: 2px;
}

/* Adjust toggle icon size/position */
.toc-toggle-icon {
    font-size: 0.7em; /* Smaller */
    width: 14px; height: 14px; line-height: 14px;
    margin-left: 8px; /* More space from text */
}

#toc-list li.toc-parent-item.expanded > ul { /* Show expanded lists */
    max-height: 1000px; /* Or other large enough value */
    opacity: 1;
}
.toc-toggle-icon { /* Style for the '+' icon */
    /* ... size, border, etc. ... */
    transition: transform 0.3s ease; /* Add transition for rotation */
}
#toc-list li.toc-parent-item.expanded > a .toc-toggle-icon {
    transform: rotate(45deg); /* Rotate '+' to 'x' when expanded */
}

/* ==========================================================================
   Next Chapter Link Styling
   ========================================================================== */

.next-chapter-link-container {
    text-align: right;
    margin-top: 3em; /* Space above link */
    padding-top: 1em;
    border-top: 1px dashed #ccc;
    font-size: 0.95em;
}

/* Style the clickable span */
.next-chapter-link {
    /* Styles already applied inline via JS for basic look */
    /* Add hover effect */
    transition: color 0.2s ease;
}
.next-chapter-link:hover {
    color: #0056b3; /* Darker blue on hover */
}

/* ==========================================================================
   Content Panel & Reading Area
   ========================================================================== */

.content-panel {
    flex-grow: 1;
    padding: 40px 60px;
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
    background-color: rgba(255, 255, 255, 0.97); /*  Very slightly transparent */
    min-height: 100vh;
    position: relative;
    z-index: 1; /* Above potential background, below TOC/Q&A */
    box-shadow: inset 5px 0 15px -5px rgba(0,0,0,0.05), inset -5px 0 15px -5px rgba(0,0,0,0.05);
}

#book-content {
    padding-bottom: 100px;
    font-family: 'Merriweather', serif;
    font-size: 1.05em;
    color: #2b2b2b;
}

/* Content Headings */
#book-content h1, #book-content h2, #book-content h3, #book-content h4 {
    font-family: 'Lato', sans-serif; margin-top: 2em; margin-bottom: 1em;
    line-height: 1.3; color: #333; scroll-margin-top: 20px; font-weight: 700;
}
#book-content h2 { font-size: 2.2em; border-bottom: 2px solid #e0e0e0; padding-bottom: 0.4em; }
#book-content h3 { font-size: 1.7em; border-bottom: 1px solid #eee; padding-bottom: 0.3em; }
#book-content h4 { font-size: 1.4em; color: #555; }

/* Content Paragraphs */
#book-content p { margin-bottom: 1.2em; text-align: justify; hyphens: auto; }
#book-content b, #book-content strong { font-weight: bold; }
#book-content i, #book-content em { font-style: italic; }

/* Book Intro Pages */
.book-intro-page {
    padding: 60px 40px; margin-top: 2em; margin-bottom: 4em;
    text-align: center; border-top: 2px solid #ccc; border-bottom: 2px solid #ccc;
    background-color: #fdfdfd;
}
.book-intro-image { display: block; max-height: 40vh; width: auto; max-width: 50%; margin: 0 auto 25px auto; border-radius: 4px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15); }
.book-intro-title { font-family: 'Lato', sans-serif; font-size: 1.8em; color: #555; margin-bottom: 5px; font-weight: normal; text-transform: uppercase; letter-spacing: 1px; }
.book-intro-subtitle { font-family: 'Merriweather', serif; font-size: 2.2em; color: #333; margin-bottom: 20px; line-height: 1.3; }

/* Structure & Utilities */
.content-section { min-height: 50px; }
.loading-indicator { text-align: center; padding: 40px; font-size: 1.2em; color: #888; }

/* ==========================================================================
   Image Styling (within #book-content)
   ========================================================================== */

/* --- 1. Chapter Lead Image (Parallax) --- */
.chapter-lead-image-container { /* This is the div added by JS */
    height: 350px;
    background-size: cover;
    background-position: center center;
    background-attachment: fixed; /* Creates parallax */
    margin-bottom: 1.5em;
    border-radius: 5px;
    position: relative;
    
    z-index: 1; /* Ensure it's above the fixed #chapter-background */
    background-color: #eee; /* Fallback color */
}

/* --- 2. Section/Subsection Header Images (from Paragraphs) --- */
.header-image-container { /* This holds the figures */
    margin-bottom: 1.5em;
    clear: both;
}
.header-image { /* Figure wrapper */
    margin: 0 0 1em 0;
    text-align: center;
}
.header-image img { /* The actual image */
    display: inline-block; max-width: 100%; height: auto;
    max-height: 300px; object-fit: contain; border-radius: 5px;
    border: 0; margin: 0; float: none !important;
}

/* --- 3. Inline Images (data-inline-image="true") --- */
/* Use high specificity to override potential inline styles/attributes */
#book-content .content-section p img {
    display: inline-block !important; vertical-align: middle !important;
    max-width: 60% !important; width: auto !important; height: auto !important;
    object-fit: contain !important; margin: 2px 5px 2px 0 !important;
    max-height: none !important; float: none !important; /* Default */
    border: 0; border-radius: 3px; box-shadow: none !important;
}
#book-content .content-section p img[align="left"] {
    float: left !important; margin: 2px 1em 2px 0 !important; max-width: 50% !important;
}
#book-content .content-section p img[align="right"] {
    float: right !important; margin: 2px 0 2px 1em !important; max-width: 50% !important;
}
/* Force paragraph to contain its floated children */
#book-content .content-section p:has(img[align="left"]),
#book-content .content-section p:has(img[align="right"]) {
    overflow: hidden;
}

/* ==========================================================================
   Q&A Sidebar
   ========================================================================== */

.qa-panel { /* Use this single definition */
    width: 280px; /* --- MUST MATCH .book-container margin-right --- */
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    background-color: #f8f9fa;
    border-left: 1px solid #d1d1d1;
    padding: 20px;
    overflow-y: auto;
    z-index: 2; /* Below TOC, Above Content */
    box-shadow: -5px 0 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease-in-out; /* For potential future hiding */
}

.qa-panel h2 {
    font-family: 'Merriweather', serif; font-size: 1.3em; color: #444;
    margin-bottom: 15px; border-bottom: 1px solid #e0e0e0; padding-bottom: 10px;
}

#qa-list-container { /* Container */ }
.qa-placeholder { color: #888; font-style: italic; text-align: center; padding-top: 20px; }

/* Q&A Accordion */
.qa-item { margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 15px; }
.qa-item:last-child { border-bottom: none; margin-bottom: 0; }
.qa-question { background: none; border: none; padding: 8px 0; margin: 0; width: 100%; text-align: left; font-family: 'Lato', sans-serif; font-weight: bold; font-size: 0.95em; color: #337ab7; cursor: pointer; position: relative; transition: color 0.2s ease; }
.qa-question:hover { color: #23527c; }
.qa-question::after { content: '+'; position: absolute; right: 5px; top: 50%; transform: translateY(-50%); font-size: 1.2em; transition: transform 0.3s ease; }
.qa-question.active::after { transform: translateY(-50%) rotate(45deg); }
.qa-answer { max-height: 0; overflow: hidden; padding: 0 5px; margin-top: 0; transition: max-height 0.4s ease-out, margin-top 0.4s ease-out, padding 0.4s ease-out; font-size: 0.9em; color: #444; line-height: 1.5; }
.qa-answer.active { max-height: 500px; margin-top: 10px; padding: 5px; }
.qa-answer p { margin-bottom: 0.8em; }
.qa-answer p:last-child { margin-bottom: 0; }

/* --- Hypothesis Table Styling --- */
.hypothesis-table {
  width: 100%; /* Or a specific max-width like 628px */
  border-collapse: collapse;
  margin-top: 1em;
  margin-bottom: 1em;
  font-size: 0.9em; /* Adjust as needed */
  page-break-inside: auto; /* Keep table from breaking across pages if possible */
}

.hypothesis-table th,
.hypothesis-table td {
  border-bottom: 1px solid #cccccc; /* Lighter border for rows */
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.hypothesis-table th {
  border-top: 2px solid #000000;
  border-bottom: 2px solid #000000; /* Heavier border below header */
  background-color: #f0f0f0; /* Slight background for header */
  font-weight: bold;
}

/* Style for the category header rows */
.hypothesis-table tr.category-header td {
  background-color: #eeeeee;
  font-weight: bold;
  border-top: 1px solid #999999; /* Border above category header */
  border-bottom: 1px solid #999999; /* Border below category header */
  font-size: 1.1em; /* Make category headers slightly larger */
  padding-top: 10px;
  padding-bottom: 10px;
}

/* Remove bottom border from the last row's cells */
.hypothesis-table tbody tr:last-child td {
   border-bottom: 2px solid #000000; /* Heavier border at the very bottom */
}

/* Style for bold text within regular cells (Category column) */
.hypothesis-table td b {
   font-weight: bold; /* Ensure boldness is applied if needed */
}

/* Optional: Add alternating row colors for non-header rows if desired */
/* This might conflict slightly with the original alternating within categories,
   but provides clear visual separation for standard rows. */
/*
.hypothesis-table tbody tr:not(.category-header):nth-child(odd) {
  background-color: #f9f9f9;
}
*/



/* ==========================================================================
   Footnotes & Popovers
   ========================================================================== */

.footnote-ref { vertical-align: super; font-size: 0.75em; margin-left: 2px; padding: 0 2px; cursor: pointer; color: #007bff; text-decoration: underline dotted; }
.tippy-box[data-theme~='light-footnote'] { background-color: #f8f9fa; color: #333; border: 1px solid #ddd; box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-radius: 4px; font-size: 0.9em; line-height: 1.5; text-align: left; }
.tippy-box[data-theme~='light-footnote'][data-placement^='top'] > .tippy-arrow::before { border-top-color: #ddd; }
.tippy-box[data-theme~='light-footnote'][data-placement^='bottom'] > .tippy-arrow::before { border-bottom-color: #ddd; }
.tippy-box[data-theme~='light-footnote'] > .tippy-content { padding: 8px 12px; }

/* ==========================================================================
   End of Stylesheet
   ========================================================================== */
   
   
   /* ==========================================================================
   Mobile Responsive Styles (Add this at the end of style.css)
   ========================================================================== */

/* --- Base styles for mobile nav buttons (hidden on desktop) --- */
.mobile-nav-buttons {
    display: none; /* Hidden by default */
    position: fixed; /* Keep them accessible */
    top: 10px;
    z-index: 1001; /* Ensure they are above everything */
    gap: 8px; /* Space between buttons if needed */
}

/* Position TOC toggle button */
#toggle-toc-btn {
    left: 10px;
}

/* Position Q&A toggle button */
#toggle-qa-btn {
    right: 10px; /* Position on the opposite side */
    left: auto; /* Override any potential left positioning from container */
}

.mobile-nav-buttons button {
    background-color: rgba(255, 255, 255, 0.85);
    border: 1px solid #ccc;
    color: #333;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 1.2em; /* Adjust size as needed */
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    backdrop-filter: blur(3px); /* Optional: frosted glass effect */
}

/* --- Media Query for Mobile Devices (e.g., screens <= 768px) --- */
@media (max-width: 768px) {

    /* --- Show Mobile Buttons --- */
    .mobile-nav-buttons {
        display: block; /* Show the container */
        /* The position: fixed; and top/left/right are already set above */
    }
    /* Ensure individual buttons are visible if container is block */
     #toggle-toc-btn, #toggle-qa-btn {
        position: fixed; /* Reiterate fixed positioning */
     }


    /* --- Adjust Main Layout --- */
    .book-container {
        display: block; /* Stack TOC and Content instead of flex row */
        margin-right: 0; /* Remove margin needed for desktop Q&A */
    }

    .content-panel {
        padding: 25px 15px; /* Reduce side padding for more content space */
        max-width: 100%; /* Allow content to use full width */
        min-height: calc(100vh - 50px); /* Adjust min-height if needed, account for potential top/bottom bars */
        box-shadow: none; /* Optional: remove inset shadow on mobile */
    }

    /* --- Hide and Reposition Side Panels (TOC & Q&A) --- */
    .toc-panel,
    .qa-panel {
        /* Override desktop styles */
        position: fixed; /* Take out of flow, position relative to viewport */
        top: 0;
        height: 100vh; /* Full viewport height */
        width: 85%; /* Adjust width as desired */
        max-width: 320px; /* Sensible max width */
        z-index: 1000; /* Below buttons, above content overlay */
        overflow-y: auto; /* Allow scrolling within the panel */
        display: block; /* Ensure it's block for transform/visibility */
        visibility: hidden; /* Use visibility + opacity for smoother transitions */
        opacity: 0;
        transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0s linear 0.3s; /* Delay visibility change */
        box-shadow: 0 0 15px rgba(0,0,0,0.3);
        padding-top: 60px; /* Add padding to prevent content hiding under fixed buttons */
        padding-bottom: 20px;
    }

    .toc-panel {
        left: 0;
        transform: translateX(-100%); /* Start off-screen left */
        border-right: 1px solid #ccc; /* Keep border */
        background-color: #ffffff; /* Ensure background */
    }

    .qa-panel {
        right: 0;
        transform: translateX(100%); /* Start off-screen right */
        border-left: 1px solid #ccc; /* Keep border */
        background-color: #f8f9fa; /* Ensure background */
    }

    /* --- Style for Visible Panels --- */
    .toc-panel.visible,
    .qa-panel.visible {
        visibility: visible;
        opacity: 1;
        transform: translateX(0); /* Slide into view */
        transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; /* Remove visibility delay */
    }

    /* --- Adjust Chapter Background --- */
    #chapter-background {
        left: 0; /* Cover full width */
        right: 0;
        /* Opacity/transition is handled by JS, fixed positioning is okay */
    }

    /* --- Content Readability Adjustments --- */
    #book-content {
        font-size: 1em; /* Adjust base font size if needed */
    }
    #book-content p {
        text-align: left; /* Justify can look messy on narrow screens */
        hyphens: none; /* Disable hyphens which might be awkward */
    }
    #book-content h2 { font-size: 1.8em; }
    #book-content h3 { font-size: 1.4em; }
    #book-content h4 { font-size: 1.2em; }

    /* --- Image Adjustments --- */
    /* Ensure images don't cause overflow */
    #book-content img,
    #book-content figure {
        max-width: 100%;
        height: auto; /* Maintain aspect ratio */
        margin-left: auto; /* Center block images if needed */
        margin-right: auto;
        float: none !important; /* Prevent floats on mobile */
    }
    .chapter-lead-image-container {
        height: 200px; /* Reduce parallax height */
        background-attachment: scroll; /* Disable parallax on mobile (often jerky/problematic) */
    }
    .book-intro-image {
        max-width: 80%; /* Adjust book intro image size */
        max-height: 30vh;
    }
    .header-image-container { margin-bottom: 1em; } /* Reduce space */


    /* --- Cover Screen Adjustments --- */
    #book-cover-section {
        padding: 20px;
    }
    #book-cover-image {
        max-height: 45vh; /* Adjust cover image size */
        margin-bottom: 20px;
    }
    #book-main-title { font-size: 2em; }
    #book-subtitle { font-size: 1.2em; }
    #book-author { font-size: 1em; margin-bottom: 30px; }

    /* Adjust language switcher position/size if needed */
    .language-switcher {
        top: 10px;
        right: 10px;
    }
     .language-switcher a {
         font-size: 1.5em; /* Slightly smaller flags */
     }
     
     /* Inside the @media (max-width: 768px) block */

	.language-switcher {
		/* Override desktop positioning */
		right: auto; /* Remove the right positioning */
		left: 50%;   /* Position the left edge at the center */
		transform: translateX(-50%); /* Shift the element left by half its own width */

		/* Optional: Adjust vertical position if needed */
		top: 10px; /* Align with the mobile buttons, or adjust as you like */

		/* Optional: Ensure it has enough space if flags wrap */
		width: auto; /* Let it size based on content */
		white-space: nowrap; /* Prevent flags from wrapping if space is tight */
		z-index: 10; /* Keep its original z-index relative to the cover section */
	}

	/* Optional: If the flags feel too big on mobile */
	.language-switcher a {
		font-size: 1.6em; /* Slightly smaller flags, adjust as needed */
		margin-left: 5px;
		margin-right: 5px;
	}
}
   