/* ============ Maritime Reporter — design system ============ */
:root {
    --red: #e30815;
    --red-dark: #b90611;
    /* Brand red is 4.47:1 on --paper-warm, just under the 4.5 AA floor.
       Small text uses this darker tone instead (6.2:1 warm, 6.8:1 white). */
    --red-text: #b90611;
    --ink: #14171c;
    --ink-soft: #3c414a;
    --muted: #6d727c;
    --paper: #ffffff;
    --paper-warm: #f6f5f2;
    --line: #e6e4df;
    --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --shadow-sm: 0 1px 3px rgba(20, 23, 28, .08);
    --shadow-md: 0 6px 24px rgba(20, 23, 28, .14);
    --shadow-lg: 0 18px 48px rgba(20, 23, 28, .22);
    --container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: inherit; }

.container {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--ink);
    color: #fff;
    padding: .5rem 1rem;
    z-index: 100;
}
.skip-link:focus { left: 0; }

/* Available to screen readers and to the heading outline, not painted. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ============ Buttons ============ */
.btn {
    display: inline-block;
    padding: .65rem 1.4rem;
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
    border-radius: 3px;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { border: 1.5px solid var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }

/* ============ Header ============ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--paper);
    border-top: 4px solid var(--red);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 76px;
}

.brand img { display: block; width: 96px; height: auto; }

.site-nav {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 2.2rem);
}

.site-nav a:not(.btn) {
    text-decoration: none;
    font-weight: 600;
    font-size: .95rem;
    letter-spacing: .01em;
    color: var(--ink);
    padding: .35rem 0;
    border-bottom: 2px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}
.site-nav a:not(.btn):hover { color: var(--red); border-bottom-color: var(--red); }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: 0;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--ink);
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ Hero (latest issue) ============ */
.hero {
    background: var(--paper-warm);
    border-bottom: 1px solid var(--line);
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(260px, 420px) 1fr;
    gap: clamp(2rem, 6vw, 5rem);
    align-items: center;
    padding-block: clamp(2.5rem, 6vw, 5rem);
}

.hero-cover {
    display: block;
    line-height: 0;
    aspect-ratio: 10 / 13;   /* reserves space before the cover loads */
    box-shadow: var(--shadow-lg);
    border-radius: 4px;
    overflow: hidden;
    transition: transform .25s ease;
}
.hero-cover:hover { transform: translateY(-4px); }
.hero-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.eyebrow {
    display: inline-block;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--red-text);
    margin-bottom: 1rem;
}

.hero h1 {
    font-family: var(--serif);
    font-size: clamp(1.9rem, 4.2vw, 3.2rem);
    font-weight: 700;
    line-height: 1.12;
    margin: 0 0 1.1rem;
    letter-spacing: -.01em;
}

.hero .lede {
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    color: var(--ink-soft);
    max-width: 56ch;
    margin: 0 0 1.8rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; }

/* ============ Credentials strip ============ */
.cred-strip {
    background: var(--ink);
    color: #fff;
}
.cred-inner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding-block: 1.4rem;
    text-align: center;
}
.cred-inner strong {
    display: block;
    font-family: var(--serif);
    font-size: 1.35rem;
    color: #fff;
}
.cred-inner span { font-size: .85rem; color: rgba(255,255,255,.72); }

/* ============ Recent editions ============ */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.section-head h2 {
    font-family: var(--serif);
    font-size: clamp(1.5rem, 2.6vw, 2.1rem);
    margin: 0;
    letter-spacing: -.01em;
}

.section-head .more {
    font-weight: 600;
    font-size: .95rem;
    color: var(--red-text);
    text-decoration: none;
    white-space: nowrap;
}
.section-head .more:hover { text-decoration: underline; }

.issue-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);   /* never more than 4 across */
    gap: clamp(1.2rem, 3vw, 2rem);
}

.issue-card { text-decoration: none; display: block; }

.issue-card .cover {
    aspect-ratio: 10 / 13;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
    background: var(--paper-warm);
    transition: transform .2s ease, box-shadow .2s ease;
}
.issue-card .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.issue-card:hover .cover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.issue-card time {
    display: block;
    margin-top: .8rem;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--red-text);
}

