/* =========================================================================
   MB Bois : pages de l'architecture SEO (accueil v2, métiers, réalisations,
   contact). Chargée APRÈS styles.css, dont elle reprend les tokens et les
   composants. Elle ne s'applique qu'aux pages qui l'appellent : la page
   d'accueil actuelle n'en dépend pas.
   ========================================================================= */

/* ---------- Fil d'Ariane ---------------------------------------------- */

.crumbs {
  padding: 16px var(--gutter);
  background: #fff;
  border-bottom: 1px solid var(--hairline);
  font: 400 12.5px/1.5 var(--ui);
  color: var(--muted);
}

.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; list-style: none; }
.crumbs li + li::before { content: "/"; margin: 0 10px; color: var(--line); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--olive); }
.crumbs [aria-current] { color: var(--ink); }

/* ---------- En-tête de page (métiers) --------------------------------- */

.page-hero {
  display: grid;
  gap: clamp(30px, 5vw, 80px);
  align-items: center;
  padding: clamp(40px, 6vw, 96px) var(--gutter);
  background: #fff;
}

@media (min-width: 1024px) {
  .page-hero { grid-template-columns: 1.15fr .85fr; }
}

.page-hero h1 {
  margin: clamp(14px, 1.4vw, 20px) 0 0;
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.page-hero .lead { max-width: 620px; }
.page-hero .lead strong { font-weight: 500; color: var(--ink); }
.page-hero .lead a { color: var(--olive); border-bottom: 1px solid rgba(126, 139, 98, .4); }

.page-hero .ph { aspect-ratio: 4 / 5; }

@media (max-width: 1023px) {
  .page-hero .ph { aspect-ratio: 4 / 3; }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(26px, 3vw, 40px);
}

@media (max-width: 599px) {
  .actions { flex-direction: column; }
  .actions .btn { display: block; }
}

/* ---------- Corps d'article + encart latéral --------------------------- */

.page-body {
  display: grid;
  gap: clamp(40px, 6vw, 90px);
  padding: clamp(50px, 7vw, 110px) var(--gutter);
  background: #fff;
  border-top: 1px solid var(--hairline);
}

@media (min-width: 1024px) {
  .page-body { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
}

.content { max-width: 740px; }

.content > h2 {
  margin: clamp(46px, 5vw, 72px) 0 0;
  font-size: clamp(26px, 2.5vw, 36px);
  line-height: 1.1;
}

.content > h2:first-child { margin-top: 0; }

.content h3 {
  margin: 30px 0 0;
  font-size: clamp(19px, 1.5vw, 22px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.content p,
.content li {
  font: 400 clamp(15px, 1.1vw, 16.5px)/1.8 var(--ui);
  color: var(--body);
  text-wrap: pretty;
}

.content p { margin: 16px 0 0; }
.content strong { font-weight: 500; color: var(--ink); }

.content ul {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.content ul li { position: relative; padding-left: 22px; }
.content ul li + li { margin-top: 4px; }

.content ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .88em;
  width: 10px;
  height: 1px;
  background: var(--olive);
}

/* Liste sur deux colonnes pour les énumérations courtes (éléments de toiture). */
@media (min-width: 640px) {
  .content ul.cols { columns: 2; column-gap: 32px; }
  .content ul.cols li { break-inside: avoid; }
}

.more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  font: 500 14px/1.4 var(--ui);
  color: var(--olive);
  border-bottom: 1px solid rgba(126, 139, 98, .4);
  padding-bottom: 3px;
  transition: color .3s ease, border-color .3s ease;
}

.more::after { content: "→"; transition: transform .3s var(--ease); }
.more:hover { color: var(--ink); border-color: var(--ink); }
.more:hover::after { transform: translateX(3px); }

/* Photo dans le fil du texte. */
.content figure { margin: 32px 0 0; }
.content figure .ph { aspect-ratio: 3 / 2; }

.content figcaption,
.shot figcaption {
  margin-top: 10px;
  font: 400 12.5px/1.6 var(--ui);
  color: var(--muted);
}

/* Deux photos côte à côte. */
.duo { display: grid; gap: 12px; margin-top: 32px; }
.duo figure { margin: 0; }
.duo .ph, .duo .ph-slot { aspect-ratio: 1; }

@media (min-width: 640px) {
  .duo { grid-template-columns: 1fr 1fr; }
}

/* Avant / pendant / après. */
.triptych { display: grid; gap: 12px; margin-top: 28px; }
.triptych figure { margin: 0; }
.triptych .ph, .triptych .ph-slot { aspect-ratio: 4 / 5; }

@media (min-width: 640px) {
  .triptych { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Emplacement photo à fournir -------------------------------- */

/* Placeholder visible : il dit quelle photo manque et sous quel nom la
   déposer (convention du plan SEO : lieu + nature des travaux + mb-bois). */
.ph-slot {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 22px;
  min-height: 180px;
  background:
    repeating-linear-gradient(135deg,
      rgba(18, 18, 15, .035) 0 12px,
      transparent 12px 24px),
    var(--sand);
  border: 1px dashed rgba(18, 18, 15, .22);
  text-align: center;
  font: 400 12.5px/1.55 var(--ui);
  color: var(--muted);
}

.ph-slot::before {
  content: "";
  width: 28px;
  height: 22px;
  margin-bottom: 4px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  background:
    radial-gradient(circle at 70% 32%, currentColor 0 2.5px, transparent 3px),
    linear-gradient(135deg, transparent 55%, currentColor 55% 62%, transparent 62%);
  opacity: .55;
}

.ph-slot strong { display: block; font-weight: 500; color: var(--body); }

.ph-slot code {
  display: block;
  max-width: 100%;
  font: 400 11px/1.4 ui-monospace, Menlo, monospace;
  color: var(--soft);
  overflow-wrap: anywhere;
}

/* ---------- Étapes (rénovation) ---------------------------------------- */

.steps {
  counter-reset: step;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.steps > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 0 14px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.steps > li::before {
  content: counter(step, decimal-leading-zero);
  grid-row: 1 / span 2;
  font: 500 12px/2 var(--ui);
  color: var(--olive);
}

.steps h3 { margin: 0; }
.steps p { margin: 8px 0 0; }

@media (min-width: 640px) {
  .steps > li { grid-template-columns: 42px minmax(0, 1fr) 150px; gap: 0 22px; }
  .steps .ph { grid-column: 3; grid-row: 1 / span 2; aspect-ratio: 1; align-self: start; }
}

@media (max-width: 639px) {
  .steps .ph { grid-column: 2; margin-top: 16px; aspect-ratio: 3 / 2; }
}

/* ---------- Encart latéral -------------------------------------------- */

.aside { display: grid; gap: 18px; }

@media (min-width: 1024px) {
  .aside { position: sticky; top: calc(var(--header-h) + 24px); }
}

.aside-card {
  padding: 28px;
  background: var(--sand);
}

.aside-card h2 {
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.aside-card p { margin: 12px 0 0; font: 400 14px/1.7 var(--ui); color: var(--body); }

.aside-card .tel-sm {
  display: block;
  margin-top: 18px;
  font: 300 30px/1 var(--display);
  letter-spacing: -.02em;
}

.aside-card .tel-sm:hover { color: var(--olive); }
.aside-card .btn { display: block; margin-top: 18px; }

.aside-links { margin: 14px 0 0; padding: 0; list-style: none; }
.aside-links li { border-top: 1px solid var(--line); }

.aside-links a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  font: 400 14.5px/1.4 var(--ui);
  transition: color .3s ease;
}

.aside-links a::after { content: "→"; color: var(--olive); }
.aside-links a:hover { color: var(--olive); }

/* ---------- Voir aussi : maillage vers les autres métiers --------------- */

.related {
  display: grid;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) { .related { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .related { grid-template-columns: repeat(var(--n, 3), 1fr); } }

.related a { display: block; }
.related .ph { aspect-ratio: 4 / 3; }

.related h3 {
  margin-top: 18px;
  font-size: clamp(20px, 1.6vw, 24px);
  font-weight: 400;
  letter-spacing: -.01em;
}

.related p { margin: 8px 0 0; font: 400 14px/1.65 var(--ui); color: var(--soft); }
.related .more { margin-top: 14px; }

@media (hover: hover) {
  .related a:hover .ph img { transform: scale(1.045); }
  .related a:hover .more { color: var(--ink); border-color: var(--ink); }
}

/* ---------- Bandeau zone d'intervention -------------------------------- */

.zone-band {
  display: grid;
  gap: 18px 60px;
  padding: clamp(50px, 6vw, 90px) var(--gutter);
  background: var(--sand);
}

@media (min-width: 1024px) {
  .zone-band { grid-template-columns: .9fr 1.1fr; align-items: start; }
}

.zone-band h2 { font-size: clamp(26px, 2.5vw, 36px); line-height: 1.1; }
.zone-band p { margin: 0; font: 400 clamp(15px, 1.1vw, 16.5px)/1.8 var(--ui); color: var(--body); }
.zone-band p + p { margin-top: 14px; }

.towns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.towns li {
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--hairline);
  font: 400 13.5px/1.2 var(--ui);
}

.towns li.hq { background: var(--ink); color: #fff; border-color: var(--ink); }
.towns a { text-decoration: underline; text-decoration-color: rgba(126, 139, 98, .5); text-underline-offset: 3px; transition: color .3s var(--ease); }
.towns a:hover { color: var(--olive); }

/* ---------- Bandeau d'appel à l'action --------------------------------- */

.cta-band {
  padding: clamp(60px, 8vw, 120px) var(--gutter);
  background: var(--ink);
  color: #fff;
}

.cta-band h2 {
  max-width: 820px;
  font-size: clamp(30px, 3.4vw, 50px);
  line-height: 1.08;
  color: #fff;
  text-wrap: balance;
}

.cta-band p {
  max-width: 640px;
  margin: 20px 0 0;
  font: 400 clamp(15px, 1.2vw, 17px)/1.75 var(--ui);
  color: rgba(255, 255, 255, .78);
}

.cta-band .eyebrow { color: rgba(255, 255, 255, .6); margin-bottom: 18px; }

/* ---------- Accueil v2 : métiers ---------------------------------------- */

.intro {
  display: grid;
  gap: 20px clamp(40px, 6vw, 100px);
  padding: clamp(60px, 8vw, 120px) var(--gutter);
  background: var(--sand);
}

@media (min-width: 1024px) {
  .intro { grid-template-columns: .9fr 1.1fr; }
}

.intro h2 { font-size: clamp(30px, 3.2vw, 46px); line-height: 1.05; text-wrap: balance; }
.intro .lead:first-child { margin-top: 0; }
.intro .lead strong { font-weight: 500; color: var(--ink); }

.metiers { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }

.metier {
  display: grid;
  gap: 20px clamp(30px, 5vw, 80px);
  padding: clamp(30px, 4vw, 56px) 0;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 800px) {
  .metier { grid-template-columns: minmax(220px, 360px) 1fr; align-items: center; }
}

.metier .ph { aspect-ratio: 4 / 3; }

.metier h3 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 300;
  line-height: 1.1;
}

.metier h3 .num { font-size: 12px; }
.metier h3 a { display: inherit; align-items: inherit; gap: inherit; color: inherit; transition: color .3s var(--ease); }
.metier h3 a:hover { color: var(--olive); }
.metier p { margin: 14px 0 0; max-width: 620px; font: 400 clamp(15px, 1.1vw, 16.5px)/1.8 var(--ui); color: var(--body); }

.approche { display: grid; gap: 30px clamp(40px, 5vw, 80px); }
@media (min-width: 900px) { .approche { grid-template-columns: 1fr 1fr; } }
.approche h2 { font-size: clamp(26px, 2.5vw, 36px); line-height: 1.1; }
.approche p { margin: 16px 0 0; font: 400 clamp(15px, 1.1vw, 16.5px)/1.8 var(--ui); color: var(--body); }

/* ---------- Réalisations ---------------------------------------------- */

.fiches {
  display: grid;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 700px) { .fiches { grid-template-columns: repeat(3, 1fr); } }

.fiche .ph, .fiche .ph-slot { aspect-ratio: 4 / 3; }
.fiche h3 { margin-top: 16px; font-size: 20px; font-weight: 400; letter-spacing: -.01em; }
.fiche h3 strong { font-weight: 600; }
.fiche p { margin: 6px 0 0; font: 400 13.5px/1.6 var(--ui); color: var(--muted); }

.gallery-static li { list-style: none; }

/* Fiche chantier : tableau récapitulatif. */
.facts-table {
  display: grid;
  gap: 0;
  margin: 28px 0 0;
  border-top: 1px solid var(--line);
}

.facts-table > div {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.facts-table dt { font: 500 12px/1.8 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.facts-table dd { margin: 0; font: 400 15.5px/1.7 var(--ui); color: var(--body); }

@media (max-width: 539px) {
  .facts-table > div { grid-template-columns: 1fr; gap: 2px; }
}

/* Repère visible sur les éléments à compléter avant publication. */
.todo {
  padding: 1px 6px;
  background: #FFF4D6;
  color: #7A5B00;
  font-style: normal;
}

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

.contact-page .contact { padding: clamp(40px, 6vw, 96px) var(--gutter); background: #fff; }
.contact-page h1 { font-size: clamp(36px, 4.4vw, 64px); line-height: 1.02; letter-spacing: -.03em; margin-top: 14px; }
.contact-page .lead { max-width: 520px; }

/* ---------- Pied de page étendu ---------------------------------------- */

.footer-grid {
  display: grid;
  gap: 30px 40px;
  padding: clamp(46px, 5vw, 72px) var(--gutter) clamp(30px, 3vw, 40px);
  background: #fff;
  border-top: 1px solid rgba(18, 18, 15, .1);
}

@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; } }

.footer-grid h2 {
  margin-bottom: 14px;
  font: 500 11px/1 var(--ui);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-grid ul { margin: 0; padding: 0; list-style: none; }
.footer-grid li { font: 400 14px/2 var(--ui); }
.footer-grid a:hover { color: var(--olive); }
.footer-grid address { font: 400 14px/1.9 var(--ui); font-style: normal; color: var(--body); }
.footer-grid .brand img { height: 44px; width: auto; margin-bottom: 14px; }

.footer-grid + .site-footer { border-top: 1px solid var(--hairline); }

/* ---------- Barre d'appel mobile --------------------------------------- */

/* Sous 1024 px le numéro n'est plus dans l'en-tête (il passe dans le menu) :
   la barre garde « Appeler » et « Devis » à portée de pouce en permanence. */
.callbar { display: none; }

@media (max-width: 1023px) {
  .callbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 38;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(6px);
  }

  .callbar .btn { padding: 15px 0; }
  body.has-callbar { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
}

/* Lien de navigation de la page en cours. */
.nav a[aria-current="page"] { color: var(--olive); }

/* ---------- Accueil v2 : ajustements du hero et des sections ----------- */

/* Le titre de l'accueil v2 est une phrase (« Couvreur et charpentier à… »),
   pas le seul nom de l'entreprise : il ne peut pas garder les 104 px du hero
   d'origine. */
.hero-v2 .hero-body h1 {
  max-width: 19ch;
  font-size: clamp(38px, 5.4vw, 80px);
  font-weight: 400;
  text-wrap: balance;
  line-height: 1.04;
  letter-spacing: -.015em;
  text-shadow: 0 2px 24px rgba(12, 12, 10, .35);
}

/* Le texte de l'accueil v2 monte jusqu'au milieu de la photo, là où le voile
   d'origine (dégradé vers le bas) ne couvre presque plus les tuiles claires :
   un second dégradé, latéral, assombrit la colonne de texte. */
.hero-v2 .hero-veil {
  background:
    linear-gradient(to right,
      rgba(12, 12, 10, .62) 0%,
      rgba(12, 12, 10, .38) 45%,
      rgba(12, 12, 10, 0) 75%),
    linear-gradient(to top,
      rgba(12, 12, 10, .6) 0%,
      rgba(12, 12, 10, .3) 40%,
      rgba(12, 12, 10, .15) 100%);
}

.hero-v2 .eyebrow-light { color: #fff; font-weight: 600; }

.hero-v2 .hero-baseline { letter-spacing: .06em; color: #fff; font-weight: 500; }

.gallery-static, .gallery-static ~ .ig-embed { margin-top: clamp(36px, 5vw, 64px); }

/* Repli du fil Instagram : même gabarit que le cadre d'Instagram (1000 px au
   plus, trois colonnes carrées), fait de photos du site. Affiché seulement si
   le fil ne se charge pas, voir assets/site.js. */
.ig-fallback {
  max-width: 1000px;
  margin: clamp(36px, 5vw, 64px) auto 0;
}

.ig-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fff;
}
.ig-preview li { aspect-ratio: 1; overflow: hidden; }
.ig-preview img { width: 100%; height: 100%; object-fit: cover; }
.ig-fallback ~ .ig-embed { margin-top: clamp(36px, 5vw, 64px); }
.cta-band .cta-strong { color: #fff; font-weight: 500; }
.section-ruled { border-top: 1px solid var(--hairline); }
.page-hero .ph-slot { aspect-ratio: 4 / 5; }
@media (max-width: 1023px) { .page-hero .ph-slot { aspect-ratio: 4 / 3; } }
.nw { white-space: nowrap; }

/* Ancres visées depuis l'extérieur (page /besoin/ de la préproduction) :
   la cible s'arrête sous l'en-tête collant et se signale un instant. */
main [id] { scroll-margin-top: calc(var(--header-h) + 24px); }

.ph-slot:target,
.triptych:target,
.fiches:target {
  outline: 2px solid var(--olive);
  outline-offset: 6px;
  animation: cible 1.6s var(--ease) 2;
}

@keyframes cible {
  50% { outline-color: rgba(126, 139, 98, .25); }
}
