/*
Theme Name: Ecurie de la Tannerie
Theme URI: https://www.ecuriedelatannerie.be/
Description: Theme sur mesure pour l'Ecurie de la Tannerie (Paliseul). Page unique, sans dependance externe, sans page builder.
Author: L.P.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: ecurie-tannerie
*/

/* ==========================================================================
   1. Variables
   ========================================================================== */

:root {
  /* Palette nature & bois */
  --sable:        #f7f3ec;
  --sable-2:      #efe7da;
  --sable-3:      #e2d6c3;
  --encre:        #2b231c;
  --encre-doux:   #5f5449;
  --cuir:         #8a5a2b;
  --cuir-fonce:   #6b4420;
  --foret:        #3d4a38;
  --blanc:        #ffffff;

  --titre: "Marcellus", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --texte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --largeur:   1180px;
  --etroit:    760px;
  --gouttiere: 24px;
  --header-h:  76px;

  --ombre:      0 1px 2px rgba(43, 35, 28, .06), 0 8px 24px rgba(43, 35, 28, .08);
  --ombre-fort: 0 2px 4px rgba(43, 35, 28, .08), 0 18px 48px rgba(43, 35, 28, .16);
  --rayon:      4px;
  --transition: .25s ease;
}

/* ==========================================================================
   2. Base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--sable);
  color: var(--encre);
  font-family: var(--texte);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--cuir-fonce); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--cuir); }

h1, h2, h3, h4 {
  font-family: var(--titre);
  font-weight: 400;
  line-height: 1.15;
  color: var(--encre);
  margin: 0 0 .5em;
  letter-spacing: .005em;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

:focus-visible {
  outline: 3px solid var(--cuir);
  outline-offset: 3px;
  border-radius: 2px;
}

.lien-evitement {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--encre);
  color: var(--blanc);
  padding: 12px 20px;
}
.lien-evitement:focus { left: 8px; top: 8px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   3. Utilitaires de mise en page
   ========================================================================== */

.conteneur {
  width: 100%;
  max-width: var(--largeur);
  margin-inline: auto;
  padding-inline: var(--gouttiere);
}

.conteneur-etroit { max-width: var(--etroit); }

.section { padding-block: clamp(64px, 9vw, 120px); }
.section--sable { background: var(--sable-2); }
.section--foret { background: var(--foret); color: #eae7df; }
.section--foret h2, .section--foret h3 { color: var(--blanc); }

.section__entete {
  text-align: center;
  max-width: 660px;
  margin: 0 auto clamp(40px, 5vw, 64px);
}
.section__entete p { color: var(--encre-doux); font-size: 1.075rem; }
.section--foret .section__entete p { color: rgba(255, 255, 255, .78); }

/* Surtitre encadre de deux filets */
.surtitre {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-family: var(--texte);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--cuir);
  margin-bottom: 14px;
}
.surtitre::before, .surtitre::after {
  content: "";
  height: 1px;
  width: 44px;
  background: currentColor;
  opacity: .45;
}
.surtitre--gauche { justify-content: flex-start; }
.surtitre--gauche::before { display: none; }
.section--foret .surtitre { color: #c9b189; }

.plomb { font-size: 1.15rem; color: var(--encre-doux); }
.section--foret .plomb { color: rgba(255, 255, 255, .82); }

/* ==========================================================================
   4. Boutons
   ========================================================================== */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 30px;
  font-family: var(--texte);
  font-size: .93rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--rayon);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}
.bouton:hover { transform: translateY(-1px); }

.bouton--plein {
  background: var(--cuir);
  color: var(--blanc);
}
.bouton--plein:hover { background: var(--cuir-fonce); color: var(--blanc); }

.bouton--ligne {
  background: transparent;
  color: var(--blanc);
  border-color: rgba(255, 255, 255, .6);
}
.bouton--ligne:hover { background: rgba(255, 255, 255, .14); border-color: var(--blanc); color: var(--blanc); }