.issue-card h3 {
    font-family: var(--serif);
    font-size: 1.05rem;
    line-height: 1.35;
    margin: .3rem 0 0;
    color: var(--ink);
}
.issue-card:hover h3 { text-decoration: underline; text-decoration-color: var(--line); }

/* ============ Related issues ============ */
.related-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: clamp(1rem, 2.2vw, 1.6rem);
}

@media (max-width: 1024px) {
    .related-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
    .related-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ Archive year index ============ */
.year-index { border-top: 1px solid var(--line); }

.year-index h2 {
    font-family: var(--serif);
    font-size: clamp(1.3rem, 2.2vw, 1.7rem);
    margin: 0 0 1.2rem;
}

.year-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.year-list a {
    display: block;
    padding: .45rem .85rem;
    font-size: .92rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
    color: var(--ink);
    background: var(--paper-warm);
    border: 1px solid var(--line);
    border-radius: 3px;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.year-list a:hover {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}
.year-list a.current {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.page-hero .eyebrow a { text-decoration: none; }
.page-hero .eyebrow a:hover { text-decoration: underline; }

/* ============ Archive article ============ */
.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
    padding-block: clamp(1.5rem, 4vw, 3rem);
}

.crumbs {
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.crumbs a { color: var(--red-text); text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }

.article-main > h1 {
    font-family: var(--serif);
    font-size: clamp(1.8rem, 3.6vw, 2.7rem);
    line-height: 1.15;
    letter-spacing: -.01em;
    margin: 0 0 .8rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1.2rem;
    font-size: .9rem;
    color: var(--muted);
    margin: 0 0 .6rem;
}
.article-meta .byline { font-weight: 600; color: var(--ink-soft); }

.article-category {
    display: inline-block;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--red-text);
    margin: 0 0 1.4rem;
}

.article-abstract {
    font-family: var(--serif);
    font-size: clamp(1.05rem, 1.7vw, 1.25rem);
    line-height: 1.5;
    color: var(--ink-soft);
    border-left: 3px solid var(--red);
    padding-left: 1.1rem;
    margin: 0 0 1.8rem;
}

.article-actions { margin: 0 0 2rem; }

/* Long-form reading measure and rhythm. */
.article-body {
    font-size: 1.06rem;
    line-height: 1.75;
    max-width: 68ch;
}
.article-body p { margin: 0 0 1.15rem; }

.entities {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 3px solid var(--ink);
}
.entities h2 {
    font-family: var(--serif);
    font-size: 1.4rem;
    margin: 0 0 1.2rem;
}
.entity-group { margin-bottom: 1.4rem; }
.entity-group h3 {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--red-text);
    margin: 0 0 .5rem;
}
.entity-group ul { list-style: none; margin: 0; padding: 0; }
.entity-group li {
    padding: .3rem 0;
    border-bottom: 1px solid var(--line);
    font-size: .95rem;
}
.entity-group li:last-child { border-bottom: 0; }
.entity-group li span { color: var(--muted); }
.entity-group li span::before { content: " — "; }

.article-provenance {
    margin-top: 2.5rem;
    font-size: .85rem;
    font-style: italic;
    color: var(--muted);
    border-top: 1px solid var(--line);
    padding-top: 1rem;
    max-width: 68ch;
}

/* --- sidebar --- */
.article-aside { position: sticky; top: 100px; }

.aside-issue {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.4rem;
    border-bottom: 1px solid var(--line);
}
.aside-cover {
    flex: 0 0 auto;
    width: 96px;
    line-height: 0;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.aside-cover img { width: 100%; height: auto; display: block; }
.aside-issue-text h2 {
    font-family: var(--serif);
    font-size: 1.15rem;
    margin: .2rem 0 .2rem;
}
.aside-issue-text h2 a { text-decoration: none; }
.aside-issue-text h2 a:hover { color: var(--red); }
.aside-issue-text .eyebrow { margin-bottom: .2rem; font-size: .7rem; }
.aside-date { margin: 0 0 .8rem; font-size: .85rem; color: var(--muted); }
.aside-issue-text .btn { padding: .4rem .9rem; font-size: .85rem; }

.aside-contents { margin-top: 1.4rem; }
.aside-contents h2 {
    font-family: var(--serif);
    font-size: 1.1rem;
    margin: 0 0 .8rem;
}
.aside-contents h2 span {
    display: block;
    font-family: var(--sans);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}
.aside-contents ol {
    list-style: none;
    margin: 0;
    padding: 0;
    /* The full issue can run to a hundred pieces; keep the column scrollable. */
    max-height: 60vh;
    overflow-y: auto;
}
.aside-contents li {
    padding: .45rem 0;
    border-bottom: 1px solid var(--line);
    font-size: .88rem;
    line-height: 1.35;
}
.aside-contents li:last-child { border-bottom: 0; }
.aside-contents a { text-decoration: none; }
.aside-contents a:hover { color: var(--red); text-decoration: underline; }
.aside-contents li.current { font-weight: 700; }
.aside-contents li.current span[aria-current] { color: var(--red-text); }
.aside-contents .page {
    display: block;
    font-size: .75rem;
    color: var(--muted);
    font-weight: 400;
}

@media (max-width: 900px) {
    .article-layout { grid-template-columns: 1fr; }
    .article-aside { position: static; }
    .aside-contents ol { max-height: none; }
}

/* ============ Issue detail ============ */
.issue-detail { background: var(--paper); }

.issue-detail-inner {
    display: grid;
    grid-template-columns: minmax(240px, 380px) 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
    padding-block: clamp(2rem, 5vw, 4rem);
}

.issue-detail-cover {
    position: sticky;
    top: 100px;
    line-height: 0;
    aspect-ratio: 10 / 13;   /* reserves space before the cover loads */
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.issue-detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.issue-detail-body h1 {
    font-family: var(--serif);
    font-size: clamp(2rem, 4.4vw, 3.2rem);
    line-height: 1.1;
    letter-spacing: -.01em;
    margin: 0 0 .9rem;
}

/* The edition's theme, e.g. "Green Marine" — sits under the month as a deck. */
.issue-theme {
    font-family: var(--serif);
    font-size: clamp(1.15rem, 1.9vw, 1.5rem);
    line-height: 1.3;
    color: var(--red-text);
    margin: -.4rem 0 1rem;
}

.issue-meta {
    margin: 0 0 1.4rem;
    font-size: .98rem;
    color: var(--ink-soft);
}
.issue-meta .label {
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: .78rem;
    color: var(--muted);
    margin-right: .4rem;
}

.issue-feature {
    font-size: 1.1rem;
    color: var(--ink-soft);
    max-width: 62ch;
    margin: 0 0 1.6rem;
}

.issue-actions { margin: 0 0 2.4rem; }

/* --- Table of contents --- */
.toc { border-top: 3px solid var(--ink); padding-top: 1.4rem; }

.toc h2 {
    font-family: var(--serif);
    font-size: clamp(1.3rem, 2.2vw, 1.7rem);
    margin: 0 0 1.2rem;
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: toc;
}

.toc-item {
    display: flex;
    align-items: baseline;
    gap: 1.2rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}
.toc-item:last-child { border-bottom: 0; }

.toc-item-web { align-items: flex-start; }

.toc-thumb {
    flex: 0 0 auto;
    display: block;
    width: 180px;
    line-height: 0;
    border-radius: 3px;
    overflow: hidden;
    background: var(--paper-warm);
}
.toc-thumb img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    transition: transform .25s ease;
}
.toc-thumb:hover img { transform: scale(1.04); }

.toc-author {
    margin: .3rem 0 0 !important;
    font-size: .85rem !important;
    font-weight: 600;
    color: var(--muted) !important;
}

.toc-text { flex: 1 1 auto; min-width: 0; }

.toc-text h3 {
    font-family: var(--serif);
    font-size: 1.12rem;
    line-height: 1.35;
    margin: 0;
    color: var(--ink);
}

.toc-text h3 a {
    text-decoration: none;
    transition: color .15s ease;
}
.toc-text h3 a:hover { color: var(--red); text-decoration: underline; }

.toc-text p {
    margin: .35rem 0 0;
    font-size: .95rem;
    color: var(--ink-soft);
    max-width: 62ch;
}

.toc-page {
    flex: 0 0 auto;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--red-text);
    white-space: nowrap;
    text-decoration: none;
}
a.toc-page:hover { text-decoration: underline; }

.issue-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

@media (max-width: 860px) {
    .issue-detail-inner { grid-template-columns: 1fr; }
    .issue-detail-cover {
        position: static;
        max-width: 320px;
        margin-inline: auto;
    }
}

/* ============ About page ============ */
.section-warm { background: var(--paper-warm); border-block: 1px solid var(--line); }

.section-title {
    font-family: var(--serif);
    font-size: clamp(1.5rem, 2.6vw, 2.1rem);
    margin: 0 0 .8rem;
    letter-spacing: -.01em;
}

.section-lede {
    font-size: 1.08rem;
    color: var(--ink-soft);
    max-width: 68ch;
    margin: 0 0 2rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(1.2rem, 3vw, 2rem);
    margin-top: 1.6rem;
}

.stat { border-top: 3px solid var(--red); padding-top: 1rem; }

.stat strong {
    display: block;
    font-family: var(--serif);
    font-size: clamp(1.9rem, 3.4vw, 2.6rem);
    line-height: 1.05;
    letter-spacing: -.02em;
}

.stat span {
    display: block;
    margin-top: .5rem;
    font-size: .92rem;
    color: var(--ink-soft);
}

.audience-list { list-style: none; margin: 0; padding: 0; max-width: 720px; }

.audience-list li + li { margin-top: 1.4rem; }

.audience-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: .5rem;
}
.audience-head span { font-weight: 600; }
.audience-head strong {
    font-family: var(--serif);
    font-size: 1.15rem;
    color: var(--red-text);
    font-variant-numeric: tabular-nums;
}

