/* ==================================================================================================================
 * Passe 31 (16/11/2026) : la rubrique L'entreprise en six pages. Demande du client du 15/11/2026 au soir : Matériel
 * et Câblage rejoignent L'entreprise (outils/refonte/r79-preprod-rubrique-entreprise.sh), la page FAQ disparaît.
 * Feuille chargée après style.css (functions.php, assets/css/passe-*.css). Elle ne vise que la barre des pages et
 * les cartes de la page mère (inc/pages-editoriales.php, style.css passe 23, section 6 bis).
 * - Pictogrammes de Matériel et Câblage à leur nouvelle adresse (ceux de style.css visent /conseils/...).
 * - Cartes en écrin, numérotées, image entière (images composées par r83, 16/11/2026) ; six cartes : trois par ligne
 *   sur grand écran (deux lignes égales au lieu de quatre puis deux), deux sur tablette,
 *   une sur téléphone.
 * ================================================================================================================== */

body .wp-block-post-content :is(.onglets-rubriques, .liens-rubriques) a[href*="-legato/materiel/"],
body .wp-block-post-content :is(.onglets-rubriques, .liens-rubriques) a[href*="/entreprise/materiel/"],
body .wp-block-post-content :is(.onglets-rubriques, .liens-rubriques) a[href*="/enceintes-jean-maurer/"] {
	--picto: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='2.5' width='12' height='19' rx='1'/%3E%3Ccircle cx='12' cy='7.2' r='1.7'/%3E%3Ccircle cx='12' cy='14.6' r='3.9'/%3E%3Ccircle cx='12' cy='14.6' r='1.1'/%3E%3C/svg%3E");
}

body .wp-block-post-content :is(.onglets-rubriques, .liens-rubriques) a[href*="-legato/cablage/"],
body .wp-block-post-content :is(.onglets-rubriques, .liens-rubriques) a[href*="/entreprise/cablage/"] {
	--picto: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.8 12h2.4M19.8 12h2.4'/%3E%3Crect x='4.2' y='9.4' width='4' height='5.2' rx='.6'/%3E%3Crect x='15.8' y='9.4' width='4' height='5.2' rx='.6'/%3E%3Cpath d='M8.2 12c1.9-4.4 5.7 4.4 7.6 0'/%3E%3C/svg%3E");
}

/* TotalDAC (r84) : un appareil, sa façade et son afficheur. */
body .wp-block-post-content :is(.onglets-rubriques, .liens-rubriques) a[href*="/totaldac/"] {
	--picto: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='7.5' width='19' height='9' rx='1'/%3E%3Cpath d='M5.5 12h6'/%3E%3Ccircle cx='17.5' cy='12' r='1.6'/%3E%3Cpath d='M4.5 16.5v1.5M19.5 16.5v1.5'/%3E%3C/svg%3E");
}

body .wp-block-post-content > .cartes-pages--6 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	max-width: 64rem !important;
}

/* Sept cartes (r84 : Matériel scindée) : quatre puis trois, centrées, sur grand écran ; deux par ligne sur tablette
   (la dernière centrée), une sur téléphone. */
body .wp-block-post-content > .cartes-pages--7 {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	--cartes-col: 4;
}

body .wp-block-post-content > .cartes-pages--7 > li {
	flex: 0 0 calc((100% - (var(--cartes-col) - 1) * clamp(1rem, 2vw, 1.5rem)) / var(--cartes-col));
}

@media (max-width: 1099.98px) {
	body .wp-block-post-content > .cartes-pages--7 {
		--cartes-col: 3;
	}
}

@media (max-width: 899.98px) {
	body .wp-block-post-content > .cartes-pages--7 {
		--cartes-col: 2;
	}
}

@media (max-width: 559.98px) {
	body .wp-block-post-content > .cartes-pages--7 {
		--cartes-col: 1;
	}
}

