/*
Theme Name: First Corp
Description: Thème maison des sites de First Corp (kit 1.0.0). Copie de Twenty Twenty-Five 1.5 (équipe WordPress), sans thème parent : on garde ce qui sert, on retire le reste (décision du board du 20/10/2026, charte-sites, section 3, point 16). Les gabarits ne se modifient jamais dans l'éditeur du site (TEC-32) : toute modification passe par une nouvelle version du kit.
Author: First Corp (TechWP)
Requires at least: 7.1
Tested up to: 7.1
Requires PHP: 8.1
Version: 1.9.2
Update URI: false
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: firstcorp
*/

/* Feuille de styles de Twenty Twenty-Five 1.5, reprise telle quelle (liens, sélection de texte). */
/*
 * Link styles
 * https://github.com/WordPress/gutenberg/issues/42319
 */
a {
	text-decoration-thickness: 1px !important;
	text-underline-offset: .1em;
}

/* Focus styles */
:where(.wp-site-blocks *:focus) {
	outline-width: 2px;
	outline-style: solid;
}

/* Increase the bottom margin on submenus, so that the outline is visible. */
.wp-block-navigation .wp-block-navigation-submenu .wp-block-navigation-item:not(:last-child) {
	margin-bottom: 3px;
}

/* Increase the outline offset on the parent menu items, so that the outline does not touch the text. */
.wp-block-navigation .wp-block-navigation-item .wp-block-navigation-item__content {
	outline-offset: 4px;
}

/* Remove outline offset from the submenus, otherwise the outline is visible outside the submenu container. */
.wp-block-navigation .wp-block-navigation-item ul.wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	outline-offset: 0;
}

/*
 * Progressive enhancement to reduce widows and orphans
 * https://github.com/WordPress/gutenberg/issues/55190
 */
h1, h2, h3, h4, h5, h6, blockquote, caption, figcaption, p {
	text-wrap: pretty;
}

/*
 * Change the position of the more block on the front, by making it a block level element.
 * https://github.com/WordPress/gutenberg/issues/65934
*/
.more-link {
	display: block;
}

/*
 * Prevents unnecessary scrollbars while handling long lines of preformatted text.
 * https://core.trac.wordpress.org/ticket/63875
 */
:where(pre) {
	overflow-x: auto;
}

/*
 * Kit 1.3.0 (FIR-292 ; maquettes FIR-286) ; kit 1.5.0 (FIR-452 ; cahier de design de FIR-451) : un seul jeu de
 * composants, sans les signes d'un site « fait par IA » (section 2 du cahier).
 * Couleurs : rôles de la fiche du site (palette du thème, TEC-34) ; « action » sert aux seuls boutons vers Amazon.
 * Forme : classes posées sur <body> par functions.php d'après la fiche (forme.entete, forme.accueil).
 * Angles : 4 px (boutons, pastilles, petites images) et 8 px (encadrés, cartes, images), aucun angle « pilule » ;
 * aucune ombre. Les gabarits ne changent pas : tout passe par ces classes et cette feuille (et celle de firstcorp-blocs).
 */
