@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Source+Sans+3:wght@300;400;600&display=swap');
@import './tokens.css';

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  font-size: 1rem;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--color-primary); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
a:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 2px; border-radius: 2px; }

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--color-primary);
}
h1 { font-size: clamp(1.75rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.35rem); }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ── Layout ── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }

section { padding: 3rem 0; }

/* ── Skip link ── */
.skip-link {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  position: fixed; top: 0; left: 0;
  width: auto; height: auto;
  padding: 0.5rem 1rem;
  background: var(--color-primary); color: #fff;
  font-weight: 700; z-index: 9999;
}

/* ── Header ── */
header {
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-primary);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 10px rgba(12, 110, 122, 0.1);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  max-width: 1140px;
  margin: 0 auto;
}
.logo { display: flex; align-items: center; }
.logo img { height: 44px; width: auto; }

.nav-toggle {
  display: flex; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 0.35rem;
}
.nav-toggle span {
  display: block; width: 26px; height: 2px;
  background: var(--color-primary); border-radius: 2px;
  transition: transform 0.28s, opacity 0.28s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

nav {
  display: none; position: absolute; top: 100%; left: 0; width: 100%;
  background: var(--color-bg); border-bottom: 2px solid var(--color-primary);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
nav.is-open { display: block; }
nav ul { list-style: none; padding: 0.5rem 0; }
nav li a {
  display: block; padding: 0.75rem 1.5rem;
  color: var(--color-text); font-weight: 600; font-size: 0.975rem;
}
nav li a:hover,
nav li a[aria-current="page"] {
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 6%, var(--color-bg));
  text-decoration: none;
}

@media (min-width: 768px) {
  .nav-toggle { display: none; }
  nav {
    display: block; position: static; width: auto;
    border: none; box-shadow: none; background: transparent;
  }
  nav ul { display: flex; gap: 0.125rem; padding: 0; }
  nav li a { padding: 0.45rem 0.875rem; border-radius: 5px; }
}

/* ── Buttons ── */
.btn {
  display: inline-block; padding: 0.75rem 1.5rem;
  border-radius: 6px; font-weight: 600; font-size: 0.975rem;
  cursor: pointer; border: 2px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.1s;
  text-decoration: none; line-height: 1.3;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: none; }

.btn-primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-primary:hover, .btn-primary:focus { background: #0a5d68; border-color: #0a5d68; color: #fff; }

.btn-outline { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline:hover, .btn-outline:focus { background: var(--color-primary); color: #fff; }

.btn-phone {
  background: var(--color-secondary); color: var(--color-text);
  border-color: var(--color-secondary); font-size: 1.05rem;
}
.btn-phone:hover, .btn-phone:focus { background: #d97706; border-color: #d97706; color: #fff; }

.cta-group {
  display: flex; flex-wrap: wrap; gap: 0.875rem;
  justify-content: center; margin-top: 1.5rem;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--color-primary) 7%, var(--color-bg)) 0%,
    var(--color-bg) 65%
  );
  padding: 3rem 0 2.5rem;
}
.hero-content { text-align: center; }
.tagline {
  font-family: var(--font-display); font-style: italic;
  color: var(--color-accent); font-size: 1.1rem; margin-bottom: 0.875rem;
}
.hero h1 { margin-bottom: 1rem; }
.hero p { max-width: 680px; margin: 0 auto 0.5rem; font-size: 1.05rem; }
.hero .visual-placeholder { margin-top: 2rem; }

@media (min-width: 768px) {
  .hero { padding: 4.5rem 0 3.5rem; }
  .hero-content { text-align: left; }
  .cta-group { justify-content: flex-start; }
  .hero p { margin-left: 0; margin-right: auto; }
}

/* ── Section headings ── */
.section-title { text-align: center; margin-bottom: 0.4rem; }
.section-sub {
  text-align: center; color: var(--color-accent);
  font-family: var(--font-display); font-style: italic;
  font-size: 1rem; margin-bottom: 2rem;
}

/* ── Features / Cards ── */
.features {
  background: color-mix(in srgb, var(--color-primary) 4%, var(--color-bg));
}
.features-grid {
  display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-top: 2rem;
}
@media (min-width: 560px) { .features-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .features-grid { grid-template-columns: 1fr 1fr 1fr; } }

.card {
  background: var(--color-bg); border-radius: 10px;
  padding: 1.5rem; border-top: 3px solid var(--color-primary);
  box-shadow: 0 2px 12px rgba(12, 110, 122, 0.08);
}
.card h3 { margin-bottom: 0.6rem; }
.card p { font-size: 0.95rem; margin-bottom: 0; }

/* ── CTA Banner ── */
.cta-banner {
  background: var(--color-primary); color: #fff;
  text-align: center; padding: 3.5rem 1.25rem;
}
.cta-banner h2 { color: #fff; margin-bottom: 0.75rem; }
.cta-banner p { color: rgba(255,255,255,0.88); margin-bottom: 1.5rem; }
.cta-banner .btn-ghost {
  background: rgba(255,255,255,0.12); color: #fff;
  border-color: rgba(255,255,255,0.4);
}
.cta-banner .btn-ghost:hover { background: rgba(255,255,255,0.22); border-color: #fff; }

/* ── Avis ── */
.avis-section {
  background: color-mix(in srgb, var(--color-secondary) 7%, var(--color-bg));
  text-align: center;
}
.avis-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 1.25rem; color: var(--color-primary);
  font-weight: 600; font-size: 0.975rem;
  border: 2px solid var(--color-primary);
  padding: 0.55rem 1.1rem; border-radius: 6px;
}
.avis-link:hover { background: var(--color-primary); color: #fff; text-decoration: none; }

/* ── Services page ── */
.services-intro { max-width: 720px; margin: 0 auto 2.5rem; text-align: center; }
.service-list { max-width: 800px; margin: 0 auto; }
.service-item {
  padding: 2rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 10%, var(--color-bg));
}
.service-item:last-child { border-bottom: none; }
.service-item h3 { margin-bottom: 0.5rem; }
.service-item p { font-size: 0.975rem; }
.service-item ul { list-style: none; margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.25rem; }
.service-item ul li::before { content: "—"; color: var(--color-secondary); margin-right: 0.5rem; font-weight: 700; }
.service-item ul li { font-size: 0.95rem; }
.service-badge {
  display: inline-block; background: color-mix(in srgb, var(--color-secondary) 15%, var(--color-bg));
  color: var(--color-accent); border: 1px solid var(--color-secondary);
  border-radius: 20px; font-size: 0.8rem; font-weight: 600;
  padding: 0.15rem 0.7rem; margin-bottom: 0.75rem;
}

/* ── About ── */
.about-layout {
  display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: start;
}
@media (min-width: 768px) {
  .about-layout { grid-template-columns: 300px 1fr; }
}
.about-text p { font-size: 1.05rem; }

/* ── Contact ── */
.contact-grid {
  display: grid; grid-template-columns: 1fr; gap: 2.5rem;
}
@media (min-width: 768px) { .contact-grid { grid-template-columns: 1fr 1fr; } }

.contact-info { display: flex; flex-direction: column; gap: 0.1rem; }
.info-row { display: flex; flex-direction: column; padding: 0.75rem 0; border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, var(--color-bg)); }
.info-row:last-child { border-bottom: none; }
.info-label { font-weight: 700; color: var(--color-primary); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2rem; }
.info-value { font-size: 1rem; }
.info-value a { color: var(--color-text); font-weight: 600; }
.info-value a:hover { color: var(--color-primary); }

.horaires-table { width: 100%; border-collapse: collapse; margin-top: 0.25rem; font-size: 0.9rem; }
.horaires-table tr { border-bottom: 1px solid color-mix(in srgb, var(--color-text) 6%, var(--color-bg)); }
.horaires-table td { padding: 0.3rem 0.25rem; }
.horaires-table td:last-child { text-align: right; font-weight: 600; }
.fermé { color: #ef4444; font-style: italic; }

.map-wrapper {
  border-radius: 10px; overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--color-primary) 20%, var(--color-bg));
  margin-top: 0.5rem;
}
.map-wrapper iframe { display: block; width: 100%; height: 280px; border: none; }

/* ── Form ── */
.form-section { background: color-mix(in srgb, var(--color-primary) 3%, var(--color-bg)); }
.form-card {
  background: var(--color-bg); border-radius: 12px;
  padding: 2rem 1.5rem; max-width: 640px; margin: 0 auto;
  box-shadow: 0 4px 20px rgba(12,110,122,0.1);
}
.form-group { margin-bottom: 1.25rem; }
label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.9rem; color: var(--color-text); }
input, textarea {
  width: 100%; padding: 0.65rem 0.9rem;
  border: 2px solid color-mix(in srgb, var(--color-text) 18%, var(--color-bg));
  border-radius: 6px; font-family: var(--font-body); font-size: 1rem;
  background: var(--color-bg); color: var(--color-text);
  transition: border-color 0.2s;
}
input:focus, textarea:focus { outline: none; border-color: var(--color-primary); }
textarea { resize: vertical; min-height: 120px; }
.rgpd-note { font-size: 0.8rem; color: color-mix(in srgb, var(--color-text) 55%, var(--color-bg)); margin-top: 1rem; }

