/* ==========================================================================
   Breaking Stories — Ghost theme
   Type:  Anton (headlines) / Newsreader (body) / Space Mono (meta)
   Rule:  the theme colour owns arrival and furniture, never body text.
   ========================================================================== */

:root {
    --paper:      #F3EFE6;
    --paper-2:    #EAE4D7;
    --ink:        #191318;
    --ink-soft:   #5C4D55;
    --ink-faint:  #8A7F8C;
    --signal:     #C0342A;   /* constant: wordmark, links, the horizon line */
    --near-black: #250A1B;

    /* default theme — politics / untagged */
    --theme:      #4A1236;
    --on-theme:   #F3EFE6;
    --theme-kick: #E3B9B4;

    --font-display: 'Anton', 'Arial Narrow', Impact, sans-serif;
    --font-body:    'Newsreader', Georgia, 'Times New Roman', serif;
    --font-mono:    'Space Mono', 'Courier New', monospace;

    --panel-w: 360px;
    --measure: 66ch;
}

/* --- topic themes ------------------------------------------------------- */
.tag-philosophy      { --theme: #10454F; --on-theme: #F3EFE6; --theme-kick: #7FC2C6; }
.tag-history         { --theme: #A8321F; --on-theme: #F3EFE6; --theme-kick: #F0B9A9; }
.tag-marine-biology  { --theme: #262459; --on-theme: #F3EFE6; --theme-kick: #A9A5E8; }
.tag-jazz            { --theme: #D79A28; --on-theme: #191318; --theme-kick: #5C3F08; }
.tag-politics        { --theme: #4A1236; --on-theme: #F3EFE6; --theme-kick: #E3B9B4; }

/* --- base -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 19px;
    line-height: 1.76;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--signal); text-decoration: none; }
a:hover { color: var(--theme); }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    text-transform: uppercase;
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: 0.005em;
    margin: 0;
    text-wrap: balance;
}

::selection { background: var(--signal); color: var(--paper); }

.kicker, .panel__kicker, .article__kicker, .page-head__kicker {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin: 0;
}

/* --- masthead ---------------------------------------------------------- */
.masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 22px;
    height: 52px;
    background: var(--paper);
    border-bottom: 1px solid rgba(25, 19, 24, 0.18);
    position: relative;
    z-index: 5;
}

.masthead__mark {
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 22px;
    color: var(--signal);
    letter-spacing: 0.005em;
    white-space: nowrap;
}
.masthead__mark:hover { color: var(--near-black); }

.masthead__tagline {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--theme);
    text-align: center;
    flex: 1 1 auto;
}

.masthead__nav { display: flex; gap: 22px; align-items: center; }
.masthead__nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.masthead__nav a,
.masthead__subscribe {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink);
    white-space: nowrap;
}
.masthead__subscribe { color: var(--signal); }
.masthead__nav a:hover { color: var(--signal); }

/* --- the strip (index) -------------------------------------------------- */
.strip-wrap { position: relative; }

.strip {
    display: flex;
    height: calc(100vh - 52px);
    min-height: 560px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    outline: none;
    padding-right: 46px;
}
.strip::-webkit-scrollbar { height: 6px; }
.strip::-webkit-scrollbar-thumb { background: rgba(74, 18, 54, 0.35); }

.panel {
    flex: 0 0 var(--panel-w);
    width: var(--panel-w);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    background: var(--theme);
    color: var(--on-theme);
    border-right: 1px solid rgba(243, 239, 230, 0.16);
    text-decoration: none;
    position: relative;
    transition: flex-basis 0.35s ease, width 0.35s ease;
}

.panel--intro { background: var(--near-black); justify-content: space-between; }

.panel__image {
    height: 38%;
    flex: 0 0 38%;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}
.panel__image img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.panel--post:hover .panel__image img { transform: scale(1.04); }

.panel__inner {
    padding: 24px 22px 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1 1 auto;
    gap: 16px;
    min-height: 0;
}

.panel__kicker { color: var(--theme-kick); margin-bottom: 14px; }
.panel--intro .panel__kicker { color: var(--signal); }

.panel__title {
    font-size: clamp(26px, 2.4vw, 34px);
    color: var(--on-theme);
}

.panel__manifesto { font-size: 40px; color: var(--paper); }
.panel__manifesto-dek {
    font-size: 15px; line-height: 1.55; font-weight: 300;
    color: #B9A6B8; margin: 20px 0 0;
}

.panel__dek {
    font-size: 14px;
    line-height: 1.55;
    font-weight: 300;
    margin: 14px 0 0;
    color: var(--on-theme);
    opacity: 0.84;
}

.panel__cta {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--on-theme);
}
.panel--post:hover .panel__cta { color: var(--signal); }
.panel--subscribe { background: var(--paper); color: var(--ink); border-right: none; }
.panel--subscribe .panel__title { color: var(--ink); }
.panel--subscribe .panel__kicker { color: var(--signal); }

/* the horizon device: noise resolving into one line */
.horizon { position: relative; height: 120px; margin: 0 22px 26px; }
.horizon__noise, .horizon__grain, .horizon__line { position: absolute; left: 0; right: 0; }
.horizon__noise {
    top: 0; bottom: 0;
    background-image: repeating-linear-gradient(to bottom, rgba(211, 203, 242, 0.45) 0 1px, transparent 1px 8px);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.12), rgba(0,0,0,0.9) 80%, rgba(0,0,0,0.15));
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.12), rgba(0,0,0,0.9) 80%, rgba(0,0,0,0.15));
}
.horizon__grain {
    top: 0; bottom: 0;
    background-image: repeating-linear-gradient(104deg, rgba(192, 52, 42, 0.4) 0 1px, transparent 1px 21px);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 60%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 60%);
}
.horizon__line { bottom: 0; height: 2px; background: var(--signal); }

