/* ==========================================================================
   Modèle « Portfolio & Prestations » — Tonton Lee Market
   Gabarit du contrat v1 : couleurs et polices remplacées par le master (bloc :root ajouté après ce fichier).
   Principe : fond clair et neutre, une seule couleur de marque,
   les réalisations du commerçant sont ce qu'on voit en premier.
   ========================================================================== */

/* ── 1. Variables ───────────────────────────────────────────────────────── */
:root {
  /* Couleurs du commerçant (remplacées par le master, voir schema.json) */
  --primaire: #2337C6;          /* boutons, liens, éléments actifs */
  --primaire-fonce: #1A2995;    /* survol */
  --primaire-pale: #EEF0FC;     /* fonds légers (puce choisie) */
  --primaire-rgb: 35 55 198;
  --accent: #E3A81B;            /* petite touche : numéros des étapes */

  /* Neutres (communs à tous les commerçants) */
  --fond: #FFFFFF;
  --fond-2: #F5F5F3;            /* sections alternées */
  --encre: #17171B;             /* texte principal */
  --gris: #5D5D66;              /* texte secondaire (contraste AA) */
  --gris-clair: #8B8B94;
  --trait: #E4E4E1;
  --wa: #128C4A;                /* bouton WhatsApp (vert lisible sur blanc) */
  --wa-fonce: #0E7339;

  /* Polices (remplacées selon le choix du master) */
  --font-titre: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-texte: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --wrap: 1180px;
  --gutter: 20px;
  --header-h: 72px;
  --r-sm: 6px;
  --r-md: 10px;
}

