/*
Theme Name: Famille
Author: Auguste
Description: Thème chaleureux pour un site de généalogie familiale. Menu brun ancien, palette parchemin et bois, page d'arbre généalogique interactif (plugin tng-wp-arbre), modèles pour les familles et les documents d'archives.
Version: 1.4.1
Requires at least: 6.3
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: famille
Tags: custom-menu, custom-logo, featured-images, blog, accessibility-ready
*/

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
	--nuit: #49372C;
	--nuit-2: #5C4535;
	--nuit-3: #38291F;
	--laiton: #C7A17A;
	--laiton-fonce: #79583D;
	--laiton-clair: #E0C3A0;
	--creme: #F2E1CF;
	--creme-2: #E8D2BA;
	--creme-3: #FBF5EE;
	--texte: #302820;
	--texte-doux: #66594F;
	--filet: rgba(176, 141, 87, .45);
	--titre: 'Lora', Georgia, 'Times New Roman', serif;
	--corps: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--largeur-menu: 292px;
	--largeur-texte: 46rem;
	--rayon: 6px;
	--ombre: 0 1px 2px rgba(31, 45, 69, .08), 0 6px 18px rgba(31, 45, 69, .08);
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body.famille {
	margin: 0;
	background-color: var(--creme);
	background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .36 0 0 0 0 .2 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	color: var(--texte);
	font-family: var(--corps);
	font-size: 1.125rem;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; }

a { color: var(--laiton-fonce); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--nuit); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--laiton); outline-offset: 2px; }

:where(h1, h2, h3, h4, h5, h6) {
	font-family: var(--titre);
	font-weight: 600;
	line-height: 1.25;
	color: var(--nuit);
	margin: 2rem 0 .75rem;
}
:where(h1) { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-top: 0; }
:where(h2) { font-size: clamp(1.45rem, 3vw, 1.85rem); }
:where(h3) { font-size: 1.3rem; }
:where(h4) { font-size: 1.12rem; }

p { margin: 0 0 1.2em; }
strong, b { font-weight: 600; }
hr { border: 0; height: 24px; background: url("assets/img/ornement.svg") center / 240px 24px no-repeat; margin: 2.5rem 0; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto;
	top: .75rem; left: .75rem; z-index: 1000;
	background: var(--creme); color: var(--nuit);
	padding: .6rem 1rem; border-radius: var(--rayon); box-shadow: var(--ombre);
}

/* ==========================================================================
   Menu latéral
   ========================================================================== */
.site-sidebar {
	position: fixed;
	inset: 0 auto 0 0;
	width: var(--largeur-menu);
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	padding: 2rem 1.4rem 1.5rem;
	background: linear-gradient(180deg, var(--nuit) 0%, var(--nuit-3) 100%);
	color: var(--creme);
	border-right: 4px double var(--laiton);
	overflow-y: auto;
	z-index: 50;
}

.site-brand { text-align: center; }
.site-brand a { color: inherit; text-decoration: none; display: block; }
.site-brand__logo { display: block; width: 64px; height: 64px; margin: 0 auto .6rem; color: var(--laiton-clair); }
.site-brand .custom-logo { width: auto; max-height: 84px; margin: 0 auto .6rem; display: block; }
.site-title {
	font-family: var(--titre);
	font-size: 2rem;
	font-weight: 600;
	line-height: 1.15;
	margin: 0;
	color: var(--creme);
	letter-spacing: .01em;
}
.site-tagline { margin: .35rem 0 0; font-size: .95rem; font-style: italic; color: var(--laiton-clair); line-height: 1.4; }

.site-brand::after {
	content: "";
	display: block;
	height: 24px;
	margin-top: 1rem;
	background: url("assets/img/ornement.svg") center / 200px 20px no-repeat;
}

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li { margin: 0; }
.site-nav a {
	display: block;
	padding: .62rem .9rem;
	border-left: 3px solid transparent;
	border-radius: 0 var(--rayon) var(--rayon) 0;
	color: var(--creme);
	font-weight: 600;
	font-size: 1.05rem;
	text-decoration: none;
	transition: background-color .15s, border-color .15s;
}
.site-nav a:hover,
.site-nav a:focus-visible {
	background: rgba(245, 240, 230, .08);
	border-left-color: var(--laiton);
	color: #fff;
}
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a,
.site-nav .current-menu-ancestor > a,
.site-nav .current-page-ancestor > a {
	background: rgba(176, 141, 87, .18);
	border-left-color: var(--laiton-clair);
	color: #fff;
}
.site-nav ul ul { margin: .1rem 0 .4rem 1.1rem; border-left: 1px solid rgba(212, 183, 133, .3); }
.site-nav ul ul a { font-weight: 400; font-size: .98rem; padding: .4rem .8rem; }

