/* ==========================================================================
   DST Travaux — sections de page
   ========================================================================== */

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: stretch;
  min-height: min(82vh, 760px);
  border-bottom: 1px solid var(--trait);
}

.hero__texte {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(3rem, 6vw, 6.5rem) clamp(1.25rem, 4vw, 4rem) clamp(3rem, 6vw, 6rem);
  padding-left: max(clamp(1.25rem, 4vw, 3rem), calc((100vw - var(--largeur)) / 2 + 1.25rem));
}

.hero h1 { margin-bottom: 1.5rem; }

.hero__sous {
  font-size: var(--t-md);
  color: var(--noyer-2);
  max-width: 46ch;
  margin-bottom: 2rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}
.hero__tel { font-size: var(--t-sm); color: var(--noyer-soft); }

.hero__reperes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--trait);
  font-size: var(--t-sm);
  color: var(--noyer-2);
  max-width: 46ch;
}
.hero__reperes li { list-style: none; }
.hero__reperes li::before {
  content: "";
  display: inline-block;
  width: 9px; height: 9px;
  margin-right: 0.55rem;
  background: var(--marbre);
  transform: rotate(45deg);
  vertical-align: 1px;
}

.hero__image {
  position: relative;
  overflow: hidden;
  background: var(--plaster-2);
}
.hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% center;
}

/* La vidéo se pose exactement sur la photo et apparaît une fois prête.
   Si elle ne charge pas, la photo reste : rien ne bouge, rien ne casse. */
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% center;
  opacity: 0;
  transition: opacity 900ms ease;
  pointer-events: none;
}
.hero__video.est-pret { opacity: 1; }

/* Même mécanique pour les photos des pages intérieures. */
.media-anime { position: relative; }
.media-anime video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 900ms ease;
  pointer-events: none;
}
.media-anime video.est-pret { opacity: 1; }

@media (max-width: 960px), (prefers-reduced-motion: reduce) {
  .hero__video, .media-anime video { display: none; }
}

/* La couture en point de Hongrie : le parquet du chantier devient
   la ligne de partage entre le texte et la photo. */
.hero__couture {
  position: absolute;
  inset: 0 auto 0 0;
  width: 22px;
  background: var(--plaster);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='44' viewBox='0 0 22 44' preserveAspectRatio='none'%3E%3Cpath d='M0 0 H22 L0 22 L22 44 H0 Z' fill='%23000'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='44' viewBox='0 0 22 44' preserveAspectRatio='none'%3E%3Cpath d='M0 0 H22 L0 22 L22 44 H0 Z' fill='%23000'/%3E%3C/svg%3E");
  -webkit-mask-repeat: repeat-y;
  mask-repeat: repeat-y;
  -webkit-mask-size: 22px 44px;
  mask-size: 22px 44px;
}

.hero__legende {
  position: absolute;
  left: 3rem; bottom: 1.25rem;
  font-size: var(--t-xs);
  color: var(--craie);
  background: rgba(51, 36, 28, 0.55);
  backdrop-filter: blur(4px);
  padding: 0.35rem 0.7rem;
  border-radius: 3px;
}

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero__texte { padding-left: clamp(1.25rem, 4vw, 3rem); order: 2; }
  .hero__image { order: 1; aspect-ratio: 4 / 3; }
  .hero__couture {
    inset: auto 0 0 0;
    width: auto; height: 22px;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='68' height='22' viewBox='0 0 68 22' preserveAspectRatio='none'%3E%3Cpath d='M0 22 V0 L34 22 L68 0 V22 Z' fill='%23000'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='68' height='22' viewBox='0 0 68 22' preserveAspectRatio='none'%3E%3Cpath d='M0 22 V0 L34 22 L68 0 V22 Z' fill='%23000'/%3E%3C/svg%3E");
    -webkit-mask-repeat: repeat-x;
    mask-repeat: repeat-x;
    -webkit-mask-size: 68px 22px;
    mask-size: 68px 22px;
  }
  .hero__legende { left: 1.25rem; bottom: 2rem; }
}

