/* =====================================================================
   Modèle « Site vitrine » HorizonWeb
   Tout le style dépend des variables ci-dessous : changer d'ambiance = changer
   data-theme sur <html>, ou adapter les couleurs d'une ambiance au client.
   ===================================================================== */

/* ---------- Ambiances ---------- */
:root, [data-theme="nature"] {          /* paysagiste, bien-être, fleuriste, gîte */
  --paper: #EDF0EA;  --surface: #FFFFFF;  --alt: #E1E7DE;
  --ink: #1C2B22;    --muted: #56675C;    --line: #C9D3C6;
  --accent: #2F6B4F; --on-accent: #FFFFFF; --spark: #D9A441;
  --deep: #1F3A2C;   --on-deep: #E8EFE6;
  --f-title: "Instrument Serif", Georgia, serif; --t-weight: 400; --t-track: -0.01em; --t-style: normal;
  --f-body: "Figtree", system-ui, sans-serif;
  --arch: 999px 999px 20px 20px;   /* forme des grandes photos : arche */
  --r: 14px;                       /* arrondi des boutons et champs */
}
[data-theme="artisan"] {                /* couvreur, maçon, électricien, garage */
  --paper: #F1F2F0;  --surface: #FFFFFF;  --alt: #E3E6E8;
  --ink: #1B232B;    --muted: #56616B;    --line: #CDD3D8;
  --accent: #E3A500; --on-accent: #1B232B; --spark: #E3A500;
  --deep: #1B232B;   --on-deep: #E9EDF0;
  --f-title: "Archivo", "Arial Narrow", sans-serif; --t-weight: 800; --t-track: -0.02em; --t-style: normal;
  --f-body: "Archivo", system-ui, sans-serif;
  --arch: 4px; --r: 4px;
}
[data-theme="gourmand"] {               /* boulangerie, restaurant, traiteur, épicerie */
  --paper: #F7EEDF;  --surface: #FFFBF4;  --alt: #EFE0C8;
  --ink: #2B1B15;    --muted: #6E5446;    --line: #E0CBB0;
  --accent: #A3243B; --on-accent: #FFF6EC; --spark: #E7B84B;
  --deep: #3A2219;   --on-deep: #F6E9D8;
  --f-title: "Gloock", Georgia, serif; --t-weight: 400; --t-track: 0; --t-style: normal;
  --f-body: "Outfit", system-ui, sans-serif;
  --arch: 999px 999px 0 0; --r: 999px;
}
[data-theme="prestige"] {               /* coiffure, esthétique, immobilier, avocat */
  --paper: #121315;  --surface: #1A1B1E;  --alt: #18191C;
  --ink: #EDE8DF;    --muted: #A39C90;    --line: #2E2F33;
  --accent: #C3A36B; --on-accent: #121315; --spark: #C3A36B;
  --deep: #0C0D0E;   --on-deep: #EDE8DF;
  --f-title: "Cormorant Garamond", Georgia, serif; --t-weight: 500; --t-track: 0; --t-style: italic;
  --f-body: "Jost", system-ui, sans-serif;
  --arch: 0; --r: 0;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--f-body); transition: background-color .4s, color .4s; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-title); font-weight: var(--t-weight); letter-spacing: var(--t-track); line-height: 1.08; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(42px, 6.4vw, 84px); font-style: var(--t-style); }
