/* Blog listing + article styles. Token-driven (see DESIGN_GUIDELINES.md / :root in style.css). */

/* ----- shared ----- */
.blog-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 96px;
}

.blog-head {
    margin-bottom: 40px;
}

.blog-title {
    font-family: var(--font-display);
    font-weight: bold;
    font-size: var(--fs-display-2);
    line-height: 1;
    letter-spacing: var(--track-display);
    color: var(--color-ink);
    margin: 0;
}

.blog-sub {
    font-family: var(--font-body);
    font-size: var(--fs-body);
    color: var(--color-text);
    margin: 14px 0 0;
    max-width: 620px;
}

/* tag chips (not buttons) */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 4px;
}

.post-tag {
    font-family: var(--font-display);
    font-size: var(--fs-caption);
    color: var(--color-text-strong);
    padding: 4px 11px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    white-space: nowrap;
}

/* meta row (author / date / readtime) */
.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-family: var(--font-body);
    font-size: var(--fs-caption);
    color: var(--color-text-strong);
    margin: 0;
}

.post-meta .sep { color: var(--color-border); }
.post-meta .author { font-weight: bold; color: var(--color-ink); }
.post-meta .bi { margin-right: 2px; }

/* media boxes: fixed aspect ratio, cover crop, no filter */
.post-media {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--color-bg);
}

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

.post-media--placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: bold;
    font-size: var(--fs-display-2);
    color: var(--color-border);
    background: var(--color-bg);
}

/* ----- featured (most recent) ----- */
.post-feature {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 0;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-surface);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
    margin-bottom: 48px;
}

.post-feature:hover {
    border-color: var(--color-border);
    box-shadow: 12px 16px 32px -12px rgba(0, 0, 0, 0.18);
    color: inherit;
}

.post-feature .post-media { aspect-ratio: 4 / 3; }

.post-feature__body {
    padding: 40px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.post-feature__title {
    font-family: var(--font-display);
    font-weight: bold;
    font-size: var(--fs-display-2);
    line-height: 1.08;
    color: var(--color-ink);
    margin: 0;
}

.post-feature__excerpt {
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: 1.55;
    color: var(--color-text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ----- grid of cards ----- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 32px;
}

.post-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-surface);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.post-card:hover {
    border-color: var(--color-border);
    box-shadow: 10px 12px 26px -10px rgba(0, 0, 0, 0.16);
    color: inherit;
}

.post-card .post-media { aspect-ratio: 16 / 10; }

.post-card__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px 24px 26px;
    flex: 1;
}

.post-card__title {
    font-family: var(--font-display);
    font-weight: bold;
    font-size: var(--fs-lede);
    line-height: 1.2;
    color: var(--color-ink);
    margin: 0;
}