/* scroll rail */
.strip-rail {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 46px;
    background: rgba(243, 239, 230, 0.94);
    border-left: 1px solid rgba(25, 19, 24, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    pointer-events: none;
}
.strip-rail__label, .strip-rail__count {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
}
.strip-rail__label { color: #4A1236; }
.strip-rail__count { color: var(--ink-faint); }
.strip-rail__line { width: 1px; height: 120px; background: rgba(74, 18, 54, 0.3); }

/* --- article ------------------------------------------------------------ */
.article__progress {
    position: sticky; top: 0; z-index: 4;
    height: 3px; background: rgba(25, 19, 24, 0.1);
}
.article__progress span { display: block; height: 3px; width: 0; background: var(--theme); }

.article__hero {
    position: relative;
    min-height: 460px;
    display: flex;
    align-items: flex-end;
    background: var(--theme);
    overflow: hidden;
}
.article__hero.has-image { min-height: 72vh; }
.article__hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.article__scrim {
    position: absolute; left: 0; right: 0; bottom: 0; height: 72%;
    background: linear-gradient(to bottom, transparent 0%, var(--theme) 78%, var(--theme) 100%);
    opacity: 0.94;
}
.article__hero-text { position: relative; padding: 0 54px 44px; width: 100%; }
.article__kicker { color: var(--theme-kick); margin-bottom: 18px; }
.article__title {
    font-size: clamp(42px, 7vw, 104px);
    color: var(--on-theme);
    max-width: 20ch;
}
.article__hero-caption {
    font-family: var(--font-mono);
    font-size: 10.5px;
    line-height: 1.7;
    color: var(--ink-soft);
    padding: 12px 54px 0;
    max-width: 80ch;
}

/* body: free-flowing prose, images interrupt it */
.article__body {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 58px 22px 0;
}
.article__body > * { margin: 0 0 26px; }
.article__body > *:first-child { margin-top: 0; }

.article__body p { text-align: left; }
.article__body > p:first-of-type {
    font-size: 25px;
    line-height: 1.6;
    font-weight: 300;
    color: var(--theme);
    margin-bottom: 34px;
}

.article__body h2 {
    font-size: 34px;
    margin: 52px 0 18px;
    color: var(--ink);
}
.article__body h3 {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--theme);
    margin: 44px 0 14px;
}

.article__body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.article__body em { font-style: italic; }
.article__body strong { font-weight: 500; }

.article__body blockquote {
    margin: 42px 0 44px;
    padding: 0 0 0 26px;
    border-left: 6px solid var(--signal);
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.14;
    letter-spacing: 0.005em;
    color: var(--theme);
}
.article__body blockquote p { margin: 0; }

.article__body hr {
    border: none;
    height: 2px;
    background: rgba(25, 19, 24, 0.14);
    margin: 52px 0;
}

.article__body ul, .article__body ol { padding-left: 1.2em; }
.article__body li { margin-bottom: 10px; }

/* Ghost editor cards */
.gh-content figure { margin: 42px 0; }
.gh-content figcaption {
    font-family: var(--font-mono);
    font-size: 10.5px;
    line-height: 1.7;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    margin-top: 12px;
    padding-left: 40px;
    position: relative;
    text-align: left;
}
.gh-content figcaption::before {
    content: "";
    position: absolute; left: 0; top: 10px;
    width: 26px; height: 2px; background: var(--theme);
}

.kg-width-wide {
    width: min(1020px, calc(100vw - 44px));
    margin-left: 50%;
    transform: translateX(-50%);
    max-width: none;
}
.kg-width-full {
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
    max-width: none;
}
.kg-width-full img { width: 100%; }

.kg-callout-card {
    display: flex;
    gap: 14px;
    padding: 24px 28px;
    border-left: 4px solid var(--theme);
    background: color-mix(in srgb, var(--theme) 8%, transparent);
    font-size: 18px;
    line-height: 1.62;
    font-weight: 300;
}
.kg-callout-card-emoji { font-size: 20px; }

.kg-blockquote-alt { font-family: var(--font-body); text-transform: none; font-size: 22px; font-style: italic; }

.kg-bookmark-card { border: 1px solid rgba(25,19,24,0.2); }
.kg-bookmark-container { display: flex; text-decoration: none; color: var(--ink); }
.kg-bookmark-content { padding: 20px; }
.kg-bookmark-title { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; }

.article__end { max-width: var(--measure); margin: 44px auto 36px; padding: 0 22px; display: flex; align-items: center; gap: 14px; }
.article__end span { width: 10px; height: 10px; background: var(--signal); flex: 0 0 auto; }
.article__end::after { content: ""; flex: 1 1 auto; height: 1px; background: rgba(25, 19, 24, 0.16); }

.article__footer { max-width: var(--measure); margin: 0 auto; padding: 0 22px 54px; }

.byline { display: flex; gap: 18px; align-items: flex-start; }
.byline__img { width: 54px; height: 54px; object-fit: cover; flex: 0 0 auto; border: 1px solid var(--theme); }
.byline__img--blank { background: color-mix(in srgb, var(--theme) 10%, transparent); display: block; }
.byline__name {
    font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--theme); margin: 0 0 6px;
}
.byline__bio { font-size: 16px; line-height: 1.6; font-weight: 300; color: var(--ink-soft); margin: 0; max-width: 52ch; }

