/* cover.css — FT-inspired cover for Open iPub
   Pairs with cover.cfm. Self-contained; depends on Playfair Display + Inter from Google Fonts. */

:root {
    --serif: "Playfair Display", "Times New Roman", Georgia, serif;
    --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --ink:         #0a0a0a;
    --ink-soft:    #3d3d3d;
    --ink-muted:   #6b6b6b;
    --rule:        #d9d4cb;
    --rule-soft:   #ece8e0;
    --paper:       #ffffff;
    --accent:      #8b0000;        /* dark claret, editorial */
    --accent-ink:  #ffffff;
    --kicker:      #8b0000;
    --focus:       #2a6df4;
    --brand-blue:  #5eb3ff;        /* light blue ring */
    --brand-blue-edge: #5eb3ff;
    --brand-dark:  #0d1b2a;        /* near-black circle fill */
    --brand-ipub:  #b8c2cc;        /* gray iPub text */
}

body.theme-salmon {
    --paper:     #fff1e5;          /* FT salmon */
    --rule:      #e4d6c4;
    --rule-soft: #f0e3d2;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover h1, a:hover h2, a:hover h3, a:hover .hero-headline { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

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

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

/* ---------- Masthead ---------- */

.masthead {
    border-bottom: 1px solid var(--ink);
    padding: 0.75rem 1.25rem 0;
}
.masthead-inner {
    max-width: 1240px;
    margin: 0 auto;
}
.masthead-utility {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--rule-soft);
    font-size: 0.85rem;
}
.masthead-search input[type="search"] {
    font: inherit;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--rule);
    background: transparent;
    color: var(--ink);
    min-width: 220px;
    border-radius: 2px;
}
.masthead-search input[type="search"]:focus { border-color: var(--ink); outline: none; }
.masthead-nav { display: flex; gap: 1rem; align-items: center; }
.masthead-nav a { color: var(--ink-soft); }
.masthead-nav a:hover { color: var(--ink); }
.masthead-nav .btn-subscribe {
    background: var(--accent);
    color: var(--accent-ink);
    padding: 0.4rem 0.85rem;
    border-radius: 2px;
    font-weight: 600;
}
.masthead-nav .btn-subscribe:hover { filter: brightness(1.1); }

.wordmark {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35em;
    font-family: var(--sans);
    font-weight: 900;
    font-size: clamp(2.2rem, 6vw, 4rem);
    line-height: 1;
    letter-spacing: -0.01em;
    text-align: center;
    padding: 1rem 0 0.4rem;
    color: var(--ink);
    text-decoration: none;
}
.wordmark:hover { text-decoration: none; }
.wordmark:hover .wm-ipub { filter: brightness(1.08); }

.wm-open {
    color: var(--brand-blue);
    letter-spacing: -0.02em;
}

.wm-ipub {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 2.5em;
    height: 2.5em;
    font-size: 0.64em;
    background: var(--brand-dark);
    color: var(--brand-ipub);
    border: 0.18em solid var(--brand-blue);
    border-radius: 50%;
    letter-spacing: -0.04em;
    line-height: 1;
}
.dateline {
    text-align: center;
    font-size: 0.85rem;
    color: var(--ink-muted);
    margin: 0 0 0.75rem;
    font-style: italic;
}
.dateline .tagline { font-style: normal; }
.dateline .dot { opacity: 0.6; margin: 0 0.35rem; }

.section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    justify-content: center;
    padding: 0.5rem 0;
    border-top: 1px solid var(--rule-soft);
    font-size: 0.88rem;
    font-weight: 500;
}
.section-nav a { color: var(--ink-soft); padding: 0.25rem 0; }
.section-nav a.active { color: var(--ink); border-bottom: 2px solid var(--accent); }
.section-nav a:hover { color: var(--ink); }

/* ---------- Content container ---------- */

.content {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem 3rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--ink-muted);
    font-size: 1.1rem;
}

/* ---------- Ad slots ---------- */

.ad-slot {
    display: block;
    margin: 0 auto;
    text-align: center;
}
.ad-slot .ad-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 0.4rem;
}
.ad-slot-top {
    margin: 0;
    padding: 0.5rem 1.25rem;
    border-bottom: 1px solid var(--rule-soft);
    background: var(--paper);
}
.ad-slot-top .ad-slot-inner {
    max-width: 1240px;
    margin: 0 auto;
    text-align: center;
    max-height: 120px;
    overflow: hidden;
}
.ad-slot-sidebar {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule-soft);
    min-height: 280px;
    min-width: 300px;
}

/* ---------- Above-fold: hero + secondary ---------- */

.above-fold {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--rule);
}

.hero-link { display: block; }
.hero-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-color: var(--rule-soft);
    margin-bottom: 1.25rem;
}
.hero-text { padding-right: 1rem; }

.kicker {
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--kicker);
    margin: 0 0 0.5rem;
}

.hero-headline {
    font-family: var(--serif);
    font-weight: 900;
    font-size: clamp(1.8rem, 3.5vw, 2.75rem);
    line-height: 1.1;
    letter-spacing: -0.015em;
    margin: 0 0 0.75rem;
    color: var(--ink);
}

