/* ==========================================================================
   Gâtinais VTC — feuille de styles
   Palette et typographie reprises de la maquette « VTC Ferrières-en-Gâtinais ».
   ========================================================================== */

:root {
  /* Couleurs */
  --ink: #12181B;
  --ink-70: rgba(18, 24, 27, .7);
  --ink-65: rgba(18, 24, 27, .65);
  --cream: #FBF7F0;
  --cream-85: rgba(251, 247, 240, .85);
  --cream-75: rgba(251, 247, 240, .75);
  --cream-40: rgba(251, 247, 240, .4);
  --cream-25: rgba(251, 247, 240, .25);
  --cream-15: rgba(251, 247, 240, .15);
  --cream-06: rgba(251, 247, 240, .06);
  --forest: #0E3B33;
  --coral: #FF5A45;
  --amber: #F2A93F;
  --amber-18: rgba(242, 169, 63, .18);
  --amber-15: rgba(242, 169, 63, .15);
  /* Assombri d'un cran par rapport à la maquette (#1477A6) : sur le fond
     bleuté de la section Tarifs, l'original tombait à 4,31:1. Ici 4,53:1. */
  --blue: #1373A1;
  --blue-tint: rgba(42, 111, 151, .06);
  --white: #FFFFFF;
  --line: rgba(14, 59, 51, .12);
  --line-soft: rgba(14, 59, 51, .1);
  --line-strong: rgba(14, 59, 51, .2);
  --line-toggle: rgba(14, 59, 51, .25);

  /* Typographie */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Mesures */
  --wrap: 1180px;
  --gutter: 24px;
  --radius: 8px;
  --header-offset: 88px;
}

/* --------------------------------------------------------------- Base --- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

::selection {
  background: var(--amber);
  color: var(--ink);
}

a { color: var(--blue); }
a:hover { color: var(--forest); }

/* L'ambre de la maquette ne donne que 1,87:1 sur le crème : invisible comme
   indicateur de focus (WCAG 2.2, 1.4.11 exige 3:1). Un contour forêt seul
   résout le crème mais disparaît sur les sections à fond forêt (hero, zone,
   footer, encart tarif, page 404) — et ces zones ne se laissent pas cibler
   proprement par sélecteur, un bouton comme .btn--forest changeant de fond
   selon la section qui l'entoure. L'anneau bicolore ci-dessous fonctionne
   sur n'importe quel fond sans exception à maintenir : l'anneau forêt
   extérieur se voit sur le clair, l'anneau crème intérieur se voit sur le
   forêt — l'un des deux est toujours visible. */
:focus-visible {
  outline: 3px solid var(--forest);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--cream);
}

img, svg { max-width: 100%; }

/* Lien d'évitement — visible uniquement au clavier. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--forest);
  color: var(--cream);
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius) 0;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
  color: var(--cream);
}

/* ------------------------------------------------------------ Boutons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn--sm { padding: 10px 20px; }
.btn--lg { font-size: 16px; padding: 15px 28px; }
.btn--block {
  display: flex;
  width: 100%;
  padding: 12px 0;
  margin-top: 8px;
}

/* Texte encre et non crème comme dans la maquette : crème sur corail ne
   donnait que 2,89:1, sous le seuil WCAG AA. Le corail de marque est
   conservé tel quel, l'encre le porte à 5,80:1. */
.btn--coral {
  background: var(--coral);
  color: var(--ink);
}
.btn--coral:hover {
  background: #FF6E5B;
  color: var(--ink);
}

.btn--ghost {
  background: transparent;
  border-color: var(--cream-40);
  color: var(--cream);
}
.btn--ghost:hover {
  background: var(--cream-06);
  border-color: var(--cream);
  color: var(--cream);
}

.btn--white {
  background: var(--white);
  border-color: var(--line-strong);
  color: var(--forest);
}
.btn--white:hover {
  background: #F4F0E8;
  color: var(--forest);
}

.btn--forest {
  background: var(--forest);
  color: var(--cream);
}
.btn--forest:hover {
  background: #0A2C26;
  color: var(--cream);
}

