/*
Theme Name:   Hello Démo
Description:  Thème enfant de Hello Elementor pour le site de démo (fil d'Ariane, ajustements Bridge).
Author:       DN Consultants
Template:     hello-elementor
Version:      1.0.0
Text Domain:  hello-demo
*/

/* ==========================================================================
   Fil d'Ariane (inc/breadcrumb.php) – affiché sous l'en-tête
   Pages du site (fond sombre) : bandeau sombre ; fiches Bridge (fond blanc) : bandeau clair.
   ========================================================================== */
.hd-breadcrumb {
	--hd-bg: #1C2D31;
	--hd-text: #909DA1;
	--hd-link: #FFFFFF;
	--hd-sep: #0CB2DB;
	padding: 16px max(24px, calc((100% - 1320px) / 2));
	font-family: "Inter", sans-serif;
	font-size: 14px;
	line-height: 22px;
	color: var(--hd-text);
	background: var(--hd-bg);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
body.single-fiche_sit .hd-breadcrumb {
	--hd-bg: #EDF5F6;
	--hd-text: #5F6E72;
	--hd-link: #1C2D31;
	box-shadow: none;
}
.hd-breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}
.hd-breadcrumb li { display: inline-flex; align-items: center; margin: 0; }
.hd-breadcrumb li + li::before {
	content: "»";
	margin: 0 10px;
	font-family: "Bebas Neue", sans-serif;
	font-size: 18px;
	line-height: 1;
	color: var(--hd-sep);
}
.hd-breadcrumb a {
	font-weight: 500;
	color: var(--hd-link);
	text-decoration: none;
	transition: color 0.3s;
}
.hd-breadcrumb a:hover,
.hd-breadcrumb a:focus-visible { color: var(--hd-sep); }
.hd-breadcrumb [aria-current="page"] {
	max-width: 60ch;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* La fiche itinéraire Bridge a son propre fil d'Ariane : on garde uniquement celui du thème */
.bridge-fiche.fiche-itineraire > #crumbs { display: none; }

@media (max-width: 639px) {
	.hd-breadcrumb { padding: 12px 16px; font-size: 13px; }
	.hd-breadcrumb [aria-current="page"] { max-width: 100%; white-space: normal; }
}

/* Codes SIT traduits (inc/bridge-codes.php) : petit badge turquoise */
.hd-sit-code {
	display: inline-block;
	padding: 4px 14px;
	font-family: "Bebas Neue", sans-serif;
	font-size: 17px;
	line-height: 22px;
	letter-spacing: 0.04em;
	color: #FFFFFF;
	background: #0CB2DB;
	border-radius: 30px;
}

/* ==========================================================================
   Sélecteur de modèles Bridge dans l'en-tête (inc/gabarits-liste.php)
   Le bouton garde le style Elementor du .tk-btn qu'il remplace : seul le panneau est stylé ici.
   Panneau latéral (off-canvas) qui glisse depuis la droite ; c'est un <dialog> : focus, Échap et voile natifs.
   Listes : 2 zones côte à côte (modèle de liste | gabarit de fiche), chacune avec son défilement.
   Fiches : 1 zone (modèle de fiche), vignettes en portrait.
   ========================================================================== */

.hd-gabarits-dialog {
	position: fixed;
	inset: 0 0 0 auto;
	width: min(760px, 100%);
	max-width: 100%;
	height: 100%;
	max-height: 100%;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	color: #909DA1;
	background: #1C2D31;
	border: 0;
	border-left: 1px solid rgba(255, 255, 255, 0.1);
	box-shadow: -30px 0 80px rgba(0, 0, 0, 0.45);
}
.hd-gabarits-dialog[open] { animation: hd-offcanvas-in 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.hd-gabarits-dialog.is-closing { animation: hd-offcanvas-out 0.25s ease-in forwards; }
.hd-gabarits-dialog::backdrop { background: rgba(18, 35, 39, 0.75); animation: hd-fade-in 0.35s; }
.hd-gabarits-dialog.is-closing::backdrop { animation: hd-fade-in 0.25s reverse forwards; }
@keyframes hd-offcanvas-in { from { transform: translateX(100%); } }
@keyframes hd-offcanvas-out { to { transform: translateX(100%); } }
@keyframes hd-fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
	.hd-gabarits-dialog[open],
	.hd-gabarits-dialog.is-closing,
	.hd-gabarits-dialog::backdrop { animation: none; }
}
.hd-gabarits-dialog.is-loading { opacity: 0.6; pointer-events: none; cursor: progress; }
.hd-gabarits-box { margin: 0; padding: 0 28px 32px; font-family: "Inter", sans-serif; }

/* Titre et bouton de fermeture restent visibles pendant le défilement */
.hd-gabarits-head {
	position: sticky;
	top: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 0 -28px;
	padding: 24px 28px 16px;
	background: #1C2D31;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.hd-gabarits-head h2 {
	margin: 0;
	font-family: "Bebas Neue", sans-serif;
	font-size: 34px;
	font-weight: 400;
	line-height: 1.1;
	color: #FFFFFF;
}
.hd-gabarits-close {
	width: 40px;
	height: 40px;
	padding: 0;
	font-size: 24px;
	line-height: 1;
	color: #FFFFFF;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	cursor: pointer;
}
.hd-gabarits-close:hover { background: #0CB2DB; border-color: #0CB2DB; }

.hd-gabarits-dialog fieldset { min-width: 0; margin: 24px 0 0; padding: 0; border: 0; }
.hd-gabarits-dialog legend {
	float: left; /* légende traitée comme un bloc normal (sinon rendu spécial des fieldsets) */
	width: 100%;
	margin-bottom: 12px;
	padding: 0;
	font-family: "Bebas Neue", sans-serif;
	font-size: 22px;
	letter-spacing: 0.03em;
	color: #0CB2DB;
}
.hd-gabarits-grid { clear: both; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.hd-gabarit {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 8px;
	font-size: 13px;
	line-height: 18px;
	text-align: center;
	color: #909DA1;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 14px;
	cursor: pointer;
	transition: border-color 0.3s, color 0.3s;
}
.hd-gabarit input { position: absolute; opacity: 0; pointer-events: none; }
.hd-gabarit-vignette {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	background: #122327;
	border-radius: 8px;
}
/* Vignettes de fiche détaillée : captures pleine page, on montre le haut */
.hd-gabarits-grid--fiche { grid-template-columns: repeat(4, 1fr); }
.hd-gabarits-grid--fiche .hd-gabarit-vignette { aspect-ratio: 3 / 4; object-position: top; }
.hd-gabarit-origine { display: flex; align-items: center; justify-content: center; font-size: 34px; color: #0CB2DB; }
.hd-gabarit:hover { color: #FFFFFF; border-color: rgba(12, 178, 219, 0.5); }
.hd-gabarit:has(input:checked) { color: #FFFFFF; border-color: #0CB2DB; box-shadow: 0 0 0 1px #0CB2DB; }
.hd-gabarit:has(input:focus-visible) { outline: 2px solid #0CB2DB; outline-offset: 2px; }

/* Intertitre d'un groupe de gabarits (ex. « Prototypes » : modèles du thème enfant) */
.hd-gabarits-groupe {
	grid-column: 1 / -1;
	margin: 12px 0 0;
	padding-top: 20px;
	font-family: "Bebas Neue", sans-serif;
	font-size: 22px;
	letter-spacing: 0.03em;
	color: #0CB2DB;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Deux zones côte à côte : panneau large, chaque zone défile seule */
@media (min-width: 900px) {
	.hd-gabarits-dialog--2 { width: min(1240px, 100%); overflow: hidden; }
	.hd-gabarits-dialog--2 .hd-gabarits-box { display: flex; flex-direction: column; height: 100%; padding-bottom: 0; }
	.hd-gabarits-dialog--2 .hd-gabarits-zones {
		display: grid;
		flex: 1;
		grid-template-columns: 1fr 1fr;
		min-height: 0;
		margin: 0 -28px;
	}
	.hd-gabarits-dialog--2 .hd-gabarits-zone {
		margin: 0;
		padding: 24px 28px 32px;
		overflow-y: auto;
		overscroll-behavior: contain;
	}
	.hd-gabarits-dialog--2 .hd-gabarits-zone + .hd-gabarits-zone {
		background: #18282C;
		border-left: 1px solid rgba(255, 255, 255, 0.08);
	}
}

@media (max-width: 639px) {
	.hd-gabarits-box { padding: 0 20px 24px; }
	.hd-gabarits-head { margin: 0 -20px; padding: 18px 20px 14px; }
	.hd-gabarits-grid,
	.hd-gabarits-grid--fiche { grid-template-columns: repeat(2, 1fr); }
}

/* Menu mobile de l'en-tête (js/nav.js) : replié par défaut, ouvert par le bouton « Menu » */
@media (max-width: 767px) {
	.tk-nav { display: none !important; }
	body.hd-nav-open .tk-nav { display: flex !important; }
	body.hd-nav-open .tk-burger,
	body.hd-nav-open .tk-burger:hover { color: #FFFFFF !important; background-color: #0CB2DB !important; border-color: #0CB2DB !important; }
}

/* ==========================================================================
   Mode clair (inc/theme-mode.php, js/theme-mode.js) – <html data-theme="light">
   Le site est sombre par défaut : on redéfinit la palette --tk-* du kit (rôles inversés :
   --tk-white = titres, --tk-dark / --tk-dark-2 = fonds), puis on corrige les quelques
   couleurs codées en dur dans Elementor.
   ========================================================================== */

html[data-theme="light"] {
	--tk-dark: #FFFFFF;
	--tk-dark-2: #F2F7F8;
	--tk-dark-3: #E3EDEF;
	--tk-text: #5F6E72;
	--tk-white: #122327;
	--tk-border: rgba(18, 35, 39, 0.1);
	color-scheme: light;
}
html[data-theme="light"] body { background-color: var(--tk-dark); } /* .elementor-kit-5 : #122327 */

/* Zones sur photo ou sur turquoise : elles restent sombres (texte blanc).
   - 1re section de chaque page = bandeau photo ;
   - accueil : bandeau chiffres et encart final ;
   - ajouter la classe hd-sombre à une section Elementor pour la garder sombre en mode clair. */
html[data-theme="light"] :is(
	.hd-sombre,
	[data-elementor-type="wp-page"] > .tk-section:first-child,
	.e-66af75e3-1e78,
	.e-7f4588aa-6cdb
) {
	--tk-dark: #122327;
	--tk-dark-2: #1C2D31;
	--tk-dark-3: #20353B;
	--tk-text: #909DA1;
	--tk-white: #FFFFFF;
	--tk-border: rgba(255, 255, 255, 0.1);
}

/* Texte blanc sur turquoise, quel que soit le mode */
html[data-theme="light"] .elementor :is(.tk-btn:not(.tk-btn-outline), .tk-badge, .e-2a1e40ac-d9ae, .e-51111415-77e5) { color: #FFFFFF; }
html[data-theme="light"] .elementor .tk-btn:not(.tk-btn-outline):is(:hover, :focus-visible) { color: var(--tk-dark); }
html[data-theme="light"] .elementor .tk-btn-dark { color: #FFFFFF; background-color: #122327; }
html[data-theme="light"] .elementor .tk-btn-dark:is(:hover, :focus-visible) { color: #FFFFFF; background-color: var(--tk-primary); }
html[data-theme="light"] .elementor .tk-burger:not(:hover):not(:focus-visible) { border-color: rgba(18, 35, 39, 0.25); }

/* Filets rgba(255, 255, 255, …) codés en dur dans Elementor (à remplacer par var(--tk-border) dans l'éditeur à terme) */
html[data-theme="light"] .elementor .e-f393449-ec4b { box-shadow: 0 -1px 0 0 var(--tk-border) inset; } /* en-tête */
html[data-theme="light"] .elementor .e-28acc82a-92a9 { box-shadow: 0 1px 0 0 var(--tk-border) inset; } /* pied de page */
html[data-theme="light"] .elementor :is(.e-b1aa705-2432, .e-7e46788c-77a5, .e-786124ef-bef5, .e-585f86d1-b24a, .e-73602c8-aaf7, .e-570a994a-4dd1, .e-1278c264-a538) {
	box-shadow: 0 1px 0 0 var(--tk-border) inset; /* pieds de cartes (accueil) */
}
@media (min-width: 1025px) {
	html[data-theme="light"] .elementor :is(.e-157086c9-7881, .e-4464ec77-79a4, .e-39d558cc-6361, .e-3167569a-2cb5) {
		box-shadow: -1px 0 0 0 var(--tk-border) inset; /* séparateurs du bandeau de recherche (accueil) */
	}
}
@media (max-width: 767px) {
	html[data-theme="light"] .elementor .tk-nav .tk-link { box-shadow: 0 1px 0 0 var(--tk-border) inset; }
}

/* Fil d'Ariane : bandeau clair, comme sur les fiches */
html[data-theme="light"] .hd-breadcrumb {
	--hd-bg: #EDF5F6;
	--hd-text: #5F6E72;
	--hd-link: #1C2D31;
	box-shadow: none;
}

/* Bouton du sélecteur, dans le style du bouton « Menu » (.tk-burger) */
.hd-theme-toggle,
.hd-theme-toggle:focus { /* le reset Hello colore button:focus en #c36 */
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: var(--tk-white, #FFFFFF);
	background: transparent;
	border: 1px solid var(--hd-toggle-line, rgba(255, 255, 255, 0.25));
	border-radius: 50%;
	cursor: pointer;
	transition: color 0.3s, border-color 0.3s;
}
html[data-theme="light"] { --hd-toggle-line: rgba(18, 35, 39, 0.25); }
.hd-theme-toggle:hover,
.hd-theme-toggle:focus-visible { --hd-toggle-line: var(--tk-primary, #0CB2DB); color: var(--tk-primary, #0CB2DB); background: transparent; }
.hd-theme-toggle:focus-visible { outline: 2px solid var(--tk-primary, #0CB2DB); outline-offset: 2px; }
.hd-theme-toggle svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.hd-theme-toggle-lune,
html[data-theme="light"] .hd-theme-toggle-soleil { display: none; }
html[data-theme="light"] .hd-theme-toggle-lune { display: block; }

@media (max-width: 767px) {
	.hd-theme-toggle { width: 36px; height: 36px; }
	.hd-theme-toggle svg { width: 18px; height: 18px; }
}
