/*
 * Couches Expert — CSS complémentaire
 *
 * Règle : tout ce qui peut être défini dans theme.json y vit déjà.
 * Ce fichier ne couvre que ce que theme.json ou les blocs natifs ne
 * permettent pas d'exprimer proprement (sticky + backdrop-filter,
 * pseudo-éléments décoratifs, scroll horizontal, transforms, halos,
 * rotation icône <details>, etc.). Tout est scopé en .pcse-*.
 */

/* ─────────────────────────────────────────────────────────────
 * 00 — Header sticky translucide
 * sticky + backdrop-filter non exprimables en theme.json.
 * ───────────────────────────────────────────────────────────── */
.pcse-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: rgba(247, 250, 252, 0.9);
	-webkit-backdrop-filter: saturate(140%) blur(12px);
	backdrop-filter: saturate(140%) blur(12px);
	box-shadow: 0 16px 40px rgba(0, 32, 69, 0.05);
}

@supports not ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
	.pcse-header {
		background-color: var(--wp--preset--color--background);
	}
}

/* Marque éditoriale italique du header */
.pcse-site-brand .wp-block-site-title a {
	font-family: var(--wp--preset--font-family--heading);
	font-style: italic;
	font-weight: 700;
	font-size: 1.5rem;
	letter-spacing: -0.02em;
	color: var(--wp--preset--color--primary);
}

/* ─────────────────────────────────────────────────────────────
 * 01 — Hero éditorial
 * Mesures typographiques courtes + plaque décorative bleue
 * derrière l'image (translate + rotate), non exprimable en theme.json.
 * ───────────────────────────────────────────────────────────── */
.pcse-hero__title {
	max-width: 12ch;
}

.pcse-hero__intro {
	max-width: 38rem;
}

.pcse-hero__label-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	width: fit-content;
	padding: 0.5rem 0.875rem;
	background: var(--wp--preset--color--secondary-soft);
	border-radius: 999px;
	color: var(--wp--preset--color--secondary);
}

.pcse-hero__label-pill::before {
	content: "";
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: currentColor;
	flex: none;
}

.pcse-hero__media {
	position: relative;
	isolation: isolate;
}

.pcse-hero__media::before {
	content: "";
	position: absolute;
	inset: auto -1rem -1rem auto;
	width: 90%;
	height: 90%;
	background: rgba(0, 32, 69, 0.08);
	border-radius: 2rem;
	transform: rotate(4deg);
	z-index: -1;
}

@media (max-width: 781px) {
	.pcse-hero__title {
		max-width: none;
	}
	.pcse-hero__media::before {
		inset: auto -0.5rem -0.5rem auto;
	}
}

/* ─────────────────────────────────────────────────────────────
 * 02 — Bandeau métriques en overlap glass
 * Remontée négative + glass + séparateurs verticaux verts.
 * ───────────────────────────────────────────────────────────── */
.pcse-metrics {
	margin-top: -3rem;
	position: relative;
	z-index: 10;
}

.pcse-metrics__panel {
	background-color: rgba(255, 255, 255, 0.86);
	-webkit-backdrop-filter: saturate(120%) blur(16px);
	backdrop-filter: saturate(120%) blur(16px);
}

@supports not ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
	.pcse-metrics__panel {
		background-color: var(--wp--preset--color--surface);
	}
}

.pcse-metrics__item {
	padding-left: var(--wp--preset--spacing--md);
	border-left: 3px solid var(--wp--preset--color--secondary);
}

.pcse-metrics__value {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	font-size: 2.75rem;
	line-height: 1;
	color: var(--wp--preset--color--secondary);
	margin: 0 0 var(--wp--preset--spacing--xs) 0;
}

.pcse-metrics__label {
	color: var(--wp--preset--color--primary);
	font-size: var(--wp--preset--font-size--meta);
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin: 0;
}

@media (max-width: 781px) {
	.pcse-metrics {
		margin-top: -1.5rem;
	}
	.pcse-metrics__item {
		border-left: none;
		border-top: 3px solid var(--wp--preset--color--secondary);
		padding-left: 0;
		padding-top: var(--wp--preset--spacing--md);
	}
}

/* ─────────────────────────────────────────────────────────────
 * 03 — Podium classement
 * Carte centrale élevée, badge d'angle absolu, gros chiffres
 * décoratifs italiques, étoiles. theme.json ne peut pas exprimer
 * position:absolute, transform translateY négatif, ni les
 * border-radius asymétriques du badge d'angle.
 * ───────────────────────────────────────────────────────────── */
.pcse-ranking__grid {
	align-items: end;
}

.pcse-ranking-card {
	position: relative;
	height: 100%;
}