.sidebar-cta { margin-top: auto; display: grid; gap: .6rem; }
.sidebar-cta .btn { justify-content: center; width: 100%; }
.sidebar-cta__lien {
	text-align: center; font-size: .95rem; color: var(--laiton-clair);
}
.sidebar-cta__lien a { color: inherit; }
.sidebar-cta__lien a:hover { color: #fff; }

/* Barre du haut + bouton menu (mobile) */
.site-topbar { display: none; }
.menu-close { display: none; }
.menu-overlay { display: none; }

.menu-toggle {
	display: inline-flex; align-items: center; gap: .6rem;
	background: transparent; color: var(--creme);
	border: 1px solid var(--laiton); border-radius: var(--rayon);
	padding: .45rem .8rem; font: 600 1rem var(--corps); cursor: pointer;
}
.menu-toggle__barres, .menu-toggle__barres::before, .menu-toggle__barres::after {
	display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px;
	transition: transform .2s, opacity .2s;
}
.menu-toggle__barres { position: relative; }
.menu-toggle__barres::before, .menu-toggle__barres::after { content: ""; position: absolute; left: 0; }
.menu-toggle__barres::before { top: -6px; }
.menu-toggle__barres::after { top: 6px; }
.menu-open .menu-toggle__barres { background: transparent; }
.menu-open .menu-toggle__barres::before { transform: translateY(6px) rotate(45deg); }
.menu-open .menu-toggle__barres::after { transform: translateY(-6px) rotate(-45deg); }

/* ==========================================================================
   Zone principale
   ========================================================================== */
.site-shell { margin-left: var(--largeur-menu); min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 3rem clamp(1.25rem, 4vw, 3.5rem) 2rem; }

.entry, .page-header { max-width: var(--largeur-texte); margin-inline: auto; }
.entry--large { max-width: none; }
.entry__header, .page-header { margin-bottom: 1.8rem; }
.entry__titre { margin-bottom: .5rem; }
.entry__meta { font-size: .98rem; color: var(--texte-doux); display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; }
.entry__meta a { color: inherit; }
.entry__vignette { margin: 0 0 1.8rem; }
.entry__vignette img { display: block; width: 100%; border-radius: var(--rayon); border: 1px solid var(--filet); padding: 6px; background: var(--creme-3); }

.page-header h1 { margin-bottom: .4rem; }
.page-header p { color: var(--texte-doux); margin: 0; }
.page-header::after {
	content: ""; display: block; height: 22px; margin-top: 1.2rem;
	background: url("assets/img/ornement.svg") left center / 200px 20px no-repeat;
}

.pastille {
	display: inline-block; padding: .12rem .7rem; border-radius: 999px;
	background: var(--creme-2); border: 1px solid var(--filet);
	color: var(--laiton-fonce); font-size: .9rem; font-weight: 600; text-decoration: none;
}
a.pastille:hover { background: var(--nuit); color: var(--creme); }

/* Contenu éditorial */
.entry-content > * { max-width: 100%; }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; margin: 0 0 1.2em; }
.entry-content li { margin-bottom: .3em; }
.entry-content li::marker { color: var(--laiton); }

blockquote, .wp-block-quote {
	margin: 1.8rem 0; padding: .4rem 0 .4rem 1.4rem;
	border-left: 4px solid var(--laiton);
	font-family: var(--titre); font-style: italic; font-size: 1.15rem; color: var(--nuit);
}
blockquote p:last-child { margin-bottom: 0; }
blockquote cite, .wp-block-quote cite { display: block; margin-top: .5rem; font: normal .95rem var(--corps); color: var(--texte-doux); }

