/* ============================================================
   SAAS IS DEAD — Newspaper Stylesheet
   ============================================================ */

@font-face {
    font-family: 'Chomsky';
    src: url('/static/fonts/Chomsky.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Butler';
    src: url('/static/fonts/Butler.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Butler';
    src: url('/static/fonts/Butler-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Liberation Serif';
    src: url('/static/fonts/LiberationSerif-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Liberation Serif';
    src: url('/static/fonts/LiberationSerif-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Liberation Serif';
    src: url('/static/fonts/LiberationSerif-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: block;
}

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

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

body {
    font-family: 'Liberation Serif', 'Georgia', 'Times New Roman', serif;
    background-color: #fff;
    color: #000;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

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

/* ============================================================
   NEWSPAPER PAGE
   ============================================================ */

.newspaper-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   MASTHEAD
   ============================================================ */

.masthead {
    text-align: center;
    padding-top: 1rem;
    flex-shrink: 0;
}

.masthead-rule {
    border: none;
    border-top: 1px solid #000;
    margin: 0;
}

.masthead-rule.thick {
    border-top: 3px double #000;
}

.masthead-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    font-family: 'Liberation Serif', 'Georgia', serif;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-variant: small-caps;
}

.masthead-title {
    font-family: 'Chomsky', serif;
    font-size: clamp(2.2rem, 9vw, 5.5rem);
    font-weight: 400;
    line-height: 1.1;
    padding: 0.15em 0 0.05em;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.masthead-subtitle {
    font-family: 'Butler', 'Georgia', serif;
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    font-weight: 400;
    font-style: italic;
    padding-bottom: 0.4rem;
    letter-spacing: 0.02em;
}

.masthead-subtitle strong {
    font-style: normal;
    font-weight: 700;
}

/* ============================================================
   ARTICLES GRID
   ============================================================ */

.articles-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid #000;
    border-left: 1px solid #000;
}

.article {
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
}

.article-link {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.75rem 0.85rem;
    height: 100%;
    transition: background-color 0.15s ease;
}

.article-link:hover {
    background-color: rgba(0, 0, 0, 0.025);
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.4rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-variant: small-caps;
}

.article-author {
    font-weight: 700;
}

.article-platform {
    font-style: italic;
    font-weight: 400;
}

.article-excerpt {
    font-family: 'Liberation Serif', 'Georgia', serif;
    font-size: 0.85rem;
    line-height: 1.5;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.article-headline {
    font-family: 'Butler', 'Georgia', serif;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.25;
    margin-bottom: 0.3rem;
}

.article-date {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: right;
    font-variant: small-caps;
}

/* ============================================================
   NO POSTS STATE
   ============================================================ */

.no-posts {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
}

.no-posts p {
    font-family: 'Liberation Serif', 'Georgia', serif;
    font-style: italic;
    font-size: 1.25rem;
    letter-spacing: 0.02em;
}

/* ============================================================
   PAGINATION
   ============================================================ */

.pagination {
    flex-shrink: 0;
    padding: 0.6rem 0 1rem;
}

.pagination-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.6rem;
    font-size: 0.8rem;
}

.page-link {
    padding: 0.2em 0.5em;
    text-decoration: none;
}

.page-link:hover {
    text-decoration: underline;
}

.page-numbers {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.current-page {
    font-weight: 700;
    border-bottom: 2px solid #000;
    padding: 0.2em 0.5em;
}

/* ============================================================
   PAGE TURN HINT
   ============================================================ */

.page-turn-hint {
    position: fixed;
    bottom: 1rem;
    right: 1.5rem;
    font-size: 0.7rem;
    background: #fff;
    border: 1px solid #000;
    padding: 0.4em 0.7em;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: opacity 0.3s ease;
    z-index: 10;
}

.page-turn-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

.page-turn-hint kbd {
    display: inline-block;
    padding: 0.15em 0.4em;
    border: 1px solid #000;
    font-family: inherit;
    font-size: 0.85em;
}

/* ============================================================
   MOBILE DATE
   ============================================================ */

.date-full {
    display: inline;
}

.date-short {
    display: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1200px) {
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .masthead-meta {
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }

    .newspaper-page {
        padding: 0 0.75rem;
    }

    .masthead-title {
        font-size: clamp(2rem, 12vw, 3rem);
    }

    .masthead-meta {
        flex-direction: column;
        gap: 0.15rem;
    }

    .date-full {
        display: none;
    }

    .date-short {
        display: inline;
    }

    .page-turn-hint {
        display: none;
    }
}
