/*
 * « Actualités » — section 08/08 of the validated homepage, the posts index
 * (templates/home.html), the resource lists (« Documents à télécharger »,
 * templates/archive-ressource.html) and the article page (templates/single.html).
 * Loaded when a post-template carries .is-style-gb-actus / .is-style-gb-fichiers,
 * or a group carries .is-style-gb-article.
 *
 * Colours: currentColor and presets only. Rules: structural 22 %, accent full ink.
 */

/* ───────────────────────────────────────── shared: titles of a card or a row ── */
/* Headings are uppercase Unbounded by theme.json; in a list the title is a line
   of text, sentence case, 800, tight. Read from the mockup (.actu h3). */
.is-style-gb-actus .wp-block-post-title,
.is-style-gb-fichiers .wp-block-post-title { text-transform: none; font-size: 1.05rem; line-height: 1.3;
	font-weight: 800; letter-spacing: -0.03em; }
.is-style-gb-actus .wp-block-post-title a,
.is-style-gb-fichiers .wp-block-post-title a { text-decoration: none; color: inherit; }
.is-style-gb-actus .wp-block-post-title a:hover,
.is-style-gb-fichiers .wp-block-post-title a:hover { text-decoration: underline; text-decoration-thickness: 3px;
	text-underline-offset: 0.2em; }

/* ─────────────────────────────────────────────────────────── news cards ── */
/* The grid comes from the block's own layout (3 columns); only the gap and the
   breakpoints are ours. */
.wp-block-post-template.is-style-gb-actus { gap: clamp(1.5rem, 3vw, 2.5rem); margin-block-start: clamp(0.75rem, 2vw, 1.5rem); }

/* A card: accent rule on top (full ink), fading to 55 % on hover. The whole card
   is the link (see the title's ::after), so the image needs no link of its own —
   one tab stop per card, as the mockup's tabindex="-1" intended. */
.is-style-gb-actus > .wp-block-post { position: relative; display: grid; gap: 0.7rem; align-content: start;
	border-block-start: 6px solid currentColor; padding-block-start: 1.1rem; transition: border-color 0.22s; }
.is-style-gb-actus > .wp-block-post > * { margin-block: 0; }
.is-style-gb-actus > .wp-block-post:hover { border-color: color-mix(in oklab, currentColor 55%, transparent); }
.is-style-gb-actus .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; }
.is-style-gb-actus > .wp-block-post:focus-within { outline: 3px solid currentColor; outline-offset: 3px; }
.is-style-gb-actus .wp-block-post-title a:focus-visible { outline: none; }

