/* ============================================================
   Ink Ledger — Magazine stylesheet
   Palette: newsprint #F4F1EA, ink #121212, rule #D4CEC4,
            accent #C45C3E
   ============================================================ */

:root {
    --paper: #F4F1EA;
    --paper-deep: #ECE7DC;
    --ink: #121212;
    --ink-soft: #3A3A3A;
    --muted: #6B675F;
    --rule: #D4CEC4;
    --accent: #C45C3E;
    --display: 'Source Serif 4', Georgia, 'Iowan Old Style', 'Times New Roman', serif;
    --blackletter: 'UnifrakturCook', Georgia, 'Times New Roman', serif;
    --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    overflow-x: clip;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
    font-family: var(--display);
    margin: 0;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.015em;
}

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.section-label {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
    margin: 0 0 10px;
}

.byline {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--muted);
    margin: 10px 0 0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.text-link {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 3px;
    margin-top: 16px;
}

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

.site-header {
    border-bottom: 1px solid var(--rule);
    background: var(--paper);
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 8px 24px;
    background: var(--ink);
    color: rgba(244, 241, 234, 0.82);
    font-size: 11.5px;
    letter-spacing: 0.02em;
    border-bottom: 1px solid rgba(244, 241, 234, 0.22);
}

.topbar-inner { display: flex; justify-content: space-between; gap: 16px; align-items: center; width: 100%; max-width: 1160px; margin: 0 auto; }

.topbar-note { margin: 0; text-transform: uppercase; letter-spacing: 0.16em; font-size: 10.5px; color: rgba(244, 241, 234, 0.72); }
.topbar-issue { margin: 0; }
.topbar-issue a { color: var(--accent); font-weight: 700; }
.topbar-issue a:hover { color: var(--paper); }

.masthead {
    text-align: center;
    padding: 20px 24px 16px;
    border-bottom: 4px double var(--ink);
}

.masthead-name {
    font-family: var(--blackletter);
    font-size: clamp(46px, 7.5vw, 92px);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 0.98;
    color: var(--ink);
}

.masthead-name a:hover { color: var(--ink); opacity: 0.85; }

.masthead-tagline {
    margin: 12px 0 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5em;
    color: var(--ink-soft);
    padding-left: 0.5em;
}

.main-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 30px;
    padding: 11px 24px;
    border-top: 1px solid var(--rule);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.main-nav a { padding: 3px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.nav-sep { width: 1px; background: var(--rule); align-self: stretch; }

/* ---------------- Lead hero (home, first screen) ---------------- */

.lead-hero {
    position: relative;
    width: 100%;
    min-height: clamp(480px, 66vh, 700px);
    background: var(--ink);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.lead-hero-media { position: absolute; inset: 0; }
.lead-hero-media a { display: block; width: 100%; height: 100%; }
.lead-hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.92; }

.lead-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(18, 18, 18, 0.10) 0%, rgba(18, 18, 18, 0.28) 40%, rgba(18, 18, 18, 0.95) 100%);
}

.lead-hero-copy {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px clamp(32px, 4.5vw, 58px);
}

.lead-hero .section-label { color: var(--accent); }
.lead-hero .section-label a { color: var(--accent); }
.lead-hero .section-label a:hover { color: var(--paper); }
.lead-hero .lead-dek { color: rgba(244, 241, 234, 0.9); }
.lead-hero .byline { color: rgba(244, 241, 234, 0.72); }
.lead-hero .text-link { color: var(--paper); }
.lead-hero .text-link:hover { color: var(--accent); }

.lead-headline {
    font-size: clamp(38px, 5.4vw, 68px);
    font-weight: 900;
    letter-spacing: -0.02em;
    max-width: 16ch;
}

.lead-headline a { color: var(--paper); transition: opacity 0.18s ease; }
.lead-headline a:hover { color: var(--paper); opacity: 0.82; }

.lead-dek {
    font-family: var(--display);
    font-size: 18px;
    line-height: 1.6;
    color: var(--ink-soft);
    margin: 18px 0 0;
    max-width: 46ch;
}

/* ---------------- River (home) ---------------- */

.river { padding: 42px 0 6px; border-bottom: 1px solid var(--rule); }

.river-duo {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 48px;
    align-items: start;
    margin-bottom: 46px;
}

.tile { border-top: 1px solid var(--ink); padding-top: 18px; }

.tile-link { display: block; transition: transform 0.22s ease; }
.tile-link:hover { transform: translateY(-4px); }
.tile-link:hover img { opacity: 0.85; }
.tile img { opacity: 1; transition: opacity 0.22s ease; }

.tile--wide img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.tile--tall img { aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }

.tile-headline { font-size: clamp(20px, 2.2vw, 28px); margin: 12px 0 0; }
.tile--wide .tile-headline { font-size: clamp(24px, 2.8vw, 36px); }

.tile-dek {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--ink-soft);
    margin: 10px 0 0;
    max-width: 56ch;
}

.river-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 46px;
}

.river-grid .tile img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

.band {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 44px;
    align-items: center;
    border-top: 1px solid var(--ink);
    padding: 28px 0 10px;
    margin-bottom: 44px;
}

.band img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.band .tile-headline { font-size: clamp(24px, 3vw, 34px); }

/* ---------------- Issue strip (home) ---------------- */

.issue-strip { padding: 34px 0 44px; border-bottom: 1px solid var(--rule); }
.issue-strip-inner { display: grid; grid-template-columns: 118px 1fr; gap: 26px; align-items: center; max-width: 860px; margin: 0 auto; }
.issue-strip-cover { width: 118px; aspect-ratio: 3 / 4; object-fit: cover; }
.issue-strip-copy h2 { font-size: 26px; margin: 0 0 8px; }
.issue-strip-copy h2 span { color: var(--accent); }