/* ── Mentions légales ── */
.mentions-section {
  background: color-mix(in srgb, var(--color-text) 4%, var(--color-bg));
  font-size: 0.88rem;
}
.mentions-section h2 { font-size: 1.25rem; }
.mentions-section h3 { font-size: 1rem; margin: 1rem 0 0.4rem; }
.mentions-section p { margin-bottom: 0.6rem; }

/* ── Footer ── */
footer {
  background: var(--color-text); color: rgba(255,255,255,0.78);
  padding: 2.5rem 0 0; font-size: 0.875rem;
}
.footer-inner {
  max-width: 1140px; margin: 0 auto; padding: 0 1.25rem;
  display: grid; grid-template-columns: 1fr; gap: 2rem;
}
@media (min-width: 560px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .footer-inner { grid-template-columns: 2fr 1fr 1fr; } }

.footer-brand { color: #fff; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; }
footer p { margin-bottom: 0.35rem; }
footer a { color: rgba(255,255,255,0.72); }
footer a:hover { color: var(--color-secondary); text-decoration: none; }
.footer-nav ul { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }
.footer-heading { color: #fff; font-weight: 700; margin-bottom: 0.5rem; }

.footer-bottom {
  max-width: 1140px; margin: 2rem auto 0;
  padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center; font-size: 0.78rem; color: rgba(255,255,255,0.4);
}
.footer-bottom a { color: rgba(255,255,255,0.4); }
.footer-bottom a:hover { color: rgba(255,255,255,0.7); }

/* ── Cookie banner ── */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: color-mix(in srgb, var(--color-text) 96%, transparent);
  color: rgba(255,255,255,0.88); padding: 0.875rem 1.25rem;
  z-index: 500; font-size: 0.875rem;
  display: flex; flex-wrap: wrap; gap: 0.875rem;
  align-items: center; justify-content: space-between;
}
.cookie-banner p { flex: 1; min-width: 200px; margin: 0; }
.cookie-banner button {
  background: var(--color-secondary); color: var(--color-text);
  border: none; padding: 0.45rem 1.1rem; border-radius: 5px;
  font-weight: 700; cursor: pointer; font-size: 0.875rem; white-space: nowrap;
}
.cookie-banner.hidden { display: none; }

/* ── Visual Placeholders ── */
.visual-placeholder {
  display: block; width: 100%; border-radius: 8px;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-primary) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-primary) 10%, var(--color-bg)) 55%,
      color-mix(in srgb, var(--color-secondary) 18%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-aspect="4:3"]  { aspect-ratio: 4 / 3; }