.bouton--sombre {
  background: var(--encre);
  color: var(--blanc);
}
.bouton--sombre:hover { background: #40342a; color: var(--blanc); }

/* ==========================================================================
   5. En-tete
   ========================================================================== */

.entete {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background var(--transition), box-shadow var(--transition);
  background: transparent;
}

.entete__interieur {
  width: 100%;
  max-width: var(--largeur);
  margin-inline: auto;
  padding-inline: var(--gouttiere);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.entete__logo { display: block; flex: 0 0 auto; line-height: 0; }
.entete__logo img { height: 52px; width: auto; transition: height var(--transition); }
.entete__logo .logo--clair { display: block; }
.entete__logo .logo--sombre { display: none; }

.entete.est-collee {
  background: rgba(247, 243, 236, .96);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--sable-3), 0 6px 20px rgba(43, 35, 28, .07);
}
.entete.est-collee .entete__logo .logo--clair { display: none; }
.entete.est-collee .entete__logo .logo--sombre { display: block; }
.entete.est-collee .entete__logo img { height: 46px; }
.entete.est-collee .nav__lien { color: var(--encre); }
.entete.est-collee .nav__lien:hover,
.entete.est-collee .nav__lien.est-actif { color: var(--cuir); }
.entete.est-collee .burger span { background: var(--encre); }

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

.nav__lien {
  position: relative;
  padding: 8px 14px;
  font-size: .94rem;
  font-weight: 500;
  color: var(--blanc);
  text-decoration: none;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .45);
  transition: color var(--transition);
}
.nav__lien::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.nav__lien:hover::after,
.nav__lien.est-actif::after { transform: scaleX(1); }

.entete.est-collee .nav__lien { text-shadow: none; }

.nav__bouton { margin-left: 12px; padding: 11px 22px; }

.burger {
  display: none;
  width: 44px; height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.burger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--blanc);
  transition: transform var(--transition), opacity var(--transition), background var(--transition);
}
.burger[aria-expanded="true"] span { background: var(--encre); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   6. Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: min(100svh, 860px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--blanc);
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 62%;
}
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 15, 10, .58) 0%, rgba(20, 15, 10, .22) 38%, rgba(20, 15, 10, .70) 100%);
}

.hero__contenu {
  position: relative;
  z-index: 1;
  padding: calc(var(--header-h) + 40px) var(--gouttiere) 72px;
  max-width: 820px;
}

.hero__logo {
  width: clamp(130px, 17vw, 190px);
  margin: 0 auto 26px;
  opacity: .95;
}

.hero h1 {
  color: var(--blanc);
  margin-bottom: .35em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .4);
}

.hero__accroche {
  font-size: clamp(1.05rem, 1.9vw, 1.3rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, .93);
  max-width: 620px;
  margin: 0 auto 36px;
  text-shadow: 0 1px 14px rgba(0, 0, 0, .45);
}

.hero__actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero__lieu {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  width: max-content;
  max-width: calc(100% - 2 * var(--gouttiere));
  text-align: center;
  font-size: .78rem;
  line-height: 1.6;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .8);
}

/* ==========================================================================
   7. Bandeau de chiffres
   ========================================================================== */

.chiffres { background: var(--encre); color: var(--blanc); }

.chiffres__grille {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, .13);
}
.chiffres__item {
  background: var(--encre);
  padding: 34px 20px;
  text-align: center;
}
.chiffres__valeur {
  display: block;
  font-family: var(--titre);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.1;
  color: var(--blanc);
}
.chiffres__libelle {
  display: block;
  margin-top: 6px;
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .62);
}

/* ==========================================================================
   8. Blocs texte + image
   ========================================================================== */

.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.duo--inverse .duo__media { order: 2; }

.duo__media {
  position: relative;
  border-radius: var(--rayon);
  overflow: hidden;
  box-shadow: var(--ombre-fort);
}
.duo__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.duo__media--portrait img { aspect-ratio: 3 / 4; }

.duo__texte h2 { margin-bottom: .45em; }

/* Listes */
.liste-tirets { list-style: none; margin: 0; padding: 0; }
.liste-tirets li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 12px;
}
.liste-tirets li::before {
  content: "";
  position: absolute;
  left: 0; top: .62em;
  width: 12px; height: 2px;
  background: var(--cuir);
}
.liste-tirets strong { color: var(--encre); }
.section--foret .liste-tirets li::before { background: #c9b189; }
.section--foret .liste-tirets strong { color: var(--blanc); }

/* ==========================================================================
   9. Cartes d'equipements
   ========================================================================== */

.cartes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 22px;
}