.entry-content figure { margin: 1.8rem 0; }
.entry-content figure img,
.entry-content .wp-block-image img {
	border: 1px solid var(--filet); padding: 6px; background: var(--creme-3);
	border-radius: 3px; box-shadow: var(--ombre);
}
figcaption, .wp-element-caption { font-size: .92rem; font-style: italic; color: var(--texte-doux); text-align: center; margin-top: .5rem; }

.entry-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 1rem; background: var(--creme-3); }
.entry-content th, .entry-content td { padding: .55rem .8rem; border: 1px solid var(--filet); text-align: left; vertical-align: top; }
.entry-content thead th, .entry-content th { background: var(--nuit); color: var(--creme); font-weight: 600; }
.entry-content tbody tr:nth-child(even) td { background: rgba(237, 229, 211, .55); }
.wp-block-table { overflow-x: auto; }

code, pre { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .92em; }
pre { background: var(--nuit); color: var(--creme); padding: 1rem; border-radius: var(--rayon); overflow-x: auto; }
:not(pre) > code { background: var(--creme-2); padding: .1rem .35rem; border-radius: 3px; }

.alignwide { max-width: 100%; }
.alignfull { max-width: 100%; }
.aligncenter { display: block; margin-inline: auto; }
.alignleft { float: left; margin: .3rem 1.5rem 1rem 0; }
.alignright { float: right; margin: .3rem 0 1rem 1.5rem; }
.entry-content::after { content: ""; display: table; clear: both; }

/* ==========================================================================
   Arbre généalogique (plugin tng-wp-arbre)
   Le plugin reprend ces variables --gen-* quand elles existent.
   ========================================================================== */
:root {
	--gen-bg: var(--creme-3);
	--gen-text: var(--texte);
	--gen-accent: var(--nuit);
	--gen-border: rgba(176, 141, 87, .65);
}
/* Page contenant l'arbre : on libère toute la largeur disponible */
.avec-arbre .site-main { max-width: 1360px; }
.avec-arbre .entry,
.avec-arbre .page-header,
.avec-arbre .entry-content { max-width: none; }
.tngwp-arbre-wrap { font-family: var(--corps); font-size: 1rem; line-height: 1.4; }
.tngwp-arbre-wrap .f3 { font-family: var(--corps); }
/* Traits de liaison : blancs par défaut dans family-chart, invisibles sur fond crème */
.tngwp-arbre-wrap .f3 path.link { stroke: var(--laiton); }
.tngwp-arbre-wrap .f3 .f3-path-to-main { stroke: var(--laiton-fonce); }

/* ==========================================================================
   Boutons
   ========================================================================== */