/* --- Sections génériques ------------------------------------------------- */

.section { padding-block: var(--bloc); }
.section--craie { background: var(--craie); border-block: 1px solid var(--trait); }
.section--noyer { background: var(--noyer); color: #E4DACE; }
.section--noyer h2, .section--noyer h3 { color: var(--craie); }
.section--noyer .sur-titre { color: var(--chene); }

.section__entete { margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section__entete h2 { max-width: 20ch; }
.section__entete p { margin-top: 1rem; }

/* --- Ce que nous faisons : liste éditoriale, pas des cartes -------------- */

.metiers { border-top: 1px solid var(--trait); }

.metier {
  display: grid;
  grid-template-columns: 1fr 1.2fr minmax(0, 260px);
  gap: clamp(1rem, 3vw, 3rem);
  align-items: start;
  padding-block: clamp(1.75rem, 3vw, 2.75rem);
  border-bottom: 1px solid var(--trait);
}
.metier h3 { max-width: 14ch; }
.metier p { color: var(--noyer-2); font-size: var(--t-sm); }
.metier img { border-radius: 2px; aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.metier__lien {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: var(--t-sm);
  text-decoration: none;
  border-bottom: 1px solid var(--marbre);
}

@media (max-width: 860px) {
  .metier { grid-template-columns: 1fr; gap: 1rem; }
  .metier img { max-width: 420px; }
}

/* --- Galerie du chantier ------------------------------------------------- */

.piece {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}
.piece figure { margin: 0; }
.piece figcaption {
  font-size: var(--t-xs);
  color: var(--noyer-soft);
  margin-top: 0.5rem;
  max-width: 46ch;
}
.piece img { width: 100%; border-radius: 2px; }

.piece__titre {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid var(--trait);
  padding-bottom: 0.6rem;
  margin-bottom: 0.5rem;
}
.piece__titre h2, .piece__titre h3 { font-size: var(--t-lg); }
.piece__titre span { font-size: var(--t-xs); color: var(--noyer-soft); }

.col-7 { grid-column: span 7; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-12 { grid-column: span 12; }

@media (max-width: 760px) {
  .col-7, .col-5, .col-6 { grid-column: span 12; }
}

/* --- Déroulé du chantier (une vraie séquence) --------------------------- */

.etapes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: clamp(1.5rem, 2.4vw, 2rem);
  counter-reset: etape;
}
.etape { border-top: 2px solid var(--marbre); padding-top: 1rem; }
.etape::before {
  counter-increment: etape;
  content: counter(etape, decimal-leading-zero);
  display: block;
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--marbre);
  margin-bottom: 0.5rem;
}
.section--noyer .etape { border-top-color: var(--chene); }
.section--noyer .etape::before { color: var(--chene); }
.etape h3 { font-size: var(--t-md); font-family: var(--sans); font-weight: 500; margin-bottom: 0.5rem; }
.etape p { font-size: var(--t-sm); color: inherit; opacity: 0.85; }

/* --- Garanties / preuves ------------------------------------------------- */

.garanties {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--trait);
  border: 1px solid var(--trait);
}
.garantie { background: var(--craie); padding: 1.5rem; }
.garantie h3 { font-family: var(--sans); font-size: var(--t-base); font-weight: 500; margin-bottom: 0.4rem; }
.garantie p { font-size: var(--t-sm); color: var(--noyer-2); }

.a-fournir {
  display: inline-block;
  font-family: var(--sans);
  font-size: var(--t-xs);
  font-weight: 500;
  color: #8A5A00;
  background: #FBF0D8;
  border: 1px dashed #D6A93C;
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
}

/* --- FAQ ----------------------------------------------------------------- */

.faq { max-width: 820px; }
.faq details {
  border-bottom: 1px solid var(--trait);
  padding-block: 1.15rem;
}
.faq summary {
  cursor: pointer;
  font-family: var(--serif);
  font-size: var(--t-md);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: baseline;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--sans);
  color: var(--marbre);
  flex: none;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 0.75rem; color: var(--noyer-2); font-size: var(--t-sm); max-width: 66ch; }
