/* =========================================================================
   Blog: the /blog index and the prerendered posts (scripts/build-blog.mjs).
   Loaded after style.css on blog.html, post.html and blog/*.html.
   ========================================================================= */

.blog-main,
.post-main {
    --paper-deep: #E6EAE3;
    --card: var(--slip);
    --ink-2: #33433F;
    --muted: var(--ink-soft);
    --line: var(--hairline);
    --line-strong: rgba(31, 42, 39, 0.22);
    --sage: #487F72;
    --sage-text: var(--house);
    --sage-deep: var(--house);
    --sage-wash: #E6EEE9;
    --marigold-wash: #FBF0DC;
    --marigold-text: #7E520C;
    --clay: #C8705A;
    --sky: #6495A9;
    --focus: var(--ink);
    --ease: cubic-bezier(0.22, 0.8, 0.3, 1);
    /* No fixed header: in-page jumps and the sticky contents only keep a little air above. */
    --header-offset: 32px;

    background: var(--paper);
    color: var(--ink);
    padding-top: 112px;
    padding-bottom: 96px;
}

/* One column at the wordmark's edge, as on the home page. */
.blog-main .container,
.post-main .container {
    max-width: calc(1180px + 2 * var(--gutter));
    padding: 0 var(--gutter);
}

/* Category colours, used by dots, chips and labels. */
.cat-emociones { --cat: #C8705A; }
.cat-ansiedad { --cat: #6495A9; }
.cat-relaciones { --cat: #E39B2F; }
.cat-habitos { --cat: #487F72; }
.cat-trabajo { --cat: #2F5A4F; }
.cat-duelo { --cat: #8A7C9A; }

.cat-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cat, var(--sage));
    box-shadow: 1px 1px 0 rgba(26, 38, 35, 0.18);
    flex-shrink: 0;
}

.blog-main :where(a, button, input, summary):focus-visible,
.post-main :where(a, button, input, summary):focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: 6px;
}

.blog-main .icon,
.post-main .icon {
    flex-shrink: 0;
}

/* Shared button */
.blog-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 26px;
    border-radius: 999px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    font: 600 0.98rem/1.2 'Montserrat', sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
    box-shadow: 0 2px 0 rgba(26, 38, 35, 0.12);
}

.blog-button:hover {
    background: var(--house);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(47, 90, 79, 0.22);
}

.blog-button-quiet {
    background: var(--card);
    color: var(--sage-deep);
    border-color: var(--line-strong);
    box-shadow: none;
}

.blog-button-quiet:hover {
    background: var(--sage-wash);
    box-shadow: none;
}

/* =========================================================================
   Index: hero
   ========================================================================= */

.blog-hero {
    padding: 40px 0 28px;
}

.blog-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
}

.blog-eyebrow,
.blog-section-label {
    font: 600 0.78rem/1.2 'Montserrat', sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sage-text);
}

.blog-eyebrow {
    margin-bottom: 18px;
}

.blog-hero h1 {
    font-weight: 900;
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    line-height: 1.04;
    letter-spacing: -0.025em;
    color: var(--ink);
    max-width: 16ch;
    margin-bottom: 20px;
}

.blog-intro {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--muted);
    max-width: 42ch;
}

.blog-help-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin-top: 18px;
    color: var(--sage-text);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.blog-help-link:hover {
    color: var(--sage-deep);
    text-decoration-thickness: 2px;
}

/* The app's arrival collage in the hero (images/blog/hero-art.svg, scripts/build-app-art.mjs),
   framed as on the landing page. */
.blog-hero-art {
    position: relative;
    justify-self: end;
    width: 100%;
    max-width: 360px;
    border-radius: 6px;
    overflow: hidden;
}

/* The app's paper grain over every cover, at the 16% its ArtGrain uses. */
.blog-hero-art::after,
.featured-post-media::after,
.post-card-media::after,
.post-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url(/images/noise-grain.png) repeat;
    background-size: 128px;
    opacity: 0.16;
    pointer-events: none;
}

.blog-hero-art img {
    display: block;
    width: 100%;
    height: auto;
    animation: paper-rise 1s var(--ease) both;
}

