/*
Theme Name: Haleau
Theme URI: https://haleau-plombier.fr
Author: Haleau
Description: Theme bloc sur mesure pour Haleau, plombier chauffagiste en Seine-et-Marne. Style editorial a typographie display, palette bleue, zero dependance externe.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: haleau
Tags: full-site-editing, blocks, block-patterns, one-column, custom-colors
*/

/* ---------------------------------------------------------------
   1. Base
   --------------------------------------------------------------- */

:root {
  --hal-radius: 22px;
  --hal-radius-sm: 14px;
  --hal-border: 2px solid var(--wp--preset--color--ink);
  --hal-shadow: 6px 6px 0 var(--wp--preset--color--ink);
  --hal-shadow-soft: 0 18px 40px -24px rgba(14, 42, 71, .55);
}

/* Les pastilles du heros sont decalees par transform : depuis le passage a
   1240 px elles atteignent le bord et debordent du viewport, ce qui ouvre un
   defilement horizontal — et fait apparaitre l'en-tete et le pied de page
   tronques a droite sur grand ecran. On coupe le debordement lateral.
   clip et non hidden : hidden creerait un conteneur de defilement et
   casserait le position:sticky de l'en-tete. */
html, body { overflow-x: clip; }

body { -webkit-font-smoothing: antialiased; }

::selection { background: var(--wp--preset--color--sky); color: var(--wp--preset--color--ink); }

