/* ============================================================
   Civic Ink — magazine design system
   newsprint #F4F1EA · ink #121212 · rule #D4CEC4 · accent #C45C3E
   Asymmetric three-column river · blackletter-feel masthead
   ============================================================ */

:root {
    --newsprint: #F4F1EA;
    --ink: #121212;
    --rule: #D4CEC4;
    --accent: #C45C3E;
    --accent-deep: #A3472E;
    --accent-soft: #E8A98E;
    --muted: #6B6559;
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-ui: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --maxw: 1280px;
    --gutter: clamp(1rem, 4vw, 3rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--newsprint);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-deep); }

ul, ol { margin: 0; padding: 0; list-style: none; }

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

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

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

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

.masthead {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
    gap: 1rem 2rem;
    padding-top: 1.4rem;
    padding-bottom: 1.1rem;
}

.masthead__meta,
.masthead__issue {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1.7;
}

.masthead__meta { justify-self: start; }
.masthead__issue { justify-self: end; text-align: right; }

.masthead__brand {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.1rem, 5.5vw, 3.6rem);
    line-height: 0.95;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--ink);
    justify-self: center;
    white-space: nowrap;
    border-bottom: 4px double var(--ink);
    padding-bottom: 0.35rem;
}

.brand-accent { color: var(--accent); }

.main-nav { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--ink); }

.main-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 2.2rem;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    overflow-x: auto;
}

.main-nav a {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
    padding: 0.15rem 0;
    border-bottom: 1px solid transparent;
    transition: color 0.18s ease, border-color 0.18s ease;
    white-space: nowrap;
}

.main-nav a:hover { color: var(--accent-deep); border-bottom-color: var(--accent); }

/* ---------------- Section head ---------------- */

.section-head {
    padding: 2.8rem 0 1.5rem;
    border-bottom: 3px solid var(--ink);
}

.section-head__label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-deep);
    margin: 0 0 0.5rem;
}

.section-head h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    line-height: 1.02;
    margin: 0;
    letter-spacing: -0.01em;
}

.section-head p.sub {
    color: var(--muted);
    max-width: 46rem;
    margin: 0.9rem 0 0;
    font-size: 1.02rem;
}

/* ---------------- Lead band ---------------- */

.lead {
    position: relative;
    min-height: min(78vh, 780px);
    display: flex;
    align-items: flex-end;
    color: #FDFBF5;
    background: var(--ink);
    border-bottom: 1px solid var(--ink);
    overflow: hidden;
}

.lead__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.lead__scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg,
        rgba(18, 18, 18, 0.10) 0%,
        rgba(18, 18, 18, 0.28) 42%,
        rgba(18, 18, 18, 0.62) 72%,
        rgba(18, 18, 18, 0.88) 100%);
}

.lead__body {
    position: relative;
    z-index: 2;
    padding-top: 6rem;
    padding-bottom: 2.8rem;
    max-width: 900px;
}

.lead__kicker {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-soft);
    margin: 0 0 1rem;
}

.lead__kicker::before {
    content: "";
    width: 2.2rem;
    height: 2px;
    background: var(--accent);
}

.lead__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.3rem, 6vw, 4.6rem);
    line-height: 0.99;
    letter-spacing: -0.01em;
    margin: 0 0 1.1rem;
    text-wrap: balance;
}

.lead__title a:hover { color: var(--accent-soft); }

.lead__dek {
    font-size: clamp(1.02rem, 1.6vw, 1.25rem);
    line-height: 1.55;
    color: rgba(253, 251, 245, 0.88);
    max-width: 38rem;
    margin: 0 0 1.4rem;
}

.lead__meta {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(253, 251, 245, 0.72);
    margin: 0 0 1.6rem;
}

.lead__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
    background: var(--newsprint);
    padding: 0.8rem 1.4rem;
    border: 1px solid var(--newsprint);
    transition: background 0.18s ease, color 0.18s ease;
}

.lead__cta:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------------- River grid (asymmetric three-column) ---------------- */

.river {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1px;
    background: var(--rule);
    border-top: 1px solid var(--rule);
    margin-top: 1px;
}

.story {
    background: var(--newsprint);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.4rem 1.5rem;
    min-width: 0;
}

.story__media { display: block; overflow: hidden; background: var(--rule); }
.story__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.25s ease, transform 0.35s ease;
}
.story:hover .story__media img { opacity: 0.92; transform: scale(1.012); }

.story__kicker {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-deep);
    margin: 0;
}

.story__title {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -0.005em;
    margin: 0;
}

.story__title a { transition: color 0.18s ease; }
.story__title a:hover { color: var(--accent-deep); }

.story__dek { color: var(--muted); margin: 0; line-height: 1.55; }