/* ------------------------------------------------------------ En-tête --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 247, 240, .92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  text-decoration: none;
  color: var(--forest);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand span { color: var(--coral); }
.brand:hover { color: var(--forest); }

.desktop-nav {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
}
.nav-link:hover { color: var(--forest); }

.mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--line-toggle);
  background: transparent;
  cursor: pointer;
}
.mobile-toggle .icon-close { display: none; }
.site-header.is-open .mobile-toggle .icon-open { display: none; }
.site-header.is-open .mobile-toggle .icon-close { display: block; }

.mobile-nav {
  display: flex;
  flex-direction: column;
  padding: 8px var(--gutter) 20px;
  gap: 4px;
  border-top: 1px solid var(--line);
}
.mobile-nav .nav-link { padding: 10px 0; }

/* --------------------------------------------------------------- Hero --- */

.hero {
  background: var(--forest);
  color: var(--cream);
}

.hero-grid {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 64px var(--gutter) 80px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 48px;
  align-items: center;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.05;
  margin: 0 0 20px;
  text-wrap: pretty;
}

.hero-lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--cream-85);
  max-width: 46ch;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-map { position: relative; }
.hero-map svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.route-line {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: dash 2.4s ease-out forwards .3s;
}
@keyframes dash { to { stroke-dashoffset: 0; } }

/* ---------------------------------------------------------- Sections --- */

.section {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 88px var(--gutter);
}

/* Compense l'en-tête collant lors d'un saut d'ancre. */
[id] { scroll-margin-top: var(--header-offset); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.eyebrow--amber { color: var(--amber); }
.eyebrow--blue { color: var(--blue); }
/* Seul le surtitre du hero prend 18px de marge basse dans la maquette. */
.hero .eyebrow--amber { margin-bottom: 18px; }

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 38px);
  margin: 0 0 40px;
  text-wrap: balance;
}
/* Largeurs de ligne reprises une à une de la maquette. */
.section-title--w20 { max-width: 20ch; }
.section-title--w22 { max-width: 22ch; }
.section-title--tight { margin-bottom: 20px; }
.section-title--lead { margin-bottom: 12px; }
.section-title--sm {
  font-size: clamp(26px, 4vw, 34px);
  margin-bottom: 12px;
}

.center { text-align: center; }

/* ------------------------------------------------------------ Cartes --- */

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 28px;
}
.card > svg { margin-bottom: 16px; }
/* Pas de font-weight : la maquette laisse le gras par défaut du <h3>. */
.card h3 {
  font-family: var(--font-display);
  font-size: 19px;
  margin: 0 0 8px;
}
.card p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-70);
  margin: 0;
}

/* ------------------------------------------------------- Zone servie --- */

.zone {
  background: var(--forest);
  color: var(--cream);
  padding: 88px var(--gutter);
}

.zone-grid {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.zone-lede {
  font-size: 16px;
  line-height: 1.7;
  color: var(--cream-85);
  max-width: 50ch;
  margin: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chip {
  background: var(--cream-06);
  border: 1px solid var(--cream-25);
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 999px;
}
.chip--accent {
  background: var(--amber-18);
  border-color: var(--amber);
  color: var(--amber);
  font-weight: 600;
}

/* ---------------------------------------------------------- Pourquoi --- */

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.why-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: var(--amber-15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.why h3 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0 0 6px;
}
.why p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-70);
  margin: 0;
}

/* -------------------------------------------------------- Estimateur --- */

.estimator {
  background: var(--blue-tint);
  padding: 88px var(--gutter);
}

.estimator-inner {
  max-width: 780px;
  margin: 0 auto;
}

.estimator-lede {
  font-size: 15px;
  color: var(--ink-65);
  margin: 0 0 36px;
}

.estimator-card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 32px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--forest);
}
.field--narrow {
  max-width: 160px;
  margin-bottom: 24px;
}

.field select {
  font-family: var(--font-mono);
  /* 16px et non 14 : sous ce seuil, Safari iOS zoome automatiquement au
     focus sur un champ de formulaire et ne dézoome pas ensuite. */
  font-size: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--white);
  color: var(--ink);
  width: 100%;
  max-width: 100%;
}

.estimate {
  background: var(--forest);
  border-radius: 12px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.estimate-route {
  font-family: var(--font-mono);
  color: var(--amber);
  font-size: 13px;
  margin: 0 0 4px;
}

.estimate-figure {
  font-family: var(--font-mono);
  color: var(--cream);
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.estimate .btn { white-space: nowrap; }

/* ------------------------------------------------------- Réservation --- */

.reservation-lede {
  font-size: 16px;
  color: var(--ink-70);
  text-align: center;
  max-width: 56ch;
  margin: 0 auto 40px;
}

.contact-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.contact-actions--compact { margin-bottom: 0; }
.contact-actions .btn { padding: 13px 22px; }

.booking-frame {
  max-width: 900px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--white);
}

.booking-fallback {
  padding: 48px 32px;
  text-align: center;
}
.booking-fallback__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 10px;
  color: var(--forest);
}
.booking-fallback__text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-70);
  max-width: 46ch;
  margin: 0 auto 24px;
}