.standfirst {
    font-family: var(--serif);
    font-weight: 400;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.45;
    color: var(--ink-soft);
    margin: 0 0 0.75rem;
}
.standfirst p { margin: 0; }

.byline {
    font-size: 0.82rem;
    color: var(--ink-muted);
    margin: 0;
}
.byline .dot { opacity: 0.6; margin: 0 0.25rem; }

.secondary {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--rule-soft);
    padding-left: 2rem;
}
.sec-item {
    padding: 1.1rem 0;
    border-top: 1px solid var(--rule-soft);
}
.sec-item:first-child { border-top: none; padding-top: 0; }
.sec-item:last-child { padding-bottom: 0; }
.sec-headline {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1.2;
    letter-spacing: -0.005em;
    margin: 0 0 0.4rem;
    color: var(--ink);
}
.sec-item .kicker { font-size: 0.7rem; }

/* ---------- River ---------- */

.river { padding: 2.25rem 0 1rem; }
.river-heading {
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin: 0 0 1.5rem;
    position: relative;
    text-align: center;
}
.river-heading::before,
.river-heading::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: var(--rule);
}
.river-heading::before { left: 0; }
.river-heading::after  { right: 0; }
.river-heading span { background: var(--paper); padding: 0 1rem; position: relative; }

.river-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem 2.25rem;
}
.river-item { display: flex; flex-direction: column; }
.river-item > a { display: flex; flex-direction: column; gap: 0.75rem; height: 100%; }
.river-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    background-color: var(--rule-soft);
}
.river-headline {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.25;
    margin: 0 0 0.35rem;
    color: var(--ink);
}
.river-item .kicker { font-size: 0.68rem; }

/* ---------- Subscribe ---------- */

.subscribe {
    margin: 3rem auto 0;
    padding: 2.5rem 1.5rem;
    background: var(--rule-soft);
    border-top: 3px double var(--ink);
    border-bottom: 1px solid var(--rule);
}
.subscribe-inner {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}
.subscribe h2 {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.75rem;
    margin: 0 0 0.5rem;
}
.subscribe p { color: var(--ink-soft); margin: 0 0 1.25rem; }
.subscribe form {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}
.subscribe input[type="email"] {
    font: inherit;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--rule);
    border-radius: 2px;
    min-width: 240px;
    flex: 1 1 240px;
    max-width: 340px;
}
.subscribe input[type="email"]:focus { border-color: var(--ink); outline: none; }
.subscribe button {
    font: inherit;
    font-weight: 600;
    padding: 0.65rem 1.4rem;
    background: var(--ink);
    color: var(--paper);
    border: none;
    border-radius: 2px;
    cursor: pointer;
}
.subscribe button:hover { background: var(--accent); }

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

.site-footer {
    border-top: 1px solid var(--rule);
    margin-top: 2rem;
    background: var(--paper);
}
.footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 2rem 1.25rem 2.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem 2rem;
    align-items: start;
}
.footer-wordmark {
    font-family: var(--serif);
    font-weight: 900;
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
}
.footer-about p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.88rem; }
.footer-links a { color: var(--ink-soft); }
.footer-links a:hover { color: var(--ink); }
.footer-copy {
    grid-column: 1 / -1;
    border-top: 1px solid var(--rule-soft);
    padding-top: 1rem;
    margin: 0;
    font-size: 0.8rem;
    color: var(--ink-muted);
}

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

@media (max-width: 900px) {
    .above-fold {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
    .secondary {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--rule);
        padding-top: 1rem;
    }
    .river-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem; }
    .ad-slot-top { padding: 0.35rem 1rem; }
    .ad-slot-top .ad-slot-inner { max-height: 90px; }
}

@media (max-width: 560px) {
    .masthead { padding: 0.5rem 1rem 0; }
    .masthead-utility { flex-direction: column; align-items: stretch; gap: 0.5rem; }
    .masthead-search input[type="search"] { width: 100%; }
    .masthead-nav { justify-content: center; }
    .wordmark { font-size: 2.4rem; }
    .section-nav { gap: 0.25rem 1rem; font-size: 0.82rem; }
    .content { padding: 1.25rem 1rem 2rem; }
    .river-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .river-heading::before, .river-heading::after { width: 20%; }
    .footer-inner { grid-template-columns: 1fr; }

    /* Keep the top banner compact so it never dominates small viewports. */
    .ad-slot-top { padding: 0.25rem 0.75rem; }
    .ad-slot-top .ad-label { font-size: 0.6rem; margin-bottom: 0.2rem; }
    .ad-slot-top .ad-slot-inner { max-height: 60px; }
    .ad-slot-top .adsbygoogle { max-height: 50px !important; }
}

@media (max-width: 560px) and (orientation: landscape) {
    /* Landscape phones have very little vertical room — tighten further. */
    .ad-slot-top .ad-slot-inner { max-height: 50px; }
    .ad-slot-top .adsbygoogle { max-height: 40px !important; }
}