.carte {
  background: var(--blanc);
  border: 1px solid var(--sable-3);
  border-radius: var(--rayon);
  padding: 30px 28px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.carte:hover { transform: translateY(-3px); box-shadow: var(--ombre); }

.carte__icone {
  width: 36px; height: 36px;
  margin-bottom: 16px;
  color: var(--cuir);
}
.carte__icone svg { width: 100%; height: 100%; display: block; }

.carte h3 { font-size: 1.2rem; margin-bottom: .35em; }
.carte p { color: var(--encre-doux); font-size: .95rem; margin: 0; }

/* ==========================================================================
   10. Pistes
   ========================================================================== */

.piste { display: grid; gap: clamp(28px, 4vw, 56px); }
.piste + .piste { margin-top: clamp(56px, 7vw, 96px); }

.piste__dimension {
  display: inline-block;
  font-family: var(--titre);
  font-size: 1.05rem;
  color: var(--cuir);
  border: 1px solid var(--sable-3);
  background: var(--blanc);
  padding: 5px 16px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.section--foret .piste__dimension {
  color: #e7dcc6;
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .22);
}

.piste__media { border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre-fort); }
.piste__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

@media (min-width: 861px) {
  .piste { grid-template-columns: 1fr 1fr; align-items: center; }
  .piste--inverse .piste__media { order: 2; }
}

/* ==========================================================================
   11. Galerie
   ========================================================================== */

.galerie {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.galerie__item {
  margin: 0;
  overflow: hidden;
  border-radius: var(--rayon);
  background: var(--sable-3);
}
.galerie__item img {
  width: 100%; height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform .5s ease;
}
.galerie__item:hover img { transform: scale(1.05); }
.galerie__item--large { grid-column: span 2; grid-row: span 2; }

/* ==========================================================================
   12. Contact
   ========================================================================== */

.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 5vw, 72px); }

.coordonnees { list-style: none; margin: 0 0 32px; padding: 0; }
.coordonnees li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--sable-3);
}
.coordonnees li:first-child { padding-top: 0; }
.coordonnees__icone { flex: 0 0 22px; color: var(--cuir); margin-top: 3px; }
.coordonnees__icone svg { width: 22px; height: 22px; display: block; }
.coordonnees__label {
  display: block;
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--encre-doux);
  margin-bottom: 2px;
}
.coordonnees a { color: var(--encre); text-decoration: none; }
.coordonnees a:hover { color: var(--cuir); text-decoration: underline; }

.carte-lieu {
  border-radius: var(--rayon);
  overflow: hidden;
  border: 1px solid var(--sable-3);
  background: var(--blanc);
}
.carte-lieu__apercu { position: relative; display: block; text-decoration: none; }
.carte-lieu__apercu img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; filter: saturate(.85); }
.carte-lieu__voile {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(43, 35, 28, .45);
  color: var(--blanc);
  font-weight: 600;
  font-size: .95rem;
  transition: background var(--transition);
}
.carte-lieu__apercu:hover .carte-lieu__voile { background: rgba(43, 35, 28, .62); }
.carte-lieu__note { padding: 12px 16px; font-size: .82rem; color: var(--encre-doux); }

/* Formulaire */
.formulaire {
  background: var(--blanc);
  border: 1px solid var(--sable-3);
  border-radius: var(--rayon);
  padding: clamp(26px, 3.5vw, 40px);
  box-shadow: var(--ombre);
}
.champ { margin-bottom: 18px; }
.champ label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  margin-bottom: 7px;
  color: var(--encre);
}
.champ .requis { color: var(--cuir); }
.champ input,
.champ textarea,
.champ select {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--encre);
  background: var(--sable);
  border: 1px solid var(--sable-3);
  border-radius: var(--rayon);
  transition: border-color var(--transition), background var(--transition);
}
.champ textarea { min-height: 140px; resize: vertical; }
.champ input:focus,
.champ textarea:focus,
.champ select:focus {
  background: var(--blanc);
  border-color: var(--cuir);
  outline: none;
}
.champ--pot { position: absolute; left: -9999px; }