@keyframes paper-rise {
    from { transform: translateY(14px); }
    to { transform: none; }
}

/* =========================================================================
   Index: featured post
   ========================================================================= */

.blog-featured {
    margin-top: 28px;
}

.blog-section-label {
    margin-bottom: 16px;
}

.featured-post {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 2px 3px 0 var(--shadow);
    transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
}

.featured-post:hover {
    transform: translateY(-3px);
    box-shadow: 3px 5px 0 var(--shadow);
}

.featured-post-media {
    position: relative;
    min-height: 340px;
    background: var(--paper-deep);
}

.featured-post-media img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-post-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: clamp(28px, 4vw, 52px);
}

.featured-post-title {
    font-weight: 900;
    letter-spacing: -0.02em;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.1;
    letter-spacing: -0.005em;
}

.featured-post-title a,
.post-card-title a {
    color: var(--ink);
    text-decoration: none;
}

/* Stretched link: the whole card is the hit area, read as a single link. */
.featured-post-title a::after,
.post-card-title a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.featured-post:focus-within,
.post-card:focus-within {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.featured-post-title a:focus-visible,
.post-card-title a:focus-visible {
    outline: none;
}

.featured-post-summary {
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--muted);
}

/* =========================================================================
   Cards (index grid and related posts)
   ========================================================================= */

.post-category {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--ink-2);
}

.post-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-size: 0.84rem;
    color: var(--muted);
}

.meta-sep {
    color: var(--line-strong);
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 2px 3px 0 var(--shadow);
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

.post-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: 3px 5px 0 var(--shadow);
}

.post-card[hidden] {
    display: none;
}

.post-card-media {
    position: relative;
    background: var(--paper-deep);
    overflow: hidden;
}

.post-card-media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

.post-card:hover .post-card-media img,
.featured-post:hover .featured-post-media img {
    transform: scale(1.025);
}

.featured-post-media {
    overflow: hidden;
}

.featured-post-media img {
    transition: transform 0.6s var(--ease);
}

.post-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    padding: 20px 24px 22px;
}

.post-card-title {
    font-weight: 900;
    letter-spacing: -0.02em;
    font-size: 1.5rem;
    line-height: 1.16;
}

.post-card-summary {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card .post-card-meta {
    margin-top: auto;
    padding-top: 8px;
}

/* =========================================================================
   Index: library, search and filters
   ========================================================================= */

.blog-library {
    margin-top: 72px;
}

.blog-library-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.blog-library-head h2 {
    font-weight: 900;
    font-size: clamp(1.9rem, 3.4vw, 2.5rem);
    line-height: 1.1;
}

.blog-count {
    font-size: 0.9rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.blog-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

/* Filtering needs JS; without it the full list shows. */
html:not(.js) .blog-controls {
    display: none;
}

.blog-search {
    position: relative;
    max-width: 440px;
}

.blog-search .icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    width: 1.1rem;
    height: 1.1rem;
    pointer-events: none;
}

.blog-search input {
    width: 100%;
    min-height: 52px;
    padding: 0 20px 0 48px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--card);
    color: var(--ink);
    font: 500 1rem 'Montserrat', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.blog-search input::placeholder {
    color: var(--ink-soft);
}

.blog-search input:hover {
    border-color: rgba(26, 38, 35, 0.3);
}

.blog-search input:focus-visible {
    outline: none;
    border-color: var(--sage);
    box-shadow: 0 0 0 4px rgba(72, 127, 114, 0.22);
}

.blog-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.blog-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--card);
    color: var(--ink-2);
    font: 600 0.9rem/1 'Montserrat', sans-serif;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.blog-chip:hover {
    border-color: var(--sage);
    background: var(--sage-wash);
}