h2 { font-size: clamp(32px, 4.2vw, 52px); font-style: var(--t-style); }
h3 { font-size: 22px; line-height: 1.25; }
[data-theme="artisan"] h1 { font-stretch: 75%; }
[data-theme="gourmand"] h1 { font-size: clamp(38px, 5.2vw, 68px); line-height: 1.04; }
[data-theme="gourmand"] h2 { font-size: clamp(30px, 3.6vw, 46px); }
[data-theme="artisan"] h2 { font-stretch: 85%; }
[data-theme="artisan"] h3, [data-theme="nature"] h3, [data-theme="gourmand"] h3 { font-family: var(--f-body); font-weight: 600; letter-spacing: 0; font-style: normal; }
p { margin: 0 0 1em; }
.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--spark); outline-offset: 3px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: var(--r);
  font: 600 16px/1 var(--f-body); text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: transform .15s, background-color .2s, color .2s; }
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.btn-main { background: var(--accent); color: var(--on-accent); }
.btn-ghost { border-color: currentColor; }
.btn-call { background: var(--ink); color: var(--paper); min-height: 42px; padding: 0 16px; font-size: 15px; }
.link { font-weight: 600; text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: var(--spark); }

/* ---------- En-tête ---------- */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.top.scrolled { border-bottom-color: var(--line); }
.top-in { display: flex; align-items: center; gap: 28px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); flex: none; }
[data-theme="artisan"] .brand-mark, [data-theme="prestige"] .brand-mark { border-radius: var(--r); }
.brand-mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.brand-name { font-family: var(--f-title); font-weight: var(--t-weight); font-size: 24px; letter-spacing: var(--t-track); line-height: 1; }
[data-theme="artisan"] .brand-name { font-size: 20px; font-stretch: 85%; }
.nav { display: flex; gap: 26px; }
.nav a { text-decoration: none; font-weight: 500; font-size: 15.5px; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.on { border-bottom-color: var(--spark); }
.burger { display: none; width: 44px; height: 44px; border: 0; background: none; padding: 10px; cursor: pointer; color: var(--ink); }
.burger span { display: block; height: 2px; background: currentColor; margin: 7px 0; transition: transform .25s; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(4.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-4.5px) rotate(-45deg); }

/* ---------- Accueil ---------- */
.hero { padding: clamp(28px, 5vw, 64px) 0 clamp(56px, 8vw, 110px); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero-kicker { font-weight: 600; color: var(--accent); margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
[data-theme="artisan"] .hero-kicker { color: var(--ink); }
.hero-kicker::before { content: ""; width: 28px; height: 2px; background: var(--spark); }
.lead { font-size: clamp(18px, 1.6vw, 20px); color: var(--muted); max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 38px; }
.proofs { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 14px 30px; font-size: 15px; color: var(--muted); }
.proofs b { display: block; font-family: var(--f-title); font-weight: var(--t-weight); font-size: 30px; color: var(--ink); line-height: 1.1; }
[data-theme="artisan"] .proofs b { font-stretch: 75%; }
.hero-pic { margin: 0; position: relative; }
.hero-pic img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--arch); }
.hero-pic figcaption { position: absolute; left: 16px; bottom: 16px; background: var(--surface); color: var(--ink); font-size: 13.5px; padding: 6px 12px; border-radius: var(--r); }
[data-theme="artisan"] .hero-pic::after { content: ""; position: absolute; inset: auto -14px -14px auto; width: 45%; height: 40%; background: var(--accent); z-index: -1; }

/* ---------- Sections ---------- */
.sec { padding: clamp(64px, 9vw, 120px) 0; }
.sec-alt { background: var(--alt); }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 40px; }
.sec-head h2 { margin: 0; max-width: 16em; }
.sec-head p { margin: 0; color: var(--muted); }

/* Prestations */
.split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.split-head { position: sticky; top: 110px; }
.split-head p { color: var(--muted); font-size: 18px; }
.services { list-style: none; margin: 0; padding: 0; display: grid; }
.service { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; padding: 26px 0; border-top: 1px solid var(--line); align-items: center; }
.service:last-child { border-bottom: 1px solid var(--line); }
.service img { width: 180px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: calc(var(--r) * .8); }
[data-theme="gourmand"] .service img { border-radius: 18px; }
.service h3 { margin-bottom: 6px; }
.service p { margin: 0; color: var(--muted); }