.pcse-ranking-card__rank {
	font-family: var(--wp--preset--font-family--heading);
	font-style: italic;
	font-weight: 700;
	font-size: 4rem;
	line-height: 1;
	text-align: center;
	color: rgba(0, 32, 69, 0.36);
	margin: 0 0 var(--wp--preset--spacing--md) 0;
}

.pcse-ranking-card--featured {
	transform: translateY(-1rem);
}

.pcse-ranking-card--featured .pcse-ranking-card__rank {
	color: var(--wp--preset--color--secondary);
	font-size: 5rem;
}

.pcse-ranking-card__badge {
	position: absolute;
	top: 0;
	right: 0;
	padding: 0.65rem 1rem;
	background-color: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--surface);
	border-radius: 0 1.5rem 0 1rem;
	font-size: 0.6875rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin: 0;
}

.pcse-ranking-card__image {
	margin: 0;
}

.pcse-ranking-card__image img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 1rem;
}

.pcse-ranking-card__title {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: 1.85rem;
	line-height: 1.1;
	color: var(--wp--preset--color--primary);
	margin: 0;
}

.pcse-ranking-card__rating {
	display: inline-flex;
	gap: 0.2rem;
	color: var(--wp--preset--color--secondary);
	font-size: 1.25rem;
	letter-spacing: 0.05em;
}

.pcse-ranking-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--md);
	flex-wrap: wrap;
	margin-top: auto;
}

.pcse-ranking-card__score {
	color: var(--wp--preset--color--secondary);
	font-weight: 800;
	margin: 0;
}

@media (max-width: 781px) {
	.pcse-ranking-card--featured {
		transform: none;
	}
}

/* ─────────────────────────────────────────────────────────────
 * 04 — Tableau comparatif global
 * scroll-x + thead bleu + badges rang + typo cellules.
 * theme.json ne couvre ni overflow-x:auto ni les pseudo-classes
 * de cellules.
 * ───────────────────────────────────────────────────────────── */
.pcse-table-panel {
	overflow: hidden;
}

.pcse-table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.pcse-comparison-table table {
	width: 100%;
	min-width: 44rem;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--body);
}

.pcse-comparison-table thead {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--surface);
}

.pcse-comparison-table thead th {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: 1rem;
	padding: 1.25rem 1.5rem;
	text-align: left;
}

.pcse-comparison-table th:not(:first-child),
.pcse-comparison-table td:not(:first-child) {
	text-align: center;
}

.pcse-comparison-table th:last-child,
.pcse-comparison-table td:last-child {
	text-align: right;
}

.pcse-comparison-table tbody td {
	padding: 1.25rem 1.5rem;
	color: var(--wp--preset--color--text);
}

.pcse-comparison-table tbody tr + tr td {
	border-top: 1px solid var(--wp--preset--color--border);
}

.pcse-comparison-table__brand {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--md);
	text-align: left;
}

.pcse-comparison-table__brand strong {
	display: block;
	color: var(--wp--preset--color--primary);
}