.faq details p + p { margin-top: 0.6rem; }

/* --- Contact ------------------------------------------------------------- */

.contact {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }

.contact__aside p { color: var(--noyer-2); margin-bottom: 1.25rem; max-width: 42ch; }
.contact__tel {
  font-family: var(--serif);
  font-size: var(--t-lg);
  color: var(--noyer);
  text-decoration: none;
  border-bottom: 2px solid var(--marbre);
}
.contact__tel:hover { color: var(--marbre); }

.formulaire {
  background: var(--craie);
  border: 1px solid var(--trait);
  border-radius: 4px;
  padding: clamp(1.5rem, 3vw, 2.25rem);
}
.champ { margin-bottom: 1.1rem; }
.champ label {
  display: block;
  font-size: var(--t-sm);
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.champ input, .champ select, .champ textarea {
  width: 100%;
  background: var(--plaster);
  border: 1px solid var(--trait);
  border-radius: 3px;
  padding: 0.7rem 0.85rem;
  font-size: var(--t-sm);
}
.champ input:focus, .champ select:focus, .champ textarea:focus {
  border-color: var(--marbre);
  outline: none;
  box-shadow: 0 0 0 3px rgba(110, 34, 51, 0.12);
}
.champ textarea { min-height: 120px; resize: vertical; }
.champs-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .champs-2 { grid-template-columns: 1fr; } }

.formulaire .bouton { width: 100%; }
.mention-form { font-size: var(--t-xs); color: var(--noyer-soft); margin-top: 0.85rem; }
.piege { position: absolute; left: -9999px; }

.form-ok { text-align: center; padding: 1rem 0; }
.form-ok h3 { font-size: var(--t-lg); margin-bottom: 0.5rem; }
.form-ok p { color: var(--noyer-2); font-size: var(--t-sm); }
.form-erreur {
  margin-top: 0.85rem;
  font-size: var(--t-sm);
  color: var(--marbre);
}

/* --- Appel à l'action de bas de page ------------------------------------ */

.rappel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.rappel h2 { max-width: 18ch; }

/* --- Pages intérieures --------------------------------------------------- */

.entete-page {
  padding-block: clamp(3rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--trait);
}
.fil {
  font-size: var(--t-xs);
  color: var(--noyer-soft);
  margin-bottom: 1.25rem;
}
.fil a { color: var(--noyer-soft); text-decoration: none; }
.fil a:hover { color: var(--marbre); }

.prose { max-width: var(--lecture); }
.prose h2 { font-size: var(--t-lg); margin-top: 2.5rem; margin-bottom: 0.75rem; }
.prose h3 { font-size: var(--t-md); font-family: var(--sans); font-weight: 500; margin-top: 1.75rem; margin-bottom: 0.5rem; }
.prose p { margin-bottom: 1rem; color: var(--noyer-2); }
.prose ul, .prose ol { margin: 0 0 1.25rem 1.1rem; color: var(--noyer-2); }
.prose li { margin-bottom: 0.4rem; }
.prose li::marker { color: var(--marbre); }

.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
@media (max-width: 860px) { .duo { grid-template-columns: 1fr; } }

/* Apparition unique du hero, une seule fois au chargement */
.hero__texte > * {
  opacity: 0;
  animation: monter 620ms cubic-bezier(.2, .7, .3, 1) forwards;
}
.hero__texte > *:nth-child(1) { animation-delay: 60ms; }
.hero__texte > *:nth-child(2) { animation-delay: 130ms; }
.hero__texte > *:nth-child(3) { animation-delay: 200ms; }
.hero__texte > *:nth-child(4) { animation-delay: 270ms; }
.hero__texte > *:nth-child(5) { animation-delay: 340ms; }

@keyframes monter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__texte > * { opacity: 1; animation: none; }
}