.btn, .wp-block-button__link, input[type="submit"], button.btn {
	display: inline-flex; align-items: center; gap: .55rem;
	padding: .7rem 1.35rem;
	background: var(--nuit); color: var(--creme);
	border: 1px solid var(--nuit); border-bottom: 3px solid var(--laiton);
	border-radius: var(--rayon);
	font: 600 1.05rem/1.2 var(--corps);
	text-decoration: none; cursor: pointer;
	transition: transform .12s, background-color .15s, color .15s;
}
.btn:hover, .wp-block-button__link:hover, input[type="submit"]:hover {
	background: var(--nuit-2); color: #fff; transform: translateY(-1px); text-decoration: none;
}
.btn--laiton { background: var(--laiton-clair); color: var(--nuit); border-color: var(--laiton-clair); border-bottom-color: var(--laiton-fonce); }
.btn--laiton:hover { background: #fff; color: var(--nuit); }
.btn--ghost { background: transparent; color: var(--creme); border-color: var(--laiton-clair); border-bottom-width: 1px; }
.btn--ghost:hover { background: rgba(245, 240, 230, .1); color: #fff; }
.btn--grand { padding: .95rem 1.8rem; font-size: 1.2rem; }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }

/* ==========================================================================
   Accueil
   ========================================================================== */
.hero {
	position: relative;
	margin-bottom: 2.5rem;
	padding: clamp(2rem, 6vw, 4.2rem) clamp(1.5rem, 5vw, 3.5rem);
	background: var(--nuit) url("assets/img/arbre-banniere.svg") right bottom / cover no-repeat;
	color: var(--creme);
	border-radius: var(--rayon);
	box-shadow: inset 0 0 0 7px var(--nuit), inset 0 0 0 8px var(--laiton), var(--ombre);
	overflow: hidden;
}
.hero::before {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: linear-gradient(90deg, var(--nuit) 0%, rgba(31, 45, 69, .88) 38%, rgba(31, 45, 69, 0) 64%);
}
.hero__texte { position: relative; z-index: 1; max-width: 30rem; }
.hero__surtitre { margin: 0 0 .6rem; font-size: .95rem; letter-spacing: .14em; text-transform: uppercase; color: var(--laiton-clair); font-weight: 600; }
.hero h1 { color: var(--creme); font-size: clamp(2rem, 5vw, 3.1rem); margin-bottom: 1rem; }
.hero__intro { font-size: 1.2rem; color: #E8D2BA; margin-bottom: 1.8rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; }

.section-titre { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 3rem 0 1.2rem; }
.section-titre h2 { margin: 0; }
.section-titre a { font-weight: 600; }

.cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }

.carte {
	position: relative; display: flex; flex-direction: column;
	background: var(--creme-3); border: 1px solid var(--filet); border-radius: var(--rayon);
	box-shadow: var(--ombre); overflow: hidden;
	transition: transform .15s, box-shadow .15s;
}
.carte::after { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(176, 141, 87, .25); border-radius: 3px; pointer-events: none; }
.carte:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(31, 45, 69, .1), 0 12px 28px rgba(31, 45, 69, .14); }
.carte__image { aspect-ratio: 16 / 10; background: var(--nuit); overflow: hidden; }
.carte__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carte__image--deco {
	display: grid; place-items: center; color: var(--laiton-clair);
	background: linear-gradient(135deg, var(--nuit) 0%, var(--nuit-2) 100%);
}
.carte__image--deco svg { width: 56px; height: 56px; opacity: .85; }
.carte__corps { padding: 1.2rem 1.35rem 1.4rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.carte__date { font-size: .9rem; color: var(--texte-doux); }
.carte__titre { font-size: 1.25rem; margin: 0; }
.carte__titre a { color: var(--nuit); text-decoration: none; }
.carte__titre a::before { content: ""; position: absolute; inset: 0; z-index: 1; } /* carte entièrement cliquable */
.carte__titre a:hover { color: var(--laiton-fonce); text-decoration: underline; }
.carte__extrait { color: var(--texte-doux); font-size: 1rem; line-height: 1.55; margin: 0; }
.carte__lire { margin-top: auto; padding-top: .6rem; font-weight: 600; color: var(--laiton-fonce); font-size: .98rem; }

.carte--rubrique { text-align: center; }
.carte--rubrique .carte__corps { align-items: center; padding: 1.6rem 1.3rem; }
.carte--rubrique .carte__icone { width: 46px; height: 46px; color: var(--laiton-fonce); }

.alerte-admin { margin: 0 0 2rem; padding: .9rem 1.2rem; background: #FBF0DF; border: 1px solid #E2C35A; border-radius: var(--rayon); font-size: 1rem; }

/* ==========================================================================
   Documents / galeries
   ========================================================================== */
.wp-block-gallery, .gallery, .galerie-documents {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.2rem;
	list-style: none; padding: 0; margin: 1.8rem 0;
}
.wp-block-gallery.has-nested-images { display: grid; }
.wp-block-gallery figure, .gallery .gallery-item, .galerie-documents figure {
	margin: 0; width: auto !important; max-width: none;
	background: var(--creme-3); border: 1px solid var(--filet); padding: 8px; border-radius: 3px; box-shadow: var(--ombre);
}
.wp-block-gallery figure img, .gallery img, .galerie-documents img {
	width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border: 0; padding: 0; box-shadow: none; cursor: zoom-in;
}
.gallery-caption, .wp-block-gallery figcaption { font-size: .88rem; padding-top: .4rem; }
.documents .entry-content img { cursor: zoom-in; }

.liste-pdf { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: .6rem; }
.liste-pdf a {
	display: block; padding: .75rem 1rem; background: var(--creme-3);
	border: 1px solid var(--filet); border-left: 4px solid var(--laiton); border-radius: var(--rayon);
	font-weight: 600; text-decoration: none; color: var(--nuit);
}
.liste-pdf a:hover { background: var(--creme-2); }

dialog.visionneuse {
	padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 96vh; overflow: visible;
}
dialog.visionneuse::backdrop { background: rgba(16, 24, 42, .88); }
dialog.visionneuse img { display: block; max-width: 94vw; max-height: 88vh; border: 8px solid var(--creme-3); border-radius: 3px; background: var(--creme-3); }
dialog.visionneuse button {
	position: absolute; top: -2.6rem; right: 0;
	background: var(--creme); color: var(--nuit); border: 0; border-radius: var(--rayon);
	padding: .4rem .9rem; font: 600 1rem var(--corps); cursor: pointer;
}

/* ==========================================================================
   Navigation article, pagination, commentaires
   ========================================================================== */
.nav-articles { display: flex; justify-content: space-between; gap: 1rem; margin: 3rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--filet); }
.nav-articles a { display: block; max-width: 46%; font-family: var(--titre); text-decoration: none; }
.nav-articles span { display: block; font: 600 .85rem var(--corps); color: var(--texte-doux); text-transform: uppercase; letter-spacing: .08em; }
.nav-articles .suivant { text-align: right; margin-left: auto; }

.pagination { margin: 2.5rem 0 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.pagination .page-numbers {
	min-width: 2.6rem; text-align: center; padding: .45rem .8rem;
	background: var(--creme-3); border: 1px solid var(--filet); border-radius: var(--rayon);
	text-decoration: none; font-weight: 600; color: var(--nuit);
}
.pagination .page-numbers.current, .pagination .page-numbers:hover { background: var(--nuit); color: var(--creme); }

.commentaires { max-width: var(--largeur-texte); margin: 3rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--filet); }
.commentaires ol { list-style: none; padding: 0; margin: 0 0 2rem; }
.commentaires .comment-body { background: var(--creme-3); border: 1px solid var(--filet); border-radius: var(--rayon); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.commentaires .children { list-style: none; margin-left: 1.5rem; padding: 0; }
.commentaires .comment-meta { font-size: .92rem; color: var(--texte-doux); margin-bottom: .4rem; }
.commentaires .avatar { border-radius: 50%; vertical-align: middle; margin-right: .5rem; }
.commentaires .comment-form p { margin-bottom: 1rem; }

.formulaire-recherche { display: flex; gap: .5rem; }
.formulaire-recherche input[type="search"] { flex: 1; }

/* ==========================================================================
   Pied de page
   ========================================================================== */
.site-footer { margin-top: 1.5rem; padding: 0 1.5rem 1rem; text-align: center; color: var(--texte-doux); font-size: .8rem; line-height: 1.4; }
.site-footer::before { content: ""; display: block; height: 14px; margin: 0 auto .5rem; background: url("assets/img/ornement.svg") center / 120px 12px no-repeat; }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem .9rem; padding: 0; margin: 0 0 .4rem; }
.site-footer a { color: var(--laiton-fonce); }
.site-footer p { margin: 0; }

/* ==========================================================================
   Écrans étroits : le menu latéral devient un tiroir
   ========================================================================== */
@media (max-width: 900px) {
	body.famille { font-size: 1.0625rem; }

	.site-topbar {
		display: flex; align-items: center; justify-content: space-between; gap: 1rem;
		position: fixed; inset: 0 0 auto 0; height: 60px; padding: 0 1rem;
		background: var(--nuit); color: var(--creme);
		border-bottom: 3px double var(--laiton); z-index: 40;
	}
	.site-topbar__titre { display: flex; align-items: center; gap: .6rem; color: var(--creme); text-decoration: none; font: 600 1.35rem var(--titre); min-width: 0; }
	.site-topbar__titre svg { width: 34px; height: 34px; color: var(--laiton-clair); flex: none; }
	.site-topbar__titre span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

	.site-sidebar {
		transform: translateX(-102%);
		transition: transform .25s ease;
		width: min(86vw, 340px);
		z-index: 60;
		visibility: hidden;
	}
	.menu-open .site-sidebar { transform: none; visibility: visible; box-shadow: 8px 0 30px rgba(0, 0, 0, .35); }
	.menu-close {
		display: grid; place-items: center; position: absolute; top: .6rem; right: .6rem;
		width: 44px; height: 44px; padding: 0;
		background: transparent; color: var(--creme); border: 1px solid var(--laiton); border-radius: var(--rayon);
		font: 400 1.8rem/1 var(--corps); cursor: pointer;
	}
	.menu-open { overflow: hidden; }
	.menu-overlay { position: fixed; inset: 0; background: rgba(16, 24, 42, .55); z-index: 55; }
	.menu-open .menu-overlay { display: block; }

	.site-shell { margin-left: 0; padding-top: 60px; }
	.site-main { padding-top: 1.8rem; }

	.hero { background-position: 60% bottom; }
	.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(31, 45, 69, .92) 0%, rgba(31, 45, 69, .55) 100%); }
	.nav-articles a { max-width: 48%; }
}