.is-style-gb-actus .wp-block-post-featured-image { margin: 0; overflow: hidden; }
.is-style-gb-actus .wp-block-post-featured-image img { display: block; inline-size: 100%; block-size: auto;
	aspect-ratio: 3 / 2; object-fit: cover; transition: scale 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.is-style-gb-actus > .wp-block-post:hover .wp-block-post-featured-image img { scale: 1.05; }

/* Date: Martian Mono (preset on the block), spaced, 72 %. */
.is-style-gb-actus .wp-block-post-date { letter-spacing: 0.12em; opacity: 0.72;
	font-variation-settings: "wdth" 84; font-feature-settings: "tnum"; }

/* Excerpt: the « note » of the mockup. */
.is-style-gb-actus .wp-block-post-excerpt { font-size: 0.9375rem; line-height: 1.5; opacity: 0.78; }
.is-style-gb-actus .wp-block-post-excerpt p { margin: 0; }

@media (max-width: 1000px) {
	.wp-block-post-template.is-style-gb-actus { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
	.wp-block-post-template.is-style-gb-actus { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
	.is-style-gb-actus .wp-block-post-featured-image img { transition: none; }
	.is-style-gb-actus > .wp-block-post:hover .wp-block-post-featured-image img { scale: 1; }
}

/* ───────────────────────────────────────────────────────── resource rows ── */
/* Rows separated by structural rules (3 px, 22 %), closed by one at the bottom. */
.wp-block-post-template.is-style-gb-fichiers { margin-block-start: clamp(0.75rem, 2vw, 1.5rem);
	border-block-end: 3px solid color-mix(in oklab, currentColor 22%, transparent); }
.is-style-gb-fichiers > .wp-block-post { margin-block: 0; padding-block: clamp(1rem, 2vw, 1.5rem);
	border-block-start: 3px solid color-mix(in oklab, currentColor 22%, transparent); }
.is-style-gb-fichiers .gb-fichier { gap: 1rem clamp(1.5rem, 3vw, 3rem); }
.is-style-gb-fichiers .gb-fichier__texte { display: grid; gap: 0.5rem; }
.is-style-gb-fichiers .gb-fichier__texte > * { margin-block: 0; }
.is-style-gb-fichiers .gb-fichier__meta { gap: 0.4rem 1.2rem; opacity: 0.72; }
/* A resource without a file has no weight: the bound paragraph comes back empty. */
.is-style-gb-fichiers .gb-fichier__meta > p:empty { display: none; }
.is-style-gb-fichiers .wp-block-buttons { margin: 0; }
.is-style-gb-fichiers .wp-block-button__link:empty { display: none; }

/* ─────────────────────────────────────────────────────────── the article ── */
.is-style-gb-article .gb-article__meta { gap: 0.4rem 1.2rem; letter-spacing: 0.12em; opacity: 0.72;
	font-variation-settings: "wdth" 84; font-feature-settings: "tnum"; text-transform: uppercase; }
.is-style-gb-article .gb-article__meta > * { margin-block: 0; }
.is-style-gb-article .gb-article__meta a { text-decoration: none; color: inherit; }
.is-style-gb-article .gb-article__meta a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.2em; }
/* The uppercase h1 has no descenders: without extra air the image sits on it. */
.is-style-gb-article .wp-block-post-featured-image { margin: 0; margin-block-start: clamp(2rem, 4vw, 3rem); }
.is-style-gb-article .wp-block-post-featured-image img { display: block; inline-size: 100%; block-size: auto; }

/* Reading width. The socle's .is-style-gb-texte clamps the element that carries
   it; on the post-content wrapper that would pin a 66ch box to the left edge of a
   full-width block. Lift it from the wrapper and apply it to each child instead,
   so the constrained layout still centres the prose and wide images still break out. */
.is-style-gb-article .wp-block-post-content.is-style-gb-texte { max-inline-size: none; }
.is-style-gb-article .wp-block-post-content.is-style-gb-texte > :where(:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright)) {
	max-inline-size: var(--wp--custom--mesure); }

/* Intertitles of an article (11/09): the section-title size of the socle's h2 is
   made for a pan, not for prose — one step down. And the measure is in ch, which a
   heading reads in its OWN (huge) font: 66ch of Unbounded is wider than the page,
   so the box filled the width and the title sat on the left edge. Headings get the
   paragraphs' measure in rem (66ch of the body font ≈ 45rem). */
.is-style-gb-article .wp-block-post-content.is-style-gb-texte > :is(h2, h3) { max-inline-size: 45rem; }
.is-style-gb-article .wp-block-post-content.is-style-gb-texte > h2 { font-size: var(--wp--preset--font-size--x-large); }

/* Footer: the download button (resources only — empty, hence hidden, on a post)
   and the way back to the list. */
.is-style-gb-article .gb-article__pied { gap: 1rem 2rem; padding-block-start: clamp(1rem, 2vw, 1.5rem);
	border-block-start: 3px solid color-mix(in oklab, currentColor 22%, transparent); }
.is-style-gb-article .gb-article__pied > * { margin-block: 0; }
.is-style-gb-article .gb-article__pied .wp-block-buttons { margin: 0; }
.is-style-gb-article .gb-article__pied .wp-block-button__link:empty { display: none; }
/* …and its wrapper too, so it does not keep a flex slot and push the back link right. */
.is-style-gb-article .gb-article__pied .wp-block-buttons:has(> .wp-block-button > .wp-block-button__link:empty) { display: none; }

/* ──────────────────────────────────────────────────────────── pagination ── */
.gb-pagination { font-family: var(--wp--preset--font-family--heading); font-size: 0.6875rem; font-weight: 700;
	letter-spacing: 0.08em; text-transform: uppercase; margin-block-start: clamp(2rem, 4vw, 3rem);
	padding-block-start: 1.1rem; border-block-start: 3px solid color-mix(in oklab, currentColor 22%, transparent); }
.gb-pagination a { text-decoration: none; }
.gb-pagination a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.3em; }
.gb-pagination .page-numbers { display: inline-block; min-inline-size: 24px; min-block-size: 24px; padding: 0.5rem 0.55rem; text-align: center; }
/* The ink comes from the couple, not from currentColor: the second rule below changes
   this element's colour, and currentColor would resolve against THAT — ground on ground,
   an invisible current page (greenbay.css, « the ground and ink variables »). */
.gb-pagination .page-numbers.current { background: var(--gb-encre); color: var(--gb-fond); }