.post-card__excerpt {
    font-family: var(--font-body);
    font-size: var(--fs-small);
    line-height: 1.5;
    color: var(--color-text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__body .post-meta { margin-top: auto; }

/* staff-only unpublished list */
.blog-unpublished {
    margin-top: 56px;
    padding-top: 20px;
    border-top: 1px dashed var(--color-border);
    font-family: var(--font-body);
    color: var(--color-text);
}

/* ----- responsive ----- */
@media (max-width: 768px) {
    .blog-wrap { padding: 32px 18px 64px; }
    .post-feature { grid-template-columns: 1fr; }
    .post-feature .post-media { aspect-ratio: 16 / 9; }
    .post-feature__body { padding: 28px 24px; }
    .post-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ===================== article (single post) =====================
   The house article: head (kicker, title, lede, hairline meta row), the Sommaire rail
   (docs/sommaire_rail.md: fixed at the frame's left edge under the site navbar, sections always
   listed, the current section's h3s open under it, a 2 px progress line; an inline list under
   1100 px), the body, the share row. The head (tag bubbles, title, meta row, lede) and the share
   icons keep the original post page's look. */
.post-wrap {
    --frame: 1440px;
    --toc-gutter: 296px;
    --measure: 760px;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    width: 100%;   /* the page shell shrink-wraps its children; the frame must span the window */
    max-width: calc(var(--measure) + 48px);
    margin: 0 auto;
    padding: 48px 24px 96px;
}
.post-article { min-width: 0; }

.post-progress {
    position: fixed; top: var(--chrome-h, 0px); left: 0; z-index: 20;
    width: 100%; height: 2px; background: var(--color-ink);
    transform: scaleX(0); transform-origin: left; pointer-events: none;
}

/* ----- head (unchanged from the original post page) ----- */
.post-article .post-tags { justify-content: flex-start; margin-bottom: 18px; }

.post-title-page {
    font-family: var(--font-display);
    font-weight: bold;
    font-size: var(--fs-display-2);
    line-height: 1.05;
    letter-spacing: var(--track-display);
    color: var(--color-ink);
    text-align: left;
    margin: 0 0 18px;
}

.post-article .post-meta { margin-bottom: 32px; }

.post-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--color-bg);
    margin: 0 0 36px;
}

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

.post-lede {
    font-family: var(--font-body);
    font-size: var(--fs-lede);
    line-height: 1.6;
    color: var(--color-text-strong);
    margin: 0 0 28px;
}

/* ----- the Sommaire ----- */
nav.toc { font-family: var(--font-body); font-size: var(--fs-caption); line-height: 1.35; }
nav.toc .toc-label { font-size: var(--fs-caption); color: var(--color-text-soft); margin: 0 0 8px; }
nav.toc ol { list-style: none; margin: 0; padding: 0; }
nav.toc > ol { border-left: 1px solid var(--color-border); }
nav.toc a { display: block; position: relative; padding: 4px 0 4px 14px; color: var(--color-text-soft); text-decoration: none; text-wrap: pretty; }
nav.toc a.sub { padding-left: 26px; }
nav.toc a:hover { color: var(--color-ink); }
nav.toc a:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; }
nav.toc .sub-wrap { display: none; }
@media (min-width: 1100px) {
    .post-wrap.with-toc { max-width: var(--frame); padding-left: var(--toc-gutter); padding-right: 24px; }
    .with-toc .post-article { max-width: var(--measure); }
    nav.toc {
        position: fixed; top: var(--chrome-h, 0px); bottom: 0;
        left: max(0px, calc((100% - var(--frame)) / 2)); width: 248px;
        padding: 48px 0 48px 24px; overflow-y: auto; scrollbar-width: none;
    }
    nav.toc::-webkit-scrollbar { display: none; }
    nav.toc a[aria-current] { color: var(--color-ink); }
    nav.toc a[aria-current]::before { content: ""; position: absolute; left: -1px; top: 4px; bottom: 4px; width: 2px; background: var(--color-ink); }
    /* The accordion: a section's items take their height only while it is the one being read. */
    nav.toc .sub-wrap {
        display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
        transition: grid-template-rows .3s var(--ease), opacity .15s var(--ease), visibility 0s .3s;
    }
    nav.toc .sub-wrap > ol { min-height: 0; overflow: hidden; margin-left: -2px; padding-left: 2px; }
    nav.toc li.open > .sub-wrap { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition-delay: 0s; }
}
@media (max-width: 1099px) {
    nav.toc { padding: 24px 0; margin: 0 0 48px; border-block: 1px solid var(--color-border); }
    nav.toc > ol { border-left: 0; }
    nav.toc a { padding-left: 0; }
}

/* ----- body ----- */
.post-body {
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: 1.7;
    color: var(--color-text);
}
.post-body > :first-child { margin-top: 0; }
.post-body p { margin: 0 0 1.1em; }
.post-body strong { color: var(--color-text-strong); }
.post-body h2, .post-body h3 {
    font-family: var(--font-display);
    font-weight: bold;
    color: var(--color-ink);
    scroll-margin-top: calc(var(--chrome-h, 84px) + 24px);
    text-wrap: balance;
}
.post-body h2 { font-size: var(--fs-display-3); line-height: 1.2; margin: 72px 0 16px; }
.post-body h3 { font-size: var(--fs-emph); line-height: 1.3; margin: 48px 0 12px; }
.post-head { scroll-margin-top: calc(var(--chrome-h, 84px) + 24px); }
.post-body a { color: var(--color-ink); text-decoration: underline; text-underline-offset: 2px; }
.post-body ul, .post-body ol { padding-left: 1.2em; margin: 0 0 1.4em; }
.post-body li { margin: 0 0 0.5em; padding-left: 0.2em; }
.post-body li::marker { color: var(--color-text-soft); }
.post-body aside { border-left: 2px solid var(--color-ink); padding: 4px 0 4px 16px; margin: 1.5em 0; }

/* figures: images keep their own proportions; a tall one is capped, never cropped */
.post-body figure { margin: 40px 0; }
.post-body figure img { display: block; max-width: 100%; max-height: 560px; width: auto; height: auto; }
.post-body figcaption {
    font-size: var(--fs-caption);
    line-height: 1.45;
    color: var(--color-text-soft);
    margin-top: 10px;
}
.post-body figcaption em { font-style: normal; }
/* a floated figure (source img data-float="left"): small, at the top left, the text wraps around it */
.post-body .post-figure--left { float: left; width: min(200px, 40%); margin: 6px 28px 16px 0; }
.post-body .post-figure--left img { width: 100%; max-height: none; }
.post-body h2, .post-body h3, .post-body .post-chart, .post-body .post-table, .post-body .post-stats { clear: both; }

