/* Blog hub only (/blog): intro, hero carousel, post-card polish.
   blog.css is shared with every post page and /search and sits at its size cap, so hub
   styling lives here. All colours come from app.css tokens, so dark and light both work. */

.hc { --hc-dur: 7s; --hc-ease: cubic-bezier(.22, .61, .36, 1); }

/* ── Header: follow the theme background instead of a fixed dark tint ───────── */
body > header { background: color-mix(in srgb, var(--bg) 86%, transparent); }

/* app.css pads every <section> 60px/28px for the landing page; on the hub the sections
   line up with main's own gutter and are spaced by their margins instead. */
main > section { padding: 0; }

/* ── Intro + search ──────────────────────────────────────────────────────────── */
.hub-intro {
    display: grid;
    gap: 1.25rem 2.5rem;
    align-items: end;
    margin-bottom: 2rem;
    animation: fadeIn .6s ease-out;
}
@media (min-width: 900px) {
    .hub-intro { grid-template-columns: minmax(0, 1fr) minmax(300px, 440px); }
}
.hub-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: .6rem;
}
.hub-eyebrow::before {
    content: "";
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--gold);
}
.hub-title {
    font-family: 'Hanken Grotesk', 'Segoe UI', system-ui, sans-serif;
    font-size: clamp(1.9rem, 3.4vw, 3rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.025em;
    color: var(--text);
    text-wrap: balance;
}
.hub-sub {
    margin-top: .7rem;
    max-width: 58ch;
    color: var(--dim);
    font-size: 1.02rem;
    line-height: 1.6;
}
.hub-search-form { max-width: none; margin: 0; }

/* ── Carousel ────────────────────────────────────────────────────────────────
   Cover images are designed title cards with their own text, so the photo and our copy sit
   side by side rather than one over the other. Slides share one grid cell, so the stage is
   as tall as its tallest slide and nothing below it moves when a slide changes. */
.hero.hc {
    display: block;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    overflow: visible;
}
.hero.hc:hover { border-color: transparent; box-shadow: none; }

.hc-stage {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    isolation: isolate;
    background: var(--s1);
    border: 1px solid var(--border);
    box-shadow: 0 30px 70px -40px rgba(0, 0, 0, .6);
    touch-action: pan-y;
    container-type: inline-size;
}
.hc-track { display: grid; }

.hc-slide {
    grid-area: 1 / 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    color: var(--text);
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .8s var(--hc-ease), visibility 0s linear .8s;
}
.hc-slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
    transition: opacity .8s var(--hc-ease);
}
.hc-slide:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; border-radius: 20px; }

.hc-media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1200 / 630;
    background: #0b0b0d;
}
/* Slow push-in on the active image; inactive ones snap back once they are hidden. */
.hc-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.05);
    transition: transform 0s linear .8s;
    user-select: none;
}
.hc-slide.is-active .hc-img { transform: scale(1); transition: transform 8s var(--hc-ease); }
.hc-img-fallback {
    object-fit: contain;
    padding: 14% 34%;
    background: radial-gradient(ellipse at 50% 45%, rgba(var(--gold-rgb), .24), transparent 65%), #0b0b0d;
}

.hc-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    padding: clamp(1.35rem, 2.8vw, 2.75rem);
    background: radial-gradient(120% 90% at 100% 0%, rgba(var(--gold-rgb), .09), transparent 60%);
}
/* Copy rises in after the image, one line at a time. */
.hc-body > * {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease;
}
.hc-slide.is-active .hc-body > * {
    opacity: 1;
    transform: none;
    transition: opacity .7s var(--hc-ease), transform .7s var(--hc-ease);
}
.hc-slide.is-active .hc-kicker { transition-delay: .18s; }
.hc-slide.is-active .hc-title  { transition-delay: .28s; }
.hc-slide.is-active .hc-desc   { transition-delay: .38s; }

.hc-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--dim);
}
.hc-badge {
    padding: .24rem .7rem;
    border-radius: 999px;
    background: var(--gold);
    color: var(--bg);
    font-weight: 800;
}
.hc-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }

.hc-title {
    margin: .85rem 0 .7rem;
    font-family: 'Hanken Grotesk', 'Segoe UI', system-ui, sans-serif;
    font-size: clamp(1.4rem, 1.95vw, 2.15rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.02em;
    color: var(--text);
    text-wrap: balance;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .25s;
}
.hc-slide:hover .hc-title { color: var(--gold); }
.hc-desc {
    color: var(--dim);
    font-size: clamp(.92rem, 1vw, 1rem);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hc-read {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1.4rem;
    padding: .6rem 1.15rem;
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 700;
    color: var(--gold);
    border: 1px solid rgba(var(--gold-rgb), .45);
}
.hc-slide.is-active .hc-read {
    transition: opacity .7s var(--hc-ease) .48s, transform .7s var(--hc-ease) .48s,
                background .25s, color .25s, border-color .25s;
}
.hc-read svg { transition: transform .25s var(--hc-ease); }
.hc-slide:hover .hc-read,
.hc-slide:focus-visible .hc-read { background: var(--gold); border-color: var(--gold); color: var(--bg); }
.hc-slide:hover .hc-read svg { transform: translateX(3px); }

@media (min-width: 900px) {
    /* The image column is 60% of the stage; size the slide to the covers' 1200x630 ratio so
       they show uncropped. A longer title can still grow the slide past it. */
    .hc-slide {
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
        min-height: clamp(340px, 31vw, 480px);
        min-height: calc(60cqi / 1.905);
    }
    .hc-media { aspect-ratio: auto; }
}

/* ── Rail + controls (under the stage) ───────────────────────────────────────── */
.hc-nav { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.hc-rail {
    flex: 1;
    min-width: 0;
    list-style: none;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: .5rem;
}
.hc-tab {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .7rem .55rem;
    width: 100%;
    padding: .75rem 0;
    border: 0;
    background: none;
    font: inherit;
    text-align: left;
    color: var(--dim);
    cursor: pointer;
    transition: color .25s;
}
.hc-tab:hover, .hc-tab.is-active { color: var(--text); }
.hc-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.hc-num, .hc-tab-title { display: none; }
.hc-bar {
    order: -1;
    grid-column: 1 / -1;
    display: block;
    height: 3px;
    border-radius: 3px;
    overflow: hidden;
    background: color-mix(in srgb, var(--dim) 25%, transparent);
}
.hc-bar i {
    display: block;
    height: 100%;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left center;
}
.hc-tab.is-active .hc-bar i { animation: hc-fill var(--hc-dur) linear forwards; }
.hc.is-paused .hc-tab.is-active .hc-bar i { animation-play-state: paused; }
.hc.is-static .hc-tab.is-active .hc-bar i { animation: none; transform: scaleX(1); }
@keyframes hc-fill { to { transform: scaleX(1); } }

@media (min-width: 900px) {
    .hc-tab { padding: .2rem 0 .35rem; }
    .hc-num {
        display: block;
        font-family: 'Hanken Grotesk', 'Segoe UI', system-ui, sans-serif;
        font-size: .8rem;
        font-weight: 800;
        line-height: 1.55;
        color: rgba(var(--gold-rgb), .55);
        transition: color .25s;
    }
    .hc-tab.is-active .hc-num, .hc-tab:hover .hc-num { color: var(--gold); }
    .hc-tab-title {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: .88rem;
        font-weight: 600;
        line-height: 1.45;
    }
}

.hc-controls {
    flex: none;
    display: flex;
    align-items: center;
    gap: .1rem;
    padding: .25rem;
    border-radius: 999px;
    background: var(--s1);
    border: 1px solid var(--border);
}
/* Inert without the script; keep the space so nothing shifts when it arrives. */
.hc:not(.hc-ready) .hc-controls { visibility: hidden; }
.hc-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background .2s, color .2s;
}
.hc-btn:hover { background: rgba(var(--gold-rgb), .14); color: var(--gold); }
.hc-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.hc-count {
    padding: 0 .3rem;
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: .04em;
    color: var(--dim);
}
.hc-count b { color: var(--text); font-weight: 700; }
.hc-ico-play { display: none; }
.hc.is-user-paused .hc-ico-play { display: block; }
.hc.is-user-paused .hc-ico-pause { display: none; }
.hc.is-static .hc-play { display: none; }

@media (max-width: 600px) {
    .hc-stage { border-radius: 16px; }
    .hc-slide:focus-visible { border-radius: 16px; }
    .hc-nav { gap: .6rem; }
    .hc-rail { gap: .35rem; }
    .hc-count { display: none; }
    .hc-btn { width: 32px; height: 32px; }
    .hc-read { margin-top: 1.1rem; padding: .5rem 1rem; font-size: .85rem; }
}

/* ── Section headings + topics ───────────────────────────────────────────────── */
main .section-title {
    font-family: 'Hanken Grotesk', 'Segoe UI', system-ui, sans-serif;
    font-size: clamp(1.25rem, 1.6vw, 1.6rem);
    font-weight: 800;
    letter-spacing: -.015em;
    text-transform: none;
    margin-bottom: 1.1rem;
}
.topics-grid { gap: .6rem; }
.topic-tag {
    font: inherit;
    font-size: .88rem;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    padding: .45rem 1.05rem;
}
.topic-tag:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── Post cards ──────────────────────────────────────────────────────────────── */
.posts-header .section-title { margin-bottom: 0; }
.post-card { display: flex; flex-direction: column; }
.post-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.post-image {
    height: auto;
    aspect-ratio: 16 / 9;
    display: block;
    transition: transform .6s var(--hc-ease, ease);
}
.post-card:hover .post-image:not(.post-image-fallback) { transform: scale(1.04); }
.post-content {
    position: relative; /* covers the zoomed image's lower edge */
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--s1);
    padding: 1.25rem 1.35rem 1.35rem;
}
.post-meta { font-size: .74rem; letter-spacing: .08em; gap: .85rem; flex-wrap: wrap; }
.post-title {
    margin: .6rem 0 .55rem;
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.35;
    text-wrap: balance;
    transition: color .25s;
}
.post-card:hover .post-title { color: var(--gold); }
.post-card-excerpt {
    margin-bottom: 1rem;
    color: var(--dim);
    font-size: .92rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card-read {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .86rem;
    font-weight: 700;
    color: var(--gold);
}
.post-card-read::after { content: "\2192"; transition: transform .25s; }
.post-card:hover .post-card-read::after { transform: translateX(4px); }

/* ── Reduced motion: no push-in, no staggered text, no running bar ───────────── */
@media (prefers-reduced-motion: reduce) {
    .hc-slide, .hc-slide.is-active,
    .hc-img, .hc-slide.is-active .hc-img,
    .hc-body > *, .hc-slide.is-active .hc-body > * { transition: none !important; }
    .hc-img, .hc-slide.is-active .hc-img { transform: none; }
    .hc-tab.is-active .hc-bar i { animation: none; transform: scaleX(1); }
    .post-image, .post-card:hover .post-image:not(.post-image-fallback) { transition: none; transform: none; }
}