.champ-consentement {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: .86rem;
  color: var(--encre-doux);
  margin-bottom: 22px;
}
.champ-consentement input { width: 18px; height: 18px; margin-top: 3px; flex: 0 0 auto; }

.message {
  padding: 14px 18px;
  border-radius: var(--rayon);
  margin-bottom: 22px;
  font-size: .95rem;
}
.message--ok { background: #e9f3e9; border: 1px solid #b8d6b8; color: #2f5c2f; }
.message--ko { background: #fbecec; border: 1px solid #e2b9b9; color: #8a2f2f; }

/* ==========================================================================
   13. Pied de page
   ========================================================================== */

.pied {
  background: var(--encre);
  color: rgba(255, 255, 255, .72);
  padding-block: 64px 28px;
  font-size: .93rem;
}
.pied__grille {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 44px;
  border-bottom: 1px solid rgba(255, 255, 255, .13);
}
.pied__logo { width: 168px; margin-bottom: 18px; }
.pied h3 {
  font-family: var(--texte);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--blanc);
  margin-bottom: 16px;
}
.pied ul { list-style: none; margin: 0; padding: 0; }
.pied li { margin-bottom: 9px; }
.pied a { color: rgba(255, 255, 255, .72); text-decoration: none; }
.pied a:hover { color: var(--blanc); text-decoration: underline; }

.reseaux { display: flex; gap: 12px; margin-top: 4px; }
.reseaux a {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  transition: background var(--transition), border-color var(--transition);
}
.reseaux a:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .5); }
.reseaux svg { width: 19px; height: 19px; display: block; }

.pied__bas {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  font-size: .85rem;
  color: rgba(255, 255, 255, .5);
}

/* ==========================================================================
   14. Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .chiffres__grille { grid-template-columns: repeat(2, 1fr); }
  .pied__grille { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  :root { --header-h: 66px; }

  /* Le burger doit rester au-dessus du tiroir pour servir de bouton de fermeture. */
  .burger { display: flex; position: relative; z-index: 2; }

  .nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(320px, 84vw);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2px;
    padding: calc(var(--header-h) + 20px) 22px 32px;
    background: var(--sable);
    box-shadow: -12px 0 40px rgba(43, 35, 28, .18);
    transform: translateX(100%);
    transition: transform .3s ease;
    overflow-y: auto;
  }
  .nav.est-ouvert { transform: translateX(0); }

  .nav__lien {
    color: var(--encre);
    text-shadow: none;
    padding: 14px 8px;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--sable-3);
  }
  .nav__lien::after { display: none; }
  .nav__lien.est-actif { color: var(--cuir); }
  .nav__bouton { margin: 20px 0 0; width: 100%; }

  .voile-nav {
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(43, 35, 28, .5);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
  }
  .voile-nav.est-visible { opacity: 1; visibility: visible; }

  body.nav-ouverte { overflow: hidden; }
  body.nav-ouverte .entete { background: rgba(247, 243, 236, .98); }
  body.nav-ouverte .entete .logo--clair { display: none; }
  body.nav-ouverte .entete .logo--sombre { display: block; }

  .duo, .contact { grid-template-columns: 1fr; }
  .duo--inverse .duo__media { order: 0; }
  .duo__media img, .duo__media--portrait img { aspect-ratio: 16 / 10; }

  .galerie { grid-template-columns: repeat(2, 1fr); }
  .galerie__item--large { grid-column: span 2; grid-row: span 1; }
  .galerie__item--large img { aspect-ratio: 16 / 10; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  :root { --gouttiere: 18px; }
  .chiffres__grille { grid-template-columns: 1fr; }
  .pied__grille { grid-template-columns: 1fr; gap: 32px; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .bouton { width: 100%; }
  .galerie { grid-template-columns: 1fr; }
  .galerie__item--large { grid-column: span 1; }
}

/* ==========================================================================
   15. Impression
   ========================================================================== */

@media print {
  .entete, .burger, .nav, .hero__actions, .formulaire, .voile-nav { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .section { padding-block: 18pt; }
}
