@import url('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.6;
  font-size: 1rem;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--color-primary); }
ul { list-style: none; padding: 0; }

/* ── Skip link ─────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 1000;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ── Typography ─────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--color-primary);
}
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.3rem, 3vw, 2rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
p  { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ── Layout ─────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.section      { padding: 3.5rem 0; }
.section-alt  { background: #EEF2FF; }
.section-dark { background: var(--color-primary); color: #fff; }
.section-dark h2, .section-dark h3, .section-dark p { color: #fff; }

/* ── Header ─────────────────────────────────────────── */
.site-header {
  background: var(--color-bg);
  border-bottom: 3px solid var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(30,58,138,0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}
.logo-link { flex-shrink: 0; }
.logo { width: 180px; height: auto; }

/* ── Mobile nav toggle ──────────────────────────────── */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.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); }

/* ── Navigation (mobile-first: direct <a> children) ── */
.main-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-top: 1px solid #E5E7EB;
  box-shadow: 0 4px 12px rgba(30,58,138,0.1);
  padding: 0.5rem 0;
}
.main-nav.open { display: flex; flex-direction: column; }
.main-nav a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--color-primary);
  border-left-color: var(--color-accent);
  background: #EEF2FF;
}
.main-nav .btn-nav {
  margin: 0.5rem 1.5rem;
  padding: 0.6rem 1rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 6px;
  text-align: center;
  border-left: none;
}
.main-nav .btn-nav:hover { background: #1e40af; border-left-color: transparent; background: #1e40af; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  border: 2px solid transparent;
  line-height: 1.2;
}
.btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-large { padding: 0.9rem 1.75rem; font-size: 1.05rem; }