body {
	--fc-fond: var(--wp--preset--color--fond);
	--fc-surface: var(--wp--preset--color--surface);
	--fc-texte: var(--wp--preset--color--texte);
	--fc-texte-2: var(--wp--preset--color--texte-2);
	--fc-filet: var(--wp--preset--color--filet);
	--fc-principale: var(--wp--preset--color--principale);
	--fc-fonce: var(--wp--preset--color--principale-fonce);
	--fc-action: var(--wp--preset--color--action);
	--fc-action-survol: color-mix(in srgb, var(--wp--preset--color--action) 82%, #000);
	--fc-accent: var(--wp--preset--color--accent);
	--fc-succes: var(--wp--preset--color--succes);
	--fc-alerte: var(--wp--preset--color--alerte);
	--fc-surface-alerte: var(--wp--preset--color--surface-alerte);
	/* Kit 1.8.0 (FIR-641 ; maquettes de FIR-636, section 5) : sections sombres (nuit), accent clair seulement sur nuit
	   (bois), fond des sections claires, cartes en blanc (papier). Valeurs par défaut : nuit = texte, papier = fond
	   (blanc) ; un site qui ne les choisit pas ne voit rien changer. */
	--fc-nuit: var(--wp--preset--color--nuit);
	--fc-bois: var(--wp--preset--color--bois);
	--fc-papier: var(--wp--preset--color--papier);
	--fc-rayon-petit: 4px;
	--fc-rayon: 8px;
	/* Anciens noms des variables (kit 1.3.0), gardés pour les règles qui s'en servent encore. */
	--fc-pale: var(--fc-surface);
	--fc-gris: var(--fc-texte-2);
	--fc-action-fonce: var(--fc-action-survol);
	color: var(--fc-texte);
}

/* Commun : titres, liens, fil d'Ariane, signature. Intertitres sans filet : la hiérarchie vient de la taille et de l'espace (C04). */
.wp-site-blocks h1.wp-block-post-title { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.6rem); line-height: 1.15; }
.wp-site-blocks .entry-content h2 { font-size: clamp(1.45rem, 1.2rem + .9vw, 1.9rem); margin-top: 3rem; }
.wp-site-blocks .entry-content h3 { font-size: clamp(1.15rem, 1.05rem + .4vw, 1.35rem); color: var(--fc-texte); }
.wp-site-blocks a:where(:not(.fc-bouton__lien)) { color: var(--fc-fonce); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--fc-principale) 55%, transparent); text-underline-offset: .18em; transition: color .12s, text-decoration-color .12s, text-decoration-thickness .12s; }
.wp-site-blocks a:where(:not(.fc-bouton__lien)):hover { color: var(--fc-fonce); text-decoration-color: currentColor; text-decoration-thickness: 2px !important; }

/* Focus clavier visible partout : 2 px de la couleur principale, décalé de 2 px (WCAG 2.2). */
.wp-site-blocks :is(a, button, summary, input, select, textarea):focus-visible { outline: 2px solid var(--fc-principale); outline-offset: 2px; }
/* Le lecteur demande moins d'animations : aucune transition. */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
/*
 * Finitions (kit 1.5.0, morceau 2, FIR-453 ; skill identite-visuelle, section 7 ; cahier de design de FIR-451, section 3d) :
 * CSS seul, aucune bibliothèque JavaScript ; ce qui bouge n'utilise que transform et opacity ; le texte est là dès
 * l'ouverture ; tout est coupé par la règle prefers-reduced-motion ci-dessus. Un navigateur qui ne connaît pas une de
 * ces fonctions affiche la page comme avant, sans la finition.
 */