/* stat tiles (a row of key figures from the doc): the figure, the sentence under it */
.post-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 32px 24px;
    margin: 24px 0 8px;
}
.post-stat { border-top: 1px solid var(--color-ink); padding-top: 14px; }
.post-body .post-stat__value {
    font-family: var(--font-display);
    font-weight: bold;
    font-size: var(--fs-display-3);
    line-height: 1.15;
    color: var(--color-ink);
    margin: 0 0 10px;
}
.post-body .post-stat__text { font-size: var(--fs-small); line-height: 1.5; margin: 0; }

/* tables: hairline rows, figures aligned; a table wider than the page scrolls inside its box */
.post-table { overflow-x: auto; margin: 24px 0 32px; }
.post-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-small);
    line-height: 1.45;
    font-variant-numeric: tabular-nums;
}
.post-body th, .post-body td {
    text-align: left;
    vertical-align: top;
    padding: 10px 16px 10px 0;
    border-bottom: 1px solid var(--color-border);
}
.post-body th:last-child, .post-body td:last-child { padding-right: 0; }
.post-body thead th { font-size: var(--fs-caption); font-weight: normal; color: var(--color-text-soft); border-bottom-color: var(--color-ink); }
.post-body td { color: var(--color-text); }
.post-body td:first-child { color: var(--color-text-strong); }
/* a table head that holds images (party logos): the images at icon size */
.post-body th figure { margin: 0; }
.post-body th figure img { max-height: 72px; }
.post-body th figure figcaption { display: none; }
/* the bold label paragraph that introduces an annex table sits close to it */
.post-body p:has(+ .post-table) { margin-bottom: 0; }

/* annexes (method, data): an h2 whose title starts with "Annexe" and everything after it read as
   a footnote reference, small and grey (owner 2026-11-10) */
.post-body h2[id^="annexe"] { font-size: var(--fs-emph); color: var(--color-text-soft); margin-top: 64px; }
.post-body h2[id^="annexe"] ~ * { font-size: var(--fs-caption); line-height: 1.5; color: var(--color-text-soft); }
.post-body h2[id^="annexe"] ~ h3 { font-size: var(--fs-small); color: var(--color-text-soft); margin: 28px 0 8px; }
.post-body h2[id^="annexe"] ~ * table { font-size: var(--fs-caption); }
.post-body h2[id^="annexe"] ~ * th,
.post-body h2[id^="annexe"] ~ * td,
.post-body h2[id^="annexe"] ~ * strong { color: var(--color-text-soft); }
.post-body h2[id^="annexe"] ~ * th, .post-body h2[id^="annexe"] ~ * td { padding-top: 6px; padding-bottom: 6px; }

/* charts: the drawing, the caption, the numbers folded under them */
.post-body .post-chart { display: flex; flex-direction: column; }
.post-body .post-chart .chart { width: 100%; min-height: 200px; }
.post-body .post-chart figcaption { order: 1; }
.post-body .post-chart details { order: 2; margin-top: 8px; font-size: var(--fs-caption); color: var(--color-text-soft); overflow-x: auto; }
.post-body .post-chart summary { cursor: pointer; width: fit-content; }
.post-body .post-chart details table { margin: 8px 0 0; font-size: var(--fs-caption); }

/* an image the site does not hold yet: staff see a slot to drop it in; visitors never get it */
.post-body .post-slot {
    border: 1px dashed var(--color-ghost);
    padding: 32px 24px;
    cursor: pointer;
    color: var(--color-text-soft);
}
.post-body .post-slot.is-over { border-color: var(--color-ink); color: var(--color-ink); }
.post-body .post-slot.is-busy { opacity: 0.6; }
.post-body .post-slot__label { font-family: var(--font-display); font-size: var(--fs-small); margin: 0 0 4px; }
.post-body th .post-slot { padding: 16px; }

/* ----- share row (unchanged from the original post page) ----- */
.post-share {
    margin-top: 56px;
    padding-top: 28px;
    border-top: 1px solid var(--color-border);
}

.post-share__label {
    font-family: var(--font-display);
    font-size: var(--fs-caption);
    color: var(--color-text-strong);
    margin: 0 0 14px;
}

.post-share__links { display: flex; align-items: center; gap: 14px; }
.post-share__links a { display: inline-flex; line-height: 0; }
.post-share__links img {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    transition: opacity 0.2s ease;
}
.post-share__links a:hover img { opacity: 0.7; }

@media (max-width: 768px) {
    .post-wrap { padding: 32px 20px 72px; }
    .post-stats { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
    .post-body h2 { margin-top: 56px; }
}
/* the site footer slides over the fixed rail at the end of the page */
footer.site-footer { position: relative; z-index: 21; }

@media print { nav.toc, .post-progress, .post-share { display: none !important; } }
@media (prefers-reduced-motion: reduce) { nav.toc .sub-wrap { transition: none !important; } }
