/*
Theme Name: De fil en branche
Theme URI: https://defilenbranche.ca
Description: Thème enfant de Twenty Twenty-Five aux couleurs de De fil en branche — Recherches généalogiques et ADN. Couleurs, polices auto-hébergées (Cormorant Garamond, Work Sans) et composantes du répertoire (fiche, badge d'accès, bouton, puce de lieu).
Author: Stef — De fil en branche
Template: twentytwentyfive
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: defilenbranche
*/

/* Jetons de l'identité visuelle, reliés à la palette de theme.json. */
:root {
	--papier: var(--wp--preset--color--base);
	--papier-sureleve: var(--wp--preset--color--papier-sureleve);
	--lin: var(--wp--preset--color--accent-5);
	--ligne: var(--wp--preset--color--accent-6);
	--ligne-forte: var(--wp--preset--color--ligne-forte);
	--encre: var(--wp--preset--color--contrast);
	--encre-douce: var(--wp--preset--color--accent-4);
	--sapin: var(--wp--preset--color--accent-3);
	--sur-sapin: var(--wp--preset--color--sur-sapin);
	--sapin-pale: var(--wp--preset--color--accent-2);
	--rouille: var(--wp--preset--color--accent-1);
	--sur-rouille: #ffffff;
	--rouille-clair: var(--wp--preset--color--rouille-clair);
	--acces-libre: var(--wp--preset--color--acces-libre);
	--acces-libre-fond: var(--wp--preset--color--acces-libre-fond);
	--acces-payant: var(--wp--preset--color--acces-payant);
	--acces-payant-fond: var(--wp--preset--color--acces-payant-fond);
	--acces-membres: var(--wp--preset--color--acces-membres);
	--acces-membres-fond: var(--wp--preset--color--acces-membres-fond);
	--erreur: var(--wp--preset--color--erreur);
	--focus: var(--rouille);
	--font-titre: var(--wp--preset--font-family--titre);
	--font-texte: var(--wp--preset--font-family--texte);
	--espace-1: 4px;
	--espace-2: 8px;
	--espace-3: 12px;
	--espace-4: 16px;
	--espace-6: 24px;
	--espace-8: 32px;
	--espace-12: 48px;
	--espace-16: 64px;
	--rayon-sm: 4px;
	--rayon-md: 8px;
	--rayon-pilule: 999px;
}

/* Anneau de focus clavier, partout. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}

/* Boutons WordPress : 44 px minimum pour le toucher. */
.wp-element-button,
.wp-block-button__link {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: var(--papier-sureleve);
	color: var(--encre);
	border: 1px solid var(--ligne-forte);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--sapin-pale);
}

/* Liens : soulignement discret, décalé. */
a { text-underline-offset: 3px; }

/* ---------- Composantes du répertoire (classes dfb-) ---------- */

/* Bouton */
.dfb-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--espace-2); min-height: 44px; padding: 0 var(--espace-4); border-radius: var(--rayon-md); border: 1px solid var(--ligne-forte); background: var(--papier-sureleve); color: var(--encre); font-family: var(--font-texte); font-size: 15px; line-height: 20px; font-weight: 600; text-decoration: none; cursor: pointer; }
.dfb-btn:hover { background: var(--sapin-pale); color: var(--encre); }
.dfb-btn--principal { background: var(--rouille); border-color: var(--rouille); color: var(--sur-rouille); }
.dfb-btn--principal:hover { background: var(--rouille); color: var(--sur-rouille); filter: brightness(0.92); }
.dfb-btn--lien { border-color: transparent; background: none; color: var(--rouille); padding: 0 var(--espace-1); text-decoration: underline; text-underline-offset: 3px; }
.dfb-btn--lien:hover { background: none; color: var(--encre); }
.dfb-btn svg { width: 16px; height: 16px; flex: none; }

/* Badge d'accès */
.dfb-acces { display: inline-flex; align-items: center; gap: var(--espace-1); padding: 2px var(--espace-2); border-radius: var(--rayon-sm); font-size: 13px; line-height: 18px; font-weight: 600; background: var(--lin); color: var(--encre-douce); }
.dfb-acces--libre { background: var(--acces-libre-fond); color: var(--acces-libre); }
.dfb-acces--payant { background: var(--acces-payant-fond); color: var(--acces-payant); }
.dfb-acces--membres { background: var(--acces-membres-fond); color: var(--acces-membres); }
.dfb-acces--surplace { background: var(--lin); color: var(--encre-douce); }

/* Puce de lieu */
.dfb-lieu { display: inline-flex; align-items: center; gap: var(--espace-2); min-height: 36px; padding: 0 var(--espace-3); border-radius: var(--rayon-pilule); border: 1px solid var(--ligne); background: var(--papier-sureleve); color: var(--encre); font-size: 15px; font-weight: 500; text-decoration: none; }
.dfb-lieu:hover { border-color: var(--ligne-forte); color: var(--encre); }
.dfb-lieu[aria-current="page"] { background: var(--sapin-pale); border-color: var(--sapin-pale); font-weight: 600; }
.dfb-lieu__drapeau { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; flex: none; outline: 1px solid var(--ligne); }

/* Fiche de ressource */
.dfb-fiche { display: flex; flex-direction: column; gap: var(--espace-3); padding: var(--espace-6); background: var(--papier-sureleve); border: 1px solid var(--ligne); border-radius: var(--rayon-md); box-sizing: border-box; }
.dfb-fiche__titre { margin: 0; font-family: var(--font-texte); font-size: 20px; line-height: 28px; font-weight: 600; color: var(--encre); }
.dfb-fiche__meta { margin: 0; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--encre-douce); }
.dfb-fiche__desc { margin: 0; font-size: 15px; line-height: 22px; color: var(--encre); }
.dfb-fiche__acces { display: flex; flex-wrap: wrap; gap: var(--espace-2); }
.dfb-fiche__lacunes { margin: 0; font-size: 13px; line-height: 18px; color: var(--encre-douce); }
.dfb-fiche__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--espace-4); padding-top: var(--espace-1); }
.dfb-fiche__statut { align-self: flex-start; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--erreur); }

/* Étiquette en majuscules (intitulés de filtres et de champs) */
.dfb-etiquette { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--encre-douce); }

/* Respect du choix « réduire les animations ». */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
