/*
Theme Name: École CDK
Theme URI: https://example.org/ecole-cdk
Author: École élémentaire CDK
Description: Thème FSE sur-mesure pour le site vitrine de l’école élémentaire CDK — chaleureux, épuré et lisible.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ecole-cdk
Tags: full-site-editing, block-patterns, education, accessibility-ready
*/

/*
 * Les styles globaux vivent dans theme.json.
 * Ce fichier ne contient que ce que theme.json ne sait pas exprimer.
 */

/* Les bandeaux colorés s'enchaînent sans espace parasite. */
.wp-site-blocks > main,
.wp-site-blocks > footer {
	margin-block-start: 0;
}

/* Focus clavier bien visible partout. */
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--soleil);
	outline-offset: 3px;
	border-radius: 4px;
}

/* Sections larges des pages : le texte courant garde une longueur de ligne lisible. */
.cdk-section > p,
.cdk-section > .wp-block-list {
	max-width: 70ch;
}

/* Surtitre au-dessus des titres de section. */
.cdk-surtitre {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* Cartes (actualités, classes, équipe, activités). */
.cdk-carte {
	background: var(--wp--preset--color--blanc);
	border-radius: 20px;
	box-shadow: var(--wp--preset--shadow--douce);
	height: 100%;
	padding: var(--wp--preset--spacing--40);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cdk-carte:hover {
	box-shadow: var(--wp--preset--shadow--marquee);
	transform: translateY(-3px);
}

/* Dans une colonne, la carte garde sa hauteur naturelle. */
.wp-block-column > .cdk-carte {
	height: auto;
}

.cdk-carte > :first-child {
	margin-block-start: 0;
}

/* Grille d'actualités : l'image colle aux bords de la carte. */
.cdk-carte--actu {
	padding: 0;
	overflow: hidden;
}

.cdk-carte--actu .wp-block-post-featured-image {
	border-radius: 0;
	margin: 0;
}

.cdk-carte--actu .wp-block-post-featured-image img {
	border-radius: 0;
}

.cdk-carte__corps {
	padding: var(--wp--preset--spacing--40);
}

/* Chiffres clés. */
.cdk-chiffre {
	border-bottom: 3px solid var(--wp--preset--color--soleil);
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 600;
	line-height: 1.1;
	padding-bottom: 0.35rem;
	width: fit-content;
}

/* Citation du mot de la direction : guillemet décoratif. */
.cdk-citation {
	position: relative;
}

.cdk-citation::before {
	color: var(--wp--preset--color--soleil);
	content: "“";
	font-family: var(--wp--preset--font-family--titres);
	font-size: 6rem;
	left: -0.15rem;
	line-height: 1;
	position: absolute;
	top: -3.25rem;
}

/* Illustrations SVG. */
.cdk-illustration img {
	border-radius: 0;
	height: auto;
	width: 100%;
}

/* Accordéons (règlement intérieur, FAQ). */
.wp-block-details {
	background: var(--wp--preset--color--blanc);
	border: 1px solid var(--wp--preset--color--menthe);
	border-radius: 14px;
	padding: 1rem 1.25rem;
}

.wp-block-details summary {
	cursor: pointer;
	font-family: var(--wp--preset--font-family--titres);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
}

/* Tableaux (menus, calendrier). */
.wp-block-table table {
	background: var(--wp--preset--color--blanc);
	border-collapse: collapse;
	border-radius: 14px;
	overflow: hidden;
	width: 100%;
}

.wp-block-table th {
	background: var(--wp--preset--color--vert);
	color: var(--wp--preset--color--blanc);
	text-align: left;
}

.wp-block-table th,
.wp-block-table td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--menthe);
	padding: 0.75rem 1rem;
}

/* Liens du pied de page. */
.cdk-liens {
	list-style: none;
	padding-left: 0;
}

.cdk-liens li + li {
	margin-top: 0.35rem;
}

/* Emplacement à remplacer (formulaire, etc.). */
.cdk-emplacement {
	border: 2px dashed var(--wp--preset--color--vert);
	border-radius: 16px;
}

/* Carte OpenStreetMap. */
.cdk-plan iframe {
	border: 0;
	border-radius: 20px;
	display: block;
	height: 380px;
	width: 100%;
}

/* Formulaire de contact (Contact Form 7). */
.wpcf7 {
	background: var(--wp--preset--color--blanc);
	border-radius: 20px;
	box-shadow: var(--wp--preset--shadow--douce);
	padding: var(--wp--preset--spacing--40);
}

.wpcf7 form > p,
.cdk-form-ligne > p {
	margin: 0 0 1.25rem;
}

.cdk-form-ligne {
	display: grid;
	gap: 0 1.25rem;
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.wpcf7 label {
	display: block;
	font-weight: 700;
}

.cdk-requis,
.cdk-facultatif {
	color: var(--wp--preset--color--ardoise);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
}

.wpcf7 .wpcf7-form-control-wrap {
	display: block;
	margin-top: 0.4rem;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 select,
.wpcf7 textarea {
	background: var(--wp--preset--color--creme);
	border: 2px solid var(--wp--preset--color--menthe);
	border-radius: 12px;
	box-sizing: border-box;
	color: var(--wp--preset--color--encre);
	font: inherit;
	font-weight: 400;
	padding: 0.7rem 0.9rem;
	transition: border-color 0.15s ease;
	width: 100%;
}

.wpcf7 textarea {
	min-height: 10rem;
	resize: vertical;
}

.wpcf7 input:focus-visible,
.wpcf7 select:focus-visible,
.wpcf7 textarea:focus-visible {
	border-color: var(--wp--preset--color--vert);
	outline-color: var(--wp--preset--color--soleil);
}

.wpcf7 .wpcf7-not-valid {
	border-color: var(--wp--preset--color--corail);
}

.wpcf7 .wpcf7-not-valid-tip {
	color: #B23A1E;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	margin-top: 0.35rem;
}

.cdk-consentement {
	font-size: var(--wp--preset--font-size--small);
}

.cdk-consentement label {
	align-items: flex-start;
	display: flex;
	font-weight: 400;
	gap: 0.6rem;
}

.cdk-consentement input[type="checkbox"] {
	accent-color: var(--wp--preset--color--vert);
	height: 1.15rem;
	margin-top: 0.25rem;
	width: 1.15rem;
}

.cdk-consentement .wpcf7-list-item {
	margin: 0;
}

.wpcf7 .wpcf7-submit {
	background: var(--wp--preset--color--soleil);
	border: 0;
	border-radius: 999px;
	color: var(--wp--preset--color--encre);
	cursor: pointer;
	font-family: var(--wp--preset--font-family--texte);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 800;
	padding: 0.85rem 1.8rem;
}

.wpcf7 .wpcf7-submit:hover {
	background: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--blanc);
}

.wpcf7 .wpcf7-submit:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

.wpcf7 form .wpcf7-response-output {
	border-radius: 12px;
	border-width: 2px;
	margin: 1rem 0 0;
	padding: 0.75rem 1rem;
}

.wpcf7 form.sent .wpcf7-response-output {
	background: var(--wp--preset--color--menthe);
	border-color: var(--wp--preset--color--vert);
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output {
	background: var(--wp--preset--color--peche);
	border-color: var(--wp--preset--color--corail);
}

@media (prefers-reduced-motion: reduce) {
	.cdk-carte {
		transition: none;
	}

	.cdk-carte:hover {
		transform: none;
	}
}
