/* Updated Color Palette */
:root {
    --primary-text: #121212;
    --body-text: #333333;
    --accent-color: #ffd900; /* Punchier newsroom yellow */
    --bg-color: #ffffff;
    --border-color: #dfdfdf;
    --button-gray: #f2f2f2;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Georgia', serif;
    color: var(--body-text);
    background-color: var(--bg-color);
    line-height: 1.6;
}

/* Top Bar: Search and Subscribe */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.search-container {
    display: flex;
    gap: 0.5rem;
    width: 250px;
    position: relative; /* This acts as the anchor for the dropdown */
}

/* Force Pagefind to match your site's font */
.pagefind-ui {
    font-family: 'Arial', sans-serif;
}

.search-input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-family: 'Arial', sans-serif;
}

.search-btn, .subscribe-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 3px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Arial', sans-serif;
    text-transform: uppercase;
}

.search-btn {
    background-color: var(--button-gray);
    color: var(--primary-text);
}

.subscribe-btn {
    background-color: var(--accent-color);
    color: var(--primary-text);
}

.subscribe-btn:hover {
    background-color: #e6c300;
}

/* Redesigned Clean Header */
.site-header {
    background-color: var(--bg-color);
    color: var(--primary-text);
    text-align: center;
    border-top: 5px solid var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.logo-container {
    padding: 1.5rem 0;
}

.logo-container h1 a {
    color: var(--primary-text);
    text-decoration: none;
    font-family: 'Georgia', serif;
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -2px;
    text-shadow: 3px 3px 0px var(--accent-color);
}

.tagline {
    color: #555;
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    font-style: italic;
    margin-top: 0.8rem;
    letter-spacing: 1.5px;
    display: inline-block;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.4rem 2rem;
}

/* Navigation */
.main-nav {
    border-top: 1px solid var(--border-color);
    padding: 0;
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--primary-text);
    font-weight: bold;
    font-family: 'Arial', sans-serif;
    text-transform: uppercase;
    display: inline-block;
    padding: 1rem 0;
    border-bottom: 3px solid transparent;
}

.main-nav a:hover {
    color: #000;
    border-bottom: 3px solid var(--accent-color);
}

/* Side Menu Drawer */
.side-menu {
    height: 100%;
    width: 250px;
    position: fixed;
    top: 0;
    left: -250px;
    background-color: #fff;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    transition: left 0.3s ease;
    z-index: 1000;
    padding-top: 60px;
}

.side-menu.open {
    left: 0;
}

.side-menu .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
}

.side-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-nav a {
    padding: 15px 20px;
    display: block;
    text-decoration: none;
    color: #333;
    font-size: 1.2rem;
    border-bottom: 1px solid #eee;
    font-family: 'Georgia', serif;
}

/* Hide Hamburger on Desktop */
.hamburger-btn {
    display: none;
}

/* Main Layout */
.site-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Homepage Grid Elements */
.featured-story {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.featured-story h2 {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-text);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* --- SMH-Style Grid Dividers --- */
.grid-item {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 640px) {
    .grid-item {
        padding-right: 1.5rem;
        border-right: 1px solid var(--border-color);
        /* Fades the line out 0.5rem from the top, and 2rem from the bottom */
        border-image: linear-gradient(to bottom, 
            transparent 0.5rem, 
            var(--border-color) 0.5rem, 
            var(--border-color) calc(100% - 2rem), 
            transparent calc(100% - 2rem)
        ) 1;
    }
    
    .grid-item:last-child {
        border-right: none;
        padding-right: 0;
    }
}

.grid-item h3 {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--primary-text);
    margin-bottom: 0.75rem;
    text-wrap: balance; /* Perfect, even headline wrapping */
}

.grid-item p {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 1rem;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-text);
    font-weight: bold;
    font-family: 'Arial', sans-serif;
}

.read-more:hover {
    text-decoration: underline;
    text-decoration-color: var(--accent-color);
    text-decoration-thickness: 3px;
}

/* =========================================
   SINGLE ARTICLE PAGE STYLES
   ========================================= */

.full-article, .full-story {
    max-width: 740px;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.article-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1.5rem;
}

.meta-data {
    font-size: 0.9rem;
    color: #666666;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-category {
    display: inline-block;
    color: var(--primary-text);
    background-color: var(--accent-color);
    padding: 0.2rem 0.8rem;
    font-family: 'Arial', sans-serif;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 1rem;
    border-radius: 2px;
}

.full-article h2, .article-header h1 {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 2.5rem;
    line-height: 1.15;
    color: var(--primary-text);
    text-transform: none;
    border-bottom: none;
    letter-spacing: normal;
    margin-bottom: 1.5rem;
}

.full-article p, .article-body p {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--body-text);
    margin-bottom: 1.5rem;
}