.calendly-inline-widget {
  /* Calendly documente 320px comme largeur minimale de son widget, mais ne
     pose lui-même ni width ni min-width sur ce conteneur (uniquement sur
     l'iframe interne, en width:100%). En dessous de 330px de viewport, un
     min-width figé ici dépasserait .booking-frame, dont l'overflow:hidden
     (nécessaire à l'arrondi du cadre) rognerait alors le calendrier de façon
     irrécupérable au doigt : le débordement se trouve dans une iframe
     cross-origin, qui capte le geste horizontal sur écran tactile. */
  width: 100%;
  min-width: 0;
  height: 700px;
}

.note {
  text-align: center;
  font-size: 13px;
  /* La maquette utilisait --ink-50 (3,34:1 sur crème, sous le seuil WCAG AA
     de 4,5:1) ; --ink-65 existe déjà pour .estimator-lede et atteint 5,42:1. */
  color: var(--ink-65);
  margin-top: 16px;
}

/* ------------------------------------------------------- Pied de page --- */

.site-footer {
  background: var(--forest);
  color: var(--cream-75);
  padding: 56px var(--gutter) 32px;
}

.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-about { max-width: 40ch; }
.footer-about p {
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--cream);
  margin: 0 0 10px;
}
.footer-brand span { color: var(--amber); }

.footer-contact {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 2;
}
.footer-contact p { margin: 0; }
.footer-contact a {
  color: inherit;
  text-decoration: none;
  /* Porte la cible tactile à 25px : sous 24px, WCAG 2.2 AA (2.5.8) n'est
     plus respecté pour un lien qui n'est pas au fil du texte. */
  display: inline-block;
  padding: 4px 0;
}
.footer-contact a:hover {
  color: var(--amber);
  text-decoration: underline;
}

.footer-legal {
  font-size: 12.5px;
  line-height: 1.7;
  border-top: 1px solid var(--cream-15);
  padding-top: 20px;
  margin: 0;
}

/* ----------------------------------------------------------- Responsive - */

/* Le panneau mobile ne doit jamais rester ouvert après un passage en desktop. */
@media (min-width: 901px) {
  .mobile-nav { display: none !important; }
}

@media (max-width: 900px) {
  .desktop-nav { display: none; }
  .mobile-toggle { display: inline-flex; }
  .split-grid { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: 1fr 1fr; }
  .why-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .service-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .estimator-card { padding: 24px 20px; }
  .estimate { padding: 20px; }
  .estimate .btn,
  .btn--lg { width: 100%; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .booking-fallback { padding: 36px 20px; }
}

/* ---------------------------------------------------- Mouvement réduit - */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .route-line {
    animation: none;
    stroke-dashoffset: 0;
  }
  .btn { transition: none; }
  .btn:hover { transform: none; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ------------------------------------------------------------ Impression */

@media print {
  .site-header,
  .contact-actions,
  .booking-frame,
  .hero-map { display: none; }
  body { background: #fff; color: #000; }
  .hero, .zone, .site-footer { background: #fff; color: #000; }

  /* Un enfant qui déclare sa propre couleur l'emporte sur l'héritage forcé
     ci-dessus — sans ceci, ce texte crème/ambre reste illisible sur le fond
     blanc de l'impression : lede du hero et de la zone, marque en pied de
     page, estimation chiffrée, et le numéro de téléphone du hero (le bouton
     .btn--ghost, sur fond transparent, garde sinon son texte crème). */
  .hero-lede,
  .zone-lede,
  .footer-brand,
  .footer-brand span,
  .estimate-route,
  .estimate-figure,
  .btn--ghost,
  .btn--ghost:hover { color: #000; }

  /* Fonds non imprimés par défaut par les navigateurs : sans eux, ces deux
     encarts perdent tout contraste avec la page. */
  .estimate { background: #fff; border: 1px solid #000; }
  .btn--ghost { border-color: #000; background: transparent; }

  /* index.html : l'icône du téléphone porte stroke="#FBF7F0" en attribut de
     présentation SVG ; le CSS l'emporte sur cet attribut. */
  .btn--ghost svg path { stroke: #000; }
}
