/*
Theme Name: Esquare
Author: jfsenechal
Description: Custom block theme for Esquare, in the editorial Communal Atelier language (Hybrid header + footer, article reading surface on Newsprint Cream).
Version: 0.2.0
Requires at least: 6.9
Tested up to: 6.9
Requires PHP: 8.5
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: esquare
*/

/* ─────────────────────────────────────────────────────────────────────
   Reset-ish, base
   ───────────────────────────────────────────────────────────────────── */

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background-color: #FCFAF5;
    color: #0E1F33;
    isolation: isolate;
}

/* Block themes apply spacing through the constrained layout; clear root padding
   so the dark header/footer can extend edge-to-edge. */
.wp-site-blocks {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ─────────────────────────────────────────────────────────────────────
   Skip link
   ───────────────────────────────────────────────────────────────────── */

.skip-link {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 100;
    padding: 0.75rem 1rem;
    background: #F2B33D;
    color: #081523;
    font-family: "Figtree", system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 0.25rem;
    transform: translateY(-150%);
    transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
    text-decoration: none;
}

.skip-link:focus-visible {
    transform: translateY(0);
    outline: 2px solid #081523;
    outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────────────
   Header nav — seated bar with bottom hairline + active-page wayfinding
   (markup carries the Tailwind utilities; these rules cover what it can't)
   ───────────────────────────────────────────────────────────────────── */

/* First-paint floor. The bar's surface and text colours also ship as Tailwind
   utilities (bg-navy-deep, text-white/90), but those don't exist until the
   in-browser compiler runs, and this stylesheet applies before it does. Without
   the pair declared here the header spends first paint on the body's cream with
   a white current-page link on it — 1.04:1, invisible. Declared together on
   purpose: a background without a matching foreground just moves the failure
   from the active link to every link. Literal hexes, not var(--color-navy-deep),
   because the custom properties live in the @theme block and are missing from
   exactly the same window this is covering. */
.esq-nav-bar {
    background-color: #081523;
    color: #FEFCF9;
}

.esq-nav {
    min-height: 76px;
    border-bottom: 1px solid color-mix(in oklch, #FCFAF5 12%, transparent);
}

.esq-nav-link {
    position: relative;
}

.esq-nav-link[aria-current="page"] {
    /* #FEFCF9 is --color-white; the palette has no pure #fff (Tinted Neutral). */
    color: #FEFCF9;
}

.esq-nav-link[aria-current="page"]::after {
    content: "";
    position: absolute;
    /* Matches the bar links' px-3 padding so the mark sits under the text. */
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.4375rem;
    height: 2px;
    background: #F2B33D;
}

/* Mobile disclosure panel: the burger swaps to a close glyph when open, and the
   stacked links are padded tighter than the bar's, so the active underline
   follows them. */
[aria-controls="primary-nav-panel"] .esq-nav-burger-close {
    display: none;
}

[aria-controls="primary-nav-panel"][aria-expanded="true"] .esq-nav-burger-open {
    display: none;
}

[aria-controls="primary-nav-panel"][aria-expanded="true"] .esq-nav-burger-close {
    display: block;
}

/* Focus ring for the dark bar. The system's default indicator is navy-deep,
   which is this header's own background — applied here it would be a 1:1
   invisible ring, so the bar inverts to brass (9.89:1 on #081523). The 2px
   offset keeps a navy gap between ring and control, which is what lets the
   same brass ring stay legible around the brass Contact pill. */
.esq-nav-bar :focus-visible {
    outline: 2px solid #F2B33D;
    outline-offset: 2px;
}

/* Tailwind v4 folds outline-color into transition-colors, so the bar's hover
   transition also animates the ring above. On the Contact pill it would start at
   currentColor — navy-deep, the bar's own background, 1.00:1 — and fade up to
   brass across 150ms, leaving the ring invisible exactly when focus lands. Keep
   the colour shifts hover actually uses; drop outline-color from the list. */
.esq-nav-bar a {
    transition-property: background-color, color;
}

.esq-nav-panel .esq-nav-link[aria-current="page"]::after {
    left: 0.5rem;
    /* Panel rows are full-width tap targets, so the bar's edge-to-edge underline
       would read as a separator here. Anchor a short mark under the text start. */
    right: auto;
    width: 1.75rem;
    bottom: 0.5rem;
}

/* ─────────────────────────────────────────────────────────────────────
   Home services grid — whole-card links
   ───────────────────────────────────────────────────────────────────── */

/* Each card is a single <a> wrapping heading, description and the arrow
   affordance, so the focus ring is the card. Without this rule it falls to the
   UA default — visible on Workshop Stone, but undesigned and inconsistent with
   every other focusable surface in the theme. navy-deep per DESIGN.md §5;
   note the older rules in this file use #0E1F33, a drift worth one cleanup. */
.esq-service-card:focus-visible {
    outline: 2px solid #081523;
    outline-offset: 2px;
}

/* Navy secondary pill (DESIGN.md §5, the secondary path). navy-deep on the pill
   itself is 1.11:1 — invisible — so the 2px offset is load-bearing here: it puts
   the ring on the cream section behind, at 17.6:1. Same reasoning as the header
   bar's brass ring around the brass Contact pill. */
.esq-cta-navy:focus-visible {
    outline: 2px solid #081523;
    outline-offset: 2px;
}

/* Tailwind v4 folds outline-color into transition-colors, so the pill's hover
   transition also animates its focus ring — from currentColor (white, and
   invisible on cream) to navy across 150ms. A focus ring has to be there the
   instant it lands, so narrow the transition to the property hover actually
   changes. */
.esq-cta-navy {
    transition-property: background-color;
}

/* ─────────────────────────────────────────────────────────────────────
   Footer Services nav — numbered Civic Index
   ───────────────────────────────────────────────────────────────────── */

.footer-services-nav {
    font-family: "Figtree", system-ui, sans-serif;
    font-size: 14px;
    color: #FCFAF5;
}

.footer-services-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    row-gap: 4px;
    column-gap: 16px;
    counter-reset: services-counter;
}

.footer-services-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    counter-increment: services-counter;
}

.footer-services-num {
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 10px;
    color: color-mix(in oklch, #F2B33D 80%, transparent);
    letter-spacing: 0.08em;
    min-width: 1.8em;
    font-variant-numeric: tabular-nums;
}

.footer-services-num::before {
    content: counter(services-counter, decimal-leading-zero);
}

.footer-services-link {
    color: #FCFAF5;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: color 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.footer-services-link:hover,
.footer-services-link:focus-visible {
    color: #F2B33D;
}

/* ─────────────────────────────────────────────────────────────────────
   Pied de page — « Le Colophon »
   Sur ce site, le sombre veut dire « contenu » : hero, blocs contact.
   Le pied de page se distingue donc en faisant l'inverse : la seule
   surface claire, calme et respirée de la page, ouverte par un filet
   laiton, comme l'achevé d'imprimer au dos d'un livre.
   ───────────────────────────────────────────────────────────────────── */

.esq-colophon {
    /* Kraft Famenne : un cran sous Workshop Stone, pour que le colophon
       descende toujours d'un ton, y compris sous la bande partenaires.
       Déclaré dans theme.json ; la valeur en repli couvre les contextes
       où les presets ne sont pas injectés. */
    --esq-kraft: var(--wp--preset--color--kraft, #E0D8C8);
    background-color: var(--esq-kraft);
    border-top: 1px solid #F2B33D;      /* filet Marche Brass, 1px */
    color: #0E1F33;
}

.esq-colophon-label {
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: color-mix(in srgb, #0E1F33 78%, var(--esq-kraft));
}

.esq-colophon-body {
    font-size: 14px;
    line-height: 1.6;
    color: color-mix(in srgb, #0E1F33 78%, var(--esq-kraft));
}

.esq-colophon-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    font-size: 14px;
    font-weight: 600;
    color: #0E1F33;
    text-decoration: none;
}

.esq-colophon-cta-txt {
    text-decoration: underline;
    text-decoration-color: #F2B33D;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
    transition: text-decoration-color 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.esq-colophon-cta:hover .esq-colophon-cta-txt,
.esq-colophon-cta:focus-visible .esq-colophon-cta-txt {
    text-decoration-color: #0E1F33;
}

.esq-colophon-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    font-size: 14px;
    color: #0E1F33;
    text-decoration: none;
    transition: text-decoration-color 200ms cubic-bezier(0.22, 1, 0.36, 1);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.esq-colophon-link:hover,
.esq-colophon-link:focus-visible {
    text-decoration-color: #0E1F33;
}

.esq-colophon-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    color: color-mix(in srgb, #0E1F33 80%, var(--esq-kraft));
    transition: color 200ms cubic-bezier(0.22, 1, 0.36, 1),
                background-color 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.esq-colophon-social:hover,
.esq-colophon-social:focus-visible {
    color: #0E1F33;
    background-color: color-mix(in srgb, #0E1F33 8%, transparent);
}

/* Entités légales : ASBL et Tiers-lieu, mêmes coordonnées */
.esq-colophon-entity {
    margin-top: 1rem;
}

.esq-colophon-entity + .esq-colophon-entity {
    margin-top: 1.5rem;
}

.esq-colophon-entity-name {
    margin: 0;
    max-width: 34ch;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-wrap: balance;
    color: #0E1F33;
}

.esq-colophon-entity-ids {
    display: grid;
    gap: 2px;
    margin: 0.625rem 0 0;
    font-size: 14px;
    line-height: 1.6;
    color: color-mix(in srgb, #0E1F33 78%, var(--esq-kraft));
}

.esq-colophon-entity-ids > div {
    display: flex;
    gap: 12px;
}

.esq-colophon-entity-ids dt {
    min-width: 7ch;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: calc(14px * 1.6);
}

.esq-colophon-entity-ids dd {
    margin: 0;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
    user-select: all;
}

.esq-colophon-legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 16px;
    margin-top: 3.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid color-mix(in srgb, #0E1F33 14%, transparent);
    font-size: 12px;
    color: color-mix(in srgb, #0E1F33 70%, var(--esq-kraft));
}

.esq-colophon-legal p {
    margin: 0;
}

.esq-colophon-legal-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 8px;
    color: inherit;
    text-decoration: none;
    transition: color 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.esq-colophon-legal-link:hover,
.esq-colophon-legal-link:focus-visible {
    color: #0E1F33;
}

/* Index des services, version claire */
.esq-colophon .footer-services-nav {
    color: #0E1F33;
}

.esq-colophon .footer-services-num {
    color: color-mix(in srgb, #0E1F33 55%, var(--esq-kraft));
}

.esq-colophon .footer-services-link {
    color: color-mix(in srgb, #0E1F33 88%, var(--esq-kraft));
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: color 200ms cubic-bezier(0.22, 1, 0.36, 1),
                text-decoration-color 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.esq-colophon .footer-services-link:hover,
.esq-colophon .footer-services-link:focus-visible {
    color: #0E1F33;
    text-decoration-color: #0E1F33;
}

.esq-colophon :focus-visible {
    outline: 2px solid #0E1F33;
    outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────────────
   Article surface — eyebrow, title, standfirst, tags
   (shared by article page and category archive)
   ───────────────────────────────────────────────────────────────────── */

.article-eyebrow {
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: color-mix(in oklch, #0E1F33 68%, transparent);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
}

.article-eyebrow::before {
    content: "";
    flex: none;
    width: 7px;
    height: 7px;
    background: #F2B33D;
}

.article-title {
    font-family: "Instrument Serif", Georgia, serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 6vw, 4.75rem);
    line-height: 1.04;
    letter-spacing: -0.01em;
    color: #0E1F33;
    text-wrap: balance;
    margin: 0;
}

.article-standfirst {
    font-family: "Figtree", system-ui, sans-serif;
    font-weight: 400;
    font-size: clamp(1.15rem, 1.8vw, 1.4rem);
    line-height: 1.5;
    color: color-mix(in oklch, #0E1F33 78%, transparent);
    margin: 0;
}

.article-standfirst p {
    margin: 0 0 0.6em;
}

.article-standfirst p:last-child {
    margin-bottom: 0;
}

.article-standfirst a {
    color: #0E1F33;
    text-decoration: underline;
    text-decoration-color: #F2B33D;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: text-decoration-color 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.article-standfirst a:hover {
    text-decoration-color: #0E1F33;
}

.article-standfirst strong {
    font-weight: 700;
    color: #0E1F33;
}

/* ── Tag chips ─────────────────────────────────────────────── */

.article-tag {
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #0E1F33;
    text-decoration: none;
    background: transparent;
    border: 1px solid color-mix(in oklch, #0E1F33 22%, transparent);
    padding: 0.45rem 0.85rem;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    transition:
        background-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
        color 180ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.article-tag:hover {
    background: #0E1F33;
    color: #FAF8F3;
    border-color: #0E1F33;
}

.article-tag:focus-visible {
    outline: 2px solid #0E1F33;
    outline-offset: 2px;
}

.article-tag.is-active,
.article-tag[aria-current="true"] {
    background: #0E1F33;
    color: #FAF8F3;
    border-color: #0E1F33;
}

.article-tag.is-active .article-tag__count,
.article-tag[aria-current="true"] .article-tag__count {
    color: color-mix(in oklch, #FAF8F3 70%, transparent);
}

.article-tag__count {
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: color-mix(in oklch, #0E1F33 55%, transparent);
    font-variant-numeric: tabular-nums;
}

/* ─────────────────────────────────────────────────────────────────────
   Category archive — title band, filter rail, posts grid
   ───────────────────────────────────────────────────────────────────── */

.esq-archive {
    background-color: #FAF8F3;
}

.esq-archive-header {
    max-width: 80rem;
    margin: 0 auto;
    padding: 4rem 1.5rem 0;
}

@media (min-width: 1024px) {
    .esq-archive-header {
        padding: 5rem 2rem 0;
    }
}

.esq-archive-title {
    margin-top: 1.25rem;
    max-width: 22ch;
}

.esq-archive-description {
    margin-top: 1.5rem;
    max-width: 56ch;
}

/* ── Filter rail ────────────────────────────────────────────── */

.esq-filter-section {
    max-width: 80rem;
    margin: 0 auto;
    padding: 2rem 1.5rem 0;
}

@media (min-width: 1024px) {
    .esq-filter-section {
        padding: 2.5rem 2rem 0;
    }
}

.esq-filter-meta {
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: color-mix(in oklch, #0E1F33 55%, transparent);
    margin: 0 0 0.85rem;
}

.esq-filter-rail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid color-mix(in oklch, #0E1F33 12%, transparent);
}

@media (max-width: 639px) {
    .esq-filter-rail {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .esq-filter-rail::-webkit-scrollbar {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .article-tag {
        transition: none;
    }
}

/* ── Posts grid ─────────────────────────────────────────────── */

.esq-archive-section {
    max-width: 80rem;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 6rem;
}

@media (min-width: 1024px) {
    .esq-archive-section {
        padding: 3.5rem 2rem 7rem;
    }
}

.esq-archive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem 1.75rem;
}

@media (min-width: 640px) {
    .esq-archive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .esq-archive-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 3rem 2rem;
    }
}

.esq-card {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    background: transparent;
    text-decoration: none;
    color: inherit;
}

.esq-card.esq-hidden {
    display: none;
}

.esq-card__media {
    display: block;
    overflow: hidden;
    border-radius: 1rem;
    aspect-ratio: 4 / 3;
    background-color: #F1ECE3;
    margin-bottom: 0.5rem;
}

.esq-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.esq-card:hover .esq-card__image {
    transform: scale(1.04);
}

/* Non-thumb placeholder reuses the kraft-stone surface with a brass-stamp rubric */
.esq-card__placeholder {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 1.25rem;
    color: color-mix(in oklch, #0E1F33 60%, transparent);
}

.esq-card__placeholder-stamp {
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #0E1F33;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.esq-card__placeholder-stamp::before {
    content: "";
    width: 7px;
    height: 7px;
    background: #F2B33D;
    flex: none;
}

.esq-card__meta {
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: color-mix(in oklch, #0E1F33 55%, transparent);
    margin: 0.4rem 0 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.esq-card__meta-sep {
    color: color-mix(in oklch, #0E1F33 30%, transparent);
    font-weight: 400;
}

.esq-card__meta-kind {
    color: color-mix(in oklch, #0E1F33 70%, transparent);
}

.esq-card__title {
    font-family: "Figtree", system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.375rem;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: #0E1F33;
    text-wrap: balance;
    max-width: 26ch;
    margin: 0.35rem 0 0;
}

.esq-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.esq-card__title a:hover {
    color: #1A2D4A;
}

.esq-card__excerpt {
    font-family: "Figtree", system-ui, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: color-mix(in oklch, #0E1F33 72%, transparent);
    margin: 0.5rem 0 0;
    max-width: 42ch;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .esq-card__image,
    .esq-card:hover .esq-card__image {
        transition: none;
        transform: none;
    }
}

/* ── Empty state ────────────────────────────────────────────── */

.esq-archive-empty {
    display: none;
    max-width: 56ch;
    margin: 0 auto;
    text-align: center;
    font-family: "Figtree", system-ui, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.55;
    color: color-mix(in oklch, #0E1F33 65%, transparent);
    padding: 3rem 1rem;
}

.esq-archive-empty.is-visible {
    display: block;
}

/* ── Reveal animation (gated) ───────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        animation: esq-reveal 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    .reveal-2 { animation-delay: 90ms; }
    .reveal-3 { animation-delay: 170ms; }
}

@keyframes esq-reveal {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────────────────────────────
   Article surface — cover, prose, back link, tag list
   (the editorial reading experience for single posts and pages)
   ───────────────────────────────────────────────────────────────────── */

.article-cover img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.article-cover figcaption {
    margin-top: 0.7rem;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: color-mix(in oklch, #0E1F33 55%, transparent);
}

/* Tag list — wp:post-terms renders comma-separated anchors; collapse the
   commas with font-size:0 on the wrapper, restore size on the anchors. */
.article-tags-wrap {
    margin-top: 2.25rem;
}

.article-tags-wrap .sr-only-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.wp-block-post-terms.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
    font-size: 0;
    color: transparent;
}

.wp-block-post-terms.article-tags a {
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #0E1F33;
    text-decoration: none;
    background: transparent;
    border: 1px solid color-mix(in oklch, #0E1F33 22%, transparent);
    padding: 0.45rem 0.85rem;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    transition:
        background-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
        color 180ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.wp-block-post-terms.article-tags a:hover {
    background: #0E1F33;
    color: #FAF8F3;
    border-color: #0E1F33;
}

.wp-block-post-terms.article-tags a:focus-visible {
    outline: 2px solid #0E1F33;
    outline-offset: 2px;
}

/* Prose */
.article-prose {
    max-width: 66ch;
    margin-left: auto;
    margin-right: auto;
    font-family: "Figtree", system-ui, sans-serif;
    font-size: 1.0625rem;
    color: color-mix(in oklch, #0E1F33 88%, transparent);
}

.article-prose > * + * { margin-top: 1.15rem; }
.article-prose p { line-height: 1.72; margin: 0; }

.article-prose .lede,
.article-prose > p:first-child {
    font-size: 1.1875rem;
    line-height: 1.62;
    color: #0E1F33;
}

.article-prose h2,
.article-prose .wp-block-heading[class*="is-style-"]:not(h3):not(h4):not(h5):not(h6) {
    font-family: "Figtree", system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(1.45rem, 2.4vw, 1.85rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: #0E1F33;
    margin-top: 2.85rem;
}

.article-prose h3 {
    font-family: "Figtree", system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 1.3;
    color: #0E1F33;
    margin-top: 2.1rem;
}

.article-prose h2 + *,
.article-prose h3 + * { margin-top: 0.65rem; }

.article-prose strong { font-weight: 700; color: #0E1F33; }

.article-prose a {
    color: #0E1F33;
    text-decoration: underline;
    text-decoration-color: #F2B33D;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: text-decoration-color 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.article-prose a:hover { text-decoration-color: #0E1F33; }

.article-prose a:focus-visible {
    outline: 2px solid #0E1F33;
    outline-offset: 2px;
    border-radius: 2px;
}

.article-prose ul,
.article-prose ol {
    list-style: none;
    padding-left: 0;
}

.article-prose li { position: relative; line-height: 1.62; }
.article-prose li + li { margin-top: 0.45rem; }

.article-prose ul li { padding-left: 1.55rem; }
.article-prose ul li::before {
    content: "";
    position: absolute;
    left: 0.15rem;
    top: 0.62em;
    width: 6px;
    height: 6px;
    background: #F2B33D;
}

.article-prose ol { counter-reset: steps; }
.article-prose ol li { counter-increment: steps; padding-left: 2rem; }
.article-prose ol li::before {
    content: counter(steps, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0.1em;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.78rem;
    font-weight: 600;
    color: color-mix(in oklch, #0E1F33 60%, transparent);
    font-variant-numeric: tabular-nums;
}

.article-prose blockquote {
    margin-top: 2.3rem;
    margin-bottom: 2.3rem;
    padding-block: 1.4rem;
    border-top: 1px solid color-mix(in oklch, #0E1F33 16%, transparent);
    border-bottom: 1px solid color-mix(in oklch, #0E1F33 16%, transparent);
}

.article-prose blockquote p {
    margin: 0;
    font-family: "Instrument Serif", Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.05rem);
    line-height: 1.3;
    color: #0E1F33;
}

.article-prose blockquote cite {
    display: block;
    margin-top: 0.9rem;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-style: normal;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: color-mix(in oklch, #0E1F33 58%, transparent);
}

.article-prose figure { margin-top: 2.3rem; }
.article-prose figure img { display: block; width: 100%; height: auto; }
.article-prose figcaption {
    margin-top: 0.6rem;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: color-mix(in oklch, #0E1F33 55%, transparent);
}

/* Activity detail: Notion content rendered into the prose column (BlockRenderer) */
.activity-body.article-prose { margin-left: 0; }
.activity-body > :first-child { margin-top: 0; }

.article-prose h4,
.article-prose h5 {
    font-family: "Figtree", system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.0625rem;
    line-height: 1.4;
    color: #0E1F33;
    margin-top: 1.6rem;
}

.article-prose h4 + * { margin-top: 0.5rem; }

.article-prose hr {
    border: 0;
    border-top: 1px solid color-mix(in oklch, #0E1F33 14%, transparent);
    margin-block: 2.3rem;
}

.article-prose .notion-callout {
    padding: 1.1rem 1.25rem;
    background: #F1ECE3;
    border-left: 3px solid #F2B33D;
}

.article-prose .notion-callout > * + * { margin-top: 0.75rem; }

.article-prose details {
    border-top: 1px solid color-mix(in oklch, #0E1F33 14%, transparent);
    border-bottom: 1px solid color-mix(in oklch, #0E1F33 14%, transparent);
    padding-block: 0.9rem;
}

.article-prose details > summary {
    cursor: pointer;
    font-weight: 600;
    color: #0E1F33;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.article-prose details > * + * { margin-top: 0.75rem; }

/* Back link */
.article-back {
    font-family: "Figtree", system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #0E1F33;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
}

.article-back .arrow {
    color: #F2B33D;
    font-size: 1.1rem;
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.article-back:hover .arrow { transform: translateX(-4px); }

.article-back:focus-visible {
    outline: 2px solid #0E1F33;
    outline-offset: 2px;
}

/* Footer navigation: post categories (deeper) + back to all (wider) */
.article-footer-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

@media (min-width: 768px) {
    .article-footer-nav {
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 3rem;
        align-items: end;
    }
}

.article-footer-categories {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}

/* Hide the whole categories block when the post has none. */
.article-footer-categories:not(:has(.wp-block-post-terms.article-categories a)) {
    display: none;
}

/* wp:post-terms renders comma-separated anchors; collapse the commas
   with font-size:0 on the wrapper, restore size on the anchors. */
.wp-block-post-terms.article-categories {
    display: flex;
    flex-wrap: wrap;
    column-gap: 1.5rem;
    row-gap: 0.4rem;
    align-items: baseline;
    font-size: 0;
    color: transparent;
    margin: 0;
}

.wp-block-post-terms.article-categories a {
    font-family: "Instrument Serif", Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.5rem, 2.4vw, 1.95rem);
    line-height: 1.15;
    letter-spacing: -0.005em;
    color: #0E1F33;
    text-decoration: underline;
    text-decoration-color: #F2B33D;
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
    transition:
        text-decoration-color 220ms cubic-bezier(0.22, 1, 0.36, 1),
        text-decoration-thickness 220ms cubic-bezier(0.22, 1, 0.36, 1),
        text-underline-offset 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.wp-block-post-terms.article-categories a:hover {
    text-decoration-thickness: 3px;
    text-decoration-color: #0E1F33;
    text-underline-offset: 6px;
}

.wp-block-post-terms.article-categories a:focus-visible {
    outline: 2px solid #0E1F33;
    outline-offset: 4px;
    text-decoration-color: #0E1F33;
}

/* On desktop, anchor the back link to the same baseline as the largest
   category serif type so the two paths sit on a shared visual line. */
@media (min-width: 768px) {
    .article-footer-nav .article-back {
        padding-bottom: 0.35rem;
    }
}

/* ─────────────────────────────────────────────────────────────────────
   Home news — asymmetric grid: featured (col-span-2 / 16:9 + badge)
   + secondary (4:3). Driven by :first-child since wp:post-template
   can't render per-item layout differences.
   ───────────────────────────────────────────────────────────────────── */

.news-grid {
    list-style: none;
    margin: 2.5rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .news-grid > li:first-child {
        grid-column: span 2 / span 2;
    }
}

.news-grid > li {
    list-style: none;
    margin: 0;
}

.news-card {
    display: block;
}

.news-card .wp-block-post-featured-image {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    margin: 0;
}

.news-card .wp-block-post-featured-image a {
    display: block;
    line-height: 0;
}

.news-card .wp-block-post-featured-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.news-card:hover .wp-block-post-featured-image img {
    transform: scale(1.05);
}

.news-grid > li:not(:first-child) .wp-block-post-featured-image img {
    aspect-ratio: 4 / 3;
}

.news-grid > li:first-child .wp-block-post-featured-image::after {
    content: "À la une";
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    z-index: 2;
    background: #F2B33D;
    color: #0E1F33;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-family: "Figtree", system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    pointer-events: none;
}

.news-card .news-date {
    margin: 1.25rem 0 0;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: color-mix(in oklch, #0E1F33 55%, transparent);
}

.news-card .news-title {
    margin: 0.5rem 0 0;
    max-width: 28ch;
    font-family: "Figtree", system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.15;
    color: #0E1F33;
    text-wrap: balance;
    font-size: 1.25rem;
}

.news-grid > li:first-child .news-title {
    font-size: clamp(1.5rem, 2.4vw, 1.875rem);
}

.news-card .news-title a {
    color: inherit;
    text-decoration: none;
    transition: color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.news-card:hover .news-title a {
    color: #1A2D4A;
}

.news-card .news-excerpt {
    margin: 0.75rem 0 0;
    font-family: "Figtree", system-ui, sans-serif;
    color: color-mix(in oklch, #0E1F33 70%, transparent);
    text-wrap: pretty;
    font-size: 0.875rem;
    line-height: 1.55;
}

.news-grid > li:first-child .news-excerpt {
    font-size: 1rem;
    max-width: 60ch;
}

.news-card .news-excerpt p {
    margin: 0;
}

.news-empty {
    margin: 3rem 0;
    color: color-mix(in oklch, #0E1F33 60%, transparent);
}

@media (prefers-reduced-motion: reduce) {
    .news-card .wp-block-post-featured-image img,
    .news-card:hover .wp-block-post-featured-image img {
        transition: none;
        transform: none;
    }
}

/* ─────────────────────────────────────────────────────────────────────
   Category archive — editorial header (article surface) + uniform 3-col
   card grid using the same visual language as the home news cards.
   ───────────────────────────────────────────────────────────────────── */

.archive-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem 1.75rem;
}

@media (min-width: 640px) {
    .archive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .archive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: clamp(3rem, 5vw, 4.5rem) clamp(2.5rem, 5vw, 4rem);
    }
}

.archive-grid > li {
    list-style: none;
    margin: 0;
}

.archive-card {
    display: block;
}

.archive-card .wp-block-post-featured-image {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    margin: 0;
    background-color: #F1ECE3;
}

.archive-card .wp-block-post-featured-image a {
    display: block;
    line-height: 0;
}

.archive-card .wp-block-post-featured-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.archive-card:hover .wp-block-post-featured-image img {
    transform: scale(1.04);
}

.archive-card .archive-date {
    margin: 1rem 0 0;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: color-mix(in oklch, #0E1F33 55%, transparent);
}

.archive-card .archive-title {
    margin: 0.4rem 0 0;
    max-width: 28ch;
    font-family: "Figtree", system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: #0E1F33;
    text-wrap: balance;
}

.archive-card .archive-title a {
    color: inherit;
    text-decoration: none;
    transition: color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.archive-card:hover .archive-title a {
    color: #1A2D4A;
}

.archive-card .archive-excerpt {
    margin: 0.5rem 0 0;
    font-family: "Figtree", system-ui, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: color-mix(in oklch, #0E1F33 72%, transparent);
    text-wrap: pretty;
    max-width: 42ch;
}

.archive-card .archive-excerpt p {
    margin: 0;
}

.archive-card .wp-block-post-excerpt__more-link {
    display: none;
}

.archive-pagination {
    margin-top: 3.5rem;
    justify-content: center;
    gap: 0.5rem;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.archive-pagination a,
.archive-pagination span {
    color: #0E1F33;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    transition: color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.archive-pagination a:hover {
    color: #F2B33D;
}

.archive-pagination .page-numbers.current {
    color: #F2B33D;
    border-bottom: 1.5px solid #F2B33D;
}

.archive-empty {
    margin: 4rem 0;
    font-size: 1.0625rem;
    color: color-mix(in oklch, #0E1F33 60%, transparent);
}

@media (prefers-reduced-motion: reduce) {
    .archive-card .wp-block-post-featured-image img,
    .archive-card:hover .wp-block-post-featured-image img {
        transition: none;
        transform: none;
    }
}

/* ─────────────────────────────────────────────────────────────────────
   Utility: screen reader text (fallback in case core's isn't loaded)
   ───────────────────────────────────────────────────────────────────── */

.screen-reader-text,
.sr-only {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* ─────────────────────────────────────────────────────────────────────
   Fluent Forms — habillage Communal Atelier
   Le plugin sort son propre CSS (bouton bleu, champs neutres). On le
   repeint dans la langue du thème, en portée .esq-form uniquement.
   ───────────────────────────────────────────────────────────────────── */

.esq-form .ff-el-group {
    margin-bottom: 1.25rem;
}

.esq-form .ff-el-input--label label {
    font-family: "Figtree", system-ui, sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #0E1F33;
}

.esq-form .ff-el-input--label .ff-el-is-required.asterisk-right:after {
    color: #B4551F;
}

.esq-form .ff-el-form-control {
    font-family: "Figtree", system-ui, sans-serif;
    font-size: 1rem;
    color: #0E1F33;
    background-color: #FCFAF5;
    border: 1px solid color-mix(in oklch, #0B1422 12%, transparent);
    border-radius: 0.25rem;
    padding: 0.75rem 1rem;
    box-shadow: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.esq-form .ff-el-form-control::placeholder {
    /* Le gris clair du plugin passe sous 4.5:1 ; on remonte vers l'encre. */
    color: color-mix(in oklch, #0E1F33 62%, transparent);
    opacity: 1;
}

.esq-form .ff-el-form-control:focus {
    border-color: #F2B33D;
    box-shadow: 0 0 0 3px color-mix(in oklch, #F2B33D 35%, transparent);
    outline: none;
}

.esq-form textarea.ff-el-form-control {
    min-height: 9rem;
}

.esq-form .ff-btn-submit,
.esq-form .ff_submit_btn_wrapper button {
    font-family: "Figtree", system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    background-color: #F2B33D !important;
    color: #081523 !important;
    border: 0;
    border-radius: 9999px;
    padding: 0.75rem 1.75rem;
    box-shadow: none;
    transition: background-color 300ms ease;
}

.esq-form .ff-btn-submit:hover,
.esq-form .ff_submit_btn_wrapper button:hover {
    background-color: #FDE3A6 !important;
}

.esq-form .ff-btn-submit:focus-visible,
.esq-form .ff_submit_btn_wrapper button:focus-visible {
    outline: 2px solid #081523;
    outline-offset: 2px;
}

.esq-form .ff-el-form-check-label,
.esq-form .ff-el-help-message {
    font-family: "Figtree", system-ui, sans-serif;
    color: color-mix(in oklch, #0E1F33 75%, transparent);
}

.esq-form .error.text-danger,
.esq-form .ff-el-is-error .text-danger {
    font-family: "Figtree", system-ui, sans-serif;
    font-size: 0.8125rem;
    /* Rouge argile teinté plutôt que le rouge pur du plugin. */
    color: #9E3B16;
}

.esq-form .ff-message-success {
    font-family: "Figtree", system-ui, sans-serif;
    background-color: #F1ECE3;
    border: 1px solid color-mix(in oklch, #0B1422 8%, transparent);
    border-radius: 0.5rem;
    color: #0E1F33;
    padding: 1rem 1.25rem;
}

/* Variante sur le panneau laiton : le bouton laiton y serait invisible. */
.esq-form-brass .ff-btn-submit,
.esq-form-brass .ff_submit_btn_wrapper button {
    background-color: #081523 !important;
    color: #F2B33D !important;
}

.esq-form-brass .ff-btn-submit:hover,
.esq-form-brass .ff_submit_btn_wrapper button:hover {
    background-color: #0E1F33 !important;
}

.esq-form-brass .ff-el-form-control {
    background-color: #FCFAF5;
    border-color: color-mix(in oklch, #081523 20%, transparent);
}

.esq-form-brass .ff-el-form-control:focus {
    border-color: #081523;
    box-shadow: 0 0 0 3px color-mix(in oklch, #081523 25%, transparent);
}

.esq-form-brass .ff-message-success {
    background-color: #FCFAF5;
}