@media (min-width: 901px) {
	.site-sidebar { visibility: visible !important; transform: none !important; }
}

/* ==========================================================================
   Grands écrans : le menu devient une barre horizontale en haut de page
   ========================================================================== */
@media (min-width: 901px) {
	:root { --largeur-menu: 0px; }

	.site-sidebar {
		position: sticky; top: 0; left: auto; right: auto; bottom: auto;
		width: 100%;
		flex-direction: row; align-items: center; flex-wrap: wrap;
		gap: .4rem 1.75rem;
		padding: .55rem clamp(1rem, 3vw, 2rem);
		border-right: 0;
		border-bottom: 4px double var(--laiton);
		overflow: visible;
	}
	.site-brand { text-align: left; flex: none; }
	.site-brand a { display: flex; align-items: center; gap: .7rem; }
	.site-brand__logo { width: 40px; height: 40px; margin: 0; }
	.site-brand .custom-logo { max-height: 46px; margin: 0; }
	.site-title { font-size: 1.55rem; }
	.site-tagline, .site-brand::after { display: none; }

	.site-nav { flex: 1 1 auto; min-width: 0; }
	.site-nav ul.menu { display: flex; flex-wrap: wrap; gap: .1rem .25rem; }
	.site-nav li { position: relative; }
	.site-nav a {
		padding: .55rem .9rem;
		border-left: 0;
		border-bottom: 3px solid transparent;
		border-radius: var(--rayon) var(--rayon) 0 0;
		font-size: 1.02rem;
	}
	.site-nav a:hover, .site-nav a:focus-visible { border-left-color: transparent; border-bottom-color: var(--laiton); }
	.site-nav .current-menu-item > a,
	.site-nav .current_page_item > a,
	.site-nav .current-menu-ancestor > a,
	.site-nav .current-page-ancestor > a { border-left-color: transparent; border-bottom-color: var(--laiton-clair); }

	/* Sous-menus : liste déroulante au survol ou au clavier */
	.site-nav ul ul {
		display: none; position: absolute; top: 100%; left: 0; z-index: 70;
		min-width: 13rem; margin: 0; padding: .3rem 0;
		background: var(--nuit-3); border: 1px solid var(--laiton); border-radius: 0 0 var(--rayon) var(--rayon);
		box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
	}
	.site-nav li:hover > ul, .site-nav li:focus-within > ul { display: block; }
	.site-nav ul ul a { border-radius: 0; border-bottom: 0; border-left: 3px solid transparent; }
	.site-nav ul ul a:hover, .site-nav ul ul a:focus-visible { border-left-color: var(--laiton); border-bottom-color: transparent; }

	.sidebar-cta { margin: 0 0 0 auto; display: block; }
	.sidebar-cta .btn { width: auto; white-space: nowrap; }

	/* Page de l'arbre : titre discret pour laisser la place à l'arbre */
	.avec-arbre .site-main { max-width: none; padding-top: 1rem; padding-bottom: 1rem; }
	.avec-arbre .page-header { margin-bottom: .2rem; }
	.avec-arbre .page-header h1 { font-size: 1.7rem; margin: 0; }
	.avec-arbre .page-header::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}

@media print {
	.site-sidebar, .site-topbar, .menu-overlay, .site-footer::before { display: none !important; }
	.site-shell { margin: 0; }
	body.famille { background: #fff; }
}
