/* Define the core color palette from the brand guide */
:root {
    --offwhite: #F0D6A0; /* Tagline background, footer text, main text */
    --lightbrown: #D3A478; /* Header text, borders */
    --brown: #7F664B; /* Darker accents */
    --black: #000000; /* Header background, footer background */
    --maroon: #8C0000; /* For highlighting, links, hover effects (implied primary accent) */
    --darkbrown: #3E2723; /* For headings, strong text (derived from brand colors) */
}

/* Configure the Tailwind theme with our new colors and fonts */
tailwind.config = {
    theme: {
        extend: {
            colors: {
                offwhite: 'var(--offwhite)',
                lightbrown: 'var(--lightbrown)',
                brown: 'var(--brown)',
                black: 'var(--black)',
                maroon: 'var(--maroon)',
                darkbrown: 'var(--darkbrown)',
            },
            fontFamily: {
                // 'League Spartan' for headings/header (as "Header Font")
                header: ['"League Spartan"', 'sans-serif'],
                // 'Canva Sans' for body/tagline (as "Tagline")
                body: ['"Canva Sans"', 'sans-serif'],
            }
        }
    }
}

/* Base Body Styles - Apply new background color and font */
body {
    background-color: var(--offwhite);
    color: var(--darkbrown);
    font-family: var(--body);
}

/* Main content styling */
main {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Header & Banner styling */
.banner-text {
    animation: scroll-left 60s linear infinite;
    padding-left: 100%;
    white-space: nowrap;
    display: inline-block; /* Ensures content flows naturally */
}

.sticky-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: var(--black);
}

/* Modal styling */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--offwhite);
    margin: auto;
    padding: 1.5rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

@media (min-width: 640px) {
    .modal-content {
        padding: 2.5rem;
    }
}

.modal-logo {
    display: block;
    margin: 0 auto 1.5rem;
    max-height: 6rem;
}

.close-btn {
    color: var(--darkbrown);
    font-size: 2rem;
    font-weight: bold;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
}

@media (min-width: 640px) {
    .close-btn {
        font-size: 3rem;
    }
}

.close-btn:hover,
.close-btn:focus {
    color: var(--maroon);
    text-decoration: none;
    cursor: pointer;
}

.modal h3 {
    font-family: var(--header);
    color: var(--darkbrown);
}

.modal p {
    font-family: var(--body);
}

/* Social Share Icons */
.social-share a:hover img {
    filter: invert(30%) sepia(100%) saturate(600%) hue-rotate(330deg) brightness(100%) contrast(90%);
}

/* Custom keyframes for the scrolling banner */
@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@media (max-width: 640px) {
    .animate-scroll {
        animation-duration: 30s;
    }
}

/* --- New Timeline Category Styles --- */
/* Base timeline dot */
.timeline-event::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 0.5rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background-color: var(--brown); /* Default dot color */
    border: 2px solid var(--brown);
}

/* Specific category colors (optional, but good for visual distinction) */
.timeline-event.judicial::before {
    background-color: var(--maroon);
    border-color: var(--maroon);
}

.timeline-event.legislative::before {
    background-color: var(--darkbrown);
    border-color: var(--darkbrown);
}

.timeline-event.executive::before {
    background-color: var(--lightbrown);
    border-color: var(--lightbrown);
}

.timeline-event.local::before {
    background-color: var(--brown);
    border-color: var(--brown);
}

/* 🛑 FINAL FIX: PREVENT PAGE JUMP ON MODAL CLOSE 🛑 */
/* This class ensures the page doesn't shift when the scrollbar is hidden. */
body.modal-open {
    /* Remove overflow and padding-right; we'll set dynamically in JS */
    /* overflow: hidden !important; */ 
    /* padding-right: 17px; */ 
}