/* ═══════════════════════════════════════════════════════════
   common.css — Styles partagés charlieddiet.com
   ═══════════════════════════════════════════════════════════ */

:root {
  --green: #059669; --green-light: #10b981; --green-pale: #ecfdf5;
  --dark: #0a1a12; --text: #1a2e1f; --muted: #5a7a64; --white: #ffffff; --cream: #f7fdf9;
  --font-serif: "Cormorant Garamond", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Outfit', sans-serif; background: var(--white); color: var(--text); }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
p { font-size: 0.95rem; color: #374151; line-height: 1.8; margin-bottom: 12px; }
ul { font-size: 0.95rem; color: #374151; line-height: 1.8; padding-left: 24px; margin-bottom: 16px; }
li { margin-bottom: 6px; }
strong { color: var(--text); }

/* ═══ Accessibilité : focus-visible global pour navigation clavier ═══ */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 4px;
}
.cf-turnstile:focus-within { outline: 2px solid var(--green); outline-offset: 4px; }

/* ═══ Accessibilité : réduire les animations si le système le demande ═══ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══ Navigation ═══ */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 18px 60px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.98); border-bottom: 1px solid rgba(16,185,129,0.1); }
.nav-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav-logo img { height: 42px; width: auto; }
.nav-logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.nav-logo-name { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700; color: var(--dark); letter-spacing: 0.02em; }
.nav-logo-title { font-size: 0.62rem; font-weight: 500; color: var(--green); letter-spacing: 0.12em; text-transform: uppercase; }
.nav-back { padding: 10px 22px; border-radius: 100px; border: 2px solid var(--green); color: var(--green); text-decoration: none; font-size: 0.8rem; font-weight: 500; transition: all 0.25s; }
.nav-back:hover { background: var(--green-pale); }

/* Liste de liens nav (header desktop) */
.nav-links { display: flex; align-items: center; gap: 18px; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; font-size: 0.85rem; font-weight: 500; color: var(--muted); letter-spacing: 0.04em; transition: color 0.2s; }
.nav-links a:hover { color: var(--green); }
/* CTA "Prendre rendez-vous" — pensé pour attirer l'œil sans agresser :
   - gradient diagonal animé (subtle shimmer)
   - pulse lumineux toutes les 3s (effet "respire")
   - flèche → qui glisse au hover */
.nav-cta {
  position: relative;
  padding: 11px 22px 11px 26px;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--green-light), var(--green));
  color: white !important;
  font-weight: 600 !important;
  font-size: 0.82rem !important;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(16,185,129,0.35), 0 0 0 0 rgba(16,185,129,0.5);
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s, padding 0.25s;
  animation: nav-cta-pulse 3s ease-in-out infinite;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(16,185,129,0.5);
  animation-play-state: paused;
}
@keyframes nav-cta-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(16,185,129,0.35), 0 0 0 0 rgba(16,185,129,0.45); }
  50%      { box-shadow: 0 4px 16px rgba(16,185,129,0.45), 0 0 0 8px rgba(16,185,129,0); }
}
/* Respect des préférences réduites de mouvement (a11y) */
@media (prefers-reduced-motion: reduce) {
  .nav-cta { animation: none; }
}

/* Hamburger (mobile) */
.nav-hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; background: none; border: none; cursor: pointer; padding: 4px; border-radius: 8px; }
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--dark); border-radius: 2px; transition: all 0.3s; transform-origin: center; }
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menu mobile (overlay plein écran) */
.nav-mobile-menu { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.98); z-index: 99; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 80px 32px 40px; }
.nav-mobile-menu.open { display: flex; }
.nav-mobile-menu a { font-size: 1.35rem; font-weight: 500; color: var(--dark); text-decoration: none; padding: 14px 32px; border-radius: 16px; width: 100%; text-align: center; transition: background 0.2s, color 0.2s; }
.nav-mobile-menu a:hover { background: var(--green-pale); color: var(--green); }
.nav-mobile-menu .nav-cta-mobile { margin-top: 12px; background: linear-gradient(135deg, var(--green-light), var(--green)); color: white !important; font-weight: 600; }

/* Reveal animation au scroll */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s, transform 0.6s; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Responsive nav */
@media (max-width: 1100px) {
  nav { padding: 18px 28px; }
  .nav-links { gap: 14px; }
}
@media (max-width: 900px) {
  nav { padding: 14px 20px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
}
@media (max-width: 600px) {
  nav { padding: 12px 16px; }
}

/* ═══ Hero / Page header (pages légales — petites pages) ═══ */
.legal-hero { padding: 140px 60px 60px; max-width: 860px; margin: 0 auto; }
.page-tag { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 100px; background: var(--green-pale); color: var(--green); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 20px; }
h1 { font-family: var(--font-serif); font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 300; color: var(--dark); margin-bottom: 12px; }
h1 em { font-style: italic; color: var(--green); font-weight: 600; }
.updated { font-size: 0.82rem; color: var(--muted); margin-bottom: 56px; }

/* ═══ Content ═══ */
.content { max-width: 860px; margin: 0 auto; padding: 0 60px 80px; }
.section { margin-bottom: 48px; }
/* Scope pages légales (mentions, confidentialité, CGU, cookies) — barre verte
   décorative avant chaque h2. Sur les autres pages, h2 est stylé par la page elle-même. */
.content .section > h2 { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 600; color: var(--dark); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--green-pale); display: flex; align-items: center; gap: 10px; }
.content .section > h2::before { content: ''; display: inline-block; width: 4px; height: 22px; background: linear-gradient(135deg, var(--green-light), var(--green)); border-radius: 2px; flex-shrink: 0; }

