/*
Theme Name: SafeYield Child
Theme URI: https://usesafeyield.com
Description: Thème enfant SafeYield, basé sur GeneratePress. Porte les design tokens (palette claire/sombre, typographie, rayons, ombres, espacements) du site SafeYield — un seul fichier à modifier pour propager un changement de style sur toutes les pages/langues.
Author: CA.SA
Template: generatepress
Version: 2.1.0
Text Domain: safeyield-child
*/

/* ==========================================================================
   1. Design tokens — palette « coffee shop » claire/sombre (brief §4)
   ========================================================================== */
:root {
	--sy-bg: #FBF9F5;
	--sy-surface: #FFFFFF;
	--sy-surface-2: #F4EFE7;
	--sy-text: #1B1917;
	--sy-text-2: #6E665E;
	--sy-border: #E7DFD3;
	--sy-accent: #0B6249;
	--sy-accent-fill: #0E7A5A;

	/* Section « inversée » (hero, CTA final) : toujours sombre, indépendamment du mode clair/sombre du site — un accent visuel délibéré, pas un état du toggle. */
	--sy-invert-bg: #16140F;
	--sy-invert-text: #F4EFE6;
	--sy-invert-border: rgba(244, 239, 230, 0.16);

	--sy-focus-ring: rgba(11, 98, 73, 0.45);

	/* Typographie — Inter uniquement (brief §4) */
	--sy-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

	/* Rayons */
	--sy-radius-sm: 8px;
	--sy-radius-md: 14px;
	--sy-radius-lg: 24px;
	--sy-radius-pill: 999px;

	/* Ombres (douces, cohérentes avec un fond clair chaud) */
	--sy-shadow-sm: 0 1px 2px rgba(27, 25, 23, 0.05), 0 1px 3px rgba(27, 25, 23, 0.08);
	--sy-shadow-md: 0 4px 6px rgba(27, 25, 23, 0.04), 0 10px 15px rgba(27, 25, 23, 0.07);
	--sy-shadow-lg: 0 10px 15px rgba(27, 25, 23, 0.05), 0 20px 40px rgba(27, 25, 23, 0.10);

	/* Espacements (échelle 4px) */
	--sy-space-1: 4px;
	--sy-space-2: 8px;
	--sy-space-3: 12px;
	--sy-space-4: 16px;
	--sy-space-6: 24px;
	--sy-space-8: 32px;
	--sy-space-12: 48px;
	--sy-space-16: 64px;
	--sy-space-24: 96px;

	/* Largeur de contenu */
	--sy-content-width: 1180px;

	color-scheme: light;
}

/* Respect de prefers-color-scheme par défaut, sauf override manuel via [data-theme] */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--sy-bg: #16140F;
		--sy-surface: #1E1B15;
		--sy-surface-2: #252118;
		--sy-text: #F4EFE6;
		--sy-text-2: #A69D91;
		--sy-border: #332E24;
		--sy-accent: #4FD6A2;
		--sy-accent-fill: #2FA97C;
		color-scheme: dark;
	}
}

/* Bascule manuelle (bouton clair/sombre) */
:root[data-theme="dark"] {
	--sy-bg: #16140F;
	--sy-surface: #1E1B15;
	--sy-surface-2: #252118;
	--sy-text: #F4EFE6;
	--sy-text-2: #A69D91;
	--sy-border: #332E24;
	--sy-accent: #4FD6A2;
	--sy-accent-fill: #2FA97C;
	color-scheme: dark;
}

:root[data-theme="light"] {
	--sy-bg: #FBF9F5;
	--sy-surface: #FFFFFF;
	--sy-surface-2: #F4EFE7;
	--sy-text: #1B1917;
	--sy-text-2: #6E665E;
	--sy-border: #E7DFD3;
	--sy-accent: #0B6249;
	--sy-accent-fill: #0E7A5A;
	color-scheme: light;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
html {
	background-color: var(--sy-bg);
}

body {
	font-family: var(--sy-font);
	color: var(--sy-text);
	background-color: var(--sy-bg);
	font-size: 16px;
	line-height: 1.62;
	transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--sy-font);
	color: var(--sy-text);
	line-height: 1.15;
	font-weight: 660;
	letter-spacing: -0.03em;
}

h1 { font-size: clamp(2.25rem, 4vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); }

p, li {
	color: var(--sy-text);
}

