/* =====================================================================
   La Forge du Gâtinais — thème « monochrome éditorial »
   - Tout le site : fond NOIR, texte BLANC.
   - Bandeau du haut : fond BLANC, texte NOIR.
   - Titre du bandeau : image wordmark (police de référence, texte-font).
   - Reste du site : sans-serif moderne (Manrope).
   Agencement inchangé (schéma) : bandeau → 5 catégories → « photo de fond »
   + bouton devis → bloc « texte présentation + photo ».
   ===================================================================== */

:root {
  --black:   #000000;
  --ink:     #ffffff;   /* texte principal sur noir */
  --body:    #cfcfcf;   /* texte courant sur noir */
  --muted:   #8f8f8f;   /* texte secondaire */
  --line:    #232323;   /* filets / bordures sur noir */
  --elev:    #0c0c0c;   /* placeholders légèrement relevés */

  --paper:     #ffffff; /* bandeau */
  --paper-ink: #0a0a0a; /* texte du bandeau */
  --paper-mut: #4a4a4a;

  --maxw: none;             /* le contenu s'étale sur toute la largeur de la page */
  --read: 66ch;             /* largeur de lecture confortable pour les paragraphes */
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--black);
  color: var(--body);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: clamp(18px, 3.5vw, 72px);
}

.ico { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }

/* --- Surfaces navigateur thématisées (détail de craft) --- */
::selection { background: var(--ink); color: var(--black); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
html { scrollbar-color: #333 #000; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #2c2c2c; border: 3px solid #000; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #3d3d3d; }

/* ---------------------------------------------------------------------
   1. BANDEAU (fond blanc / texte noir), collant
   --------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  color: var(--paper-ink);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 124px;
}
.brand { display: flex; align-items: center; gap: 18px; text-decoration: none; }
.brand-emblem { width: 80px; height: 80px; object-fit: contain; }
.brand-wordmark { height: clamp(40px, 6vw, 68px); width: auto; }

.header-actions { display: flex; align-items: center; gap: 18px; }
.tel {
  display: inline-flex; align-items: center; gap: .5em;
  color: var(--paper-ink); text-decoration: none;
  font-weight: 600; font-size: 1.05rem; white-space: nowrap;
}
.tel:hover { color: #000; text-decoration: underline; text-underline-offset: 4px; }
.btn-contact {
  display: inline-flex; align-items: center;
  background: var(--paper-ink); color: #fff;
  padding: .72em 1.5em; border-radius: 2px;
  font-weight: 700; font-size: 1.05rem; text-decoration: none;
  transition: background .2s var(--ease);
}
.btn-contact:hover { background: #333; }

/* ---------------------------------------------------------------------
   2. RANGÉE DES CATÉGORIES CLIQUABLES (fond noir) → pages dédiées
   --------------------------------------------------------------------- */
.cats { border-bottom: 1px solid var(--line); }
.cats-row {
  display: flex; align-items: stretch;
  gap: 0; flex-wrap: wrap;
}
.cat {
  flex: 1 1 0;
  display: flex;
  border-left: 1px solid var(--line);
}
.cat:first-child { border-left: 0; }
.cat-link {
  display: flex; align-items: center; width: 100%;
  padding: 34px clamp(16px, 2vw, 30px);
  text-decoration: none; color: inherit;
  transition: background .2s var(--ease);
}
.cat-link:hover, .cat-link:focus-visible { background: var(--elev); }
.cat-lbl {
  color: var(--ink); font-weight: 700; font-size: 1.24rem;
  line-height: 1.18; letter-spacing: -0.01em;
  transition: color .2s var(--ease);
}
.cat-link:hover .cat-lbl,
.cat-link:focus-visible .cat-lbl {
  text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px;
}

/* ---------------------------------------------------------------------
   3. HERO (photo de fond) + bouton devis centré
   --------------------------------------------------------------------- */
.hero { padding: clamp(26px, 4vw, 48px) clamp(18px, 4vw, 44px); }
.hero-photo {
  position: relative;
  max-width: var(--maxw); margin: 0 auto;
  min-height: clamp(360px, 56vh, 600px);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, #0a0a0a, #000),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(255,255,255,.03) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255,255,255,.03) 39px 40px);
}
/* Photo de fond réelle (background.jpg) + voile sombre pour la lisibilité du bouton */
.hero-photo.has-photo {
  background:
    linear-gradient(180deg, rgba(0,0,0,.30), rgba(0,0,0,.55)),
    url('assets/background.jpg') center / cover no-repeat;
}
.hero-cta { position: relative; z-index: 1; }
.btn-devis {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--black);
  padding: 1.05em 2.3em; border-radius: 2px;
  font-weight: 800; font-size: 1.28rem; letter-spacing: -0.01em;
  text-decoration: none;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.btn-devis:hover { background: #e2e2e2; transform: translateY(-2px); }
.btn-devis:active { transform: translateY(0); }

/* ---------------------------------------------------------------------
   4. BLOC « TEXTE PRÉSENTATION + PHOTO »
   --------------------------------------------------------------------- */
.presentation { padding: clamp(56px, 9vw, 110px) 0; border-top: 1px solid var(--line); }
.pres-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 72px); align-items: center;
}
.pres-text h2 { font-size: clamp(2.4rem, 5.5vw, 3.8rem); margin-bottom: 1.4rem; }
.pres-text p { color: var(--body); margin-bottom: 1.1rem; max-width: var(--read); }
.link-arrow {
  display: inline-block; margin-top: .6rem;
  color: var(--ink); font-weight: 700; text-decoration: underline;
  text-underline-offset: 5px; text-decoration-thickness: 1px;
  transition: text-underline-offset .2s var(--ease);
}
.link-arrow:hover { text-underline-offset: 8px; }
.pres-photo {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  overflow: hidden;
  background:
    linear-gradient(180deg, #0a0a0a, #000),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(255,255,255,.03) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255,255,255,.03) 39px 40px);
}
.pres-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------------
   Pied de page (fond noir)
   --------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 30px 0; }
.footer-inner {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 26px;
  font-size: .9rem; color: var(--muted);
}
.footer-brand { color: var(--ink); font-weight: 800; letter-spacing: -0.01em; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--body); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.footer-legal { margin-left: auto; }

/* ---------------------------------------------------------------------
   PAGES CATÉGORIES : en-tête de page + galerie manuelle (flèches + glisser)
   --------------------------------------------------------------------- */
.cat-hero { padding: clamp(40px, 7vw, 96px) 0 clamp(20px, 3vw, 34px); border-bottom: 1px solid var(--line); }
.back-link {
  display: inline-flex; align-items: center; gap: .5em;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem;
  margin-bottom: 1.6rem; transition: color .2s var(--ease);
}
.back-link:hover { color: var(--ink); }
.cat-hero h1 { font-size: clamp(2.6rem, 6.5vw, 4.6rem); margin-bottom: 1.1rem; }
.cat-intro { color: var(--body); max-width: var(--read); font-size: clamp(1.1rem, 1.6vw, 1.35rem); }

.gallery { padding: clamp(28px, 4vw, 56px) 0 clamp(40px, 6vw, 80px); }
.gallery-shell { position: relative; }
.gallery-track {
  display: flex; gap: clamp(14px, 2vw, 26px);
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}
.gallery-track.single { justify-content: center; }
.gallery-track li { flex: 0 0 auto; scroll-snap-align: center; }
.gallery-track img {
  height: clamp(300px, 58vh, 620px); width: auto; max-width: 88vw;
  object-fit: cover; border: 1px solid var(--line); border-radius: 2px;
  background: var(--elev);
}
.gal-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 54px; height: 54px; border-radius: 999px;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(0,0,0,.62); color: var(--ink);
  border: 1px solid var(--line); backdrop-filter: blur(6px);
  font-size: 1.7rem; line-height: 1; padding: 0 0 .12em;
  transition: background .2s var(--ease), opacity .2s var(--ease);
}
.gal-arrow:hover { background: rgba(0,0,0,.88); }
.gal-arrow:disabled { opacity: .3; cursor: default; }
.gal-arrow[hidden] { display: none; }
.gal-prev { left: 12px; }
.gal-next { right: 12px; }
.gallery-hint { margin-top: 1rem; color: var(--muted); font-size: .88rem; }