/* ═══ Info grid (mentions légales, etc.) ═══ */
.info-grid { display: grid; grid-template-columns: 200px 1fr; gap: 10px 20px; background: var(--cream); border-radius: 16px; padding: 24px; border: 1px solid rgba(16,185,129,0.12); }
.info-label { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; padding: 8px 0; border-bottom: 1px solid rgba(16,185,129,0.08); }
.info-value { font-size: 0.92rem; color: var(--text); font-weight: 500; padding: 8px 0; border-bottom: 1px solid rgba(16,185,129,0.08); }
.info-label:last-of-type, .info-value:last-child { border-bottom: none; }

/* ═══ Data table ═══ */
.table-wrapper { overflow-x: auto; margin-bottom: 16px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th { background: var(--green-pale); color: var(--green); font-weight: 700; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.08em; padding: 12px 16px; text-align: left; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid rgba(16,185,129,0.08); color: var(--text); }
.data-table tr:last-child td { border-bottom: none; }

/* ═══ Footer ═══ */
footer { background: var(--dark); padding: 32px 60px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-copy { font-size: 0.8rem; color: rgba(255,255,255,0.75); }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { font-size: 0.8rem; color: rgba(255,255,255,0.7); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--green-light); }

/* ═══ Skip to content ═══ */
.skip-to-content { position: absolute; left: -9999px; top: 0; padding: 8px 16px; background: var(--green); color: #fff; z-index: 9999; border-radius: 0 0 8px 0; font-size: 0.9rem; text-decoration: none; }
.skip-to-content:focus { left: 0; }

/* ═══ Accessibilité : label visible uniquement pour lecteurs d'écran ═══ */
.visually-hidden {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0,0,0,0) !important;
  white-space: nowrap !important; border: 0 !important;
}

/* ═══ Scroll to top ═══ */
.scroll-top { position: fixed; bottom: 24px; right: 24px; width: 40px; height: 40px; border-radius: 50%; background: var(--green); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; z-index: 999; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.scroll-top.visible { opacity: 1; pointer-events: auto; }
.scroll-top:hover { transform: scale(1.1); }

/* ═══ Sticky CTA (articles éducatifs) ═══ */
.sticky-cta { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120%); background: var(--green, #059669); color: #fff; text-decoration: none; padding: 12px 22px; border-radius: 50px; font-weight: 600; font-size: 0.92rem; box-shadow: 0 8px 24px rgba(16,185,129,0.35); z-index: 998; display: inline-flex; align-items: center; gap: 8px; transition: transform .35s cubic-bezier(.2,.8,.2,1), background .2s; max-width: calc(100% - 32px); }
.sticky-cta.visible { transform: translateX(-50%) translateY(0); }
.sticky-cta:hover { background: #10b981; }
.sticky-cta-close { background: transparent; border: 0; color: rgba(255,255,255,0.7); font-size: 1.1rem; line-height: 1; padding: 0 0 0 6px; cursor: pointer; }
.sticky-cta-close:hover { color: #fff; }
/* Sur petit écran : remonter le scroll-top au-dessus du sticky CTA quand visible
   (sinon les deux boutons sont collés en bas → risque de mistap) */
@media (max-width: 480px) {
  .sticky-cta { font-size: 0.85rem; padding: 10px 16px; bottom: 16px; }
  body:has(.sticky-cta.visible) .scroll-top { bottom: 88px; }
}
@media print { .sticky-cta { display: none !important; } }

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
  nav { padding: 16px 20px; }
  .hero, .content { padding-left: 20px; padding-right: 20px; }
  .info-grid { grid-template-columns: 1fr; }
  footer { padding: 24px 20px; flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  section { padding-left: 16px !important; padding-right: 16px !important; }
  .section-inner, .container { padding-left: 0 !important; padding-right: 0 !important; }
  h1, .hero-title, .s-title { font-size: clamp(1.8rem, 8vw, 2.6rem) !important; line-height: 1.1 !important; word-break: break-word; }
  h2 { font-size: clamp(1.5rem, 7vw, 2.2rem) !important; line-height: 1.15 !important; }
  img { max-width: 100%; height: auto; }
  body { overflow-x: hidden; }
}

/* ═══ Print ═══ */
@media print {
  nav, .scroll-top, .skip-to-content { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
  h1, h2, h3 { color: #000; }
  section { break-inside: avoid; }
}