a {
	color: var(--sy-accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

a:hover {
	color: var(--sy-accent-fill);
}

::selection {
	background-color: var(--sy-accent);
	color: var(--sy-invert-text);
}

:focus-visible {
	outline: 3px solid var(--sy-focus-ring);
	outline-offset: 2px;
}

/* ==========================================================================
   3. Composants de base
   ========================================================================== */

/* Boutons */
.sy-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sy-space-2);
	padding: var(--sy-space-3) var(--sy-space-6);
	border-radius: var(--sy-radius-md);
	font-weight: 640;
	font-size: 1rem;
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.sy-button:hover {
	transform: translateY(-1px);
}

.sy-button--primary {
	background-color: var(--sy-accent);
	color: var(--sy-invert-text);
	box-shadow: var(--sy-shadow-sm);
}

.sy-button--primary:hover {
	background-color: var(--sy-accent-fill);
	color: var(--sy-invert-text);
}

.sy-button--secondary {
	background-color: transparent;
	color: var(--sy-text);
	border: 1.5px solid var(--sy-border);
}

.sy-button--secondary:hover {
	background-color: var(--sy-surface-2);
	color: var(--sy-text);
}

/* Sur fond inversé (hero, CTA final), le bouton secondaire doit rester lisible */
.sy-section--invert .sy-button--secondary {
	color: var(--sy-invert-text);
	border-color: var(--sy-invert-border);
}

.sy-section--invert .sy-button--secondary:hover {
	background-color: rgba(255, 255, 255, 0.08);
}

/* Cartes */
.sy-card {
	background-color: var(--sy-surface);
	border-radius: var(--sy-radius-lg);
	padding: var(--sy-space-8);
	box-shadow: var(--sy-shadow-sm);
	border: 1px solid var(--sy-border);
}

/* Sections */
.sy-section {
	padding-block: var(--sy-space-24);
}

.sy-section--alt {
	background-color: var(--sy-surface-2);
}

.sy-section--invert {
	background-color: var(--sy-invert-bg);
	color: var(--sy-invert-text);
}

.sy-section--invert h1,
.sy-section--invert h2,
.sy-section--invert h3,
.sy-section--invert p {
	color: var(--sy-invert-text);
}

/* Barre de confiance */
.sy-trust-bar {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sy-space-8);
	justify-content: center;
	align-items: center;
	font-size: 0.9rem;
	color: var(--sy-text-2);
}

/* Disclaimer réglementaire (footer) */
.sy-disclaimer {
	font-size: 0.8rem;
	color: var(--sy-text-2);
	line-height: 1.5;
	max-width: 70ch;
}

.sy-section--invert .sy-disclaimer {
	color: rgba(244, 239, 230, 0.65);
}

/* Badge estimation (calculateur) */
.sy-badge-estimate {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 640;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--sy-accent);
	background-color: var(--sy-surface-2);
	border-radius: var(--sy-radius-pill);
	padding: var(--sy-space-1) var(--sy-space-3);
}

/* Tableau comparatif « Avant / Avec SafeYield » */
.sy-compare-table {
	width: 100%;
	border-collapse: collapse;
	background-color: var(--sy-surface);
	border-radius: var(--sy-radius-lg);
	overflow: hidden;
	box-shadow: var(--sy-shadow-sm);
	border: 1px solid var(--sy-border);
}

.sy-compare-table th,
.sy-compare-table td {
	padding: var(--sy-space-4) var(--sy-space-6);
	text-align: left;
	border-bottom: 1px solid var(--sy-border);
	font-size: 0.95rem;
}

.sy-compare-table th {
	font-weight: 660;
	background-color: var(--sy-surface-2);
}

.sy-compare-table tr:last-child td {
	border-bottom: none;
}

.sy-compare-table td:last-child,
.sy-compare-table th:last-child {
	color: var(--sy-accent);
	font-weight: 640;
}

/* ==========================================================================
   4. En-tête sticky
   ========================================================================== */
.sy-header {
	position: sticky;
	top: 0;
	z-index: 100;
	backdrop-filter: blur(12px);
	background-color: color-mix(in srgb, var(--sy-bg) 85%, transparent);
	border-bottom: 1px solid var(--sy-border);
}

/* ==========================================================================
   5. Bascule clair/sombre
   ========================================================================== */
.sy-theme-toggle {
	position: fixed;
	right: var(--sy-space-4);
	bottom: var(--sy-space-4);
	z-index: 200;
	display: inline-flex;
	align-items: center;
	gap: var(--sy-space-2);
	padding: var(--sy-space-2) var(--sy-space-4);
	border-radius: var(--sy-radius-pill);
	border: 1px solid var(--sy-border);
	background-color: var(--sy-surface);
	color: var(--sy-text);
	box-shadow: var(--sy-shadow-md);
	font-family: var(--sy-font);
	font-size: 0.85rem;
	font-weight: 640;
	cursor: pointer;
}

.sy-theme-toggle:hover {
	background-color: var(--sy-surface-2);
}

/* ==========================================================================
   6. Utilitaires responsives
   ========================================================================== */
@media (max-width: 782px) {
	.sy-section {
		padding-block: var(--sy-space-16);
	}

	.sy-compare-table {
		font-size: 0.85rem;
	}

	.sy-compare-table th,
	.sy-compare-table td {
		padding: var(--sy-space-2) var(--sy-space-3);
	}
}