.visual-placeholder[data-aspect="1:1"]  { aspect-ratio: 1 / 1; }
.visual-placeholder[data-aspect="3:4"]  { aspect-ratio: 3 / 4; }
.visual-placeholder[data-aspect="21:9"] { aspect-ratio: 21 / 9; }

.visual-placeholder[data-tone="secondary"] {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-secondary) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-secondary) 10%, var(--color-bg)) 55%,
      color-mix(in srgb, var(--color-primary) 16%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-tone="accent"] {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-accent, var(--color-primary)) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-primary) 12%, var(--color-bg)) 60%,
      color-mix(in srgb, var(--color-secondary) 16%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-tone="muted"] {
  background: color-mix(in srgb, var(--color-text) 8%, var(--color-bg));
}

/* ── Utility ── */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── Motion pass — WEB-5890 (zen · authentique · chaleureux) ── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-reduced-motion: no-preference) {

  /* 1 — Hero : entrée en cascade sereine */
  @keyframes rlax-rise { to { opacity: 1; transform: none; } }
  .hero-content > * {
    opacity: 0; transform: translateY(14px);
    animation: rlax-rise 700ms cubic-bezier(.2,.7,.2,1) both;
  }
  .hero-content > *:nth-child(1) { animation-delay: 90ms; }
  .hero-content > *:nth-child(2) { animation-delay: 220ms; }
  .hero-content > *:nth-child(3) { animation-delay: 360ms; }
  .hero-content > *:nth-child(4) { animation-delay: 500ms; }
  .hero-content > *:nth-child(5) { animation-delay: 660ms; }

  /* 2 — Scroll reveal (data-reveal posé par main.js dès le parse) */
  @keyframes rlax-reveal {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: none; }
  }
  html.js [data-reveal] { opacity: 0; transform: translateY(22px); }
  html.js [data-reveal].is-in {
    animation: rlax-reveal 720ms cubic-bezier(.2,.7,.2,1) both;
  }

  /* Cascade douce dans les grilles */
  .features-grid > [data-reveal]:nth-child(2).is-in { animation-delay: 90ms; }
  .features-grid > [data-reveal]:nth-child(3).is-in { animation-delay: 180ms; }
  .features-grid > [data-reveal]:nth-child(4).is-in { animation-delay: 90ms; }
  .features-grid > [data-reveal]:nth-child(5).is-in { animation-delay: 180ms; }
  .features-grid > [data-reveal]:nth-child(6).is-in { animation-delay: 270ms; }

  /* 3 — Cartes : lift chaleureux au survol */
  .card {
    transition: transform 320ms cubic-bezier(.2,.7,.2,1),
                box-shadow 320ms cubic-bezier(.2,.7,.2,1),
                border-top-color 320ms ease;
  }
  .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(12, 110, 122, 0.14);
    border-top-color: var(--color-secondary);
  }

  /* 4 — Placeholders visuels : respiration lente du dégradé */
  @keyframes rlax-breathe {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
  }
  .visual-placeholder {
    background-size: 220% 220%;
    background-position: 0% 50%;
    animation: rlax-breathe 16s ease-in-out infinite;
  }
  /* Hero placeholder : entrée en cascade + respiration à partir de la fin */
  .hero .visual-placeholder {
    animation:
      rlax-rise 700ms cubic-bezier(.2,.7,.2,1) 660ms both,
      rlax-breathe 16s ease-in-out 1600ms infinite;
  }

  /* 5 — Filet décoratif animé sous les section-titles */
  .section-title { position: relative; padding-bottom: 0.6rem; }
  .section-title::after {
    content: "";
    position: absolute; bottom: 0; left: 50%;
    width: 0; height: 2px;
    background: var(--color-secondary);
    transform: translateX(-50%);
    transition: width 620ms cubic-bezier(.2,.7,.2,1) 140ms;
  }
  .section-title.is-in::after { width: 48px; }
  /* Sans JS ou avant reveal : filet visible en petit pour ne rien casser */
  html:not(.js) .section-title::after { width: 48px; }

  /* 6 — Boutons : halo doux au survol / focus */
  .btn-primary, .btn-phone, .btn-outline, .btn-ghost {
    transition: background 240ms ease, color 240ms ease,
                border-color 240ms ease, transform 180ms ease,
                box-shadow 240ms ease;
  }
  .btn-primary:hover,
  .btn-primary:focus-visible {
    box-shadow: 0 8px 22px color-mix(in srgb, var(--color-primary) 26%, transparent);
  }
  .btn-phone:hover,
  .btn-phone:focus-visible {
    box-shadow: 0 8px 22px color-mix(in srgb, var(--color-secondary) 32%, transparent);
  }
  .btn-outline:hover,
  .btn-outline:focus-visible {
    box-shadow: 0 6px 18px color-mix(in srgb, var(--color-primary) 18%, transparent);
  }

  /* Focus ring adouci */
  a:focus-visible, .btn:focus-visible, button:focus-visible,
  input:focus-visible, textarea:focus-visible {
    transition: outline-offset 160ms ease, box-shadow 200ms ease, border-color 200ms ease;
    outline-offset: 3px;
  }

  /* 7 — Nav (desktop) : soulignement qui glisse */
  @media (min-width: 768px) {
    nav li a {
      position: relative;
      background-image: linear-gradient(currentColor, currentColor);
      background-repeat: no-repeat;
      background-size: 0% 2px;
      background-position: 0 100%;
      transition: background-size 320ms cubic-bezier(.2,.7,.2,1),
                  color 200ms ease, background-color 200ms ease;
    }
    nav li a:hover,
    nav li a:focus-visible {
      background-size: 100% 2px;
      text-decoration: none;
    }
    nav li a[aria-current="page"] { background-size: 100% 2px; }
  }

  /* 8 — Lien avis : lift + halo */
  .avis-link {
    transition: background 260ms ease, color 260ms ease,
                transform 260ms ease, box-shadow 260ms ease;
  }
  .avis-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--color-primary) 22%, transparent);
  }

  /* Input focus : bordure teal + halo léger */
  input:focus, textarea:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
  }
}