/* Appel à l'action « devis » en bas des pages catégories */
.cat-cta { padding: clamp(40px, 6vw, 80px) 0; border-top: 1px solid var(--line); text-align: center; }
.cat-cta p { color: var(--body); margin-bottom: 1.6rem; font-size: clamp(1.1rem, 1.8vw, 1.4rem); }

/* ---------------------------------------------------------------------
   Entrée à l'ouverture — un seul moment orchestré
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .cats, .hero, .presentation { animation: rise .7s var(--ease) both; }
  .hero { animation-delay: .08s; }
  .presentation { animation-delay: .16s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
    to   { opacity: 1; transform: none; filter: none; }
  }
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 980px) {
  .cat { flex: 1 1 33%; }
  .pres-grid { grid-template-columns: 1fr; }
  .pres-photo { order: -1; }
}
@media (max-width: 620px) {
  .header-inner { min-height: 96px; gap: 12px; }
  .brand-emblem { width: 60px; height: 60px; }
  .cat { flex: 1 1 50%; }
  .cat-link { padding: 24px 18px; }
  .gallery-track img { height: clamp(240px, 46vh, 420px); }
  .gal-arrow { width: 46px; height: 46px; font-size: 1.5rem; }
}
@media (max-width: 480px) {
  /* petits téléphones : on réduit le bandeau pour éviter tout débordement horizontal */
  .brand { gap: 12px; }
  .brand-emblem { width: 52px; height: 52px; }
  .brand-wordmark { height: 34px; }
  .header-actions { gap: 10px; }
  .btn-contact { padding: .6em 1.05em; font-size: .95rem; }
  .cat-hero h1 { font-size: clamp(2.1rem, 9vw, 2.8rem); }
}
@media (max-width: 420px) {
  .tel span { display: none; }
  .footer-legal { margin-left: 0; }
}
