/*
Theme Name: PrimeDep
Theme URI: https://primedep.be
Author: RDesign
Author URI: https://rdesign.be
Description: Thème enfant de Twenty Twenty-Five pour PrimeDep, dépannage et remorquage automobile 24h/24 et 7j/7 à Bruxelles, en périphérie et partout en Belgique.
Template: twentytwentyfive
Requires at least: 6.7
Requires PHP: 7.4
Version: 0.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: primedep
*/

/* ---------------------------------------------------------------------------
 * Reperes de couleurs (miroir de theme.json, pour le CSS qui ne peut pas
 * utiliser les presets : pseudo-elements, media queries, animations).
 * ------------------------------------------------------------------------- */
:root {
	--pd-base:     #ffffff;
	--pd-contrast: #0a192f;
	--pd-surface:  #1e293b;
	--pd-muted:    #f1f5f9;
	--pd-accent:   #ffb703;
	--pd-accent-2: #f77f00;
	--pd-radius:   14px;
}

/* ---------------------------------------------------------------------------
 * Barre d’appel fixe (mobile) — injectee par primedep_sticky_call_bar().
 * ------------------------------------------------------------------------- */
.pd-sticky {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 999;
	display: none;
	gap: 2px;
	padding: 8px;
	background: var(--pd-contrast);
	box-shadow: 0 -6px 24px rgb(10 25 47 / 35%);
}

.pd-sticky a {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 52px;              /* cible tactile confortable */
	padding: 10px 12px;
	border-radius: 10px;
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.2;
	text-decoration: none;
}

.pd-sticky__call { background: var(--pd-accent); color: var(--pd-contrast); }
.pd-sticky__wa   { background: #25d366;        color: #06301a; }

.pd-sticky svg { width: 20px; height: 20px; flex: none; fill: currentColor; }

/* La barre ne s’affiche que sur mobile : au-dessus, le bouton d’appel du
   header reste visible en permanence. */
@media (max-width: 781px) {
	.pd-sticky { display: flex; }
	/* Evite que la barre masque la fin du contenu. */
	body { padding-bottom: 76px; }
}

/* Pulsation discrete du bouton d’appel, desactivee si l’utilisateur à demande
   moins d’animations. */
@media (prefers-reduced-motion: no-preference) {
	.pd-sticky__call { animation: pd-pulse 2.4s ease-in-out infinite; }
}

@keyframes pd-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgb(255 183 3 / 65%); }
	50%      { box-shadow: 0 0 0 10px rgb(255 183 3 / 0%); }
}

/* ---------------------------------------------------------------------------
 * Bouton d’appel du header
 * ------------------------------------------------------------------------- */
.pd-header-call .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
	font-weight: 800;
	letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------------------
 * Cartes de services
 * ------------------------------------------------------------------------- */
.pd-card {
	height: 100%;
	overflow: hidden;
	border-radius: var(--pd-radius);
	background: var(--pd-base);
	box-shadow: 0 2px 4px rgb(10 25 47 / 6%), 0 12px 28px rgb(10 25 47 / 10%);
	transition: transform .18s ease, box-shadow .18s ease;
}

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

.pd-card:hover,
.pd-card:focus-within {
	transform: translateY(-4px);
	box-shadow: 0 4px 8px rgb(10 25 47 / 8%), 0 18px 40px rgb(10 25 47 / 16%);
}

/* Ratio constant quelle que soit l’orientation de la photo source. */
.pd-card figure.wp-block-image,
.pd-card figure.wp-block-image img {
	margin: 0;
	display: block;
	width: 100%;
}

