/* ─── Base reset + system tokens ─────────────────────
   Inherits CSS vars from <style> in Layout.tsx (theme tokens).
   Each template's own styles.css overrides layout/spacing/typography. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: var(--body-weight);
  line-height: 1.6;
  color: var(--text-on-light);
  background: var(--bg-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
img { object-fit: cover; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  line-height: 1.15;
  margin: 0 0 0.6em;
  color: var(--text-on-light);
}
h1 { font-size: clamp(2.2rem, 5vw + 1rem, 4.5rem); }
h2 { font-size: clamp(1.7rem, 2.5vw + 0.7rem, 2.6rem); }
h3 { font-size: clamp(1.15rem, 1vw + 0.7rem, 1.4rem); }
p { margin: 0 0 1em; max-width: 65ch; }

a { color: var(--color-primary-dark); text-decoration: none; }
a:hover { color: var(--color-primary); text-decoration: underline; }

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; transform: translateY(-1px); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--color-primary-dark); border: 1.5px solid currentColor; }
.btn-secondary:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); text-decoration: none; }
.link-action { color: var(--color-primary); font-weight: 600; }

/* Sections layout (defaults — templates override) */
main { display: block; }
.section {
  padding: clamp(3rem, 8vw, 6rem) clamp(1.25rem, 5vw, 4rem);
  max-width: 1280px;
  margin: 0 auto;
}
.section-head { margin-bottom: 2.5rem; }
.section-head h2 { margin-bottom: 0.4em; }
.section-intro { font-size: 1.05rem; color: var(--text-on-light); opacity: 0.85; max-width: 50ch; }

/* Hero shared */
.hero { padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 5vw, 4rem); max-width: 1280px; margin: 0 auto; }
.hero-baseline { font-size: clamp(1.05rem, 1.3vw + 0.7rem, 1.35rem); margin: 1.2rem 0 2rem; opacity: 0.9; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-placeholder { width: 100%; aspect-ratio: 4/5; background: linear-gradient(135deg, var(--color-muted), var(--bg-dark)); border-radius: 8px; }
.hero img { width: 100%; height: auto; max-height: 78vh; border-radius: 8px; }

/* Hero variants */
.hero-image-left, .hero-image-right { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 4vw, 4rem); align-items: center; }
.hero-image-right .hero-content { order: 1; }
.hero-image-right .hero-media { order: 2; }
@media (max-width: 720px) { .hero-image-left, .hero-image-right { grid-template-columns: 1fr; } }

.hero-fullscreen { position: relative; min-height: 78vh; display: flex; align-items: center; justify-content: center; padding: 0; max-width: none; background-size: cover; background-position: center; color: #fff; text-align: center; }
.hero-fullscreen::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.55)); }
.hero-fullscreen .hero-overlay { position: relative; max-width: 720px; padding: 2rem; z-index: 1; }
.hero-fullscreen h1, .hero-fullscreen .hero-baseline { color: #fff; }

.hero-split-diagonal { display: grid; grid-template-columns: 1.2fr 1fr; gap: 0; min-height: 70vh; align-items: stretch; padding: 0; max-width: none; }
.hero-split-diagonal .hero-content { padding: clamp(2rem, 5vw, 5rem) clamp(2rem, 5vw, 5rem); display: flex; flex-direction: column; justify-content: center; background: var(--bg-light); }
.hero-split-diagonal .hero-media { background: var(--bg-dark); position: relative; clip-path: polygon(8% 0, 100% 0, 100% 100%, 0 100%); }
.hero-split-diagonal img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; max-height: none; }
@media (max-width: 720px) { .hero-split-diagonal { grid-template-columns: 1fr; } .hero-split-diagonal .hero-media { clip-path: none; min-height: 50vh; } }