.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--red); border-radius: 4px; }

.topic-list {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.topic-list li {
    padding: .5rem 1rem;
    font-size: .93rem;
    font-weight: 600;
    background: var(--paper-warm);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(1.4rem, 3vw, 2.4rem);
}

.platform { border-top: 1px solid var(--ink); padding-top: 1rem; }

.platform h3 {
    font-family: var(--serif);
    font-size: 1.2rem;
    margin: 0 0 .5rem;
}

.platform p { margin: 0; color: var(--ink-soft); font-size: .97rem; }
.platform strong { color: var(--ink); font-variant-numeric: tabular-nums; }

@media (max-width: 960px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
    .stat-grid, .platform-grid { grid-template-columns: 1fr; }

    .toc-item-web { flex-wrap: wrap; }
    .toc-thumb { width: 100%; }
    .toc-thumb img { height: 180px; }
}

/* ============ Static pages ============ */
.page-hero {
    background: var(--paper-warm);
    border-bottom: 1px solid var(--line);
    padding-block: clamp(2.5rem, 6vw, 4rem);
}
.page-hero h1 {
    font-family: var(--serif);
    font-size: clamp(2rem, 4vw, 3rem);
    margin: 0 0 .6rem;
}
.page-hero p { color: var(--ink-soft); max-width: 64ch; margin: 0; font-size: 1.1rem; }

.prose { max-width: 72ch; padding-block: clamp(2rem, 5vw, 3.5rem); }
.prose h2 { font-family: var(--serif); }

/* ============ Footer ============ */
.site-footer {
    background: var(--ink);
    color: rgba(255,255,255,.82);
    margin-top: auto;
}

.footer-inner { padding-block: clamp(2.5rem, 5vw, 3.5rem); }

.footer-brand { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.footer-brand img { width: 120px; height: auto; }
.footer-brand p { max-width: 52ch; margin: 0; font-size: .95rem; }

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.8rem;
    margin-top: 2rem;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(255,255,255,.14);
}
.footer-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: .92rem;
}
.footer-nav a:hover { color: var(--red); }

.footer-copy { margin: 1.6rem 0 0; font-size: .85rem; color: rgba(255,255,255,.55); }

/* ============ Responsive ============ */
@media (max-width: 960px) {
    .issue-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-cover { max-width: 340px; margin-inline: auto; }
    .hero-copy { text-align: center; }
    .hero-actions { justify-content: center; }
    .cred-inner { grid-template-columns: 1fr; gap: 1.2rem; }
}

@media (max-width: 720px) {
    .nav-toggle { display: flex; }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-md);
        padding: .5rem 0 1rem;
    }
    .site-nav.open { display: flex; }

    .site-nav a:not(.btn) {
        padding: .9rem clamp(1rem, 4vw, 2rem);
        border-bottom: 1px solid var(--line);
    }
    .site-nav .btn { margin: 1rem clamp(1rem, 4vw, 2rem) 0; text-align: center; }

    .issue-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
    html { scroll-behavior: auto; }
}