:where(a):focus-visible,
:where(button):focus-visible,
:where(input, textarea, select):focus-visible {
  outline: 3px solid var(--wp--preset--color--azure);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Les titres sont en casse normale : c'est la graisse de Bricolage
   Grotesque qui porte la hierarchie, pas les capitales. Les capitales
   restent reservees aux etiquettes courtes — sur-titres, pastilles,
   bandeau defilant, boutons — ou elles se lisent d'un coup d'oeil. */
.wp-block-heading,
h1, h2, h3, h4 { letter-spacing: -0.01em; text-wrap: balance; }

/* ---------------------------------------------------------------
   2. Barre d'urgence + en-tete
   --------------------------------------------------------------- */

.hal-topbar {
  background: var(--wp--preset--color--ink);
  color: #fff;
  font-size: var(--wp--preset--font-size--sm);
  font-weight: 600;
  text-align: center;
  padding: .55rem clamp(1rem, 4vw, 2.5rem);
}
.hal-topbar a { color: var(--wp--preset--color--sky); text-decoration: underline; text-underline-offset: 3px; }
.hal-topbar a:hover { color: #fff; }
.hal-topbar strong { white-space: nowrap; }

.hal-header {
  background: var(--wp--preset--color--paper-alt);
  border-bottom: var(--hal-border);
  padding-block: .7rem;
  position: sticky;
  top: 0;
  z-index: 40;
}
.hal-header .wp-block-site-title a { text-decoration: none; color: var(--wp--preset--color--ink); }
.hal-header .wp-block-navigation { font-size: var(--wp--preset--font-size--sm); font-weight: 600; }
.hal-header .wp-block-navigation a { text-decoration: none; }
.hal-header .wp-block-navigation a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Bouton telephone rond de l'en-tete */
.hal-phone-round a,
a.hal-phone-round {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  background: var(--wp--preset--color--azure);
  color: #fff !important;
  border: var(--hal-border);
  border-radius: 999px;
  padding: .6rem 1.15rem;
  font-weight: 700;
  text-decoration: none !important;
  box-shadow: 3px 3px 0 var(--wp--preset--color--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.hal-phone-round a:hover,
a.hal-phone-round:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--wp--preset--color--ink); }

/* ---------------------------------------------------------------
   3. Heros
   --------------------------------------------------------------- */

.hal-hero { padding-block: clamp(2rem, 6vw, 4rem) clamp(2rem, 5vw, 3.5rem); }

.hal-hero__title {
  text-align: center;
  text-wrap: balance;
  margin-block: 0 clamp(1.5rem, 4vw, 2.5rem);
}

.hal-hero__grid {
  display: grid;
  grid-template-columns: 1fr minmax(0, 1.15fr) 1fr;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
}
@media (max-width: 900px) {
  .hal-hero__grid { grid-template-columns: 1fr; }
  .hal-hero__col--right { order: -1; }
}

.hal-hero__lede { font-size: var(--wp--preset--font-size--sm); max-width: 34ch; margin-block: 0 1.25rem; }
.hal-hero__claim { font-weight: 700; margin-top: 1.75rem; max-width: 26ch; }

/* Le carre de couleur du heros : l'equivalent du bloc jaune de la reference */
.hal-hero__media {
  position: relative;
  aspect-ratio: 1 / 1;
  border: var(--hal-border);
  border-radius: var(--hal-radius);
  background:
    radial-gradient(circle at 30% 25%, var(--wp--preset--color--sky-soft) 0 38%, transparent 39%),
    repeating-conic-gradient(from 15deg at 50% 50%,
      var(--wp--preset--color--sky) 0deg 15deg,
      #b6e2f7 15deg 30deg);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: var(--hal-shadow);
}

/* Pictogrammes Lucide : le trait est defini dans un viewBox de 24, donc il
   grossit avec l'icone. Pour garder l'epaisseur voulue a l'ecran, on reduit
   stroke-width a l'inverse de l'agrandissement — vise ~3,5 px ici. */
.hal-hero__media svg {
  width: 46%;
  height: auto;
  color: var(--wp--preset--color--ink);
  stroke-width: .55;
}

/* ---------------------------------------------------------------
   4. Pastilles inclinees
   --------------------------------------------------------------- */

.hal-pills { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; justify-items: start; }
.hal-pills li {
  font-family: var(--wp--preset--font-family--display);
  font-size: clamp(.95rem, 1.6vw, 1.15rem);
  text-transform: uppercase;
  border: var(--hal-border);
  border-radius: 999px;
  padding: .45rem 1.4rem;
  font-weight: 600;
  /* Pas d'ombre portee ici : ces pastilles sont des etiquettes, pas des
     boutons. L'ombre solide est reservee a ce qui est reellement cliquable. */
}
.hal-pills li:nth-child(1) { background: var(--wp--preset--color--lilac);  transform: rotate(-3deg); }
.hal-pills li:nth-child(2) { background: var(--wp--preset--color--sky);    transform: rotate(2deg)  translateX(12px); }
.hal-pills li:nth-child(3) { background: var(--wp--preset--color--mint);   transform: rotate(-2deg) translateX(4px); color: #fff; }
.hal-pills li:nth-child(4) { background: var(--wp--preset--color--azure);  transform: rotate(3deg)  translateX(18px); color: #fff; }

.hal-eyebrow {
  font-family: var(--wp--preset--font-family--display);
  text-transform: uppercase;
  font-size: var(--wp--preset--font-size--lg);
  margin: 0 0 .9rem;
}

/* ---------------------------------------------------------------
   5. Bandeau defilant
   --------------------------------------------------------------- */

.hal-marquee {
  background: var(--wp--preset--color--ink);
  color: #fff;
  border-block: var(--hal-border);
  overflow: hidden;
  padding-block: .8rem;
  margin-block: clamp(1.5rem, 4vw, 3rem);
}
.hal-marquee__track {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  animation: hal-scroll 32s linear infinite;
  font-family: var(--wp--preset--font-family--display);
  text-transform: uppercase;
  font-size: clamp(1rem, 2.2vw, 1.6rem);
  white-space: nowrap;
}
.hal-marquee__track span { display: inline-flex; align-items: center; gap: 2.5rem; }
.hal-marquee__track span::after { content: "\2726"; color: var(--wp--preset--color--sky); }
@keyframes hal-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .hal-marquee__track { animation: none; justify-content: center; width: 100%; flex-wrap: wrap; }
}

/* ---------------------------------------------------------------
   6. Sections et cartes
   --------------------------------------------------------------- */

.hal-section { padding-block: clamp(2rem, 5vw, 3.5rem); }

.hal-section__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: end;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}
@media (max-width: 782px) { .hal-section__head { grid-template-columns: 1fr; } }
.hal-section__head h2 { margin: 0; }
.hal-section__head p { margin: 0; font-size: var(--wp--preset--font-size--sm); }

.hal-rating { display: flex; align-items: baseline; gap: .5rem; font-weight: 700; margin-top: .9rem; }
.hal-rating__stars { color: var(--wp--preset--color--sun); letter-spacing: .1em; }
.hal-rating__note { font-family: var(--wp--preset--font-family--display); font-size: 1.5rem; }
.hal-rating small { font-weight: 400; color: var(--wp--preset--color--ink-soft); }

.hal-cards {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
}
.hal-card {
  background: var(--wp--preset--color--white);
  border: var(--hal-border);
  border-radius: var(--hal-radius);
  padding: 1.1rem 1.1rem 1.35rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--hal-shadow-soft);
  transition: transform .14s ease, box-shadow .14s ease;
}
.hal-card:hover { transform: translateY(-4px); box-shadow: var(--hal-shadow); }
.hal-card__media {
  background: var(--wp--preset--color--sky-soft);
  border-radius: var(--hal-radius-sm);
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  border: 1px solid rgba(14, 42, 71, .12);
}
.hal-card__media svg {
  width: 76px;
  height: 76px;
  color: var(--wp--preset--color--ink-soft);
  stroke-width: .8;   /* ~2,5 px a l'ecran a 76 px de large */
}
.hal-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 .45rem;
  letter-spacing: -0.005em;
}
.hal-card h3 a { color: inherit; text-decoration: none; }
.hal-card h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.hal-card p { font-size: var(--wp--preset--font-size--sm); margin: 0 0 1rem; }
.hal-card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.hal-card__price { font-family: var(--wp--preset--font-family--display); font-size: 1.1rem; }
.hal-card__price small { display: block; font-family: var(--wp--preset--font-family--body); font-size: .72rem; font-weight: 400; text-transform: uppercase; letter-spacing: .08em; color: var(--wp--preset--color--ink-soft); }

/* Petit bouton pilule reutilisable, hors blocs core */
.hal-btn {
  display: inline-block;
  background: var(--wp--preset--color--azure);
  color: #fff !important;
  border: var(--hal-border);
  border-radius: 999px;
  padding: .55rem 1.15rem;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-decoration: none !important;
  box-shadow: 3px 3px 0 var(--wp--preset--color--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.hal-btn:hover { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--wp--preset--color--ink); }
.hal-btn--ghost { background: var(--wp--preset--color--white); color: var(--wp--preset--color--ink) !important; }

/* ---------------------------------------------------------------
   7. Blocs de contenu
   --------------------------------------------------------------- */

.hal-panel {
  background: var(--wp--preset--color--white);
  border: var(--hal-border);
  border-radius: var(--hal-radius);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--hal-shadow-soft);
}
.hal-panel--sky { background: var(--wp--preset--color--sky-soft); }
.hal-panel--ink { background: var(--wp--preset--color--ink); color: #fff; }
.hal-panel--ink a { color: var(--wp--preset--color--sky); }
.hal-panel--ink h2, .hal-panel--ink h3 { color: #fff; }

.hal-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: clamp(1rem, 2.5vw, 1.75rem); }
.hal-grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }

.hal-reassure { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.hal-reassure li {
  background: var(--wp--preset--color--white);
  border: var(--hal-border);
  border-radius: var(--hal-radius-sm);
  padding: .85rem 1rem;
  font-size: var(--wp--preset--font-size--sm);
  font-weight: 600;
  text-align: center;
}

/* Tableau de tarifs */
.hal-table { width: 100%; border-collapse: collapse; font-size: var(--wp--preset--font-size--sm); }
.hal-table th, .hal-table td { border: 1px solid rgba(14,42,71,.18); padding: .7rem .85rem; text-align: left; }
.hal-table thead th { background: var(--wp--preset--color--ink); color: #fff; font-family: var(--wp--preset--font-family--display); font-weight: 400; text-transform: uppercase; letter-spacing: .03em; }
.hal-table tbody tr:nth-child(even) { background: var(--wp--preset--color--paper-alt); }
.hal-table-wrap { overflow-x: auto; border-radius: var(--hal-radius-sm); border: var(--hal-border); }

/* Encadre d'avertissement / note */
.hal-note {
  border-left: 6px solid var(--wp--preset--color--azure);
  background: var(--wp--preset--color--paper-alt);
  padding: 1rem 1.15rem;
  border-radius: 0 var(--hal-radius-sm) var(--hal-radius-sm) 0;
  font-size: var(--wp--preset--font-size--sm);
}
.hal-note--todo { border-left-color: var(--wp--preset--color--sun); background: #fff8e6; }

/* FAQ */
.hal-faq details {
  border: var(--hal-border);
  border-radius: var(--hal-radius-sm);
  background: var(--wp--preset--color--white);
  padding: .9rem 1.1rem;
  margin-bottom: .75rem;
}
.hal-faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.hal-faq summary::-webkit-details-marker { display: none; }
.hal-faq summary::after { content: "+"; font-family: var(--wp--preset--font-family--display); color: var(--wp--preset--color--azure); }
.hal-faq details[open] summary::after { content: "\2013"; }
.hal-faq details > *:not(summary) { margin-top: .75rem; font-size: var(--wp--preset--font-size--sm); }

/* Bandeau de conversion final */
.hal-cta-band {
  background: var(--wp--preset--color--ink);
  color: #fff;
  border: var(--hal-border);
  border-radius: var(--hal-radius);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  text-align: center;
}
.hal-cta-band h2 { color: #fff; margin-top: 0; }
.hal-cta-band p { max-width: 52ch; margin-inline: auto; }
.hal-cta-band .hal-btn--ghost { background: #fff; }

/* ---------------------------------------------------------------
   8. Pied de page
   --------------------------------------------------------------- */

.hal-footer {
  background: var(--wp--preset--color--ink);
  color: #fff;
  border-top: var(--hal-border);
  padding-block: clamp(2rem, 5vw, 3.5rem) 1.5rem;
  margin-top: clamp(2rem, 6vw, 4rem);
}
.hal-footer a { color: var(--wp--preset--color--sky); text-decoration: none; }
.hal-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.hal-footer h2, .hal-footer h3, .hal-footer .hal-eyebrow { color: #fff; font-size: 1.05rem; }
.hal-footer ul { list-style: none; margin: 0; padding: 0; }
.hal-footer li { margin-bottom: .4rem; font-size: var(--wp--preset--font-size--sm); }
.hal-footer p { font-size: var(--wp--preset--font-size--sm); }

.hal-footer__inner {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

/* Marque, puis Prestations / Zones / Le devis sur une seule ligne. */
.hal-footer__cols {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
}
.hal-footer__cols > * { min-width: 0; }
.hal-footer__cols a,
.hal-footer__cols p { overflow-wrap: break-word; }
.hal-footer__brand p { max-width: 38ch; }

@media (max-width: 1000px) {
  .hal-footer__cols { grid-template-columns: repeat(3, 1fr); }
  .hal-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .hal-footer__cols { grid-template-columns: 1fr; }
  .hal-footer__brand { grid-column: auto; }
}
.hal-footer__legal {
  border-top: 1px solid rgba(255,255,255,.2);
  margin-top: 2rem; padding-top: 1rem;
  font-size: var(--wp--preset--font-size--xs);
  color: rgba(255,255,255,.75);
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; justify-content: space-between;
}

/* ---------------------------------------------------------------
   9. Bouton d'appel flottant mobile
   --------------------------------------------------------------- */

.hal-callfab {
  position: fixed;
  left: 1rem; right: 1rem; bottom: 1rem;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  background: var(--wp--preset--color--azure);
  color: #fff !important;
  border: var(--hal-border);
  border-radius: 999px;
  padding: .95rem 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  text-decoration: none !important;
  box-shadow: 0 10px 24px -10px rgba(14,42,71,.8);
}
@media (max-width: 782px) { .hal-callfab { display: flex; } body { padding-bottom: 4.5rem; } }

/* ---------------------------------------------------------------
   10. Divers
   --------------------------------------------------------------- */

.hal-breadcrumb { font-size: var(--wp--preset--font-size--xs); color: var(--wp--preset--color--ink-soft); margin-bottom: 1rem; }
.hal-page-header { padding-block: clamp(1.5rem, 4vw, 2.75rem) 0; }
.hal-page-header h1 { text-wrap: balance; }
.hal-lede { font-size: var(--wp--preset--font-size--lg); font-weight: 500; max-width: 60ch; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; top: .5rem; left: .5rem; width: auto; height: auto; clip: auto;
  background: #fff; color: var(--wp--preset--color--ink); padding: .6rem 1rem; z-index: 100; border: var(--hal-border); border-radius: 8px;
}

/* ---------------------------------------------------------------
   11. Largeur de lecture
   --------------------------------------------------------------- */

/* Le conteneur fait 1240 px, comme la barre de menu : tout s'aligne sur la
   meme gouttiere. La prose courante, elle, reste bornee — une ligne de
   1240 px fait ~200 signes, illisible. Elle n'est pas centree : son bord
   gauche reste cale sur celui des cartes et du menu. */
.wp-block-post-content > p,
.wp-block-post-content > ul,
.wp-block-post-content > ol,
.wp-block-post-content > .wp-block-list {
  max-width: 74ch;
}

.hal-page-header h1 { max-width: 20ch; }
.hal-page-header .hal-lede { max-width: 64ch; }

/* Bricolage Grotesque a un gris assez clair en 400 : on remonte un peu les
   endroits ou le texte doit tenir sur fond sombre ou en petit corps. */
.hal-table thead th { font-weight: 600; }
.hal-marquee__track { font-weight: 600; }
.hal-eyebrow { font-weight: 700; }
.hal-rating__note { font-weight: 700; }

/* Pictogrammes en ligne dans les boutons : taille fixe, trait d'origine. */
.hal-phone-round svg,
.hal-callfab svg { flex: none; stroke-width: 2; }