/* Fondu entre deux pages du site, sur ordinateur seulement (768 px et plus : environ 70 ms de plus au chargement sur téléphone, FIR-448). */
@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
	@view-transition { navigation: auto; }
	::view-transition-group(root) { animation-duration: .2s; }
}
/* Fine barre de lecture des articles : 3 px de la couleur principale en haut de l'écran, liée au défilement. */
@keyframes fc-lecture { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@supports (animation-timeline: scroll()) {
	@media (prefers-reduced-motion: no-preference) {
		body.single-post::after { content: ""; position: fixed; z-index: 100; top: 0; left: 0; right: 0; height: 3px; background: var(--fc-principale); transform-origin: 0 50%; transform: scaleX(0); animation: fc-lecture linear both; animation-timeline: scroll(root block); pointer-events: none; }
	}
}
.wp-site-blocks .fc-fil-ariane, .wp-site-blocks .fc-infos { color: var(--fc-gris); }
.wp-site-blocks .fc-fil-ariane p { margin: 0; }

/* En-tête et pied : communs. */
.wp-site-blocks .fc-entete { padding-top: 12px !important; padding-bottom: 12px !important; }
.wp-site-blocks .fc-entete .wp-block-site-title { font-weight: var(--wp--custom--graisse-titres) !important; }
.wp-site-blocks .fc-entete .wp-block-site-title a { text-decoration: none; }
.wp-site-blocks .fc-entete .fc-menu a { font-weight: 600; font-size: .95rem; }

/* En-tête clair : fond blanc, filet de la couleur principale ; pied pâle. */
.fc-entete-clair .fc-entete { border-bottom: 3px solid var(--fc-principale) !important; }
.fc-entete-clair .wp-block-site-logo img { border-radius: var(--fc-rayon); }
.fc-entete-clair .fc-entete .wp-block-site-title a { color: var(--fc-fonce); }
/* Rubriques du menu : liens simples, soulignés au survol et sur la page en cours (C09 : plus de pastilles). */
.wp-site-blocks .fc-entete .fc-menu a { display: inline-block; padding: .25rem 0; text-decoration: none; text-underline-offset: .45em; }
.fc-entete-clair .fc-entete .fc-menu a { color: var(--fc-texte); }
.fc-entete-clair .fc-entete .fc-menu a:is(:hover, [aria-current]) { text-decoration: underline; text-decoration-thickness: 2px !important; text-decoration-color: var(--fc-principale); }
.fc-entete-clair .fc-pied { background: var(--fc-pale) !important; border-top: 3px solid var(--fc-principale); }
.fc-entete-clair .fc-pied__liens a { color: var(--fc-fonce); font-weight: 600; }

/* En-tête plein : fond de la couleur principale, texte blanc (contraste contrôlé par controle, TEC-34) ; pied de même. */
.fc-entete-plein .fc-entete { background: var(--fc-principale); border-bottom: 0 !important; }
.fc-entete-plein .wp-block-site-logo img { border-radius: var(--fc-rayon-petit); outline: 2px solid rgba(255, 255, 255, .85); }
.fc-entete-plein .fc-entete .wp-block-site-title a { color: #fff; letter-spacing: -.02em; }
.fc-entete-plein .fc-entete .fc-menu a { color: #fff; }
.fc-entete-plein .fc-entete .fc-menu a:is(:hover, [aria-current]) { text-decoration: underline; text-decoration-thickness: 2px !important; text-decoration-color: #fff; }
.fc-entete-plein .fc-entete :is(a, button):focus-visible { outline-color: #fff; }
.fc-entete-plein .fc-pied { background: var(--fc-principale) !important; color: #fff; }
.fc-entete-plein .fc-pied a, .fc-entete-plein .fc-pied__liens a { color: #fff; font-weight: 600; text-decoration-color: rgba(255, 255, 255, .5); }
.fc-entete-plein .fc-pied__copyright { color: #fff !important; }

/* Image à la une et image de l'accueil : angle de 8 px. */
.fc-article .wp-block-post-featured-image img, .fc-image-accueil img { border-radius: var(--fc-rayon); }

/* Listes (accueil, catégorie, recherche) : cartes au même format, vignette partout, titre et extrait sur 3 lignes. */
.fc-liste > h1.wp-block-site-title { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); margin-bottom: .25rem; }
.fc-liste > .wp-block-site-tagline { color: var(--fc-gris); font-size: 1.15rem; }
/* Cartes d'articles sans cadre ni angle (C12) : seule l'image a un angle de 8 px. */
.fc-liste .wp-block-post-template > li { display: flex; flex-direction: column; }
.fc-liste .wp-block-post-template .wp-block-post-featured-image { margin: 0; }
.fc-liste .wp-block-post-template .wp-block-post-featured-image img { aspect-ratio: 3/2 !important; width: 100%; height: auto; object-fit: cover; display: block; border-radius: var(--fc-rayon); }
.fc-accueil-une .fc-liste .wp-block-post-template .wp-block-post-featured-image img { aspect-ratio: 16/9 !important; }
.fc-liste .wp-block-post-template .fc-vignette { background: var(--fc-surface); border-radius: var(--fc-rayon); }
.fc-liste .wp-block-post-template .fc-vignette img { object-fit: contain !important; padding: .75rem; box-sizing: border-box; mix-blend-mode: multiply; }
.fc-liste .wp-block-post-template .wp-block-post-title { font-size: 1.2rem !important; line-height: 1.3; margin-top: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fc-liste .wp-block-post-template .wp-block-post-title a { color: var(--fc-texte); text-decoration: none; }
.fc-liste .wp-block-post-template .wp-block-post-title a:hover { text-decoration: underline; }
.fc-liste .wp-block-post-template .wp-block-post-excerpt { margin-top: .5rem; font-size: 1rem; color: var(--fc-gris); }
.fc-liste .wp-block-post-template .wp-block-post-excerpt__excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/*
 * Grilles sans trou, quel que soit le nombre de cartes (n) : essayées avec 1 à 12 cartes.
 * Grille (3 colonnes) : la première carte prend 2 colonnes, sauf si n est un multiple de 3 ; si n = 3k + 1 (4, 7, 10),
 * la dernière carte prend aussi 2 colonnes, en carte couchée (image à gauche).
 * À la une (2 colonnes) : la première carte prend toute la largeur, couchée ; si n est pair, la dernière aussi.
 * Tablette (601 à 900 px) : la grille passe en 2 colonnes et suit la règle « à la une ».
 */
.fc-liste .wp-block-post-template.is-layout-grid { gap: 1.5rem !important; }
@media (min-width: 901px) {
	.fc-accueil-grille .fc-liste .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
	.fc-accueil-grille .fc-liste .wp-block-post-template > li:first-child { grid-column: span 2; }
	.fc-accueil-grille .fc-liste .wp-block-post-template > li:first-child .wp-block-post-featured-image img { aspect-ratio: 2/1 !important; }
	.fc-accueil-grille .fc-liste .wp-block-post-template > li:first-child:nth-last-child(3n) { grid-column: auto; }
	.fc-accueil-grille .fc-liste .wp-block-post-template > li:first-child:nth-last-child(3n) .wp-block-post-featured-image img { aspect-ratio: 3/2 !important; }
	.fc-accueil-grille .fc-liste .wp-block-post-template > li:only-child { grid-column: 1 / -1; }
	.fc-accueil-grille .fc-liste .wp-block-post-template > li:last-child:nth-child(3n+4) { grid-column: span 2; }
	.fc-accueil-grille .fc-liste .wp-block-post-template > li:last-child:nth-child(3n+4) { display: grid; grid-template-columns: 3fr 2fr; grid-template-rows: auto auto 1fr; column-gap: 1.5rem; align-content: start; }
	.fc-accueil-grille .fc-liste .wp-block-post-template > li:last-child:nth-child(3n+4) > figure { grid-row: 1 / span 3; }
	.fc-accueil-grille .fc-liste .wp-block-post-template > li:last-child:nth-child(3n+4) > :not(figure) { margin-left: 0; }
}
@media (min-width: 601px) {
	.fc-accueil-une .fc-liste .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 1.75rem !important; }
	.fc-accueil-une .fc-liste .wp-block-post-template > li:first-child,
	.fc-accueil-une .fc-liste .wp-block-post-template > li:last-child:nth-child(2n) { grid-column: 1 / -1; }
	.fc-accueil-une .fc-liste .wp-block-post-template > li:first-child .wp-block-post-title { font-size: 1.75rem !important; margin-top: 1.25rem; }
	.fc-accueil-une .fc-liste .wp-block-post-template > li:first-child .wp-block-post-featured-image img { aspect-ratio: 3/2 !important; }
	.fc-accueil-une .fc-liste .wp-block-post-template > li:first-child,
	.fc-accueil-une .fc-liste .wp-block-post-template > li:last-child:nth-child(2n) { display: grid; grid-template-columns: 3fr 2fr; grid-template-rows: auto auto 1fr; column-gap: 1.5rem; align-content: start; }
	.fc-accueil-une .fc-liste .wp-block-post-template > li:first-child > figure,
	.fc-accueil-une .fc-liste .wp-block-post-template > li:last-child:nth-child(2n) > figure { grid-row: 1 / span 3; }
	.fc-accueil-une .fc-liste .wp-block-post-template > li:first-child > :not(figure),
	.fc-accueil-une .fc-liste .wp-block-post-template > li:last-child:nth-child(2n) > :not(figure) { margin-left: 0; }
}
@media (min-width: 601px) and (max-width: 900px) {
	.fc-accueil-grille .fc-liste .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
	.fc-accueil-grille .fc-liste .wp-block-post-template > li:first-child,
	.fc-accueil-grille .fc-liste .wp-block-post-template > li:last-child:nth-child(2n) { grid-column: 1 / -1; }
	.fc-accueil-grille .fc-liste .wp-block-post-template > li:first-child,
	.fc-accueil-grille .fc-liste .wp-block-post-template > li:last-child:nth-child(2n) { display: grid; grid-template-columns: 3fr 2fr; grid-template-rows: auto auto 1fr; column-gap: 1.5rem; align-content: start; }
	.fc-accueil-grille .fc-liste .wp-block-post-template > li:first-child > figure,
	.fc-accueil-grille .fc-liste .wp-block-post-template > li:last-child:nth-child(2n) > figure { grid-row: 1 / span 3; }
	.fc-accueil-grille .fc-liste .wp-block-post-template > li:first-child > :not(figure),
	.fc-accueil-grille .fc-liste .wp-block-post-template > li:last-child:nth-child(2n) > :not(figure) { margin-left: 0; }
}

/*
 * Téléphone (commun à toutes les formes) : le texte commence dans le premier écran (défaut a de l'essai, FIR-286).
 * En-tête sur une ligne, fil d'Ariane coupé par « … », titre de 26 px, signature, légendes et mention d'affiliation
 * en 12 px (la légende reste entière, mention « Image créée par IA. » comprise). L'image à la une reste entière.
 */
@media (max-width: 600px) {
	.wp-site-blocks .fc-entete { padding-top: 8px !important; padding-bottom: 8px !important; }
	.wp-site-blocks .fc-entete .alignwide { flex-wrap: nowrap !important; gap: .5rem; }
	.wp-site-blocks .fc-entete .alignwide > .wp-block-group { min-width: 0; gap: .5rem; }
	.wp-site-blocks .fc-entete .wp-block-site-logo img { width: 34px !important; height: 34px !important; }
	.wp-site-blocks .fc-entete .wp-block-site-title { font-size: 1rem !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
	.wp-site-blocks .fc-entete .fc-menu a { font-size: .8125rem; white-space: nowrap; }
	.wp-site-blocks main.fc-article { margin-top: 12px !important; }
	.wp-site-blocks .fc-fil-ariane { font-size: .75rem; }
	.wp-site-blocks .fc-fil-ariane p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.wp-site-blocks h1.wp-block-post-title { font-size: 1.625rem; margin-top: .4rem; margin-bottom: .4rem; }
	.wp-site-blocks .fc-infos { font-size: .75rem; line-height: 1.4; margin: .3rem 0 .6rem; }
	.wp-site-blocks .fc-article .wp-block-post-featured-image { margin-top: .5rem; margin-bottom: .25rem; }
	.wp-site-blocks .fc-legende-une, .wp-site-blocks .fc-image-accueil figcaption { font-size: .75rem; line-height: 1.35; margin-top: .3rem !important; }
	.wp-site-blocks .fc-affiliation { font-size: .75rem; margin: .5rem 0 !important; }
	.wp-site-blocks .entry-content > p:first-child { margin-top: .75rem; }
	.fc-liste .wp-block-post-template.is-layout-grid { grid-template-columns: 1fr !important; }
	.fc-liste .wp-block-post-template > li { grid-column: auto !important; }
	.fc-accueil-une .fc-liste .wp-block-post-template > li:first-child .wp-block-post-title { font-size: 1.4rem !important; }
}

/* Page de style du site d'essai (kit 1.5.0, morceau 2, FIR-453 ; motif patterns/guide-de-style.php) : nuances, angles et états des boutons montrés côte à côte. */
.fc-style__couleurs { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; font-size: .95rem; }
.fc-style__couleurs li { display: flex; gap: .75rem; align-items: center; }
.fc-style__nuance { flex: none; width: 3rem; height: 3rem; border-radius: var(--fc-rayon-petit); border: 1px solid var(--fc-filet); }
.fc-style__angles, .fc-style__boutons { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.fc-style__angle { flex: 1 1 12rem; padding: 1.25rem; background: var(--fc-surface); border-radius: var(--fc-rayon); }
.fc-style__angle--petit { border-radius: var(--fc-rayon-petit); }
.fc-style__legende { margin: 0; font-size: .85rem; color: var(--fc-texte-2); }
.fc-bouton__lien.fc-style__survol { background: var(--fc-action-survol); }
.fc-bouton__lien.fc-style__focus { outline: 2px solid var(--fc-principale); outline-offset: 2px; }
