/* The Daily AI Digest — style.css */

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #f8f8f8;
    --color-surface: #ffffff;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-text-muted: #888888;
    --color-heading: #111111;
    --color-link: #0055aa;
    --color-link-hover: #003d7a;
    --color-border: #e5e5e5;
    --color-accent: #0055aa;
    --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
    --max-width: 720px;
}

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

body {
    font-family: var(--font-stack);
    line-height: 1.65;
    color: var(--color-text);
    background-color: var(--color-bg);
}

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

a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

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

/* Layout */
.site-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Navigation */
.site-nav {
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 2rem;
}

.site-nav .site-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.site-nav .site-title {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-nav .site-title:hover {
    text-decoration: none;
    opacity: 0.8;
}

.site-logo {
    height: 6rem;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    font-size: 0.875rem;
    color: var(--color-text-light);
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--color-heading);
}

.nav-links a.active {
    color: var(--color-heading);
    font-weight: 600;
}

/* Header / Hero */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-border);
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.page-header .subtitle {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.page-header .meta {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.page-header .meta span + span::before {
    content: "\00b7";
    margin: 0 0.4em;
}

/* Edition */
.edition {
    margin-bottom: 3rem;
}

/* Edition intro block (sources + joke) */
.edition-intro {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 0.875rem 1.125rem;
    margin-bottom: 2rem;
    font-family: 'Courier New', Courier, 'Lucida Console', monospace;
    font-size: 0.85rem;
    font-style: italic;
    color: var(--color-text);
    line-height: 1.6;
}

.edition-intro .sources-summary {
    margin: 0;
}

.edition-intro .dad-joke {
    margin: 0.375rem 0 0;
}

.dad-joke-label {
    font-weight: 700;
}

/* Sections */
.section {
    margin-bottom: 2.5rem;
}

.section-header {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-heading);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 0.375rem;
}

.section-description {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin-bottom: 1.25rem;
}

.section-quiet {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-style: italic;
}

/* Items */
.item {
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.item-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.item-title a {
    color: var(--color-heading);
    text-decoration: none;
}

.item-title a:hover {
    text-decoration: underline;
}

.item-summary {
    font-size: 0.9375rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.item-why {
    font-size: 0.875rem;
    color: var(--color-text-light);
    font-style: italic;
    margin-bottom: 0.625rem;
    line-height: 1.55;
}

.item-why strong {
    font-style: normal;
    color: var(--color-text);
}

.item-links {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.item-links a {
    color: var(--color-link);
}

.item-links .separator {
    margin: 0 0.4em;
    color: var(--color-border);
}

/* Edition Navigation (prev/next) */
.edition-nav {
    display: flex;
    justify-content: space-between;
    padding: 1.25rem 0;
    border-top: 2px solid var(--color-border);
    margin-top: 2rem;
    font-size: 0.875rem;
}

.edition-nav a {
    color: var(--color-link);
}

.edition-nav .nav-prev::before {
    content: "\2190\00a0";
}

.edition-nav .nav-next::after {
    content: "\00a0\2192";
}

/* Archive */
.archive-list {
    list-style: none;
}

.archive-entry {
    padding: 0.875rem 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.archive-entry:last-child {
    border-bottom: none;
}

.archive-date {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    min-width: 6.5rem;
    font-variant-numeric: tabular-nums;
}

.archive-headline {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-heading);
    flex: 1;
}

.archive-headline a {
    color: var(--color-heading);
}

.archive-headline a:hover {
    text-decoration: underline;
}

.archive-count {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.875rem;
}

.pagination a,
.pagination span {
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
}

.pagination .current {
    background: var(--color-accent);
    color: #fff;
    font-weight: 600;
}

.pagination a {
    color: var(--color-link);
}

.pagination a:hover {
    background: #f0f0f0;
    text-decoration: none;
}

/* Static Pages (About, Subscribe) */
.page-content {
    margin-bottom: 3rem;
}

.page-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-heading);
    margin: 2rem 0 0.75rem;
}

.page-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-heading);
    margin: 1.5rem 0 0.5rem;
}

.page-content p {
    margin-bottom: 1rem;
}

.page-content ul,
.page-content ol {
    margin: 0 0 1rem 1.5rem;
}

.page-content li {
    margin-bottom: 0.375rem;
}

/* Subscribe Form */
.subscribe-form {
    background: #f0f4f8;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.subscribe-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-heading);
    margin-bottom: 0.5rem;
}

.subscribe-form input[type="email"] {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.9375rem;
    font-family: var(--font-stack);
    margin-bottom: 0.75rem;
}

.subscribe-form input[type="email"]:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(0, 85, 170, 0.15);
}

.subscribe-form button {
    display: inline-block;
    padding: 0.625rem 1.5rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--font-stack);
    cursor: pointer;
}

.subscribe-form button:hover {
    background: var(--color-link-hover);
}

/* Footer */
.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--color-border);
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.site-footer .site-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.site-footer a {
    color: var(--color-text-light);
}

.site-footer a:hover {
    color: var(--color-heading);
}

/* Responsive */
@media (max-width: 600px) {
    html {
        font-size: 15px;
    }

    .site-nav .site-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        gap: 1rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .archive-entry {
        flex-direction: column;
        gap: 0.25rem;
    }

    .archive-date {
        min-width: auto;
    }

    .edition-nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    .site-footer .site-container {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Print */
@media print {
    body {
        background: #fff;
        color: #000;
        font-size: 11pt;
    }

    .site-nav,
    .site-footer,
    .edition-nav,
    .subscribe-form,
    .pagination {
        display: none;
    }

    .site-container {
        max-width: 100%;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .item {
        page-break-inside: avoid;
    }
}
