/*
Theme Name: Costa Verde
Theme URI: https://ramonage.corsica
Author: Costa Verde Ramonage
Description: Thème block sur mesure pour Costa Verde Ramonage, l'expert du toit en Corse depuis 1999. Palette issue du logo — noir, jaune #FFE400, blanc — avec un accent braise. Aucune dépendance externe : ni page builder, ni police distante, ni bibliothèque JavaScript.
Version: 1.0.0
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: costaverde
Tags: block-theme, full-site-editing, business, one-column, custom-colors
*/

/*
 * Presque tout est piloté par theme.json. Cette feuille ne contient que ce que
 * theme.json ne sait pas exprimer : quelques comportements d'interface et les
 * ajustements typographiques fins.
 */

/* --- Accessibilité : cible de focus visible et cohérente ------------------ */
:where(a, button, input, select, textarea, .wp-block-button__link):focus-visible {
	outline: 3px solid var(--wp--preset--color--jaune);
	outline-offset: 2px;
	border-radius: 2px;
}

/* --- Titres : capitales étroites, dans l'esprit du logo ------------------- */
.cv-titre-marque {
	text-transform: uppercase;
	letter-spacing: -0.01em;
	line-height: 1.02;
}

/* --- Le numéro de téléphone, élément le plus important sur mobile --------- */
.cv-tel {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	letter-spacing: 0.01em;
}

/* --- Cartes de prestation : le survol soulève légèrement ------------------ */
.cv-carte {
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.cv-carte:hover,
.cv-carte:focus-within {
	transform: translateY(-3px);
	border-color: var(--wp--preset--color--jaune);
	box-shadow: 0 10px 28px rgb(0 0 0 / 0.10);
}

/* --- Filet jaune sous les titres de section ------------------------------- */
.cv-filet::after {
	content: "";
	display: block;
	width: 3.5rem;
	height: 4px;
	margin-top: 0.7rem;
	background: var(--wp--preset--color--jaune);
}
.has-text-align-center.cv-filet::after {
	margin-inline: auto;
}

/* --- Navigation : soulignement jaune à l'état actif ----------------------- */
.wp-block-navigation .wp-block-navigation-item.current-menu-item > a,
.wp-block-navigation .wp-block-navigation-item > a:hover {
	box-shadow: inset 0 -3px 0 0 var(--wp--preset--color--jaune);
}

/* --- Barre d'appel fixe en bas d'écran, mobile uniquement ----------------- */
.cv-barre-mobile {
	display: none;
}
@media (max-width: 781px) {
	.cv-barre-mobile {
		display: grid;
		grid-template-columns: 1fr 1fr;
		position: fixed;
		inset-inline: 0;
		bottom: 0;
		z-index: 100;
		border-top: 1px solid rgb(255 255 255 / 0.12);
	}
	.cv-barre-mobile a {
		padding: 0.95rem 0.5rem;
		text-align: center;
		font-weight: 700;
		text-decoration: none;
		font-size: 0.95rem;
	}
	/* de quoi ne pas masquer la fin du pied de page */
	body {
		padding-bottom: 3.6rem;
	}
}

/* --- Respect des préférences de mouvement réduit -------------------------- */
@media (prefers-reduced-motion: reduce) {
	.cv-carte,
	.cv-carte:hover {
		transition: none;
		transform: none;
	}
}

/* --- Sections pleine largeur jointives ------------------------------------
 * Chaque section porte son propre rembourrage vertical : l'espacement par
 * défaut entre blocs de premier niveau créerait un liseré clair entre elles.
 */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}
.wp-site-blocks > main > * + * {
	margin-block-start: 0;
}

/* --- Formulaire de demande de rendez-vous ---------------------------------
 * Aucune dépendance JavaScript : la mise en page repose sur une grille qui se
 * réduit à une colonne sous 680 px.
 */
.cv-form {
	margin-top: 1.5rem;
}
.cv-form-grille {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.1rem 1.4rem;
}
.cv-champ--large {
	grid-column: 1 / -1;
}
.cv-champ {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}
.cv-champ label {
	font-weight: 700;
	font-size: 0.95rem;
}
.cv-champ abbr {
	color: var(--wp--preset--color--braise);
	text-decoration: none;
	border: 0;
}
.cv-champ input[type="text"],
.cv-champ input[type="tel"],
.cv-champ input[type="email"],
.cv-champ select,
.cv-champ textarea {
	width: 100%;
	padding: 0.7rem 0.8rem;
	font: inherit;
	color: inherit;
	background: var(--wp--preset--color--blanc);
	border: 1px solid var(--wp--preset--color--pierre);
	border-radius: 0.4rem;
}
.cv-champ input:focus,
.cv-champ select:focus,
.cv-champ textarea:focus {
	border-color: var(--wp--preset--color--jaune);
}
.cv-champ--case label {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	font-weight: 400;
	font-size: 0.9rem;
	line-height: 1.5;
}
.cv-champ--case input {
	margin-top: 0.2rem;
	width: 1.1rem;
	height: 1.1rem;
	flex: 0 0 auto;
}

/* Champ piège : invisible pour l'humain, atteignable par un robot.
   On évite display:none, que certains robots savent détecter. */
.cv-form-piege {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.cv-form-envoi {
	margin-top: 1.6rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
}
.cv-form-note {
	font-size: 0.9rem;
	color: var(--wp--preset--color--ardoise);
}

.cv-form-message {
	padding: 1.1rem 1.3rem;
	border-radius: 0.5rem;
	margin-bottom: 1.5rem;
	border-left: 5px solid;
}
.cv-form-message--ok {
	background: #f2f8f3;
	border-left-color: #1f7a4d;
}
.cv-form-message--ko {
	background: #fdf3f1;
	border-left-color: var(--wp--preset--color--braise);
}

@media (max-width: 680px) {
	.cv-form-grille {
		grid-template-columns: 1fr;
	}
}