/* --- subscribe ---------------------------------------------------------- */
.subscribe {
    background: var(--theme);
    color: var(--on-theme);
    padding: 44px 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
}
.subscribe__title { font-size: clamp(26px, 3.4vw, 40px); color: var(--on-theme); max-width: 24ch; }
.subscribe__side { display: flex; flex-direction: column; gap: 10px; }
.subscribe__form { display: flex; }
.subscribe__form--stacked { flex-direction: column; gap: 8px; margin-top: 16px; }

.subscribe__input {
    width: 260px;
    max-width: 100%;
    background: rgba(243, 239, 230, 0.1);
    border: 1px solid rgba(243, 239, 230, 0.45);
    border-right: none;
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--on-theme);
    border-radius: 0;
}
.subscribe__form--stacked .subscribe__input { border-right: 1px solid rgba(25,19,24,0.4); border-color: rgba(25,19,24,0.4); color: var(--ink); background: transparent; width: 100%; }
.subscribe__input::placeholder { color: rgba(243, 239, 230, 0.6); }
.subscribe__form--stacked .subscribe__input::placeholder { color: var(--ink-faint); }
.subscribe__input:focus { outline: 2px solid var(--signal); outline-offset: 1px; }

.subscribe__button {
    background: var(--signal);
    color: var(--paper);
    border: 1px solid var(--signal);
    padding: 16px 26px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 0;
}
.subscribe__button:hover { background: var(--near-black); border-color: var(--near-black); }

.subscribe__note { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em; color: rgba(243,239,230,0.7); margin: 0; }
.subscribe__msg { display: none; font-family: var(--font-mono); font-size: 10px; margin: 0; }
.subscribe__form--stacked ~ .subscribe__msg { color: var(--ink-soft); }
.success .subscribe__msg--success { display: block; }
.error .subscribe__msg--error { display: block; color: var(--signal); }