.btn-primary  { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-secondary { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-secondary:hover { background: #EEF2FF; opacity: 1; }
.btn-accent   { background: var(--color-accent);  color: #fff; border-color: var(--color-accent);  }
.btn-outline-white { background: transparent; color: #fff; border-color: rgba(255,255,255,0.7); }
.btn-outline-white:hover { background: rgba(255,255,255,0.1); opacity: 1; }

/* ── Hero section ────────────────────────────────────── */
.hero-section { padding: 3rem 0; }
.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.hero-text { flex: 1; }
.hero-visual { flex: 1; }
.hero-eyebrow {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}
.hero-lead {
  font-size: 1.1rem;
  color: #374151;
  margin: 1rem 0 1.5rem;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
em { font-style: italic; color: var(--color-accent); }

/* ── Page hero (inner pages) ─────────────────────────── */
.page-hero {
  background: linear-gradient(140deg, var(--color-primary) 0%, #1a4fd8 100%);
  color: #fff;
  padding: 3rem 0;
}
.page-hero h1, .page-hero p { color: #fff; }
.page-hero .hero-eyebrow { color: #93C5FD; }
.page-hero .hero-lead { color: rgba(255,255,255,0.85); }

/* ── Section headers ─────────────────────────────────── */
.section-title { margin-bottom: 0.5rem; }
.section-lead  { color: #374151; max-width: 640px; margin-bottom: 2rem; }
.section-cta   { text-align: center; margin-top: 2.5rem; }

/* ── Cards grid ──────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.card {
  background: var(--color-bg);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 16px rgba(30,58,138,0.09);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: 0 6px 24px rgba(30,58,138,0.16); transform: translateY(-2px); }
.card h3 { color: var(--color-primary); }
.card p  { color: #374151; font-size: 0.95rem; margin-top: 0.5rem; }
.card-icon { color: var(--color-accent); margin-bottom: 1rem; }

/* ── About preview ───────────────────────────────────── */
.about-preview {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: flex-start;
}
.about-preview-visual { width: 100%; max-width: 340px; }
.about-preview-text { flex: 1; }
.about-preview-text p { color: #374151; }

/* ── Check list ──────────────────────────────────────── */
.check-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.check-list li {
  padding-left: 1.75rem;
  position: relative;
  color: #374151;
}
.check-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 700;
}

/* ── CTA band ────────────────────────────────────────── */
.cta-band {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}
.cta-band-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ── Service block (soins page) ──────────────────────── */
.service-block {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: flex-start;
}
.service-block-visual { width: 100%; }
.service-block-text { flex: 1; }
.service-block-text h2 { margin-bottom: 0.75rem; }
.service-block-text p { color: #374151; }
.service-block-text .check-list { margin-top: 1rem; }

/* ── Feature highlight ───────────────────────────────── */
.feature-highlight {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--color-bg);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(30,58,138,0.08);
  border-left: 4px solid var(--color-accent);
}
.feature-icon { color: var(--color-accent); flex-shrink: 0; }
.feature-highlight p { color: #374151; }

/* ── Info grid (a-propos) ────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}
.info-card {
  background: var(--color-bg);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(30,58,138,0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.info-icon { color: var(--color-accent); }
.info-card h3 { color: var(--color-primary); font-size: 1rem; margin: 0; }
.info-card p, .info-card a { color: #374151; font-size: 0.95rem; margin: 0; }
.info-card a { color: var(--color-primary); }

/* ── Values grid ─────────────────────────────────────── */
.values-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}
.value-item {
  padding: 1.5rem;
  background: var(--color-bg);
  border-radius: 10px;
  border-top: 3px solid var(--color-accent);
  box-shadow: 0 2px 8px rgba(30,58,138,0.07);
}
.value-item h3 { color: var(--color-primary); margin-bottom: 0.5rem; }
.value-item p { color: #374151; font-size: 0.95rem; margin: 0; }

/* ── Contact layout ──────────────────────────────────── */
.contact-layout {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
.contact-info h2, .contact-form-wrap h2 { margin-bottom: 1.25rem; }
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.contact-icon { color: var(--color-accent); flex-shrink: 0; margin-top: 2px; }
.contact-item strong { display: block; font-family: var(--font-display); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--color-primary); }
.contact-item span, .contact-link { color: #374151; font-size: 0.95rem; }
.contact-link { color: var(--color-primary); text-decoration: none; display: block; }
.contact-link:hover { text-decoration: underline; }
.cta-phone-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: #EEF2FF;
  border-radius: 8px;
  text-align: center;
}
.cta-phone-box p { margin-bottom: 0.75rem; color: var(--color-primary); font-weight: 600; }

/* ── Contact form ────────────────────────────────────── */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.form-group label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-primary);
}
.form-group input,
.form-group textarea,
.form-group select {
  border: 2px solid #D1D5DB;
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-body);
  font-size: 1rem;
  width: 100%;
  color: var(--color-text);
  background: #FAFAFA;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
  background: var(--color-bg);
}
.form-group textarea { min-height: 130px; resize: vertical; }
.form-notice {
  font-size: 0.82rem;
  color: #6B7280;
  line-height: 1.5;
  margin-top: 0.25rem;
}
.form-notice a { color: var(--color-primary); }

/* ── Map ─────────────────────────────────────────────── */
.map-wrap {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(30,58,138,0.1);
}
.map-wrap iframe { display: block; }
.map-notice { margin-top: 0.5rem; color: #6B7280; }
.map-notice a { color: var(--color-primary); }

/* ── Legal ───────────────────────────────────────────── */
.legal-content { max-width: 780px; margin: 0 auto; }
.legal-content h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.2rem;
  border-bottom: 2px solid #EEF2FF;
  padding-bottom: 0.35rem;
}
.legal-content p, .legal-content ul { color: #374151; margin-bottom: 0.75rem; }
.legal-content ul { list-style: disc; padding-left: 1.5rem; }
.legal-content ul li { margin-bottom: 0.35rem; }
.legal-content a { color: var(--color-primary); }

/* ── Footer ─────────────────────────────────────────── */
.site-footer {
  background: var(--color-primary);
  color: rgba(255,255,255,0.85);
  margin-top: 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2.5rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}
.footer-col { font-size: 0.9rem; line-height: 2; }
.footer-col h3 {
  color: #fff;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}
.footer-col p { color: rgba(255,255,255,0.7); margin: 0; }
.footer-col ul li a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
}
.footer-col ul li a:hover { color: #fff; text-decoration: underline; }
.footer-logo { filter: brightness(0) invert(1); margin-bottom: 0.75rem; }
.footer-bottom {
  background: rgba(0,0,0,0.25);
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  padding: 1rem 1.25rem;
}

/* ── 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));
}

/* ── Tablet (≥ 768px) ────────────────────────────────── */
@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .main-nav {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    position: static;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    gap: 0.25rem;
  }
  .main-nav a {
    padding: 0.5rem 0.85rem;
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 4px 4px 0 0;
    white-space: nowrap;
  }
  .main-nav a:hover,
  .main-nav a[aria-current="page"] {
    background: none;
    border-left-color: transparent;
    border-bottom-color: var(--color-accent);
    color: var(--color-primary);
  }
  .main-nav .btn-nav {
    margin: 0 0 0 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: #fff;
    border-radius: 6px;
    border-bottom: none;
    font-size: 0.88rem;
  }
  .main-nav .btn-nav:hover { background: #1e40af; opacity: 1; }

  .hero-inner { flex-direction: row; align-items: center; gap: 3rem; }
  .hero-visual { flex: 0 0 420px; }

  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .about-preview { flex-direction: row; gap: 3rem; align-items: flex-start; }
  .about-preview-visual { flex: 0 0 280px; }

  .service-block { flex-direction: row; gap: 3rem; }
  .service-block-reverse { flex-direction: row-reverse; }
  .service-block-visual { flex: 0 0 360px; }

  .cta-band { flex-direction: row; align-items: center; justify-content: space-between; }
  .feature-highlight { flex-direction: row; }

  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .values-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-layout { flex-direction: row; gap: 3rem; }
  .contact-info { flex: 0 0 300px; }
  .contact-form-wrap { flex: 1; }
  .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
}

/* ── Desktop (≥ 1024px) ──────────────────────────────── */
@media (min-width: 1024px) {
  .container { padding: 0 2rem; }
  .section   { padding: 5rem 0; }
  .hero-section { padding: 4rem 0; }

  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .info-grid  { grid-template-columns: repeat(4, 1fr); }
  .values-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-inner { grid-template-columns: 2fr 1fr 1fr; gap: 3rem; }
}

/* ================================================================
   ANIMATION PASS — WEB-4255 · Cabinet Pisiou · Template AG Clinique
   ================================================================ */

/* ── Reduced-motion safety net (WCAG 2.3.1) ────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ── Motion effects — all gated on user preference ─────────────── */
@media (prefers-reduced-motion: no-preference) {

  @keyframes heroIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes revealUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* 1 · Hero entrance — time-based, joue dès le chargement */
  .hero-text               { animation: heroIn 0.6s ease both; }
  .hero-visual             { animation: heroIn 0.6s 0.2s ease both; }

  /* 2 · Pages internes — cascade hero */
  .page-hero .hero-eyebrow { animation: heroIn 0.5s ease both; }
  .page-hero h1            { animation: heroIn 0.5s 0.1s ease both; }
  .page-hero .hero-lead    { animation: heroIn 0.5s 0.2s ease both; }

  /* 3 · Visual placeholder — lift au survol (sans toucher à l'aspect-ratio) */
  .visual-placeholder {
    transition: transform 0.3s ease;
  }
  .visual-placeholder:hover {
    transform: translateY(-3px) scale(1.01);
  }

  /* 4 · Focus-visible ring avec offset animé */
  :focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 4px;
    transition: outline-offset 0.15s ease;
  }

  /* 5 · Nav — underline animée (desktop uniquement) */
  @media (min-width: 768px) {
    .main-nav a:not(.btn-nav) {
      transition: border-bottom-color 0.25s ease, color 0.2s ease;
    }
  }

  /* 6 · Scroll-driven reveals — Chromium 115+ / Firefox 114+ / Safari 18+ */
  @supports (animation-timeline: view()) {

    .section-title,
    .section-lead,
    .about-preview-text,
    .feature-highlight {
      animation: revealUp 0.55s ease both;
      animation-timeline: view();
      animation-range: entry 0% entry 30%;
    }

    .cta-band > *:first-child {
      animation: revealUp 0.5s ease both;
      animation-timeline: view();
      animation-range: entry 0% entry 30%;
    }
    .cta-band > *:last-child {
      animation: revealUp 0.5s ease both;
      animation-timeline: view();
      animation-range: entry 8% entry 38%;
    }

    /* Check-list items — stagger par décalage de plage */
    .check-list li {
      animation: revealUp 0.4s ease both;
      animation-timeline: view();
      animation-range: entry 5% entry 40%;
    }
    .check-list li:nth-child(2) { animation-range: entry 10% entry 45%; }
    .check-list li:nth-child(3) { animation-range: entry 15% entry 50%; }
    .check-list li:nth-child(4) { animation-range: entry 20% entry 55%; }
    .check-list li:nth-child(5) { animation-range: entry 25% entry 60%; }
  }
}