.blog-chip[aria-pressed="true"] {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.blog-chip[aria-pressed="true"] .cat-dot {
    box-shadow: 0 0 0 2px #FFFFFF;
}

.blog-empty {
    text-align: center;
    padding: 56px 24px;
    border: 1px dashed var(--line-strong);
    border-radius: 6px;
    background: var(--card);
}

.blog-empty-title {
    font-weight: 900;
    letter-spacing: -0.02em;
    font-size: 1.6rem;
    line-height: 1.2;
    margin-bottom: 6px;
}

.blog-empty p:not(.blog-empty-title) {
    color: var(--muted);
    margin-bottom: 20px;
}

/* =========================================================================
   Waitlist CTA (index tile and end of post)
   ========================================================================= */

.blog-cta {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    padding: 30px 36px;
    border-radius: 6px;
    background: var(--marigold-wash);
    border: 1px solid rgba(227, 155, 47, 0.28);
    overflow: hidden;
}

.blog-cta-tile {
    grid-column: 1 / -1;
}

.blog-cta-wide {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 14px 24px;
    padding: 28px 30px;
}

.blog-cta-wide .blog-button {
    grid-column: 2;
    justify-self: start;
}

.blog-cta-tile[hidden] {
    display: none;
}

.blog-cta-title {
    font-weight: 900;
    letter-spacing: -0.02em;
    font-size: 1.7rem;
    line-height: 1.15;
    margin-bottom: 6px;
}

.blog-cta-text p {
    color: var(--ink-2);
    line-height: 1.6;
    max-width: 58ch;
}

.blog-cta-art {
    position: relative;
    width: 96px;
    height: 80px;
}

.blog-cta-art span {
    position: absolute;
    display: block;
    filter: drop-shadow(0 3px 2px rgba(43, 58, 53, 0.18));
}

.blog-cta-art span:nth-child(1) {
    width: 54px;
    height: 54px;
    right: 4px;
    top: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(200, 112, 90, 0.45) 1.3px, transparent 1.7px) 0 0 / 7px 7px,
        var(--marigold);
}

.blog-cta-art span:nth-child(2) {
    left: 0;
    right: 0;
    bottom: 6px;
    height: 34px;
    background: var(--sage);
    clip-path: polygon(0 40%, 18% 22%, 38% 30%, 58% 12%, 80% 26%, 100% 18%, 100% 100%, 0 100%);
}

.blog-cta-art span:nth-child(3) {
    left: 10px;
    bottom: 0;
    width: 60px;
    height: 18px;
    border-radius: 50%;
    background: var(--sage-deep);
}

/* =========================================================================
   Post page
   ========================================================================= */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 1001;
    pointer-events: none;
}

html:not(.js) .reading-progress {
    display: none;
}

.reading-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--sage), var(--marigold));
    transform: scaleX(var(--progress, 0));
    transform-origin: 0 50%;
}

/* Hero, text and end blocks share one axis; only the cover and the TOC step outside it. */
.post-hero {
    max-width: calc(43rem + 40px);
    padding-top: 8px;
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    font-size: 0.88rem;
    color: var(--muted);
}

.breadcrumb li + li::before {
    content: '›';
    margin: 0 10px;
    color: var(--line-strong);
    font-size: 1.1rem;
}

.breadcrumb a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--muted);
    font-weight: 500;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--sage-deep);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.post-hero .post-category {
    margin-top: 14px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--line);
}

.post-title {
    font-weight: 900;
    font-size: clamp(2.3rem, 5.4vw, 3.9rem);
    line-height: 1.07;
    letter-spacing: -0.025em;
    color: var(--ink);
    margin: 20px 0 18px;
    text-wrap: balance;
}

.post-dek {
    font-size: clamp(1.1rem, 1.8vw, 1.3rem);
    line-height: 1.55;
    color: var(--ink-2);
    max-width: 60ch;
    text-wrap: pretty;
}

.post-byline {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
}

.post-byline-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--line);
    padding: 4px;
}

.post-byline-author {
    font-weight: 600;
    font-size: 0.98rem;
}

.post-byline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;
    font-size: 0.86rem;
    color: var(--muted);
}

.post-cover {
    position: relative;
    max-width: calc(1100px + 2 * var(--gutter));
    margin: 40px 0 0;
    padding: 0 var(--gutter);
}