.pcse-comparison-table__brand small {
	display: block;
	color: var(--wp--preset--color--text-muted);
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.pcse-comparison-table__rank {
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 0.75rem;
	background-color: rgba(10, 108, 68, 0.12);
	color: var(--wp--preset--color--secondary);
	font-weight: 800;
	flex: none;
}

.pcse-comparison-table__rank--muted {
	background-color: var(--wp--preset--color--surface-alt);
	color: rgba(0, 32, 69, 0.55);
}

.pcse-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 1.75rem;
	padding-inline: 0.75rem;
	border-radius: 999px;
	font-size: 0.6875rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.pcse-badge--accent {
	background-color: var(--wp--preset--color--secondary-soft);
	color: var(--wp--preset--color--secondary);
}

.pcse-badge--neutral {
	background-color: var(--wp--preset--color--surface-alt);
	color: var(--wp--preset--color--primary);
}

@media (max-width: 781px) {
	.pcse-comparison-table thead th,
	.pcse-comparison-table tbody td {
		padding: 0.875rem 1rem;
	}
	.pcse-comparison-table table {
		min-width: 36rem;
	}
}

/* ─────────────────────────────────────────────────────────────
 * 05 — Guide composition chimique (split content)
 * Callout vert + plaque décorative bleu-marine derrière l'image.
 * ───────────────────────────────────────────────────────────── */
.pcse-callout {
	position: relative;
	background-color: var(--wp--preset--color--secondary-soft);
	color: var(--wp--preset--color--primary);
}

.pcse-callout__icon {
	color: var(--wp--preset--color--secondary);
	font-size: 2rem;
	font-style: normal;
	line-height: 1;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	margin-bottom: var(--wp--preset--spacing--sm);
}

.pcse-image-panel {
	position: relative;
	isolation: isolate;
}

.pcse-image-panel--primary::before {
	content: "";
	position: absolute;
	inset: auto auto -1.25rem -1.25rem;
	width: 90%;
	height: 90%;
	background: var(--wp--preset--color--primary-soft);
	border-radius: 2rem;
	z-index: -1;
}

.pcse-image-panel--secondary::before {
	content: "";
	position: absolute;
	inset: -1.25rem -1.25rem auto auto;
	width: 90%;
	height: 90%;
	background: var(--wp--preset--color--secondary-soft);
	border-radius: 2rem;
	z-index: -1;
}

.pcse-image-panel img {
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	border-radius: 2rem;
	box-shadow: var(--wp--preset--shadow--card);
}

@media (max-width: 781px) {
	.pcse-image-panel--primary::before,
	.pcse-image-panel--secondary::before {
		inset: auto auto -0.75rem -0.75rem;
		width: 80%;
		height: 80%;
	}
	.pcse-image-panel--secondary::before {
		inset: -0.75rem -0.75rem auto auto;
	}
}

/* ─────────────────────────────────────────────────────────────
 * 06 — Finder / scénarios
 * Tabs pills (radius 999px non gérable proprement par defaut sur
 * un bouton individuel via theme.json) + icône carrée verte.
 * ───────────────────────────────────────────────────────────── */
.pcse-finder-tabs .wp-block-button__link {
	border-radius: 999px !important;
	min-height: 3rem;
	padding-inline: 1.5rem;
	font-weight: 700;
}

.pcse-finder-tab--inactive .wp-block-button__link {
	background-color: var(--wp--preset--color--surface-alt) !important;
	color: var(--wp--preset--color--primary) !important;
	box-shadow: none !important;
}

.pcse-finder-tab--inactive .wp-block-button__link:hover,
.pcse-finder-tab--inactive .wp-block-button__link:focus {
	background-color: var(--wp--preset--color--secondary) !important;
	color: var(--wp--preset--color--surface) !important;
	box-shadow: 0 12px 24px rgba(10, 108, 68, 0.16) !important;
}

.pcse-finder-tab--active .wp-block-button__link {
	background-color: var(--wp--preset--color--secondary) !important;
	color: var(--wp--preset--color--surface) !important;
	box-shadow: 0 12px 24px rgba(10, 108, 68, 0.16) !important;
}

.pcse-option-card__icon {
	display: inline-grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	background-color: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--surface);
	border-radius: 0.75rem;
	margin-bottom: var(--wp--preset--spacing--sm);
}

.pcse-option-card__icon svg {
	width: 1.5rem;
	height: 1.5rem;
}

@media (min-width: 782px) and (max-width: 960px) {
	.pcse-option-grid .wp-block-column {
		flex-basis: calc(50% - var(--wp--preset--spacing--xl) / 2) !important;
		flex-grow: 0;
	}
}

/* ─────────────────────────────────────────────────────────────
 * 07 — Expertise terrain (split inversé)
 * feature-card avec icône verte sur fond surface-strong.
 * ───────────────────────────────────────────────────────────── */
.pcse-feature-card {
	display: flex;
	gap: var(--wp--preset--spacing--md);
	padding: var(--wp--preset--spacing--lg);
	background-color: var(--wp--preset--color--surface-strong);
	border-radius: 1.5rem;
}

.pcse-feature-card__icon {
	display: inline-grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	background-color: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--surface);
	border-radius: 0.75rem;
	flex: none;
}

.pcse-feature-card__icon svg {
	width: 1.5rem;
	height: 1.5rem;
}

.pcse-feature-card__title {
	color: var(--wp--preset--color--primary);
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	font-weight: 800;
	margin: 0;
}

.pcse-feature-card__text {
	color: var(--wp--preset--color--text-muted);
	font-size: 0.95rem;
	margin: var(--wp--preset--spacing--xs) 0 0 0;
}

@media (max-width: 781px) {
	.pcse-feature-card {
		flex-direction: column;
	}
}

/* ─────────────────────────────────────────────────────────────
 * 08 — Articles éditoriaux (blog cards)
 * Image 16:10 + zoom hover, badge top, titre serif.
 * ───────────────────────────────────────────────────────────── */
.pcse-article-card__image {
	display: block;
	overflow: hidden;
	border-radius: 1rem;
	box-shadow: var(--wp--preset--shadow--soft);
	margin: 0;
}

.pcse-article-card__image img {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	transition: transform 280ms ease;
}

.pcse-article-card:hover .pcse-article-card__image img {
	transform: scale(1.04);
}