/* --- post nav ----------------------------------------------------------- */
.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.post-nav__item { background: var(--theme); color: var(--on-theme); padding: 36px 44px; display: block; }
.post-nav__item:hover { filter: brightness(1.12); color: var(--on-theme); }
.post-nav__label {
    display: block; font-family: var(--font-mono); font-size: 9.5px;
    letter-spacing: 0.2em; text-transform: uppercase; color: var(--theme-kick); margin-bottom: 12px;
}
.post-nav__title { font-family: var(--font-display); text-transform: uppercase; font-size: 30px; line-height: 1; display: block; }

/* --- list (tag pages) --------------------------------------------------- */
.page-head { padding: 56px 54px 24px; border-bottom: 1px solid var(--ink); }
.page-head__kicker { color: var(--signal); margin-bottom: 14px; }
.page-head__title { font-size: clamp(38px, 6vw, 62px); color: var(--near-black); }
.page-head__dek { font-size: 18px; line-height: 1.6; font-weight: 300; color: var(--ink-soft); max-width: 62ch; }

.list { padding: 0 54px 60px; }
.list__item {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr) 150px;
    gap: 32px;
    align-items: baseline;
    padding: 30px 0;
    border-bottom: 1px solid rgba(25, 19, 24, 0.14);
    color: var(--ink);
}
.list__item:hover { color: var(--theme); }
.list__date, .list__tag {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--ink-faint);
}
.list__tag { text-align: right; color: var(--theme); }
.list__title { font-family: var(--font-display); text-transform: uppercase; font-size: 32px; line-height: 1.06; display: block; }
.list__dek { font-size: 17px; line-height: 1.6; font-weight: 300; color: var(--ink-soft); display: block; margin-top: 8px; }

.article--page .page-head { border-bottom: none; padding-bottom: 0; }

/* --- footer ------------------------------------------------------------- */
.site-footer {
    background: var(--near-black);
    color: #9D8B9F;
    padding: 40px 54px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.site-footer__mark { font-family: var(--font-display); text-transform: uppercase; font-size: 22px; color: var(--paper); }
.site-footer__nav { display: flex; gap: 26px; align-items: baseline; }
.site-footer__nav ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.site-footer__nav a, .site-footer__meta {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em;
    text-transform: uppercase; color: #9D8B9F;
}
.site-footer__nav a:hover { color: var(--signal); }

/* --- responsive --------------------------------------------------------- */
@media (max-width: 1100px) {
    .article__hero-text { padding: 0 32px 36px; }
    .article__hero-caption { padding-left: 32px; padding-right: 32px; }
    .page-head, .list, .site-footer, .subscribe { padding-left: 32px; padding-right: 32px; }
}

@media (max-width: 760px) {
    body { font-size: 18px; }

    .masthead { height: auto; padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
    .masthead__tagline { display: none; }

    /* the strip becomes a stack */
    .strip {
        flex-direction: column;
        height: auto;
        min-height: 0;
        overflow: visible;
        scroll-snap-type: none;
        padding-right: 0;
    }
    .panel {
        flex: 0 0 auto;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(243, 239, 230, 0.16);
        min-height: 0;
    }
    .panel__image { height: 190px; flex: 0 0 190px; }
    .panel__inner { padding: 18px 16px 24px; }
    .panel__title { font-size: 32px; }
    .panel__manifesto { font-size: 34px; }
    .strip-rail { display: none; }

    .article__hero.has-image { min-height: 52vh; }
    .article__hero-text { padding: 0 16px 24px; }
    .article__hero-caption { padding: 12px 16px 0; }
    .article__body { padding: 30px 16px 0; }
    .article__body > p:first-of-type { font-size: 21px; }
    .article__body h2 { font-size: 28px; }
    .article__footer, .article__end { padding-left: 16px; padding-right: 16px; }

    .kg-width-wide { width: 100%; margin-left: 0; transform: none; }

    .subscribe { padding: 26px 16px; flex-direction: column; align-items: flex-start; gap: 16px; }
    .subscribe__form { flex-direction: column; width: 100%; gap: 8px; }
    .subscribe__input { width: 100%; border-right: 1px solid rgba(243, 239, 230, 0.45); }
    .subscribe__button { width: 100%; }

    .post-nav { grid-template-columns: 1fr; }
    .post-nav__item { padding: 26px 16px; }
    .post-nav__title { font-size: 24px; }

    .page-head, .list, .site-footer { padding-left: 16px; padding-right: 16px; }
    .list__item { grid-template-columns: 1fr; gap: 8px; }
    .list__tag { text-align: left; }
    .list__title { font-size: 26px; }

    .site-footer { flex-direction: column; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}