/* ── 2. Base ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--font-texte);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-titre); margin: 0; line-height: 1.15; font-weight: 600; }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primaire); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 40px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--encre); color: #fff; padding: 8px 14px; border-radius: var(--r-sm); z-index: 100; }
.skip:focus { left: 8px; }

/* ── 3. Boutons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border-radius: var(--r-sm); border: 1.5px solid transparent;
  font-weight: 600; font-size: 0.97rem; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.btn-sm { min-height: 42px; padding: 0 18px; font-size: 0.93rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primaire); color: #fff; }
.btn-primary:hover { background: var(--primaire-fonce); }
.btn-ghost { color: var(--encre); border-color: var(--trait); background: var(--fond); }
.btn-ghost:hover { border-color: var(--encre); }
.btn-outline { color: var(--primaire); border-color: var(--primaire); background: transparent; }
.btn-outline:hover { background: var(--primaire); color: #fff; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-fonce); }
.btn-icon { padding: 0; width: 48px; flex: 0 0 48px; }

/* ── 4. En-tête ─────────────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(255 255 255 / 0.94);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.header.scrolled { border-bottom-color: var(--trait); }
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--primaire); color: #fff; font-weight: 700; font-size: 1rem;
}
.brand-logo { height: 36px; width: auto; }
.brand-name { font-family: var(--font-titre); font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; white-space: nowrap; }

.nav { display: flex; align-items: center; gap: 36px; margin-left: auto; }
.nav a {
  text-decoration: none; font-size: 0.97rem; font-weight: 500; color: var(--gris);
  white-space: nowrap; padding: 6px 0; border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav a:hover { color: var(--encre); }
.nav a.active { color: var(--encre); border-bottom-color: var(--primaire); }

.header-actions { display: flex; align-items: center; gap: 12px; margin-left: 20px; }
.menu-btn {
  display: none; width: 44px; height: 44px; border: 1px solid var(--trait);
  background: var(--fond); border-radius: var(--r-sm); cursor: pointer;
  align-items: center; justify-content: center;
}

@media (max-width: 900px) {
  .header-cta { display: none; }
  .menu-btn { display: inline-flex; }
  .header-actions { margin-left: auto; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--fond); border-bottom: 1px solid var(--trait);
    padding: 8px var(--gutter) 16px; margin: 0;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--trait); font-size: 1.05rem; color: var(--encre); }
  .nav a:last-child { border-bottom: 0; }
  .nav a.active { border-bottom-color: var(--trait); color: var(--primaire); }
}

/* ── 5. Haut de page ────────────────────────────────────────────────────── */
.hero { padding: 64px 0 0; }
.hero-who { color: var(--gris); font-size: 1rem; margin-bottom: 18px; }
.hero-title {
  font-size: clamp(2.1rem, 5.4vw, 4.1rem);
  font-weight: 600; letter-spacing: -0.025em; line-height: 1.05;
  max-width: 17ch;
}
.hero-foot {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 24px 48px; margin-top: 32px;
}
.hero-text { color: var(--gris); font-size: 1.08rem; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Bande d'images : le travail, en grand, juste sous la phrase */
.hero-strip {
  display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 12px;
  max-width: calc(var(--wrap) + 160px); margin: 56px auto 0; padding: 0 var(--gutter);
}
.hero-strip.strip-2 { grid-template-columns: 1fr 1fr; }
.hero-strip.strip-1 { grid-template-columns: 1fr; max-width: calc(var(--wrap)); }
.strip-item { position: relative; margin: 0; overflow: hidden; border-radius: var(--r-md); background: var(--fond-2); cursor: pointer; border: 0; padding: 0; text-align: left; }
.strip-item img { width: 100%; height: clamp(260px, 34vw, 460px); object-fit: cover; transition: transform .5s ease; }
.strip-item:hover img { transform: scale(1.025); }
.strip-item figcaption, .strip-cap {
  position: absolute; left: 12px; bottom: 12px;
  background: rgb(255 255 255 / 0.92); color: var(--encre);
  font-size: 0.85rem; font-weight: 500; padding: 6px 10px; border-radius: var(--r-sm);
}
@media (max-width: 760px) {
  .hero { padding-top: 40px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero-strip {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px;
    margin-top: 36px; padding-bottom: 4px; scrollbar-width: none;
  }
  .hero-strip::-webkit-scrollbar { display: none; }
  .strip-item { flex: 0 0 78%; scroll-snap-align: start; }
  .strip-item img { height: 300px; }
}

/* ── 6. Sections ────────────────────────────────────────────────────────── */
.section { padding: 96px 0; }
.section-alt { background: var(--fond-2); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 40px; margin-bottom: 36px; }
.section-title { font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -0.02em; }
.section-intro { color: var(--gris); max-width: 52ch; }
@media (max-width: 760px) { .section { padding: 64px 0; } .section-head { margin-bottom: 28px; } }

/* ── 7. Réalisations ────────────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filter {
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--trait); background: var(--fond); color: var(--gris);
  font-size: 0.93rem; font-weight: 500; cursor: pointer; transition: all .15s;
}
.filter:hover { color: var(--encre); border-color: var(--gris-clair); }
.filter[aria-pressed="true"] { background: var(--encre); border-color: var(--encre); color: #fff; }
.filter .count { opacity: .6; margin-left: 4px; }

.gallery { columns: 3 300px; column-gap: 24px; }
.work { break-inside: avoid; margin: 0 0 32px; }
.work[hidden] { display: none; }
.work-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; border-radius: var(--r-md); }
.work-img { overflow: hidden; border-radius: var(--r-md); background: var(--fond-2); }
.work-img img { width: 100%; transition: transform .5s ease; }
.work-btn:hover .work-img img { transform: scale(1.03); }
.work-cap { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; }
.work-title { font-family: var(--font-titre); font-weight: 600; font-size: 1.05rem; line-height: 1.3; }
.work-cat { color: var(--gris); font-size: 0.9rem; white-space: nowrap; }
.work-btn:hover .work-title { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) { .gallery { columns: 1; } .work { margin-bottom: 28px; } }

/* ── 8. Services ────────────────────────────────────────────────────────── */
.services { border-top: 1px solid var(--trait); }
.service {
  display: grid; grid-template-columns: 1fr 230px; gap: 24px 48px;
  padding: 32px 0; border-bottom: 1px solid var(--trait);
}
.service-name { font-size: 1.35rem; letter-spacing: -0.01em; }
.service-desc { color: var(--gris); margin-top: 6px; max-width: 56ch; }
.service-list { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.service-list li { position: relative; padding-left: 16px; font-size: 0.95rem; }
.service-list li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--primaire); }
.service-side { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 4px; }
.service-price { font-family: var(--font-titre); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; }
.service-price span { display: block; font-family: var(--font-texte); font-size: 0.85rem; font-weight: 400; color: var(--gris); letter-spacing: 0; }
.service-delay { color: var(--gris); font-size: 0.9rem; margin-bottom: 12px; }
@media (max-width: 760px) {
  .service { grid-template-columns: 1fr; padding: 28px 0; }
  .service-list { flex-direction: column; }
  .service-side { flex-direction: row; flex-wrap: wrap; align-items: center; text-align: left; gap: 4px 16px; }
  .service-price span { display: inline; margin-right: 6px; }
  .service-delay { margin: 0; }
  .service-side .btn { margin-left: auto; }
}

/* ── 9. À propos & étapes ───────────────────────────────────────────────── */
.about { display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: center; }
.about-sans-photo { grid-template-columns: 1fr; }
.about-photo { margin: 0; border-radius: var(--r-md); overflow: hidden; background: var(--fond-2); }
.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.about-text { display: flex; flex-direction: column; gap: 18px; max-width: 60ch; }
.about-text .lead { font-size: 1.25rem; line-height: 1.5; font-weight: 500; }
.about-text p:not(.lead) { color: var(--gris); }
.about-tools { font-size: 0.95rem; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; gap: 32px; } .about-photo { max-width: 420px; } }