/* ─────────────────────────────────────────────────────────────
 * 09 — FAQ (core/details)
 * Suppression marker + rotation icône à l'ouverture.
 * theme.json ne peut pas exprimer l'état [open] ni le marker.
 * ───────────────────────────────────────────────────────────── */
.pcse-faq-list .wp-block-details {
	background-color: var(--wp--preset--color--surface);
	border-radius: 1rem;
	padding: var(--wp--preset--spacing--lg);
	box-shadow: 0 14px 28px rgba(0, 32, 69, 0.04);
}

.pcse-faq-list .wp-block-details summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--md);
	color: var(--wp--preset--color--primary);
	font-weight: 700;
	cursor: pointer;
	list-style: none;
}

.pcse-faq-list .wp-block-details summary::-webkit-details-marker,
.pcse-faq-list .wp-block-details summary::marker {
	display: none;
	content: "";
}

.pcse-faq-list .wp-block-details summary::after {
	content: "+";
	display: inline-grid;
	place-items: center;
	width: 1.5rem;
	height: 1.5rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1.5rem;
	font-weight: 400;
	line-height: 1;
	color: var(--wp--preset--color--primary);
	transition: transform 180ms ease;
}

.pcse-faq-list .wp-block-details[open] summary::after {
	transform: rotate(45deg);
}

.pcse-faq-list .wp-block-details > *:not(summary) {
	margin-top: var(--wp--preset--spacing--md);
	color: var(--wp--preset--color--text-muted);
}

/* ─────────────────────────────────────────────────────────────
 * 10 — CTA final
 * Halo vert flouté + max-width titre + bouton clair ombré.
 * theme.json ne peut pas exprimer ::after ni filter:blur.
 * ───────────────────────────────────────────────────────────── */
.pcse-cta {
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

.pcse-cta::after {
	content: "";
	position: absolute;
	right: -7rem;
	top: -7rem;
	width: 18rem;
	height: 18rem;
	border-radius: 50%;
	background: rgba(159, 245, 193, 0.12);
	filter: blur(2rem);
	z-index: -1;
}

.pcse-cta__title {
	max-width: 14ch;
	margin-inline: auto;
	color: var(--wp--preset--color--surface);
	font-size: clamp(2.75rem, 6vw, 4.5rem);
	line-height: 1;
}

.pcse-cta__text {
	max-width: 38rem;
	margin-inline: auto;
}

.pcse-cta__label {
	color: rgba(255, 255, 255, 0.72) !important;
}

.pcse-cta-button .wp-block-button__link {
	background-color: var(--wp--preset--color--surface) !important;
	color: var(--wp--preset--color--primary) !important;
	box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15) !important;
}

/* ─────────────────────────────────────────────────────────────
 * 11 — Footer
 * Marque verte clair + headings caps verts + bottom bar séparée.
 * ───────────────────────────────────────────────────────────── */
.pcse-footer .wp-block-site-title a {
	font-family: var(--wp--preset--font-family--heading);
	font-style: italic;
	font-weight: 700;
	font-size: 1.5rem;
	color: var(--wp--preset--color--secondary-soft);
}

.pcse-footer__heading {
	color: var(--wp--preset--color--secondary-soft) !important;
	font-size: var(--wp--preset--font-size--meta) !important;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	margin: 0 0 var(--wp--preset--spacing--md) 0;
}

.pcse-footer__bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding-top: var(--wp--preset--spacing--lg);
	text-align: center;
}

.pcse-footer ul {
	list-style: none;
	padding-left: 0;
	margin: 0;
}

/* ─────────────────────────────────────────────────────────────
 * Composants transverses
 * ───────────────────────────────────────────────────────────── */

/* Label de section caps (sans pill) */
.pcse-section-label {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--xs);
	color: var(--wp--preset--color--primary);
	font-size: var(--wp--preset--font-size--meta);
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	margin: 0;
}

/* Lien texte avec flèche */
.pcse-text-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	color: var(--wp--preset--color--primary);
	font-weight: 700;
	transition: color 180ms ease, transform 180ms ease;
}

.pcse-text-link:hover,
.pcse-text-link:focus {
	color: var(--wp--preset--color--secondary);
	transform: translateX(0.15rem);
}

.pcse-text-link svg {
	width: 1rem;
	height: 1rem;
}

/* Section heading "between" : titre à gauche, lien à droite */
@media (max-width: 781px) {
	.pcse-section-heading--between {
		flex-direction: column;
		align-items: flex-start !important;
	}
}

/* Section narrow (FAQ) */
.pcse-section--narrow > * {
	max-width: 52rem;
	margin-inline: auto;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
	.pcse-article-card:hover .pcse-article-card__image img,
	.pcse-text-link:hover,
	.pcse-faq-list .wp-block-details[open] summary::after {
		transform: none;
		transition: none;
	}
}