/* Galerie */
/* Grille de 4 colonnes remplie sans trou : g-wide = 2 cases, g-tall = 2 cases, normal = 1. Total conseillé : multiple de 4 */
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 220px; grid-auto-flow: dense; gap: 14px; }
.g-item { position: relative; overflow: hidden; border-radius: calc(var(--r) * .8); background: var(--line); }
[data-theme="gourmand"] .g-item { border-radius: 18px; }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.g-item:hover img { transform: scale(1.04); }
.g-item span { position: absolute; left: 12px; bottom: 12px; right: 12px; color: #fff; font-size: 14px; font-weight: 500; text-shadow: 0 1px 8px rgba(0,0,0,.6); opacity: 0; transform: translateY(6px); transition: .25s; }
.g-item:hover span, .g-item:focus-visible span { opacity: 1; transform: none; }
.g-wide { grid-column: span 2; }
.g-tall { grid-row: span 2; }

/* Méthode */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.steps li { counter-increment: s; padding-top: 22px; border-top: 2px solid var(--ink); }
.steps li::before { content: counter(s); display: block; font-family: var(--f-title); font-weight: var(--t-weight); font-size: 46px; line-height: 1; color: var(--accent); margin-bottom: 16px; }
[data-theme="artisan"] .steps li::before { color: var(--ink); background: var(--accent); width: 54px; height: 54px; display: grid; place-items: center; font-size: 30px; }
.steps p { color: var(--muted); margin: 0; }

/* L'atelier */
.about { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.about-pic { margin: 0; }
.about-pic img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--arch); }
.about-txt > p { font-size: 18px; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 32px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.facts dt { font-size: 14px; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-weight: 600; }

/* Avis */
.reviews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.review { margin: 0; padding: 30px; background: var(--surface); border-radius: calc(var(--r) * .8); display: flex; flex-direction: column; justify-content: space-between; gap: 22px; }
[data-theme="gourmand"] .review { border-radius: 24px; }
[data-theme="prestige"] .review { border: 1px solid var(--line); }
.review blockquote { margin: 0; font-family: var(--f-title); font-weight: var(--t-weight); font-size: 22px; line-height: 1.35; font-style: var(--t-style); }
[data-theme="artisan"] .review blockquote { font-family: var(--f-body); font-weight: 500; font-size: 18px; }
.review figcaption { color: var(--muted); font-size: 15px; }
.review figcaption b { color: var(--ink); }

/* Contact */
.contact { background: var(--deep); color: var(--on-deep); padding-bottom: 0; }
.contact-in { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); padding-bottom: clamp(56px, 8vw, 96px); }
.contact-info p { color: color-mix(in srgb, var(--on-deep) 75%, transparent); font-size: 18px; }
.contact-big { display: block; font-family: var(--f-title); font-weight: var(--t-weight); font-size: clamp(36px, 4.4vw, 56px); text-decoration: none; margin: 18px 0 4px; letter-spacing: var(--t-track); color: var(--spark); }
[data-theme="artisan"] .contact-big { font-stretch: 75%; }
.contact-mail { font-size: 18px; }
address { font-style: normal; margin: 22px 0; line-height: 1.5; }
.hours { border-collapse: collapse; font-size: 15.5px; }
.hours caption { text-align: left; font-weight: 600; margin-bottom: 6px; }
.hours th { text-align: left; font-weight: 400; padding: 5px 28px 5px 0; color: color-mix(in srgb, var(--on-deep) 75%, transparent); }
.hours td { padding: 5px 0; }
.form { background: var(--surface); color: var(--ink); padding: clamp(22px, 3vw, 38px); border-radius: calc(var(--r) * .8); display: grid; gap: 16px; align-content: start; }
[data-theme="gourmand"] .form { border-radius: 26px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
.form input, .form textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: min(var(--r), 12px); padding: 12px 14px; width: 100%; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.form textarea { resize: vertical; min-height: 120px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hp { position: absolute; left: -9999px; }
.form-legal { font-size: 13.5px; color: var(--muted); margin: 0; }
.form .btn { justify-self: start; }
.form-msg { margin: 0; padding: 12px 14px; border-radius: min(var(--r), 12px); background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 500; }
.form-msg.err { background: color-mix(in srgb, #C0392B 14%, transparent); }
.map { display: block; width: 100%; height: 340px; border: 0; filter: grayscale(.35) contrast(1.05); }
[data-theme="prestige"] .map { filter: grayscale(1) invert(.9) contrast(.9); }

/* Pied de page */
.foot { padding: 36px 0 40px; font-size: 15px; }
.foot-in { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; }
.foot p { margin: 4px 0 0; color: var(--muted); }
.foot nav { display: flex; gap: 22px; }
.foot .credit { margin: 0; }

/* Barre d'actions mobile */
.mobile-bar { display: none; }

/* Agrandissement des photos */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(10, 12, 11, .92); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: min(92vw, 1400px); max-height: 82vh; object-fit: contain; border-radius: 6px; }
.lightbox p { color: #fff; margin: 14px 0 0; font-size: 15px; text-align: center; }
.lightbox button { position: fixed; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 52px; height: 52px; border-radius: 50%; font-size: 30px; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.24); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; translate: 0 -50%; }
.lb-next { right: 18px; top: 50%; translate: 0 -50%; }

/* Apparition douce au défilement (désactivée si l'utilisateur préfère moins d'animations) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Sélecteur de style (démo uniquement) */
.demo-switch { position: fixed; left: 16px; bottom: 16px; z-index: 50; display: flex; align-items: center; gap: 4px; padding: 6px; background: #111; color: #fff; border-radius: 999px; font: 500 13px/1 system-ui, sans-serif; box-shadow: 0 8px 30px rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.18); }
.demo-switch span { padding: 0 8px 0 10px; opacity: .7; }
.demo-switch button { font: inherit; color: inherit; background: none; border: 0; padding: 9px 12px; border-radius: 999px; cursor: pointer; }
.demo-switch button[aria-pressed="true"] { background: #fff; color: #111; }

/* ---------- Écrans moyens et petits ---------- */
@media (max-width: 980px) {
  .nav { position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 0; background: var(--paper); padding: 8px 20px 20px; border-bottom: 1px solid var(--line); transform: translateY(-120%); transition: transform .3s ease; z-index: -1; }
  .nav.open { transform: none; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 18px; }
  .burger { display: block; }
  .top-in { gap: 12px; }
  .hero-in, .split, .about, .contact-in { grid-template-columns: minmax(0, 1fr); }
  .hero-pic { order: -1; max-width: 560px; }
  .hero-pic img { aspect-ratio: 5 / 4; }
  [data-theme="nature"] .hero-pic img, [data-theme="gourmand"] .hero-pic img { border-radius: 260px 260px 20px 20px; }
  .split-head { position: static; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 180px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reviews { grid-template-columns: minmax(0, 1fr); }
  .about-pic { max-width: 480px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; padding-bottom: 68px; }
  .btn-call { display: none; }
  .service { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; }
  .service img { width: 96px; }
  .steps, .facts, .row2 { grid-template-columns: minmax(0, 1fr); }
  .gallery { grid-auto-rows: 150px; gap: 10px; }
  .g-item span { opacity: 1; transform: none; font-size: 12.5px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .mobile-bar { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; inset: auto 0 0 0; z-index: 40; background: var(--deep); color: var(--on-deep); padding-bottom: env(safe-area-inset-bottom); }
  .mobile-bar a { display: grid; justify-items: center; gap: 3px; padding: 10px 0 11px; font-size: 13px; font-weight: 600; text-decoration: none; }
  .mobile-bar a:first-child { background: var(--accent); color: var(--on-accent); }
  .mobile-bar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
  .demo-switch { bottom: 80px; left: 50%; translate: -50% 0; }
  .demo-switch span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
@media print { .top, .mobile-bar, .demo-switch, .map, .form { display: none; } }