/* ---------------- Magazine page ---------------- */

.issue-feature {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    gap: 48px;
    align-items: end;
    padding: 48px 0 40px;
    border-bottom: 1px solid var(--rule);
}

.issue-title { font-size: clamp(58px, 9vw, 120px); font-weight: 900; letter-spacing: -0.03em; line-height: 0.9; }
.issue-title span { color: var(--accent); }
.issue-season { text-transform: uppercase; letter-spacing: 0.3em; font-size: 13px; margin: 16px 0 0; }
.issue-feature-cover img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

.archive { padding: 40px 0 20px; }
.archive-section { margin-bottom: 52px; }

.section-heading {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    border-bottom: 1px solid var(--ink);
    padding-bottom: 10px;
    margin-bottom: 4px;
}

.story-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: baseline;
    padding: 15px 0;
    border-bottom: 1px solid var(--rule);
}

.story-row h3 { font-size: 19px; transition: color 0.15s ease; }
.story-row a:hover h3 { color: var(--accent); }
.story-row .byline { margin: 0; text-align: right; }

/* ---------------- Article detail ---------------- */

.article-detail { padding: 46px 0 60px; max-width: 880px; }
.article-title { font-size: clamp(34px, 5vw, 56px); font-weight: 900; letter-spacing: -0.02em; margin-top: 8px; }
.article-dek { font-family: var(--display); font-size: 19px; line-height: 1.6; color: var(--ink-soft); margin: 16px 0 0; }
.article-detail .byline { margin-top: 18px; }
.article-hero { margin: 28px 0 34px; }
.article-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.article-body {
    font-family: var(--display);
    font-size: 19px;
    line-height: 1.85;
    color: var(--ink);
    white-space: pre-line;
    max-width: 66ch;
}

.related { margin-top: 56px; border-top: 4px double var(--ink); padding-top: 30px; }

/* ---------------- Section page ---------------- */

.section-page { padding: 46px 0 60px; }
.section-title { font-size: clamp(40px, 6vw, 64px); font-weight: 900; text-transform: uppercase; letter-spacing: -0.01em; }
.section-intro { font-family: var(--display); font-size: 17px; color: var(--ink-soft); max-width: 60ch; margin: 14px 0 0; }
.section-list { margin-top: 38px; }
.section-list .story-row:first-child { padding: 22px 0; }
.section-list .story-row:first-child h3 { font-size: 28px; }
.section-list .story-row:first-child .byline { font-size: 12.5px; }

/* ---------------- Contributors ---------------- */

.page-head { padding: 46px 0 12px; }

.contributors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    padding: 30px 0 60px;
}

.contributor { border-top: 1px solid var(--ink); padding-top: 18px; }
.contributor img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; margin-bottom: 16px; }
.contributor h2 { font-size: 22px; }
.contributor-role { font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent); margin: 6px 0 10px; font-weight: 700; }
.contributor-bio { font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); margin: 0; }

/* ---------------- About / Newsletter ---------------- */

.prose { max-width: 66ch; padding: 26px 0 60px; }
.prose p { font-family: var(--display); font-size: 18px; line-height: 1.8; margin: 0 0 18px; }
.prose .section-label { font-family: var(--sans); }

.newsletter-form { display: flex; gap: 12px; margin: 28px 0 12px; max-width: 520px; }
.newsletter-form input {
    flex: 1;
    border: 1px solid var(--rule);
    border-radius: 0;
    background: #FFFFFF;
    padding: 13px 14px;
    font-size: 15px;
    font-family: var(--sans);
    color: var(--ink);
}
.newsletter-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.newsletter-form button {
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 13px 22px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.newsletter-form button:hover { background: var(--accent); border-color: var(--accent); }
.newsletter-note { font-size: 13px; color: var(--muted); }

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

.site-footer { border-top: 1px solid var(--rule); margin-top: 48px; }

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 40px;
    padding: 44px 0 36px;
}

.footer-wordmark { font-family: var(--display); font-size: 28px; font-weight: 900; text-transform: uppercase; margin: 0 0 10px; }
.footer-note { font-size: 14px; line-height: 1.65; color: var(--ink-soft); max-width: 40ch; margin: 0; }
.footer-col h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em; margin: 0 0 12px; }
.footer-col a { display: block; font-size: 14px; padding: 4px 0; color: var(--ink-soft); }
.footer-col a:hover { color: var(--accent); }

.footer-base {
    border-top: 1px solid var(--rule);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    font-size: 12.5px;
    color: var(--muted);
}
.footer-base p { margin: 0; }

/* ---------------- Motion & accessibility ---------------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; animation: none !important; }
    .tile-link:hover { transform: none; }
}

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

@media (max-width: 900px) {
    .lead-hero { min-height: clamp(420px, 58vh, 560px); }
    .river-duo { grid-template-columns: 1fr; }
    .river-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
    .band { grid-template-columns: 1fr; }
    .issue-feature { grid-template-columns: 1fr; align-items: start; }
    .issue-feature-cover { order: -1; max-width: 320px; }
    .contributors-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .main-nav { justify-content: flex-start; gap: 10px 18px; }
    .topbar-inner { flex-direction: column; align-items: flex-start; gap: 4px; }
    .river-grid { grid-template-columns: 1fr; }
    .contributors-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .story-row { grid-template-columns: 1fr; }
    .story-row .byline { text-align: left; }
    .newsletter-form { flex-direction: column; }
    .issue-strip-inner { grid-template-columns: 1fr; }
}