.steps-title { font-size: 1.35rem; margin: 88px 0 24px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; counter-reset: etape; }
.step { counter-increment: etape; border-top: 2px solid var(--encre); padding-top: 18px; }
.step::before { content: counter(etape); display: block; font-family: var(--font-titre); font-weight: 700; font-size: 0.95rem; color: var(--encre); background: var(--accent); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 14px; }
.step h4 { font-size: 1.08rem; margin-bottom: 6px; }
.step p { color: var(--gris); font-size: 0.95rem; }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; gap: 24px; } .steps-title { margin-top: 64px; } }

/* ── 10. Avis ───────────────────────────────────────────────────────────── */
.reviews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.review { margin: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.review blockquote { margin: 0; font-size: 1.12rem; line-height: 1.55; }
.review figcaption { color: var(--gris); font-size: 0.92rem; }
.review figcaption strong { display: block; color: var(--encre); font-weight: 600; }
@media (max-width: 860px) { .reviews { grid-template-columns: 1fr; gap: 32px; } }

/* ── 11. Devis ──────────────────────────────────────────────────────────── */
.quote { display: grid; grid-template-columns: 1fr 380px; gap: 56px; align-items: start; }
.quote-form { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.field { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.field legend, .field label { font-weight: 600; font-size: 0.97rem; padding: 0; }
.field legend { margin-bottom: 10px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field input[type="text"], .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--trait); border-radius: var(--r-sm); background: var(--fond);
  font-size: 1rem; transition: border-color .15s;
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--gris-clair); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--primaire); box-shadow: 0 0 0 3px rgb(var(--primaire-rgb) / 0.15); }
.field input[aria-invalid="true"] { border-color: #C2261B; }
.field-error { color: #C2261B; font-size: 0.9rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; min-height: 42px; padding: 0 16px;
  border: 1px solid var(--trait); border-radius: 999px; background: var(--fond);
  font-size: 0.93rem; font-weight: 500; color: var(--encre); transition: all .15s;
}
.chip:hover span { border-color: var(--gris-clair); }
.chip input:checked + span { background: var(--primaire-pale); border-color: var(--primaire); color: var(--primaire-fonce); }
.chip input:focus-visible + span { outline: 2px solid var(--primaire); outline-offset: 2px; }

.quote-preview {
  position: sticky; top: calc(var(--header-h) + 24px);
  background: var(--fond-2); border-radius: var(--r-md); padding: 22px;
  display: flex; flex-direction: column; gap: 16px;
}
.preview-label { font-weight: 600; font-size: 0.95rem; }
.bubble {
  background: #DCF8C6; color: #111B21; border-radius: 10px 10px 10px 2px;
  padding: 14px 16px; font-size: 0.9rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
  max-height: 340px; overflow-y: auto;
}
.preview-note { color: var(--gris); font-size: 0.88rem; text-align: center; }
@media (max-width: 940px) {
  .quote { grid-template-columns: 1fr; gap: 32px; }
  .quote-preview { position: static; }
}
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

/* ── 12. Questions ──────────────────────────────────────────────────────── */
.faq-wrap { display: grid; grid-template-columns: 4fr 8fr; gap: 48px; }
.faq { border-top: 1px solid var(--trait); }
.faq details { border-bottom: 1px solid var(--trait); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 40px 20px 0; position: relative;
  font-weight: 600; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--gris); border-bottom: 2px solid var(--gris); transform: rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq details p { color: var(--gris); padding: 0 40px 22px 0; max-width: 62ch; }
@media (max-width: 860px) { .faq-wrap { grid-template-columns: 1fr; gap: 24px; } }

/* ── 13. Pied de page ───────────────────────────────────────────────────── */
.footer { background: var(--encre); color: #C9C9CF; padding: 64px 0 24px; font-size: 0.95rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1.4fr 1.4fr; gap: 40px; }
.footer-name { color: #fff; font-family: var(--font-titre); font-weight: 700; font-size: 1.15rem; margin-bottom: 6px; }
.footer-title { color: #fff; font-weight: 600; margin-bottom: 10px; }
.footer-text { margin-bottom: 6px; }
.footer a { color: #fff; }
.socials { display: flex; gap: 10px; margin-top: 18px; }
.socials a { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgb(255 255 255 / 0.2); border-radius: 50%; color: #fff; }
.socials a:hover { border-color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 48px; padding-top: 20px; border-top: 1px solid rgb(255 255 255 / 0.12); font-size: 0.85rem; color: #9A9AA3; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } .footer { padding-bottom: 96px; } }

/* ── 14. Barre du bas (téléphone) ───────────────────────────────────────── */
.mobile-bar { display: none; }
@media (max-width: 760px) {
  .mobile-bar {
    display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: rgb(255 255 255 / 0.96); border-top: 1px solid var(--trait);
    transform: translateY(110%); transition: transform .25s ease;
  }
  .mobile-bar.show { transform: none; }
  .mobile-bar .btn-primary { flex: 1; }
}

/* ── 15. Détail d'une réalisation ───────────────────────────────────────── */
.viewer {
  position: fixed; inset: 0; z-index: 80; background: rgb(23 23 27 / 0.72);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.viewer[hidden] { display: none; }
.viewer-box {
  position: relative; background: var(--fond); border-radius: var(--r-md); overflow: hidden;
  width: 100%; max-width: 1040px; max-height: calc(100vh - 48px);
  display: grid; grid-template-columns: 3fr 2fr;
}
.viewer-img { width: 100%; height: 100%; max-height: calc(100vh - 48px); object-fit: cover; background: var(--fond-2); }
.viewer-body { padding: 36px 32px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.viewer-cat { color: var(--gris); font-size: 0.92rem; }
.viewer-title { font-size: 1.6rem; letter-spacing: -0.015em; }
.viewer-client { font-weight: 500; }
.viewer-text { color: var(--gris); }
.viewer-list { margin: 4px 0 12px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.viewer-list li { position: relative; padding-left: 16px; font-size: 0.95rem; }
.viewer-list li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--primaire); }
.viewer-body .btn { margin-top: auto; align-self: flex-start; }
.viewer-close {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: rgb(255 255 255 / 0.95); cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.15);
}
@media (max-width: 760px) {
  .viewer { padding: 0; align-items: flex-end; }
  .viewer-box { grid-template-columns: 1fr; max-height: 92vh; border-radius: var(--r-md) var(--r-md) 0 0; overflow-y: auto; }
  .viewer-img { max-height: 46vh; height: auto; aspect-ratio: 4 / 3; }
  .viewer-body { padding: 24px 20px 32px; overflow: visible; }
  .viewer-body .btn { width: 100%; }
}

/* ── 16. Message bref ───────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 20px);
  background: var(--encre); color: #fff; padding: 12px 18px; border-radius: var(--r-sm);
  font-size: 0.93rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 760px) { .toast { bottom: 84px; } }

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