/* The grain sits on the image, inside the figure's side padding. */
.post-cover::after {
    inset: 0 var(--gutter);
    border-radius: 6px;
}

.post-cover img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 8;
    object-fit: cover;
    border-radius: 6px;
    background: var(--paper-deep);
    box-shadow: 2px 3px 0 var(--shadow);
}

/* Layout: TOC in the left margin, the text in a comfortable measure. */
.post-layout {
    display: grid;
    grid-template-columns: minmax(11rem, 14rem) minmax(0, 43rem);
    gap: 0 56px;
    margin-top: 56px;
}

.post-aside {
    grid-column: 1;
    justify-self: end;
    width: 100%;
    max-width: 240px;
}

.post-body {
    grid-column: 2;
    min-width: 0;
}

.toc-desktop {
    position: sticky;
    top: var(--header-offset);
    max-height: calc(100vh - var(--header-offset) - 24px);
    overflow-y: auto;
    padding: 4px 4px 12px 0;
}

.toc-title {
    font: 600 0.75rem/1.2 'Montserrat', sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sage-text);
    margin-bottom: 14px;
}

.toc-list {
    list-style: none;
    counter-reset: toc;
}

.toc-list li {
    counter-increment: toc;
}

.toc-list a {
    display: flex;
    gap: 10px;
    padding: 9px 0 9px 14px;
    border-left: 2px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.4;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
}

.toc-list a::before {
    content: counter(toc, decimal-leading-zero);
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    padding-top: 0.15em;
    color: rgba(90, 107, 102, 0.75);
}

.toc-list a:hover {
    color: var(--ink);
    border-left-color: var(--line-strong);
}

.toc-list a[aria-current="true"] {
    color: var(--ink);
    font-weight: 600;
    border-left-color: var(--sage);
}

.toc-list a[aria-current="true"]::before {
    color: var(--sage-text);
}

.toc-mobile {
    display: none;
    margin-bottom: 36px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--card);
}

.toc-mobile summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 0 20px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    list-style: none;
}

.toc-mobile summary::-webkit-details-marker {
    display: none;
}

.toc-mobile summary::after {
    content: '';
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--sage-deep);
    border-bottom: 2px solid var(--sage-deep);
    transform: translateY(-3px) rotate(45deg);
    transition: transform 0.25s var(--ease);
}

.toc-mobile[open] summary::after {
    transform: translateY(2px) rotate(-135deg);
}

.toc-mobile .toc-list {
    padding: 0 20px 16px;
}

/* ---- Prose ---- */

.prose {
    font-size: 1.125rem;
    line-height: 1.78;
    color: #24312E;
    overflow-wrap: break-word;
}

.prose > * + * {
    margin-top: 1.15em;
}

.prose > p:first-child {
    font-size: 1.22rem;
    line-height: 1.7;
    color: var(--ink);
}

.prose > p.has-dropcap::first-letter {
    float: left;
    margin: 0.06em 0.1em 0 0;
    font-family: 'Bodoni Moda', Georgia, serif;
    font-style: italic;
    font-weight: 800;
    font-size: 3.7em;
    line-height: 0.82;
    color: var(--sage-deep);
}

.prose h2 {
    font-weight: 800;
    font-size: clamp(1.7rem, 3vw, 2.1rem);
    line-height: 1.18;
    color: var(--ink);
    margin-top: 2.1em;
    scroll-margin-top: var(--header-offset);
    text-wrap: balance;
}

.prose h2 + * {
    margin-top: 0.6em;
}

.prose h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.4;
    color: var(--ink);
    margin-top: 1.8em;
    scroll-margin-top: var(--header-offset);
}

.prose h3 + * {
    margin-top: 0.45em;
}