.article-body h3 {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.5rem;
    color: var(--primary-text);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.article-image, .article-hero-image {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border-bottom: 3px solid var(--accent-color);
    margin-bottom: 2rem;
    display: block;
    object-fit: cover;
    max-height: 450px;
}

.full-article ul, .article-body ul {
    margin: 1rem 0 1.5rem 0;
    padding-left: 2.5rem;
}

.full-article li, .article-body li {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.15rem;
    color: var(--body-text);
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

/* =========================================
   HOMEPAGE CATEGORY SECTIONS
   ========================================= */

.category-section {
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 4px solid var(--accent-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.category-header h2, .site-content h2 {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary-text);
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
    display: inline-block;
}

.view-all {
    font-size: 0.9rem;
    color: #0056b3;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-all:hover {
    text-decoration: underline;
    color: #003d82;
}

.section-divider {
    border: 0;
    border-top: 1px solid #dcdcdc;
    border-bottom: 1px solid #f0f0f0;
    height: 3px;
    margin: 3rem 0;
}

/* --- Modern Footer Styling --- */
.site-footer {
    background-color: #f4f4f4;
    border-top: 4px solid #000;
    padding: 3rem 0 1rem 0;
    margin-top: 4rem;
    font-family: Arial, sans-serif;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 2rem;
}

.footer-col {
    flex: 1;
    min-width: 200px;
}

.footer-logo {
    font-family: 'Times New Roman', serif;
    font-weight: bold;
    font-size: 1.5rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.footer-col h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
    display: inline-block;
}

.footer-col p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
    padding-left: 0;
}

.footer-col ul li a {
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid #ddd;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: #777;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .logo-container h1 a {
        font-size: 2.5rem;
        text-shadow: 2px 2px 0px var(--accent-color);
    }

    .tagline {
        font-size: 0.9rem;
        padding: 0.4rem 1rem;
    }

    .main-nav ul {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 1rem;
        gap: 1.5rem;
        justify-content: flex-start;
        scrollbar-width: none;
    }

    .main-nav ul::-webkit-scrollbar {
        display: none;
    }

    .main-nav li {
        flex-shrink: 0;
    }

    .main-nav a {
        padding: 0.5rem 0;
        font-size: 0.9rem;
    }

    .featured-story h2, .full-article h2, .article-header h1 {
        font-size: 1.8rem;
    }

    .hamburger-btn {
        display: block;
        font-size: 2rem;
        background: none;
        border: none;
        cursor: pointer;
        position: absolute;
        top: 1rem;
        left: 1rem;
        z-index: 100;
    }

    .main-nav {
        display: none;
    }

    .footer-grid {
        flex-direction: column;
        text-align: center;
    }

    .footer-col h4 {
        display: block;
    }

    .category-header {
        align-items: center;
        flex-direction: column;
        gap: 0.5rem;
        border-bottom: 4px solid var(--accent-color);
    }
    
    .category-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 600px) {
    .full-story, .full-article {
        padding: 1rem;
        box-shadow: none;
    }

    .article-header h1 {
        font-size: 2rem;
    }
    
    .article-body p, .full-article p {
        font-size: 1rem;
    }
}

/* --- Pagefind Search Overlay --- */
.pagefind-ui__drawer {
    position: absolute !important;
    top: 100%; /* Puts it directly below the search bar */
    right: 0; /* Aligns the dropdown with the right side of the search bar */
    width: 350px; /* Makes the results box slightly wider than the search bar */
    background-color: var(--bg-color); /* Matches your site background */
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15); /* Adds a crisp shadow */
    z-index: 9999; /* Forces it to sit above images, text, and other menus */
    max-height: 70vh; /* Prevents the box from running off the bottom of the screen */
    overflow-y: auto; /* Adds a scrollbar if there are lots of results */
    margin-top: 10px !important;
    padding: 10px;
    border-radius: 4px;
}

/* Tidy up the individual results inside the new floating box */
.pagefind-ui__result {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.pagefind-ui__result:last-child {
    border-bottom: none;
}

/* =========================================
   LETTERS TO THE EDITOR
   ========================================= */
.letter-to-editor {
    background-color: #f9f9f9; /* Slight gray to separate from the white page */
    border-left: 5px solid var(--accent-color);
    padding: 2rem;
    margin: 2.5rem 0;
}

.letter-to-editor h3 {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary-text);
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.letter-body {
    font-family: 'Georgia', serif;
    font-size: 1.15rem;
    line-height: 1.8;
    font-style: italic; /* Classic letter styling */
    color: #444;
    margin-bottom: 1.5rem;
}

.letter-signoff {
    text-align: right;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    font-size: 1rem;
    color: var(--primary-text);
    border-top: 1px solid #eaeaea;
    padding-top: 1rem;
}

.letter-signoff span {
    display: block;
    font-weight: normal;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.2rem;
}