/* ============================================
   The Daily Briefing - Stylesheet
   A modern broadsheet newspaper aesthetic
   ============================================ */

:root {
    --accent: #333;
    --accent-light: #f5f5f5;
    --accent-dark: #111;

    --text: #1a1a1a;
    --text-secondary: #555;
    --text-light: #888;
    --bg: #faf9f7;
    --bg-card: #ffffff;
    --border: #d4d0ca;
    --border-light: #e8e5e0;
    --rule: #1a1a1a;

    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

    --max-width: 720px;
    --gutter: 1.25rem;
}

/* ---------- Reset & Base ---------- */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ---------- Layout ---------- */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
    padding-top: 1.5rem;
}

.header-rule {
    height: 3px;
    background: var(--rule);
    margin-bottom: 0;
}

.masthead {
    text-align: center;
    padding: 1.5rem 0 0.75rem;
}

.masthead-link {
    text-decoration: none;
    color: var(--text);
}

.masthead-link:hover {
    color: var(--text);
}

.masthead-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-transform: uppercase;
}

.masthead-tagline {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 0.25rem;
}

.edition-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.6rem 0;
    margin: 0.5rem 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.edition-label {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent);
}

.edition-date {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.site-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 0.75rem 0;
}

.site-nav a {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.site-nav a:hover {
    color: var(--accent);
}

/* ---------- Edition Navigation ---------- */

.edition-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
}

.edition-nav-bottom {
    margin-bottom: 0;
    margin-top: 2rem;
    border-bottom: none;
    border-top: 1px solid var(--border-light);
    padding-top: 1rem;
}

.nav-prev, .nav-next {
    font-weight: 500;
    color: var(--accent);
    min-width: 0;
    flex: 1;
}

.nav-next {
    text-align: right;
}

.nav-archive {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.nav-disabled {
    visibility: hidden;
}

/* ---------- Section Index ---------- */

.section-index {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
}

.section-index-title {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.section-index-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
}

.section-index-list a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent);
}

.section-index-list a:hover {
    text-decoration: underline;
}

/* ---------- News Sections ---------- */

.news-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.news-section:last-of-type {
    border-bottom: none;
}

.section-header {
    margin-bottom: 1rem;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

.section-summary {
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* ---------- News Items ---------- */

.news-items {
    list-style: none;
}

.news-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.news-item:last-child {
    border-bottom: none;
}

.news-item-headline {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.35rem;
}

.news-item-headline a {
    color: var(--text);
}

.news-item-headline a:hover {
    color: var(--accent);
}

.news-item-summary {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.news-item-source {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}

/* ---------- Edition Timestamp ---------- */

.edition-timestamp {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
    font-style: italic;
    padding: 1rem 0;
}

/* ---------- No Edition ---------- */

.no-edition {
    text-align: center;
    padding: 4rem 1rem;
}

.no-edition h2 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
}

.no-edition p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.no-edition a {
    color: var(--accent);
    text-decoration: underline;
}

/* ---------- Archive Page ---------- */

.archive-header {
    text-align: center;
    padding: 1.5rem 0 2rem;
}

.archive-header h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
}

.archive-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    margin-bottom: 1.5rem;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.archive-month-nav .month-label {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
}

.archive-month-nav a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
}

.archive-list {
    list-style: none;
}

.archive-day {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}

.archive-day-date {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.archive-editions {
    display: flex;
    gap: 1rem;
}

.archive-edition-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s ease;
}

.archive-edition-link.morning {
    background: #FFF3EB;
    color: #E87A2D;
    border: 1px solid #E87A2D33;
}

.archive-edition-link.morning:hover {
    background: #FEE8D6;
}

.archive-edition-link.evening {
    background: #F5EBF7;
    color: #7B2D8B;
    border: 1px solid #7B2D8B33;
}

.archive-edition-link.evening:hover {
    background: #ECD9F0;
}

.archive-edition-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.morning .archive-edition-dot { background: #E87A2D; }
.evening .archive-edition-dot { background: #7B2D8B; }

.archive-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

/* ---------- Footer ---------- */

.site-footer {
    padding: 1rem 0 2rem;
    margin-top: 2rem;
}

.footer-rule {
    height: 3px;
    background: var(--rule);
    margin-bottom: 1.5rem;
}

.footer-content {
    text-align: center;
}

.footer-brand {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.footer-note {
    font-size: 0.8rem;
    color: var(--text-light);
    max-width: 480px;
    margin: 0 auto 0.75rem;
    line-height: 1.5;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.footer-links a {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-copyright {
    font-size: 0.7rem;
    color: var(--text-light);
}

/* ---------- Dark Mode ---------- */

@media (prefers-color-scheme: dark) {
    :root {
        --text: #e8e6e3;
        --text-secondary: #a8a5a0;
        --text-light: #787572;
        --bg: #141210;
        --bg-card: #1c1a17;
        --border: #3a3632;
        --border-light: #2a2724;
        --rule: #e8e6e3;
    }

    .masthead-link,
    .masthead-link:hover {
        color: var(--text);
    }

    .news-item-headline a {
        color: var(--text);
    }

    .news-item-headline a:hover {
        color: var(--accent);
    }

    .section-index {
        background: #1c1a17;
    }

    .archive-edition-link.morning {
        background: #2a1f14;
        color: #F0A060;
        border-color: #E87A2D44;
    }

    .archive-edition-link.morning:hover {
        background: #3a2a1a;
    }

    .archive-edition-link.evening {
        background: #221428;
        color: #B080C0;
        border-color: #7B2D8B44;
    }

    .archive-edition-link.evening:hover {
        background: #301a38;
    }
}

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
    .masthead-title {
        font-size: 1.75rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .news-item-headline {
        font-size: 1rem;
    }

    .edition-bar {
        flex-direction: column;
        gap: 0.25rem;
    }

    .section-index-list {
        flex-direction: column;
        gap: 0.35rem;
    }

    .archive-editions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .edition-nav {
        font-size: 0.78rem;
    }
}

@media (min-width: 800px) {
    :root {
        --max-width: 760px;
    }

    .masthead-title {
        font-size: 3rem;
    }
}