.prose a {
    color: var(--sage-text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.prose a:hover {
    color: var(--sage-deep);
    text-decoration-thickness: 2px;
}

.prose strong {
    font-weight: 600;
    color: var(--ink);
}

.prose ul,
.prose ol {
    padding-left: 1.4em;
}

.prose li + li {
    margin-top: 0.55em;
}

.prose li::marker {
    color: var(--sage);
    font-weight: 600;
}

.prose blockquote {
    margin: 2em 0;
    padding: 4px 0 4px 26px;
    border-left: 3px solid var(--marigold);
    font-weight: 700;
    font-size: clamp(1.35rem, 2.4vw, 1.6rem);
    line-height: 1.4;
    color: var(--ink);
}

.prose blockquote p + p {
    margin-top: 0.6em;
}

.prose blockquote cite,
.prose blockquote footer {
    display: block;
    margin-top: 10px;
    font: normal 500 0.9rem 'Montserrat', sans-serif;
    color: var(--muted);
}

.prose .callout {
    margin: 2em 0;
    padding: 24px 28px;
    border-radius: 6px;
    background: var(--sage-wash);
    border: 1px solid rgba(72, 127, 114, 0.18);
    font-size: 1.05rem;
    line-height: 1.7;
}

.prose .callout::before {
    content: 'Prueba esto';
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font: 700 0.75rem/1.2 'Montserrat', sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sage-deep);
}

.prose .callout:has(> .callout-title:first-child)::before {
    display: none;
}

.prose .callout-title {
    font: 700 0.75rem/1.2 'Montserrat', sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sage-deep);
}

.prose .callout > * + * {
    margin-top: 0.7em;
}

.prose .callout ul,
.prose .callout ol {
    padding-left: 1.25em;
}

.prose hr {
    border: 0;
    height: 1px;
    background: var(--line);
    margin: 2.5em 0;
}

/* ---- End of post ---- */

.post-crisis {
    display: flex;
    gap: 18px;
    margin-top: 56px;
    padding: 24px 26px;
    border-radius: 6px;
    background: #F1F7F4;
    border: 1px solid rgba(72, 127, 114, 0.22);
    line-height: 1.6;
    color: var(--ink-2);
}

.post-crisis-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--sage-wash);
    color: var(--sage-deep);
    flex-shrink: 0;
}

.post-crisis-title {
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}

.post-crisis a[href^="tel:"] {
    color: var(--sage-deep);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-crisis-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin-top: 4px;
    color: var(--sage-text);
    font-weight: 600;
    text-decoration: none;
}

.post-crisis-link:hover span {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    margin-top: 36px;
    padding: 22px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.post-share-title {
    font: 600 0.75rem/1.2 'Montserrat', sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sage-text);
}

.post-share-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.share-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--card);
    color: var(--ink-2);
    font: 600 0.9rem/1 'Montserrat', sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.share-button[hidden] {
    display: none;
}

.share-button:hover {
    background: var(--sage-wash);
    border-color: var(--sage);
}

.share-button.is-done {
    background: var(--sage-deep);
    border-color: var(--sage-deep);
    color: #FFFFFF;
}

.share-status:empty {
    display: none;
}

.share-status {
    font-size: 0.88rem;
    color: var(--sage-text);
    font-weight: 600;
}

.post-sources {
    margin-top: 36px;
}

.post-sources h2 {
    font-size: 1.45rem;
    margin-bottom: 14px;
}

.post-sources ol {
    padding-left: 1.6em;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--muted);
}

.post-sources li {
    padding-left: 4px;
    overflow-wrap: anywhere;
}

.post-sources li + li {
    margin-top: 10px;
}

.post-sources li::marker {
    color: var(--sage-text);
    font-variant-numeric: tabular-nums;
}

.post-sources a {
    color: var(--ink-2);
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 3px;
}

.post-sources a:hover {
    color: var(--sage-deep);
    text-decoration-color: currentColor;
}

.icon-external {
    width: 0.8em;
    height: 0.8em;
    margin-left: 4px;
    vertical-align: -0.05em;
    color: var(--sage-text);
}

.post-end {
    max-width: calc(43rem + 40px);
    margin-top: 72px;
}

.post-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 28px;
}

.post-pager-link {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px 24px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
    transition: border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}

.post-pager-link:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
    box-shadow: 3px 5px 0 var(--shadow);
}

.post-pager-next {
    text-align: right;
    align-items: flex-end;
}

.post-pager-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sage-text);
}

