/* Base settings */
:root {
    --text-color: #242424;
    --background-color: #ffffff;
    --brand-color: #1a8917;
    --border-color: #f2f2f2;
    --meta-color: #757575;
    
    --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-body: charter, Georgia, Cambria, "Times New Roman", Times, serif;
}

body {
    font-family: var(--font-ui);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* Layout wrappers */
.wrapper {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography & Links */
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand-color); }

p, li {
    font-family: var(--font-body);
    font-size: 20px;
    line-height: 1.6;
    margin-bottom: 1.8em;
    word-wrap: break-word;
}

h1, h2, h3, h4 {
    font-family: var(--font-ui);
    color: #111111;
    line-height: 1.2;
    margin-top: 1.8em;
    margin-bottom: 0.5em;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Header & Footer */
.site-header {
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    margin-bottom: 50px;
}
.site-title { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    margin-top: 60px;
    text-align: center;
    color: var(--meta-color);
    font-size: 14px;
}

/* Individual Post Content */
.post-header { margin-bottom: 40px; }
.post-title { font-size: 42px; line-height: 1.1; margin: 0 0 15px 0; }
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 35px 0;
}
.post-content blockquote {
    font-family: var(--font-body);
    font-size: 24px;
    font-style: italic;
    color: var(--meta-color);
    border-left: 3px solid #242424;
    padding-left: 20px;
    margin: 40px 0;
}

/* =========================================
   NEWSPAPER HOMEPAGE LAYOUT
   ========================================= */

/* --- Full Screen Breakout for Homepage & Masthead --- */
.newspaper-home, .newspaper-masthead {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 0 4vw; /* Adds breathing room on the left and right edges */
    box-sizing: border-box;
}

.newspaper-masthead {
    text-align: center;
    margin-bottom: 40px;
}

.newspaper-title {
    font-family: var(--font-body);
    font-size: 3.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 3px solid #111;
    padding-bottom: 10px;
    margin-bottom: 5px;
    color: #111;
}

/* --- Masthead Logo & Text Alignment --- */
.masthead-link {
    display: inline-flex;
    align-items: center;      /* Perfectly centers the logo and text vertically */
    justify-content: center;
    gap: 15px;                /* Adds a nice 15px gap between the logo and the text */
}

.masthead-logo {
    height: 1em;              /* The Magic Trick: Forces the image to be the exact height of the text */
    width: auto;              /* Prevents the image from stretching or distorting */
    object-fit: contain;
    margin: 0;                /* Resets any default image margins */
    border-radius: 0;
}

.newspaper-title a {
    color: #111;
}

.newspaper-date {
    font-family: var(--font-ui);
    font-size: 14px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
}

/* --- Masthead Category Menu --- */
.newspaper-categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    margin-top: 20px;
    padding: 12px 0;
    border-top: 1px solid #111;
    border-bottom: 2px solid #111;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.newspaper-categories a {
    color: #333;
    transition: color 0.2s;
}

.newspaper-categories a:hover {
    color: var(--brand-color);
}

/* --- Main Layout: 3 Columns --- */
.newspaper-layout-3col {
    display: grid;
    /* Ratio: Left gets 1 part, Center gets 2.5 parts, Right gets 1 part */
    grid-template-columns: 1fr 2.5fr 1fr; 
    gap: 40px;
}

.side-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.left-column {
    border-right: 1px solid #ccc;
    padding-right: 30px;
}

.right-column {
    border-left: 1px solid #ccc;
    padding-left: 30px;
}

/* --- The Hero Article (Center) --- */
.featured-post { display: block; }
.featured-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin-bottom: 20px;
}
.featured-content h2 {
    font-family: var(--font-body);
    font-size: 2.8rem;
    line-height: 1.1;
    margin: 10px 0;
}
.featured-content h2 a { color: #111; }
.news-category { font-weight: bold; color: var(--brand-color); }
.featured-content .post-excerpt {
    font-size: 19px;
    line-height: 1.6;
    color: #333;
}

/* --- The Sub-Posts (Left & Right) --- */
.sub-post {
    display: flex;
    flex-direction: column; 
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}
.sub-post:last-child { border-bottom: none; }
.sub-post-image {
    width: 100%;
    aspect-ratio: 16 / 9; 
    object-fit: cover;
    margin-bottom: 10px;
}
.sub-post-text h3 {
    font-family: var(--font-body);
    font-size: 1.3rem;
    line-height: 1.2;
    margin: 0 0 5px 0;
}
.sub-post-text h3 a { color: #111; }
.sub-post-text .post-meta {
    font-size: 13px;
    margin: 0;
    font-family: var(--font-ui);
    color: var(--meta-color);
}

/* =========================================
   BOTTOM HORIZONTAL GRID (Footer Posts)
   ========================================= */
.newspaper-bottom-section {
    margin-top: 60px;
    border-top: 4px solid #111;
    padding-top: 30px;
}

.bottom-section-title {
    font-family: var(--font-body);
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 30px;
}

.newspaper-footer-grid {
    display: grid;
    /* Automatically creates as many 220px columns as will fit across the screen */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 30px;
}

.footer-post {
    display: flex;
    flex-direction: column;
}

.footer-post-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin-bottom: 12px;
}

.footer-post-text h3 {
    font-family: var(--font-body);
    font-size: 1.2rem;
    line-height: 1.2;
    margin: 0 0 5px 0;
}

.footer-post-text h3 a { color: #111; }

.footer-post-text .post-meta {
    font-size: 13px;
    margin: 0;
    font-family: var(--font-ui);
    color: var(--meta-color);
}

/* =========================================
   MOBILE & TABLET RESPONSIVENESS
   ========================================= */
@media (max-width: 992px) {
    /* Stack the layout vertically */
    .newspaper-layout-3col {
        display: flex;
        flex-direction: column;
    }
    
    /* 1. FEATURED ARTICLE (Moves to absolute top) */
    .center-column {
        order: 1; 
        border-bottom: 3px solid #111;
        padding-bottom: 40px;
        margin-bottom: 40px;
    }
    
    /* 2. LEFT COLUMN (Sits under featured article) */
    .left-column {
        order: 2;
        border-right: none;
        border-bottom: 1px solid #ccc;
        padding-right: 0;
        padding-bottom: 40px;
        margin-bottom: 40px;
    }
    
    /* 3. RIGHT COLUMN (Sits at the very bottom) */
    .right-column {
        order: 3;
        border-left: none;
        padding-left: 0;
    }

    /* Shrink the massive masthead title so it fits on narrow phone screens */
    .newspaper-title {
        font-size: 2.2rem;
    }
    
    /* Make the hero title slightly smaller for readability */
    .featured-content h2 {
        font-size: 2.2rem;
    }
}