.story__meta {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: auto 0 0;
}

/* asymmetric spans: 7+5 / 4+4+4 / 3+3+3+3 */
.river .story:nth-child(1) { grid-column: span 7; }
.river .story:nth-child(2) { grid-column: span 5; }
.river .story:nth-child(3),
.river .story:nth-child(4),
.river .story:nth-child(5) { grid-column: span 4; }
.river .story:nth-child(n+6) { grid-column: span 3; }

.river .story:nth-child(1) .story__media { aspect-ratio: 16 / 10; }
.river .story:nth-child(2) .story__media { aspect-ratio: 16 / 10; }
.river .story:nth-child(n+3) .story__media { aspect-ratio: 4 / 3; }

.river .story:nth-child(1) .story__title { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.river .story:nth-child(2) .story__title { font-size: clamp(1.3rem, 2.2vw, 1.8rem); }
.river .story:nth-child(n+3) .story__title { font-size: clamp(1.05rem, 1.6vw, 1.3rem); }

/* opinion text tiles */
.river .story:nth-child(3),
.river .story:nth-child(7) { border-top: 3px solid var(--accent); }
.river .story:nth-child(3) .story__media,
.river .story:nth-child(7) .story__media { display: none; }
.river .story:nth-child(3) .story__title,
.river .story:nth-child(7) .story__title {
    font-style: italic;
    font-weight: 600;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
}

/* ---------------- Newsletter band ---------------- */

.newsletter-band {
    background: var(--ink);
    color: var(--newsprint);
    border-top: 3px solid var(--accent);
    margin-top: 3.5rem;
}

.newsletter-band__inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
    align-items: center;
    padding-top: 2.8rem;
    padding-bottom: 2.8rem;
}

.newsletter-band__kicker {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-soft);
    margin: 0 0 0.6rem;
}

.newsletter-band__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    line-height: 1.05;
    margin: 0 0 0.6rem;
}

.newsletter-band__dek {
    margin: 0;
    color: rgba(244, 241, 234, 0.75);
    max-width: 34rem;
}

.newsletter-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.newsletter-form input {
    flex: 1 1 220px;
    border: 1px solid var(--rule);
    background: transparent;
    padding: 0.85rem 1rem;
    font: inherit;
    font-size: 0.95rem;
    color: var(--newsprint);
}

.newsletter-form input::placeholder { color: rgba(244, 241, 234, 0.45); }

.newsletter-form button {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    padding: 0.85rem 1.4rem;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.18s ease;
}

.newsletter-form button:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

.newsletter-form__ok {
    flex-basis: 100%;
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-soft);
}

.newsletter-form__error {
    flex-basis: 100%;
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #FFB4A2;
}

/* ---------------- Article page ---------------- */

.article { padding-top: 3rem; padding-bottom: 4rem; }

.article__head { max-width: 760px; margin: 0 auto; }

.article__kicker {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-deep);
    margin: 0 0 1rem;
}

.article__kicker a { border-bottom: 1px solid transparent; }
.article__kicker a:hover { border-bottom-color: var(--accent); }

.article__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.1rem, 5vw, 3.6rem);
    line-height: 1.01;
    letter-spacing: -0.01em;
    margin: 0 0 1.1rem;
    text-wrap: balance;
}

.article__dek {
    font-size: clamp(1.05rem, 1.8vw, 1.3rem);
    line-height: 1.55;
    color: var(--muted);
    margin: 0 0 1.2rem;
}

.article__meta {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 2rem;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 0.9rem 0;
}

.article__hero { margin: 0 0 2.5rem; }
.article__hero img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }

.article__body {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.08rem;
    line-height: 1.8;
}

.article__body p { margin: 0 0 1.4rem; }

.article__body h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 1.15;
    margin: 2.4rem 0 1rem;
}

.article__body blockquote {
    margin: 2rem 0;
    padding: 0.2rem 0 0.2rem 1.6rem;
    border-left: 3px solid var(--accent);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--ink);
}

.article__body blockquote p { margin: 0 0 0.4rem; }

.article__more {
    max-width: 700px;
    margin: 3.5rem auto 0;
    border-top: 3px solid var(--ink);
    padding-top: 1.6rem;
}

.article__more h2 { font-family: var(--font-display); font-size: 1.3rem; margin: 0 0 1.2rem; }

.article__more li { border-bottom: 1px solid var(--rule); padding: 0.9rem 0; }
.article__more li:last-child { border-bottom: 0; }
.article__more a { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }

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

.magazine { padding-top: 3rem; padding-bottom: 4rem; }

.magazine__grid {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 3rem;
    margin-top: 2.2rem;
    align-items: start;
}

.magazine__cover { margin: 0; border: 1px solid var(--ink); background: var(--ink); }
.magazine__cover img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

