/*
Theme Name: Tout Chien
Theme URI: https://toutchien.fr
Author: Tout Chien
Description: Thème magazine léger pour Tout Chien ! — races, santé, blog. Sans Gutenberg, sans flux RSS, en-tête propre, DOM minimal.
Version: 2.0.0
Requires at least: 7.0
Tested up to: 7.0
Requires PHP: 8.5
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: toutchien
*/

@layer reset, base, layout, components;

@media (prefers-reduced-motion: no-preference) {
	@view-transition { navigation: auto; }
}

/* ============ reset ============ */
@layer reset {
	*, ::before, ::after { box-sizing: border-box; }
	html { -webkit-text-size-adjust: none; text-size-adjust: none; interpolate-size: allow-keywords; }
	body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
	ol, ul { padding: 0; list-style: none; }
	img, svg, video, iframe { display: block; max-inline-size: 100%; block-size: auto; }
	img:is([sizes="auto" i], [sizes^="auto," i]) { contain-intrinsic-size: 3000px 1500px; }
	input, button, select, textarea { font: inherit; color: inherit; }
	button { cursor: pointer; }
	[hidden] { display: none !important; }

	@media (prefers-reduced-motion: no-preference) {
		html { scroll-behavior: smooth; }
	}
}

/* ============ base ============ */
@layer base {
	:root {
		--ink: #1F1A16;
		--ink-2: #3A332D;
		--muted: #5E554D;
		--muted-2: #4A413A;
		--line: #EFE6DA;
		--line-2: #CFC3B5;
		--cream: #FFF4E0;
		--orange: #E8590C;
		--sun: #FFC531;
		--accent: #C2410C;
		--link: #B33C0A;
		--link-h: #7C2A07;
		--display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
		--body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
		--r: 1.125rem;
		--r-lg: 1.5rem;
		--max: 77.5rem;
		--pad: max(clamp(1rem, 4vw, 1.5rem), (100% - var(--max)) / 2);

		/* Icônes (masques CSS : zéro nœud SVG dans le DOM) */
		--i-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
		--i-menu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E");
		--i-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
		--i-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
		--i-paw: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 10a2 2 0 100-4 2 2 0 000 4zM9.5 6a2 2 0 100-4 2 2 0 000 4zM14.5 6a2 2 0 100-4 2 2 0 000 4zM19 10a2 2 0 100-4 2 2 0 000 4zM12 11c-3 0-6 4-6 6.5C6 19 7.2 20 8.7 20c1.2 0 2.1-.6 3.3-.6s2.1.6 3.3.6c1.5 0 2.7-1 2.7-2.5C18 15 15 11 12 11z'/%3E%3C/svg%3E");
		--i-health: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.8 5.6a5.5 5.5 0 00-7.8 0L12 6.7l-1-1.1a5.5 5.5 0 00-7.8 7.8L12 22l8.8-8.6a5.5 5.5 0 000-7.8zM12 10v5M9.5 12.5h5'/%3E%3C/svg%3E");
		--i-book: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5a2 2 0 012-2h12v16H6a2 2 0 00-2 2V5zM4 21a2 2 0 012-2h12M8 7h6M8 11h6'/%3E%3C/svg%3E");
		--i-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9v4M12 17h.01M10.3 3.9L2 18a2 2 0 001.7 3h16.6a2 2 0 001.7-3L13.7 3.9a2 2 0 00-3.4 0z'/%3E%3C/svg%3E");
		--ph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-opacity='.25' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 10a2 2 0 100-4 2 2 0 000 4zM9.5 6a2 2 0 100-4 2 2 0 000 4zM14.5 6a2 2 0 100-4 2 2 0 000 4zM19 10a2 2 0 100-4 2 2 0 000 4zM12 11c-3 0-6 4-6 6.5C6 19 7.2 20 8.7 20c1.2 0 2.1-.6 3.3-.6s2.1.6 3.3.6c1.5 0 2.7-1 2.7-2.5C18 15 15 11 12 11z'/%3E%3C/svg%3E");

		color-scheme: light;
		accent-color: var(--accent);
	}

	body {
		background: #fff;
		color: var(--ink);
		font: 400 1.0625rem/1.55 var(--body);
		-webkit-font-smoothing: antialiased;
	}

	h1, h2, h3, h4 {
		font-family: var(--display);
		line-height: 1.12;
		letter-spacing: -.01em;
		text-wrap: balance;
	}
	p, li, dd { text-wrap: pretty; }

	a {
		color: var(--link);
		text-decoration: none;
		&:hover { color: var(--link-h); }
	}

	:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

	::selection { background: var(--sun); color: var(--ink); }

	.skip {
		position: absolute; inset-inline-start: .5rem; inset-block-start: -4rem; z-index: 100;
		background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: .5rem;
		&:focus { inset-block-start: .5rem; color: #fff; }
	}

	.sr { position: absolute !important; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ============ layout ============ */
@layer layout {

	/* En-tête : un seul niveau, sans conteneur */
	.hd {
		position: relative; z-index: 20;
		display: flex; flex-wrap: wrap; align-items: center; gap: .625rem 1rem;
		padding: .875rem var(--pad);
		background: #fff; border-block-end: 1px solid var(--line);
		& > .logo { margin-inline-end: auto; }
	}

	/* Menu : popover sur mobile, barre en ligne sur grand écran */
	#nav {
		inset: 0 0 0 auto; margin: 0;
		inline-size: min(22rem, 100%); block-size: 100dvh;
		padding: 4.5rem 1.5rem 2rem;
		border: 0; background: #fff; color: var(--ink);
		box-shadow: -24px 0 48px -24px rgb(31 26 22 / .35);

		&:popover-open { display: flex; flex-direction: column; }
		&::backdrop { background: rgb(31 26 22 / .4); }

		& a {
			color: var(--ink); font-weight: 600; font-size: 1.2rem;
			padding: .8rem 0; border-block-end: 1px solid var(--line);
			&:hover, &[aria-current] { color: var(--link); }
		}
		transition: translate .25s ease;
		@starting-style { &:popover-open { translate: 100% 0; } }
	}

	@media (width >= 60rem) {
		#nav {
			display: flex; flex-wrap: wrap; gap: .25rem 1.75rem;
			position: static; inset: auto; inline-size: auto; block-size: auto;
			padding: 0; background: none; box-shadow: none; overflow: visible; transition: none;
			& a {
				font-size: 1rem; padding: .6rem 0; border: 0;
				&[aria-current] { text-decoration: underline 2px; text-underline-offset: 6px; }
			}
		}
	}

	/* Recherche (popover) */
	#search {
		inset: 0 0 auto; margin: 0; inline-size: 100%;
		padding: 1.25rem var(--pad);
		border: 0; background: var(--cream);
		&::backdrop { background: rgb(31 26 22 / .35); }
	}

	main { display: block; }

	.sec { padding: 4rem var(--pad); }
	.cream { background: var(--cream); }
	.dark { background: var(--ink); color: #fff; }

	/* Titre + lien « voir tout » sans conteneur */
	.sec:has(> .cards) {
		display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0 1rem;
		& > :not(h2, .more) { grid-column: 1 / -1; margin-block-start: 1.75rem; }
	}

	.h2, .sec > h2 { font-size: clamp(1.9rem, 3.6vw, 2.5rem); font-weight: 800; letter-spacing: -.015em; }
	.more { font-weight: 700; white-space: nowrap; }

	/* Pied de page */
	.ft {
		display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem;
		padding: 4rem var(--pad) 2rem;
		background: var(--ink); color: #E9E1D8;
		& a { color: #E9E1D8; &:hover { color: var(--sun); } }
		& h2 { font: 700 1rem/1.4 var(--body); color: #fff; letter-spacing: 0; margin-block-end: .75rem; }
		& nav { display: flex; flex-direction: column; gap: .6rem; align-items: start; }
		@media (width < 48rem) { grid-template-columns: minmax(0, 1fr); }
	}
	.ft-about {
		display: flex; flex-direction: column; align-items: start; gap: .9rem;
		max-inline-size: 28rem; color: var(--line-2);
	}
	.ft-legal {
		grid-column: 1 / -1;
		display: flex; flex-wrap: wrap; gap: .75rem 1.25rem;
		padding-block-start: 1.25rem; border-block-start: 1px solid var(--ink-2);
		font-size: .875rem; color: #B5A999;
		& span { margin-inline-end: auto; }
	}

	/* En-tête de page interne */
	.pg-hd {
		padding: 1.75rem var(--pad) 3.5rem; background: var(--cream);
		& h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); font-weight: 800; line-height: 1.04; letter-spacing: -.02em; }
		& .desc { margin-block-start: .9rem; font-size: 1.2rem; color: var(--muted-2); max-inline-size: 42rem; }
		& .sf { margin-block-start: 1.5rem; }
	}
}

/* ============ components ============ */
@layer components {
	/* Logo texte */
	.logo {
		display: inline-grid; line-height: .85; text-decoration: none;
		font: 800 2.5rem/.85 var(--display);
		color: var(--orange); text-shadow: 3px 3px 0 var(--sun);
		& small { font-size: 1rem; letter-spacing: .18em; padding-inline-start: 4px; }
		& img { max-block-size: 4rem; inline-size: auto; }
		&:hover { color: var(--accent); }
		@media (width < 60rem) { font-size: 2rem; & small { font-size: .85rem; } }
	}

	/* Boutons */
	.btn {
		display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
		min-block-size: 3rem; padding: 0 1.5rem; border-radius: 999px;
		border: 1.5px solid transparent; background: var(--accent); color: #fff;
		font-weight: 700; line-height: 1.2; text-decoration: none;
		transition: background-color .15s, color .15s;
		&:hover { background: var(--link-h); color: #fff; }
		&.sm { min-block-size: 2.75rem; padding: 0 1.25rem; font-size: .94rem; }
		&.alt { background: #fff; color: var(--ink); border-color: var(--ink); &:hover { background: var(--ink); color: #fff; } }
		&.dark { background: var(--ink); &:hover { background: #000; color: var(--sun); } }
		&.sun { background: var(--sun); color: var(--ink); &:hover { background: #fff; } }
		&.go::after { content: ""; inline-size: 1.1em; block-size: 1.1em; background: currentColor; mask: var(--i-arrow) center / contain no-repeat; }
	}

	/* Bouton icône (icône = ::before masqué) */
	.ib {
		display: inline-grid; place-items: center; flex: none;
		inline-size: 2.75rem; block-size: 2.75rem; border-radius: 50%;
		border: 1px solid #E3D8CA; background: #fff; color: var(--ink);
		&::before { content: ""; inline-size: 1.25rem; block-size: 1.25rem; background: currentColor; mask: var(--i) center / contain no-repeat; }
		&:hover { border-color: var(--ink); }
	}
	.i-search { --i: var(--i-search); }
	.i-menu { --i: var(--i-menu); }
	.i-close { --i: var(--i-close); }

	/* Boutons du menu mobile : dans ce calque (après .ib), sinon .ib l'emporte */
	#nav > .ib { position: absolute; inset: 1rem 1rem auto auto; }
	@media (width >= 60rem) {
		#nav > .ib, .hd > .i-menu { display: none; }
	}

	.kicker {
		justify-self: start; align-self: start; width: fit-content;
		background: var(--sun); color: var(--ink);
		font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
		padding: .375rem .75rem; border-radius: .375rem;
	}
	.tag {
		display: inline-block; padding: .375rem .75rem; border-radius: .375rem;
		background: #fff; border: 1px solid #E3D8CA; color: var(--ink); font-weight: 600; font-size: .8rem;
		&:hover { border-color: var(--ink); color: var(--ink); }
	}
	.cat { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--link); }

	/* Formulaire de recherche */
	.sf {
		display: flex; gap: .5rem; align-items: center; max-inline-size: 40rem;
		padding: .375rem .375rem .375rem 1.25rem;
		background: #fff; border: 1.5px solid var(--ink); border-radius: 999px;
		& input { flex: 1; min-inline-size: 0; block-size: 2.75rem; border: 0; outline: 0; background: none; }
		& input::placeholder { color: #8A7F74; }
		& .btn { min-block-size: 2.75rem; padding: 0 1.4rem; }
		&:focus-within { outline: 3px solid var(--sun); outline-offset: 2px; }
	}

	/* Vignette / fond de remplacement (pseudo-élément, pas de nœud) */
	.card, .breed, .mini, .post-hd {
		--tint: #FFE3C2;
		&:nth-child(6n+2) { --tint: #EDE3D7; }
		&:nth-child(6n+3) { --tint: #FFEFB0; }
		&:nth-child(6n+4) { --tint: #FFD9C7; }
		&:nth-child(6n+5) { --tint: #F7C98B; }
		&:nth-child(6n+6) { --tint: #E4ECD9; }
	}
	.noimg::before { content: ""; background: var(--tint) var(--ph) center / 3rem no-repeat; }

	/* Cartes article */
	.cards {
		display: grid; gap: 2.25rem 1.75rem;
		grid-template-columns: repeat(auto-fill, minmax(min(100%, 18.75rem), 1fr));
	}
	.card {
		position: relative; display: grid; align-content: start; gap: .75rem;
		& > img, &.noimg::before { inline-size: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r); }
		& h3 { font-size: 1.45rem; font-weight: 700; line-height: 1.18; }
		& h3 a { color: var(--ink); &::after { content: ""; position: absolute; inset: 0; } }
		&:hover h3 a { text-decoration: underline; text-underline-offset: 3px; }
		& > p:last-child { color: var(--muted); font-size: 1rem; }
	}

	/* Accueil — hero */
	.hero {
		display: grid; gap: 1.4rem 3rem; align-items: center;
		padding: 4rem var(--pad) 4.5rem; background: var(--cream);
		& h1 { font-size: clamp(2.5rem, 5.4vw, 4.25rem); font-weight: 800; line-height: 1.02; letter-spacing: -.02em; }
		& > p:not([class]) { font-size: 1.2rem; color: var(--muted-2); max-inline-size: 33rem; }
		& .cta { display: flex; flex-wrap: wrap; gap: .75rem; }
		@media (width >= 60rem) {
			grid-template-columns: 1fr 1fr;
			& > :not(.feature) { grid-column: 1; }
			& > .feature { grid-column: 2; grid-row: 1 / span 4; }
		}
	}
	.feature {
		background: #fff; border-radius: var(--r-lg); overflow: hidden; gap: .6rem;
		box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgb(80 40 0 / .35);
		& > img, &.noimg::before { aspect-ratio: 16 / 11; border-radius: 0; margin-block-end: .9rem; }
		& > :not(img) { margin-inline: 1.6rem; }
		& > p:last-child { margin-block-end: 1.75rem; }
		& h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); font-weight: 700; }
		& h2 a { color: var(--ink); &::after { content: ""; position: absolute; inset: 0; } }
		&:hover h2 a { text-decoration: underline; }
		& .badge {
			position: absolute; inset: 1.1rem auto auto 0; z-index: 1;
			background: var(--ink); color: #fff; font-size: .8rem; font-weight: 700;
			padding: .375rem .75rem; border-radius: .375rem;
		}
	}

	/* Rubriques */
	.tiles {
		display: grid; gap: 1rem; padding: 3.5rem var(--pad) 0;
		grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
	}
	.tile {
		display: grid; grid-template-columns: 3.25rem 1fr; column-gap: 1rem; align-items: center;
		padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--r);
		color: var(--muted); font-size: .94rem; line-height: 1.35;
		transition: border-color .15s, translate .15s;
		&::before, &::after { content: ""; grid-area: 1 / 1 / 3 / 2; inline-size: 3.25rem; block-size: 3.25rem; }
		&::before { border-radius: .875rem; background: #FFE3C2; }
		&::after { background: var(--ink); mask: var(--ti) center / 1.6rem no-repeat; }
		& b { font: 700 1.25rem/1.2 var(--display); color: var(--ink); align-self: end; }
		&:hover { border-color: var(--ink); translate: 0 -2px; color: var(--muted); }
		&:nth-child(1) { --ti: var(--i-paw); }
		&:nth-child(2) { --ti: var(--i-health); &::before { background: #FFEFB0; } }
		&:nth-child(3) { --ti: var(--i-book); &::before { background: #EDE3D7; } }
	}

	/* Races */
	.races {
		display: grid; gap: 0 2rem;
		& > p { margin-block: .5rem 1.5rem; color: var(--muted-2); }
		@media (width >= 60rem) {
			grid-template-columns: 1fr 1fr;
			& > h2, & > p { grid-column: 1; }
			& > .sf { grid-column: 2; grid-row: 1 / 3; align-self: center; justify-self: end; inline-size: 100%; }
			& > :nth-child(n+4) { grid-column: 1 / -1; }
		}
	}
	.chips {
		display: flex; flex-wrap: wrap; gap: .5rem; margin-block: .5rem 2rem;
		& a {
			display: inline-flex; align-items: center; min-block-size: 2.75rem; padding: 0 1.1rem;
			border-radius: 999px; border: 1.5px solid var(--line-2); background: #fff;
			color: var(--ink); font-size: .94rem; font-weight: 600;
			&:hover { border-color: var(--ink); }
			&[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
		}
	}
	.breeds {
		display: grid; gap: 1.25rem;
		grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
	}
	.breed {
		position: relative; display: grid; align-content: start; gap: .25rem;
		background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
		padding-block-end: 1.25rem;
		& > img, &.noimg::before { inline-size: 100%; aspect-ratio: 5 / 4; object-fit: cover; margin-block-end: .75rem; }
		& > :not(img) { margin-inline: 1.1rem; }
		& h3 { font-size: 1.3rem; font-weight: 700; }
		& h3 a { color: var(--ink); &::after { content: ""; position: absolute; inset: 0; } }
		&:hover h3 a { text-decoration: underline; text-underline-offset: 3px; }
		& p { font-size: .875rem; color: var(--muted); }
		.cream & { border-color: transparent; }
	}

	/* Santé */
	.health {
		display: grid; gap: 1.1rem 3rem; align-items: start;
		& > h2 { font-size: clamp(2.1rem, 4vw, 2.75rem); font-weight: 800; line-height: 1.05; }
		& > p:not([class]) { color: #D9CFC4; }
		& > .btn { justify-self: start; }
		@media (width >= 60rem) {
			grid-template-columns: 1fr 1fr;
			& > :not(ol) { grid-column: 1; }
			& > ol { grid-column: 2; grid-row: 1 / span 6; }
		}
	}
	.alert {
		display: grid; grid-template-columns: 2.75rem 1fr; gap: 0 1rem; margin-block-start: 1rem;
		padding: 1.4rem; border: 1px solid var(--muted-2); border-radius: var(--r);
		&::before {
			content: ""; grid-row: 1 / 3; inline-size: 2.75rem; block-size: 2.75rem; border-radius: .75rem;
			background: var(--orange) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9v4M12 17h.01M10.3 3.9L2 18a2 2 0 001.7 3h16.6a2 2 0 001.7-3L13.7 3.9a2 2 0 00-3.4 0z'/%3E%3C/svg%3E") center / 1.35rem no-repeat;
		}
		& b { color: var(--sun); font-size: .875rem; letter-spacing: .06em; text-transform: uppercase; }
		& a { color: #fff; font: 700 1.3rem/1.25 var(--display); &:hover { color: var(--sun); } }
	}
	.hl {
		counter-reset: hl;
		& li { counter-increment: hl; border-block-end: 1px solid var(--ink-2); }
		& a {
			display: grid; grid-template-columns: 2.25rem 1fr 1.25rem; align-items: baseline; gap: 1rem;
			padding: 1.25rem 0; color: #fff; font: 600 1.3rem/1.25 var(--display);
			&::before { content: counter(hl, decimal-leading-zero); color: var(--sun); font-size: .94rem; font-weight: 700; }
			&::after { content: ""; align-self: center; inline-size: 1.25rem; block-size: 1.25rem; background: var(--sun); mask: var(--i-arrow) center / contain no-repeat; }
			&:hover { color: var(--sun); }
		}
	}


	/* Bloc sombre en fin de page : ne pas le coller au pied de page sombre */
	main > .dark:last-child { margin-block-end: 4.5rem; }

	/* Fil d'Ariane */
	.bc {
		display: flex; flex-wrap: wrap; gap: .5rem; margin-block-end: 1.75rem;
		font-size: .94rem; color: var(--muted);
		& > * + *::before { content: "/" / ""; margin-inline-end: .5rem; color: #A39789; }
	}

	/* Article / fiche race */
	.post-hd {
		display: grid; gap: 1.1rem 3rem; align-items: center;
		padding: 1.75rem var(--pad) 3.5rem; background: var(--cream);
		& > .bc { grid-column: 1 / -1; margin: 0; }
		& h1 { font-size: clamp(2.3rem, 5.2vw, 4.25rem); font-weight: 800; line-height: 1.02; letter-spacing: -.02em; }
		& .lede { font-size: 1.3rem; color: var(--muted-2); max-inline-size: 35rem; }
		& .tags { display: flex; flex-wrap: wrap; gap: .5rem; }
		& > img, &.noimg::before { inline-size: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-lg); }
		&::before { order: 99; }
		@media (width >= 60rem) {
			&:is(:has(> img), .noimg) {
				grid-template-columns: 1fr 1fr;
				& > :not(.bc, img) { grid-column: 1; }
				& > img, &::before { grid-column: 2; grid-row: 2 / span 4; }
			}
		}
	}
	.by {
		font-size: .94rem; color: var(--muted);
		& a { font-weight: 700; }
	}

	.post-body {
		display: grid; grid-template-columns: minmax(0, 46rem); justify-content: center; gap: 0 3.5rem;
		padding: 3.5rem var(--pad) 4rem;
		&:has(> aside) {
			@media (width >= 60rem) {
				grid-template-columns: minmax(0, 1fr) minmax(17rem, 21rem);
				grid-template-rows: auto auto auto 1fr;
				justify-content: stretch;
				& > :not(aside) { grid-column: 1; max-inline-size: 46rem; }
				& > aside { grid-column: 2; grid-row: 1 / 5; }
			}
		}
		& > aside { display: grid; gap: 1.5rem; align-content: start; margin-block-start: 2.5rem; @media (width >= 60rem) { margin: 0; } }
	}

	.toc {
		display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-block-end: 2.5rem;
		padding: 1.25rem 1.5rem; border: 1px solid var(--line); border-radius: var(--r);
		& b { flex-basis: 100%; font-size: .875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
		& a { font-weight: 600; }
	}

	/* Contenu éditorial (éditeur classique) */
	.prose {
		font-size: 1.125rem; line-height: 1.65;
		& > * + * { margin-block-start: 1.1em; }
		& h2 { font-size: 2rem; font-weight: 800; margin-block-start: 1.6em; scroll-margin-block-start: 1.5rem; }
		& h3 { font-size: 1.5rem; font-weight: 700; margin-block-start: 1.4em; }
		& h4 { font-size: 1.25rem; font-weight: 700; margin-block-start: 1.3em; }
		& :is(h2, h3, h4) + * { margin-block-start: .5em; }
		& a { text-decoration: underline; text-underline-offset: 3px; }
		& :is(ul, ol) { padding-inline-start: 1.3em; }
		& ul { list-style: disc; }
		& ol { list-style: decimal; }
		& li + li { margin-block-start: .35em; }
		& li::marker { color: var(--orange); }
		& img { border-radius: .875rem; }
		& :is(figcaption, .wp-caption-text) { font-size: .94rem; color: var(--muted); margin-block-start: .5rem; }
		& .wp-caption { max-inline-size: 100%; }
		& blockquote {
			margin-block: 2rem; padding: 1.75rem 1.9rem; background: var(--cream); border-radius: 1.25rem;
			& p { font: 700 1.5rem/1.3 var(--display); }
			& cite { display: block; margin-block-start: .75rem; font-size: .94rem; font-style: normal; color: var(--muted); }
		}
		& table { inline-size: 100%; border-collapse: collapse; font-size: 1rem; display: block; overflow-x: auto; }
		& :is(th, td) { border-block-end: 1px solid var(--line); padding: .6rem .75rem; text-align: start; }
		& th { background: var(--cream); }
		& hr { border: 0; border-block-start: 1px solid var(--line); margin-block: 2.5rem; }
		& .alignleft { float: inline-start; margin: 0 1.5rem 1rem 0; }
		& .alignright { float: inline-end; margin: 0 0 1rem 1.5rem; }
		& .aligncenter { margin-inline: auto; }
		@media (width < 40rem) { & :is(.alignleft, .alignright) { float: none; margin: 1rem 0; } }
		&::after { content: ""; display: table; clear: both; }
	}

	.share {
		display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
		margin-block-start: 2rem; padding-block-start: 1.5rem; border-block-start: 1px solid var(--line);
		& b { margin-inline-end: .4rem; }
		& :is(a, button) {
			display: inline-flex; align-items: center; min-block-size: 2.75rem; padding: 0 1.1rem;
			border-radius: 999px; border: 1px solid var(--line-2); background: #fff;
			color: var(--ink); font-size: .94rem; font-weight: 600;
			&:hover { border-color: var(--ink); }
		}
	}
	.tags-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-block-start: 1.5rem; }

	/* Encadrés de la fiche race */
	.box {
		padding: 1.6rem; border: 1px solid var(--line); border-radius: 1.4rem;
		& h2 { font-size: 1.5rem; font-weight: 800; margin-block-end: .9rem; }
		&.ink { background: var(--ink); color: #fff; border: 0; }
		&.cream { border-color: transparent; }
	}
	.idc {
		display: grid; grid-template-columns: auto 1fr; font-size: 1rem;
		& :is(dt, dd) { padding-block: .75rem; border-block-end: 1px solid var(--ink-2); }
		& dt { color: var(--line-2); }
		& dd { font-weight: 700; text-align: end; }
		& :is(dt, dd):nth-last-child(-n+2) { border: 0; }
	}
	.g {
		display: grid; grid-template-columns: 1fr auto; gap: .375rem 1rem; font-size: 1rem;
		& + .g { margin-block-start: 1rem; }
		& span { color: var(--muted); }
		& meter {
			grid-column: 1 / -1; inline-size: 100%; block-size: .5rem;
			appearance: none; border: 0; background: var(--line);
			/* 5 segments */
			mask: repeating-linear-gradient(90deg, #000 0 calc(20% - 4px), transparent calc(20% - 4px) 20%);
			&::-webkit-meter-bar { background: var(--line); border: 0; block-size: .5rem; }
			&::-webkit-meter-optimum-value { background: var(--orange); }
			&::-moz-meter-bar { background: var(--orange); }
		}
	}
	.mini {
		display: grid; grid-template-columns: 3.5rem 1fr; gap: .9rem; align-items: center;
		padding-block: .5rem; color: var(--ink); font: 700 1.1rem/1.2 var(--display);
		& > img, &.noimg::before { inline-size: 3.5rem; block-size: 3.5rem; object-fit: cover; border-radius: .875rem; }
		&:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
	}

	/* Pagination */
	.pg {
		display: flex; flex-wrap: wrap; gap: .375rem; justify-content: center; margin-block-start: 3rem;
		& > * {
			display: inline-grid; place-items: center; min-inline-size: 2.75rem; block-size: 2.75rem; padding: 0 .9rem;
			border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink); font-weight: 700;
		}
		& .current { background: var(--ink); color: #fff; border-color: var(--ink); }
		& .dots { border: 0; }
		& a:hover { border-color: var(--ink); }
	}

	.empty { padding: 2.5rem; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--muted); }

	/* Commentaires */
	.comments {
		margin-block-start: 3.5rem; padding-block-start: 2rem; border-block-start: 1px solid var(--line);
		& h2 { font-size: 1.75rem; margin-block-end: 1rem; }
		& .children { padding-inline-start: 1.5rem; }
		& .comment-body { padding-block: 1.1rem; border-block-end: 1px solid var(--line); }
		& .comment-meta { font-size: .875rem; color: var(--muted); }
		& .avatar { border-radius: 50%; display: inline-block; vertical-align: middle; margin-inline-end: .5rem; }
		& label { display: block; font-weight: 600; margin-block-end: .25rem; }
		& :is(input[type="text"], input[type="email"], input[type="url"], textarea) { inline-size: 100%; border: 1.5px solid var(--line-2); border-radius: .875rem; padding: .75rem .9rem; }
		& .submit { min-block-size: 3rem; padding: 0 1.5rem; border-radius: 999px; border: 0; background: var(--accent); color: #fff; font-weight: 700; }
		& p + p { margin-block-start: 1rem; }
	}

	/* Formulaire de contact */
	.cf {
		display: grid; gap: 1.25rem; align-content: start;
		grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
		& label { display: grid; gap: .4rem; font-weight: 600; }
		& :is(.full, .chk, .ok, .err, button) { grid-column: 1 / -1; }
		& :is(input:not([type="checkbox"]), select, textarea) {
			inline-size: 100%; min-block-size: 3rem; padding: .75rem 1rem;
			border: 1.5px solid var(--line-2); border-radius: .875rem; background: #fff; font-weight: 400;
			&:focus-visible { border-color: var(--ink); }
			&:user-invalid, &[aria-invalid="true"] { border-color: #B42318; }
			&:is(textarea) { field-sizing: content; min-block-size: 10rem; resize: vertical; }
		}
		& select { &, &::picker(select) { appearance: base-select; } }
		& .chk {
			grid-template-columns: auto 1fr; align-items: start; gap: .75rem;
			font-weight: 400; font-size: .94rem; color: var(--muted);
			& input { inline-size: 1.25rem; block-size: 1.25rem; margin: .15rem 0 0; }
			&:has([aria-invalid]) { color: #B42318; }
		}
		& .hp { position: absolute; inset-inline-start: -100vw; inline-size: 1px; }
		& button { justify-self: start; border: 0; }
	}
	.ok, .err { padding: 1rem 1.25rem; border-radius: var(--r); font-weight: 600; }
	.ok { background: #E4ECD9; color: #1E4620; }
	.err { background: #FDECEA; color: #8A1C12; }
	.box p + p { margin-block-start: .75rem; }
	.links { display: flex; flex-direction: column; gap: .4rem; }

	/* 404 */
	.e404 {
		display: grid; justify-items: center; gap: 1.25rem; text-align: center;
		padding: 6rem var(--pad); background: var(--cream);
		& h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); font-weight: 800; line-height: 1.04; }
		& p { font-size: 1.2rem; color: var(--muted-2); max-inline-size: 36rem; }
		& .sf { inline-size: 100%; }
	}
}