@media (max-width: 899.98px) {
	body .wp-block-post-content > .cartes-pages--6 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 559.98px) {
	body .wp-block-post-content > .cartes-pages--6 {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Barre de six pages sur grand écran : deux lignes égales (trois et trois) plutôt que quatre puis deux. Sur
   téléphone et tablette, elle reste sur une ligne qui défile (style.css). */
@media (min-width: 782px) {
	body .wp-block-post-content .onglets-pages:has(> .wp-block-button:nth-child(6):last-child) {
		max-width: min(100%, 54rem) !important;
	}

	/* Sept pages (r84) : quatre puis trois. */
	body .wp-block-post-content .onglets-pages:has(> .wp-block-button:nth-child(7):last-child) {
		max-width: min(100%, 72rem) !important;
	}
}

/* Carte d'une page sans image (Câblage) : son pictogramme or au centre du cadre, au lieu d'un cadre vide. */
.carte-page {
	--picto-carte: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M12 3.5l6.5 8.5-6.5 8.5-6.5-8.5z'/%3E%3Cpath d='M12 8.6l2.6 3.4-2.6 3.4-2.6-3.4z'/%3E%3C/svg%3E");
}

.carte-page[href*="/cablage/"] {
	--picto-carte: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.8 12h2.4M19.8 12h2.4'/%3E%3Crect x='4.2' y='9.4' width='4' height='5.2' rx='.6'/%3E%3Crect x='15.8' y='9.4' width='4' height='5.2' rx='.6'/%3E%3Cpath d='M8.2 12c1.9-4.4 5.7 4.4 7.6 0'/%3E%3C/svg%3E");
}

.carte-page__image:empty {
	position: relative;
}

.carte-page__image:empty::after {
	content: "";
	position: absolute;
	inset: 0;
	width: 30%;
	height: 30%;
	margin: auto;
	background-color: var(--wp--preset--color--or);
	opacity: 0.8;
	-webkit-mask: var(--picto-carte) center / contain no-repeat;
	mask: var(--picto-carte) center / contain no-repeat;
}

/* Cartes en écrin (16/11/2026, retour du client : « mets plus en valeur les différents modules, les cases ») :
   cadre or plus présent, fond légèrement dégradé, ombre profonde ; au survol, la carte monte de 4 px dans un halo or.
   Image entière dans son cadre 4:3 (images composées pour la carte, r83), fondue vers le titre ; numéro or de la
   page devant le titre, séparé par un filet. */
.carte-page {
	overflow: hidden;
	border-color: rgb(230 177 12 / 0.5);
	background: linear-gradient(180deg, #141415 0%, #0B0B0C 100%);
	box-shadow: 0 1.5rem 3rem -1.75rem rgb(0 0 0 / 0.9), inset 0 1px 0 rgb(242 201 76 / 0.14);
	transition: border-color 0.35s ease, box-shadow 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.carte-page:is(:hover, :focus-visible) {
	box-shadow: 0 2rem 3.5rem -1.75rem rgb(0 0 0 / 0.95), 0 0 2.75rem -0.75rem rgb(230 177 12 / 0.32), inset 0 1px 0 rgb(242 201 76 / 0.3);
}

.carte-page__image {
	position: relative;
}

.carte-page__image::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 62%, rgb(11 11 12 / 0.55) 100%);
	pointer-events: none;
}

.carte-page__titre {
	justify-content: flex-start;
	gap: 0.9rem;
	padding: 1.15rem 1.25rem 1.2rem;
}

.carte-page__titre::after {
	margin-left: auto;
}

.carte-page__numero {
	flex: none;
	padding-right: 0.9rem;
	border-right: 1px solid rgb(230 177 12 / 0.45);
	font-family: var(--wp--preset--font-family--josefin-sans);
	font-size: 0.85rem;
	letter-spacing: 0.14em;
	line-height: 1.2;
	color: var(--wp--preset--color--or);
}

@media (prefers-reduced-motion: no-preference) {
	.carte-page:is(:hover, :focus-visible) {
		transform: translateY(-4px);
	}
}

/* Page mère : la FAQ suit les cartes sans grand vide (les cartes ont déjà leur marge basse). */
body .wp-block-post-content > .cartes-pages + .faq-page {
	padding-top: clamp(1.5rem, 1rem + 1.5vw, 2.5rem);
}