.hero-polaroid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.hero-stack { position: relative; min-height: 460px; }
.hero-stack .polaroid { position: absolute; width: 70%; padding: 12px 12px 32px; background: #fff; box-shadow: 0 12px 32px rgba(0,0,0,0.18); border-radius: 4px; }
.hero-stack .polaroid img { aspect-ratio: 1/1; object-fit: cover; }
.hero-stack .polaroid-0 { top: 0; left: 0; transform: rotate(-6deg); z-index: 3; }
.hero-stack .polaroid-1 { top: 10%; right: 0; transform: rotate(4deg); z-index: 2; }
.hero-stack .polaroid-2 { bottom: 0; left: 18%; transform: rotate(-2deg); z-index: 1; }
@media (max-width: 720px) { .hero-polaroid { grid-template-columns: 1fr; } .hero-stack { min-height: 360px; } }

.hero-blob { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.hero-blob-shape { position: relative; aspect-ratio: 1/1; }
.hero-blob-shape img { width: 100%; height: 100%; object-fit: cover; -webkit-mask: radial-gradient(circle at 50% 50%, #000 60%, transparent 75%); mask: radial-gradient(circle at 50% 50%, #000 60%, transparent 75%); border-radius: 50% 60% 55% 50% / 60% 50% 60% 50%; }
@media (max-width: 720px) { .hero-blob { grid-template-columns: 1fr; } }

.hero-minimal { text-align: center; padding-top: 6rem; padding-bottom: 6rem; }
.hero-minimal h1 { font-size: clamp(3rem, 8vw + 1rem, 7rem); margin-bottom: 1rem; }
.hero-minimal .hero-baseline { font-size: clamp(1.1rem, 1.5vw + 0.8rem, 1.5rem); }
.hero-minimal .hero-cta { justify-content: center; }

.hero-magazine { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: auto auto; gap: 1.5rem; }
.mag-title { grid-column: 1; grid-row: 1; }
.mag-title small { display: block; font-size: 0.85rem; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.7; margin-bottom: 1rem; }
.mag-photo { grid-column: 2; grid-row: 1 / span 2; }
.mag-photo img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3/4; }
.mag-baseline { grid-column: 1; grid-row: 2; }
.mag-cta { grid-column: 1; }
@media (max-width: 720px) { .hero-magazine { grid-template-columns: 1fr; } .mag-photo { grid-column: 1; grid-row: auto; } }

/* About */
.section-about { display: grid; grid-template-columns: 1fr 2fr; gap: 3rem; align-items: start; }
.about-portrait img { aspect-ratio: 3/4; border-radius: 6px; }
.about-meta { font-size: 0.95rem; opacity: 0.7; margin-top: 1.2rem; }
@media (max-width: 720px) { .section-about { grid-template-columns: 1fr; } }

/* Services */
.services-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.service-card { padding: 1.6rem; background: var(--bg-light); border: 1px solid var(--color-muted); border-radius: 8px; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.service-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.service-card h3 { margin: 0 0 0.5em; }
.service-desc { font-size: 0.95rem; opacity: 0.85; }
.service-meta { display: flex; gap: 1rem; font-size: 0.95rem; margin-top: 0.8rem; }
.service-duration { opacity: 0.7; }
.service-price { color: var(--color-primary-dark); font-weight: 600; }

/* Showroom */
.showroom-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.showroom-tile { margin: 0; aspect-ratio: 1/1; overflow: hidden; border-radius: 6px; }
.showroom-tile img { width: 100%; height: 100%; transition: transform 0.4s ease; }
.showroom-tile:hover img { transform: scale(1.04); }

/* Reviews */
.reviews-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.review-card { padding: 1.4rem; background: var(--bg-light); border: 1px solid var(--color-muted); border-radius: 8px; }
.review-stars { color: var(--color-primary); font-size: 1.1rem; letter-spacing: 0.05em; margin-bottom: 0.6em; }
.review-body { font-size: 0.98rem; opacity: 0.95; }
.review-meta { display: flex; gap: 0.8rem; align-items: center; font-size: 0.9rem; opacity: 0.7; }
.review-source { padding: 0.15rem 0.5rem; background: var(--color-muted); border-radius: 4px; font-size: 0.8rem; }
.reviews-empty { font-style: italic; opacity: 0.7; }
.leave-review { margin-top: 2.5rem; }
.leave-review summary { cursor: pointer; font-weight: 600; padding: 0.8rem 0; }
.review-form { display: grid; gap: 0.8rem; max-width: 600px; margin-top: 1rem; }
.review-form input, .review-form textarea, .contact-form input, .contact-form textarea { padding: 0.8rem 1rem; border: 1px solid var(--color-muted); border-radius: 6px; font-family: inherit; font-size: 1rem; background: var(--bg-light); color: var(--text-on-light); }
.review-form textarea, .contact-form textarea { resize: vertical; min-height: 100px; }
.review-form input:focus, .review-form textarea:focus, .contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; border-color: var(--color-primary); }
.rating-input { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.rating-input label { cursor: pointer; padding: 0.3rem 0.6rem; }
.captcha label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; }
.captcha input { width: 5rem; }

/* Blog */
.blog-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.blog-card { display: flex; flex-direction: column; gap: 0.5rem; }
.blog-cover { display: block; }
.blog-cover img { aspect-ratio: 16/10; border-radius: 6px; }
.blog-card h3 { margin: 0.4rem 0 0.2em; }
.blog-card h3 a { color: var(--text-on-light); }
.blog-card h3 a:hover { color: var(--color-primary); text-decoration: none; }
.blog-card time { font-size: 0.87rem; opacity: 0.65; }

/* Booking */
.section-booking { display: flex; flex-direction: column; }
.booking-iframe-wrap { aspect-ratio: 16/9; border: 1px solid var(--color-muted); border-radius: 8px; overflow: hidden; }
.booking-iframe-wrap iframe { width: 100%; height: 100%; border: 0; }

/* FAQ */
.faq-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.8rem; }
.faq-list summary { cursor: pointer; padding: 1rem 0; font-weight: 600; border-bottom: 1px solid var(--color-muted); }
.faq-list details[open] summary { color: var(--color-primary-dark); }
.faq-list p { padding: 0.5rem 0 1.2rem; max-width: 70ch; }

/* Contact */
.section-contact { display: grid; grid-template-columns: 1fr 1.3fr; gap: 3rem; }
.contact-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 1.2rem; }
.contact-form { display: grid; gap: 0.8rem; }
@media (max-width: 720px) { .section-contact { grid-template-columns: 1fr; } }

/* Footer */
.footer { background: var(--bg-dark); color: var(--text-on-dark); padding: 3rem clamp(1.25rem, 5vw, 4rem); }
.footer h1, .footer h2, .footer h3 { color: var(--text-on-dark); }
.footer-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.footer a { color: var(--text-on-dark); opacity: 0.85; }
.footer a:hover { color: var(--color-primary); opacity: 1; }
.footer-baseline { opacity: 0.7; margin: 0.3rem 0 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; justify-content: flex-end; }
.footer-copy { max-width: 1280px; margin: 2rem auto 0; opacity: 0.5; font-size: 0.85rem; text-align: center; }
@media (max-width: 720px) { .footer-inner { grid-template-columns: 1fr; } .footer-nav { justify-content: flex-start; } }

/* Cookie/RGPD baseline */
.legal-block { padding: 4rem 1.25rem; max-width: 720px; margin: 0 auto; }

/* ===================================================================
   MOBILE RESPONSIVE PATCH — added 2026-05-04
   Reset universel des grids desktop hérités sur mobile (<720px)
   =================================================================== */
@media (max-width: 720px) {
  /* Hero : tous templates → 1 colonne */
  .tpl-clinique .hero,
  .tpl-atelier .hero,
  .tpl-boho .hero,
  .tpl-brut .hero,
  .tpl-cocon .hero { grid-template-columns: 1fr !important; padding-left: 1.1rem; padding-right: 1.1rem; }
  .tpl-clinique .hero-content, .tpl-clinique .hero-media,
  .tpl-atelier .hero-content, .tpl-atelier .hero-media,
  .tpl-boho .hero-content, .tpl-boho .hero-media,
  .tpl-brut .hero-content, .tpl-brut .hero-media,
  .tpl-cocon .hero-content, .tpl-cocon .hero-media { grid-column: 1 / -1 !important; }

  /* Section about : tous templates → 1 colonne */
  .tpl-atelier .section-about,
  .tpl-boho .section-about,
  .tpl-brut .section-about { grid-template-columns: 1fr !important; gap: 2rem !important; padding-left: 1.1rem !important; padding-right: 1.1rem !important; }
  .tpl-boho .about-portrait { padding-top: 0 !important; }
  .tpl-boho .about-portrait img { transform: none !important; box-shadow: 8px 8px 0 var(--color-accent) !important; }

  /* Services list */
  .tpl-clinique .services-list,
  .tpl-atelier .services-list,
  .tpl-boho .services-list { grid-template-columns: 1fr !important; }
  .tpl-clinique .service-card,
  .tpl-atelier .service-card,
  .tpl-boho .service-card { grid-column: span 1 !important; }

  /* Reviews list */
  .tpl-clinique .reviews-list,
  .tpl-boho .reviews-list { grid-template-columns: 1fr !important; }
  .tpl-clinique .review-card { padding: 1.2rem 0 !important; border-left: 0 !important; border-top: 1px solid var(--color-muted); }

  /* Showroom : forcer 2 colonnes max */
  .tpl-clinique .showroom-grid,
  .tpl-brut .showroom-grid { grid-template-columns: 1fr 1fr !important; gap: 0.5rem !important; }
  .tpl-clinique .showroom-tile,
  .tpl-brut .showroom-tile { grid-column: span 1 !important; aspect-ratio: 1/1 !important; }

  /* Contact : tous templates */
  .tpl-clinique .section-contact,
  .tpl-brut .section-contact { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
  .tpl-clinique .contact-info, .tpl-clinique .contact-form,
  .tpl-brut .contact-info, .tpl-brut .contact-form { grid-column: 1 / -1 !important; }

  /* Section grid 12-col du clinique : reset général */
  .tpl-clinique .section { grid-template-columns: 1fr !important; padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; gap: 1.5rem !important; }
  .tpl-clinique .section > * { grid-column: 1 / -1 !important; }

  /* Section padding compaction tous templates */
  .tpl-atelier .section,
  .tpl-boho .section,
  .tpl-brut .section { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }

  /* Hero h1 typo scale-down */
  .tpl-brut .hero h1 { font-size: clamp(2.4rem, 9vw, 3.5rem) !important; }
  .tpl-clinique .hero h1,
  .tpl-atelier .hero h1,
  .tpl-boho .hero h1 { font-size: clamp(1.8rem, 8vw, 2.4rem) !important; line-height: 1.1 !important; }

  /* Boho specific : about left padding */
  .tpl-boho .section-about { padding-left: 1.1rem !important; padding-right: 1.1rem !important; }

  /* Brut service-card padding reset */
  .tpl-brut .service-card { padding: 1.25rem 0 !important; }
  .tpl-brut .service-card:hover { padding-left: 0 !important; padding-right: 0 !important; }
}

/* Garde-fou overflow horizontal mobile */
@media (max-width: 900px) {
  html, body { overflow-x: clip !important; max-width: 100vw !important; }
  img, video, iframe { max-width: 100% !important; height: auto; }
}