.post-pager-title {
    font-weight: 900;
    letter-spacing: -0.02em;
    font-size: 1.3rem;
    line-height: 1.2;
}

.related {
    margin-top: 88px;
}

.related h2 {
    font-weight: 900;
    font-size: clamp(1.9rem, 3.4vw, 2.5rem);
    line-height: 1.1;
    padding-bottom: 18px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--line);
}

.post-missing {
    max-width: 640px;
    padding: 80px 20px 40px;
    text-align: center;
}

.post-missing h1 {
    font-weight: 900;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    line-height: 1.1;
    margin: 12px 0 16px;
}

.post-missing p {
    color: var(--muted);
    margin-bottom: 28px;
}

.post-missing .post-kicker {
    margin-bottom: 0;
}

.post-kicker a {
    color: var(--sage-text);
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 1180px) {
    .post-layout {
        gap: 0 40px;
    }

    .post-aside {
        max-width: 210px;
    }
}

@media (max-width: 1023px) {
    .post-layout {
        display: block;
        max-width: calc(43rem + 40px);
    }

    .post-aside {
        display: none;
    }

    .toc-mobile {
        display: block;
    }

    .post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .post-grid-related .post-card:nth-child(3) {
        display: none;
    }
}

@media (max-width: 900px) {
    .blog-hero-inner {
        grid-template-columns: minmax(0, 1fr) 200px;
        gap: 24px;
    }

    .featured-post {
        grid-template-columns: 1fr;
    }

    .featured-post-media {
        min-height: 0;
    }

    .featured-post-media img {
        position: static;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .blog-cta {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        padding: 28px;
    }

    .blog-cta .blog-button {
        grid-column: auto;
        justify-self: start;
    }
}

@media (max-width: 680px) {
    .blog-main,
    .post-main {
        padding-top: 92px;
        padding-bottom: 64px;
        --header-offset: 24px;
    }

    .blog-hero {
        padding-top: 20px;
    }

    .blog-hero-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .blog-hero-art {
        display: none;
    }

    .post-grid,
    .post-grid-related {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .post-grid-related .post-card:nth-child(3) {
        display: flex;
    }

    .blog-library {
        margin-top: 56px;
    }

    /* Chips scroll sideways instead of stacking into many rows. */
    .blog-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0 -15px;
        padding: 2px 15px 6px;
        scrollbar-width: none;
        scroll-padding: 0 15px;
    }

    .blog-chips::-webkit-scrollbar {
        display: none;
    }

    .blog-search {
        max-width: none;
    }

    .featured-post {
        border-radius: 6px;
    }

    .featured-post-body {
        padding: 22px 22px 24px;
        gap: 12px;
    }

    .post-cover {
        margin-top: 28px;
        padding: 0 var(--gutter);
    }

    .post-cover::after {
        inset: 0 var(--gutter);
        border-radius: 6px;
    }

    .post-cover img {
        aspect-ratio: 16 / 10;
        border-radius: 6px;
    }

    .post-layout {
        margin-top: 36px;
    }

    .post-dek {
        font-size: 1.08rem;
    }

    .prose {
        font-size: 1.0625rem;
        line-height: 1.75;
    }

    .prose > p:first-child {
        font-size: 1.14rem;
    }

    .prose .callout {
        padding: 20px;
    }

    .post-crisis {
        flex-direction: column;
        gap: 12px;
        padding: 22px;
    }

    .post-pager {
        grid-template-columns: 1fr;
    }

    .post-pager-next {
        text-align: left;
        align-items: flex-start;
    }

    .post-pager-gap {
        display: none;
    }

    .related {
        margin-top: 64px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .blog-hero-art img {
        animation: none;
    }

    .featured-post,
    .post-card,
    .post-card-media img,
    .featured-post-media img,
    .post-pager-link,
    .blog-button {
        transition: none;
    }

    .featured-post:hover,
    .post-card:hover,
    .post-pager-link:hover,
    .blog-button:hover {
        transform: none;
    }

    .post-card:hover .post-card-media img,
    .featured-post:hover .featured-post-media img {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
