/*
Theme Name: Ahmed Science Facile
Theme URI: https://ahmedsciencefacile.fr
Author: Pr. Ahmed & Pr. Hamza
Description: Thème de la plateforme Ahmed Science Facile : cours, exercices, TP et séances de physique-chimie et mathématiques. Couleurs vertes, mode clair / sombre, bouton WhatsApp.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ahmed-science-facile
*/

/* ---------- Mode sombre : on redéfinit les couleurs du thème ---------- */
html[data-theme="dark"] {
	--wp--preset--color--vert: #6fd3a0;
	--wp--preset--color--or: #f0b84a;
	--wp--preset--color--bleu-vert: #6cc3d4;
	--wp--preset--color--fond: #0b1510;
	--wp--preset--color--surface: #12211a;
	--wp--preset--color--texte: #e3efe8;
	--wp--preset--color--gris: #8fa99b;
	--wp--preset--color--ligne: #22382c;
	--wp--preset--color--vert-clair: #163126;
	--wp--preset--color--or-clair: #33280f;
	color-scheme: dark;
}
html[data-theme="dark"] .asf-hero { background: var(--wp--preset--color--vert-clair) !important; }
html[data-theme="dark"] .asf-hero .wp-block-button:not(.is-style-outline) .wp-block-button__link { color: #1d1205; }

/* ---------- Éléments d'interface ---------- */
:focus-visible { outline: 3px solid var(--wp--preset--color--or); outline-offset: 2px; }

.asf-logo {
	width: 46px; height: 46px; flex: none;
	border: 2px solid var(--wp--preset--color--vert); border-radius: 6px;
	display: grid; place-items: center; position: relative;
	font-family: var(--wp--preset--font-family--sora); font-weight: 700; font-size: 1.15rem;
	color: var(--wp--preset--color--vert); text-decoration: none;
}
.asf-logo small { position: absolute; top: 1px; left: 4px; font-size: .55rem; font-weight: 600; }

.asf-theme-toggle {
	width: 40px; height: 40px; border-radius: 50%; padding: 0; cursor: pointer;
	border: 1px solid var(--wp--preset--color--ligne);
	background: var(--wp--preset--color--surface); color: var(--wp--preset--color--texte);
	display: inline-grid; place-items: center;
}
.asf-theme-toggle svg { width: 20px; height: 20px; }
.asf-theme-toggle .asf-sun { display: none; }
html[data-theme="dark"] .asf-theme-toggle .asf-sun { display: block; }
html[data-theme="dark"] .asf-theme-toggle .asf-moon { display: none; }

.asf-whatsapp {
	position: fixed; right: 18px; bottom: 18px; z-index: 99;
	display: flex; align-items: center; gap: 8px;
	background: #1f9d55; color: #fff !important; text-decoration: none !important;
	font-weight: 700; padding: 11px 16px; border-radius: 999px;
	box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.asf-whatsapp svg { width: 20px; height: 20px; fill: currentColor; }

/* Cartes et pastilles */
.asf-card h3 a { color: var(--wp--preset--color--vert); text-decoration: none; }
.asf-card h3 a:hover { text-decoration: underline; }
h1, h2, h3 { overflow-wrap: break-word; hyphens: manual; }
.asf-card { border: 1px solid var(--wp--preset--color--ligne); border-radius: 12px; }
.asf-card-pc { border-left: 5px solid var(--wp--preset--color--vert) !important; }
.asf-card-maths { border-left: 5px solid var(--wp--preset--color--bleu-vert) !important; }
.asf-card-tp { border-left: 5px solid var(--wp--preset--color--or) !important; }
.asf-securite { border-radius: 10px; }

.wp-block-button.is-style-outline .wp-block-button__link { border-width: 1px; }

.asf-wa-btn .wp-block-button__link { background: #1f9d55 !important; color: #fff !important; }

/* Tableaux de mesures des TP */
.asf-mesures table { border-collapse: collapse; width: 100%; }
.asf-mesures td, .asf-mesures th { border: 1px solid var(--wp--preset--color--ligne); padding: 10px 8px; }
.asf-mesures td { height: 2.2em; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