.pd-card figure.wp-block-image img {
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.pd-card__body { padding: clamp(18px, 3vw, 26px); }

.pd-card__body h3 {
	margin: 0 0 8px;
	font-size: 1.22rem;
	line-height: 1.25;
}

.pd-card__body p { margin: 0; color: #3d4b60; }

/* ---------------------------------------------------------------------------
 * Zone d’intervention — les 19 communes
 * ------------------------------------------------------------------------- */
.pd-communes {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pd-communes li {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 11px 14px;
	border-radius: 10px;
	background: rgb(255 255 255 / 8%);
	font-size: 0.97rem;
	line-height: 1.3;
}

.pd-communes li::before {
	content: "";
	flex: none;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--pd-accent);
}

/* ---------------------------------------------------------------------------
 * Tarifs
 * ------------------------------------------------------------------------- */
.pd-tarifs {
	width: 100%;
	border-collapse: collapse;
	background: var(--pd-base);
	border-radius: var(--pd-radius);
	overflow: hidden;
	box-shadow: 0 12px 28px rgb(10 25 47 / 10%);
}

.pd-tarifs caption {
	caption-side: bottom;
	padding: 14px 16px;
	color: #55637a;
	font-size: 0.9rem;
	text-align: left;
}

.pd-tarifs th,
.pd-tarifs td {
	padding: 14px 18px;
	text-align: left;
	border-bottom: 1px solid #e2e8f0;
}

.pd-tarifs thead th {
	background: var(--pd-contrast);
	color: var(--pd-base);
	font-size: 0.85rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.pd-tarifs tbody tr:last-child th,
.pd-tarifs tbody tr:last-child td { border-bottom: 0; }

.pd-tarifs td:last-child { font-weight: 700; white-space: nowrap; }

/* Le tableau doit pouvoir defiler seul sur petit ecran. */
.pd-table-scroll { overflow-x: auto; }

/* ---------------------------------------------------------------------------
 * Garanties / avis
 * ------------------------------------------------------------------------- */
.pd-garanties {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pd-garanties li {
	padding: 16px 18px;
	border-left: 4px solid var(--pd-accent);
	border-radius: 0 10px 10px 0;
	background: var(--pd-muted);
	font-weight: 600;
	line-height: 1.35;
}

.pd-avis {
	height: 100%;
	padding: clamp(18px, 3vw, 26px);
	border-radius: var(--pd-radius);
	background: var(--pd-base);
	box-shadow: 0 12px 28px rgb(10 25 47 / 10%);
}

.pd-avis__stars {
	color: var(--pd-accent-2);
	font-size: 1.1rem;
	letter-spacing: 2px;
}

.pd-avis blockquote {
	margin: 10px 0 14px;
	padding: 0;
	border: 0;
	font-size: 1.02rem;
	line-height: 1.55;
}

.pd-avis cite {
	color: #55637a;
	font-size: 0.9rem;
	font-style: normal;
}

/* Encart d’avertissement : contenu de démonstration à remplacer avant la mise
   en ligne. Volontairement tres visible. */
.pd-todo {
	margin: 0 0 22px;
	padding: 14px 18px;
	border: 2px dashed var(--pd-accent-2);
	border-radius: 10px;
	background: #fff7e6;
	color: #7a3d00;
	font-size: 0.95rem;
	line-height: 1.45;
}

.pd-todo strong { color: #5c2d00; }

/* ---------------------------------------------------------------------------
 * Formulaire de secours (hero) + Fluent Forms
 * ------------------------------------------------------------------------- */
.pd-form-card {
	padding: clamp(20px, 3vw, 30px);
	border-radius: var(--pd-radius);
	background: rgb(255 255 255 / 96%);
	box-shadow: 0 20px 50px rgb(0 0 0 / 30%);
}

.pd-form-card .fluentform .ff-el-input--label label { font-weight: 600; }

.pd-form-card .fluentform .ff-btn-submit {
	width: 100%;
	background: var(--pd-accent) !important;
	color: var(--pd-contrast) !important;
	border: 0;
	border-radius: 10px;
	padding: 14px 18px;
	font-weight: 800;
	font-size: 1.02rem;
	cursor: pointer;
}

.pd-form-card .fluentform .ff-btn-submit:hover { background: var(--pd-accent-2) !important; }

/* ---------------------------------------------------------------------------
 * Divers
 * ------------------------------------------------------------------------- */
.pd-eyebrow {
	margin: 0 0 10px;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--pd-accent);
}

.pd-lead { font-size: 1.1rem; line-height: 1.6; }

/* Compense le header colle en haut lors d’un saut vers une ancre. */
:where(#services, #zones, #tarifs, #avis, #contact) { scroll-margin-top: 90px; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------------------------
 * Header colle en haut
 * ------------------------------------------------------------------------- */
.pd-header {
	position: sticky;
	top: 0;
	z-index: 500;
	backdrop-filter: saturate(140%) blur(6px);
}

.pd-header .wp-block-navigation { font-weight: 600; }

.pd-brand {
	font-size: 1.35rem;
	font-weight: 900;
	letter-spacing: -0.02em;
	line-height: 1;
	text-decoration: none;
}

.pd-brand span { color: var(--pd-accent); }

/* ---------------------------------------------------------------------------
 * Correctifs de contraste
 *
 * theme.json impose la couleur "contrast" a tous les liens. Sur le bandeau
 * sombre du header et dans le pied de page, le mot "Prime" du logo devenait
 * donc bleu nuit sur bleu nuit, donc invisible.
 * ------------------------------------------------------------------------- */
.pd-header .pd-brand,
.pd-header .pd-brand:hover,
footer .pd-brand,
footer .pd-brand:hover {
	color: var(--pd-base);
}

.pd-header .pd-brand span,
footer .pd-brand span {
	color: var(--pd-accent);
}

/* Le bloc "cover" du hero passe tout son contenu en blanc. La carte du
 * formulaire, elle, est sur fond clair : on y retablit le texte sombre. */
.pd-form-card,
.pd-form-card h2,
.pd-form-card h3,
.pd-form-card p,
.pd-form-card label,
.pd-form-card legend,
.pd-form-card li,
.pd-form-card .ff-el-input--label label,
.pd-form-card .ff-el-form-check-label,
.pd-form-card .ff-el-help-message {
	color: var(--pd-contrast);
}

.pd-form-card .ff-el-help-message { opacity: .75; }

/* Champs de saisie : contour lisible et cible tactile confortable. */
.pd-form-card .fluentform input[type="text"],
.pd-form-card .fluentform input[type="tel"],
.pd-form-card .fluentform input[type="email"],
.pd-form-card .fluentform select,
.pd-form-card .fluentform textarea {
	width: 100%;
	min-height: 46px;
	padding: 10px 12px;
	border: 1px solid #c9d3e0;
	border-radius: 8px;
	background: #fff;
	color: var(--pd-contrast);
	font-size: 1rem;
}

.pd-form-card .fluentform textarea { min-height: 90px; }

.pd-form-card .fluentform :is(input, select, textarea):focus {
	outline: 3px solid rgb(255 183 3 / 55%);
	outline-offset: 1px;
	border-color: var(--pd-accent-2);
}