.toc__label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-deep);
    border-bottom: 3px solid var(--ink);
    padding-bottom: 0.8rem;
    margin: 0 0 1.4rem;
}

.toc__section { margin-bottom: 1.8rem; }

.toc__section h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 0.4rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--rule);
}

.toc__section li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--rule);
    padding: 0.75rem 0;
}

.toc__section li:last-child { border-bottom: 0; }
.toc__section a { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; }

.toc__by {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
    align-self: center;
}

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

.section-page { padding-top: 3rem; padding-bottom: 4rem; }

.section-list {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1px;
    background: var(--rule);
    border-top: 1px solid var(--rule);
    margin-top: 2.2rem;
}

.section-item {
    background: var(--newsprint);
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1.4rem;
}

.section-item__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.section-item h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; line-height: 1.1; margin: 0; }
.section-item p { color: var(--muted); margin: 0; font-size: 0.95rem; }
.section-item__meta { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }

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

.contributors { padding-top: 3rem; padding-bottom: 4rem; }

.contributors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--rule);
    border-top: 1px solid var(--rule);
    margin-top: 2.2rem;
}

.contributor { background: var(--newsprint); padding: 1.5rem; }

.contributor__photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    margin-bottom: 1.1rem;
}

.contributor__name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; margin: 0 0 0.2rem; }

.contributor__role {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-deep);
    margin: 0 0 0.8rem;
}

.contributor__bio { font-size: 0.88rem; line-height: 1.6; color: var(--muted); margin: 0; }

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

.about { padding-top: 3rem; padding-bottom: 4rem; }

.about__body { max-width: 700px; margin-top: 2.2rem; font-size: 1.05rem; line-height: 1.8; }
.about__body h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; margin: 2.2rem 0 0.8rem; }
.about__body p { margin: 0 0 1.2rem; }
.about__links { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 2rem; }
.about__links a {
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.25rem;
}

.newsletter-page { padding-top: 4rem; padding-bottom: 5rem; }

.newsletter-page__panel {
    background: var(--ink);
    color: var(--newsprint);
    border-top: 3px solid var(--accent);
    padding: clamp(1.6rem, 4vw, 3.5rem);
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 3rem;
    align-items: center;
}

.newsletter-page__panel h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.9rem, 3.6vw, 2.8rem); line-height: 1.02; margin: 0 0 0.8rem; }
.newsletter-page__panel p { color: rgba(244, 241, 234, 0.75); margin: 0 0 1.4rem; max-width: 34rem; }
.newsletter-page__fine { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(244, 241, 234, 0.5); margin-top: 1rem; }

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

.site-footer {
    background: var(--ink);
    color: var(--newsprint);
    border-top: 3px solid var(--accent);
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.2fr;
    gap: 2.5rem;
    padding-top: 3rem;
    padding-bottom: 2.5rem;
}

.site-footer__logo { font-family: var(--font-display); font-weight: 900; font-size: 1.5rem; text-transform: uppercase; letter-spacing: 0.01em; }
.site-footer p { color: rgba(244, 241, 234, 0.72); font-size: 0.9rem; }
.site-footer h3 { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-soft); margin: 0 0 0.9rem; }
.site-footer ul li { margin-bottom: 0.5rem; }
.site-footer a { color: rgba(244, 241, 234, 0.85); font-size: 0.92rem; }
.site-footer a:hover { color: #fff; }

.site-footer__bottom {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid rgba(244, 241, 234, 0.16);
    padding-top: 1.2rem;
    padding-bottom: 1.6rem;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(244, 241, 234, 0.55);
}

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

@media (max-width: 960px) {
    .masthead { grid-template-columns: 1fr auto; }
    .masthead__meta { display: none; }
    .river .story:nth-child(1),
    .river .story:nth-child(2) { grid-column: span 12; }
    .river .story:nth-child(3),
    .river .story:nth-child(4),
    .river .story:nth-child(5),
    .river .story:nth-child(n+6) { grid-column: span 6; }
    .newsletter-band__inner { grid-template-columns: 1fr; }
    .magazine__grid { grid-template-columns: 1fr; }
    .contributors-grid { grid-template-columns: repeat(2, 1fr); }
    .section-item { grid-column: span 6; }
    .site-footer__grid { grid-template-columns: 1fr 1fr; }
    .newsletter-page__panel { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .river .story:nth-child(n+3),
    .river .story:nth-child(n+6) { grid-column: span 12; }
    .section-item { grid-column: span 12; }
    .contributors-grid { grid-template-columns: 1fr; }
    .lead { min-height: 74vh; }
}

/* ---------------- Reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
    .story:hover .story__media img { transform: none; }
}
