/* ==========================================================================
   style.css — make-avis.com
   - Mobile-first, system fonts, accessible (AA), brand-aligned (Make)
   - Shared header/footer FR/EN
   - Cookie banner, buttons, cards, grids
   - No external fonts; CSP-compatible
   ========================================================================== */

/* ------------------------------
   CSS Reset (lite) & base tokens
   ------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html:focus-within { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  background: #fff;
  color: #1f2328;
}

:root {
  /* Palette Make-adjacent (accessible) */
  --ink-900: #17181a;
  --ink-800: #24262a;
  --ink-700: #373a40;
  --ink-600: #4a4f57;
  --ink-500: #60656f;
  --ink-300: #9aa1ad;

  --sand-0: #fffdfa;
  --sand-25: #f9f7f3;
  --sand-50: #f7f3ee; /* UI surface */
  --sand-100: #f3eee7;
  --sand-200: #ece6dc;

  --pink-500: #f24fb3; /* Make Pink */
  --pink-600: #e03ea3;
  --pink-700: #c82a8e;

  --focus: #005fcc; /* WCAG-friendly focus */
  --ok: #0f8b3e;
  --warn: #b75900;
  --error: #c62828;

  /* Shadows / borders */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 1px 1px rgba(0,0,0,.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,.08);
  --bd: 1px solid #e6e0d9;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 26px;

  /* Typography & spacing */
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  --lh: 1.55;
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --container: 1200px;
}

html { color-scheme: light; }

/* Typography */
body, input, button, textarea { font-family: var(--font-ui); font-size: 16px; line-height: var(--lh); }
p { margin: 0 0 var(--space-4); color: var(--ink-700); }
.lead { font-size: clamp(1rem, 1.8vw, 1.15rem); color: var(--ink-600); }
small, .small { font-size: .875rem; }
.muted { color: var(--ink-500); }
strong { font-weight: 700; }

/* Links & focus */
a { color: #0b59d9; text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Containers & sections */
.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}
.section { padding: var(--space-12) 0; }
.page-hero { padding: var(--space-12) 0 var(--space-8); }

/* Headings */
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { margin: 0 0 var(--space-3); font-size: clamp(1.6rem, 4.8vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3.2vw, 1.6rem); margin-top: var(--space-8); }
h3 { font-size: clamp(1.1rem, 2.6vw, 1.25rem); margin-top: var(--space-4); }
h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); }

/* Utility */
.grid { display: grid; gap: var(--space-5); }
.cards-3 { grid-template-columns: 1fr; }
.chip { display: inline-block; padding: .35rem .6rem; border-radius: 999px; background: var(--sand-100); border: var(--bd); color: var(--ink-700); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* Skip to content */
.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  left: 1rem; top: 1rem; width: auto; height: auto; background: #000; color: #fff; padding: .5rem .75rem; border-radius: 8px; z-index: 99999;
}

/* ------------------------------
   Header
   ------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,253,250,.9);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: var(--bd);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--space-3);
  min-height: 56px; /* slim */
  padding-block: .25rem;
}
.brand .logo-link img { height: 28px; width: auto; }

.burger {
  justify-self: end;
  width: 40px; height: 40px; border: 0; background: transparent; padding: 8px; border-radius: 10px;
}
.burger:focus-visible { outline-offset: 4px; }
.burger .burger-bar {
  display: block; height: 2px; border-radius: 2px; background: var(--ink-800);
}
.burger .burger-bar + .burger-bar { margin-top: 6px; }

.nav {
  display: none;
  grid-column: 1 / -1;
  padding-bottom: var(--space-3);
}
.nav.open { display: block; }
.nav-list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid; gap: var(--space-2);
}
.nav-link {
  display: inline-block; padding: .5rem .25rem; border-radius: 8px;
}
.nav-link[aria-current="page"] { font-weight: 700; }
.header-actions {
  display: flex; gap: var(--space-3); align-items: center; margin-top: var(--space-3);
}
.lang-switch { font-size: .9rem; color: var(--ink-500); }
.lang-link { opacity: .8; }
.lang-link.active { font-weight: 700; opacity: 1; }

/* Desktop header */
@media (min-width: 960px) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
  }
  .burger { display: none; }
  .nav {
    display: block; grid-column: auto; padding-bottom: 0;
  }
  .nav-list {
    grid-auto-flow: column; gap: var(--space-5);
  }
  .header-actions { margin-top: 0; }
}

/* ------------------------------
   Buttons
   ------------------------------ */
.btn {
  --_bg: #222; --_fg: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  padding: .6rem 1rem;
  border: 0; border-radius: 999px;
  background: var(--_bg); color: var(--_fg);
  box-shadow: var(--shadow-sm);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { opacity: .95; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline-offset: 3px; }
.btn.btn-lg { padding: .8rem 1.2rem; font-weight: 700; }
.btn.ghost { --_bg: #f2efe9; --_fg: #222; border: var(--bd); }
.btn.cta { --_bg: linear-gradient(90deg, var(--pink-600), var(--pink-500)); --_fg: #fff; }

/* CTA rows */
.cta-row { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-4); }

/* Link-like button */
.link-like { background: none; color: #0b59d9; border: 0; padding: 0; cursor: pointer; }

/* ------------------------------
   Cards, tables, lists
   ------------------------------ */
.card {
  display: grid; gap: var(--space-3);
  border: var(--bd); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm);
  overflow: clip;
}
.card .card-body { padding: var(--space-4); }
.card .card-title { margin: 0 0 .25rem; font-weight: 800; }
.card .card-excerpt { margin: 0 0 .5rem; color: var(--ink-600); }
.card .card-meta { font-size: .9rem; color: var(--ink-500); }
.card .card-actions { display: flex; gap: var(--space-3); align-items: center; }

.card-media img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.post .card-media img { aspect-ratio: 16 / 9; }

.table-wrap {
  overflow-x: auto; background: var(--sand-0); border-radius: var(--radius); border: var(--bd);
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .6rem .75rem; border-bottom: var(--bd); text-align: left; }
.table thead th { background: var(--sand-50); }

/* Lists */
.list { padding-left: 1.2rem; }
.list li + li { margin-top: .4rem; }

/* ------------------------------
   Grids
   ------------------------------ */
@media (min-width: 640px) {
  .cards-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .cards-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ------------------------------
   Hero & sections
   ------------------------------ */
.hero .hero-grid {
  display: grid; gap: var(--space-6);
}
/* ⬇️ MODIF : on reste en une colonne même sur desktop (texte au-dessus de l'image) */
@media (min-width: 960px) {
  .hero .hero-grid { grid-template-columns: 1fr; align-items: start; }
}
/* Centrage du contenu du hero (complément du centered-ui) */
.hero .hero-copy { text-align: center; }
.hero .cta-row { justify-content: center; }
.hero .hero-media { text-align: center; }
.hero .hero-media img { display: inline-block; max-width: 100%; height: auto; }

.hero-bullets { margin: var(--space-4) 0 0; color: var(--ink-700); }
.hero-bullets li + li { margin-top: .25rem; }

/* Note */
.note {
  background: var(--sand-50);
  border-left: 4px solid var(--pink-500);
  padding: .75rem 1rem;
  border-radius: 8px;
}

/* ------------------------------
   FAQ
   ------------------------------ */
.faq details {
  border: var(--bd);
  border-radius: 8px;
  padding: .25rem .75rem;
}
.faq details + details { margin-top: var(--space-3); }
.faq summary {
  cursor: pointer; list-style: none; padding: .6rem .25rem; font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq .faq-body { padding: 0 0 .75rem 0; color: var(--ink-700); }

/* ------------------------------
   Compliance block
   ------------------------------ */
.compliance .list { margin-left: 1rem; }
.compliance { background: var(--sand-50); border-top: var(--bd); }

/* ------------------------------
   Footer
   ------------------------------ */
.site-footer {
  background: var(--sand-0);
  border-top: var(--bd);
}
.footer-grid {
  display: grid; gap: var(--space-6);
  grid-template-columns: 1fr;
  padding: var(--space-10) 0;
}
.footer-brand .small { margin-top: var(--space-3); color: var(--ink-500); }
.footer-nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.footer-cta { display: grid; gap: var(--space-3); }
@media (min-width: 960px) {
  .footer-grid { grid-template-columns: 1fr auto auto; align-items: start; }
  .footer-nav ul { gap: .3rem; }
}

/* ------------------------------
   Cookie modal (banner / dialog)
   ------------------------------ */
.cookie-manage-fab {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 999;
  border: var(--bd); background: #fff; color: #222; border-radius: 999px;
  padding: .55rem .8rem; box-shadow: var(--shadow-sm);
}

.cookie-backdrop[hidden],
.cookie-modal[hidden] {
  display: none !important;
}

.cookie-backdrop,
.cookie-modal {
  display: none;
}

.cookie-backdrop:not([hidden]),
.cookie-modal:not([hidden]) {
  display: block;
}

.cookie-backdrop:not([hidden]) {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 9998;
}

.cookie-modal:not([hidden]) {
  display: grid;
  position: fixed;
  z-index: 9999;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(100% - 2rem, 720px);
  background: #fff; border-radius: var(--radius-lg); border: var(--bd);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
}

.cookie-content { display: grid; gap: var(--space-4); }
.cookie-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }

.switch { display: grid; grid-auto-flow: column; gap: .6rem; align-items: center; }

.modal-close {
  position: absolute; top: .5rem; right: .75rem;
  background: transparent; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer;
}

/* ------------------------------
   Print
   ------------------------------ */
@media print {
  .site-header, .site-footer, .cookie-manage-fab, .cookie-backdrop, .cookie-modal, .cta-row, .btn, .chips { display: none !important; }
  a[href]::after { content: " (" attr(href) ")"; font-size: .85em; color: var(--ink-500); }
  body { background: white; }
}

/* (dup safe-guards to satisfy some bundlers) */
.cookie-backdrop,
.cookie-modal {
  display: none;
}
.cookie-backdrop[hidden],
.cookie-modal[hidden] {
  display: none !important;
}
.cookie-backdrop:not([hidden]),
.cookie-modal:not([hidden]) {
  display: block;
}
.cookie-modal:not([hidden]) {
  display: grid;
  position: fixed;
  z-index: 9999;
}

/* ------------------------------
   Centered UI overrides (opt-in via <body class="centered-ui">)
   - Centers headings, paragraphs and common media inside <main>
   - Keeps lists and tables left-aligned for readability, but centers their blocks
   - Light-touch: does not alter header/nav
   ------------------------------ */
body.centered-ui main,
body.centered-ui .section .container { text-align: center; }

body.centered-ui main h1,
body.centered-ui main h2,
body.centered-ui main h3,
body.centered-ui main h4,
body.centered-ui main h5,
body.centered-ui main h6 { text-align: center; margin-left: auto; margin-right: auto; }

body.centered-ui main p,
body.centered-ui main .lead,
body.centered-ui main .note { margin-left: auto; margin-right: auto; }

/* Media */
body.centered-ui main img,
body.centered-ui main video,
body.centered-ui main iframe { display: block; margin-inline: auto; }

body.centered-ui figure { text-align: center; }

/* Cards & grids */
body.centered-ui .cards-3 { justify-items: center; }
body.centered-ui .card .card-body { text-align: center; }

/* CTAs, chips */
body.centered-ui .cta-row { justify-content: center; }
body.centered-ui .chips { justify-content: center; }

/* Tables & lists: center the block, keep text left for legibility */
body.centered-ui .table-wrap,
body.centered-ui table { margin-left: auto; margin-right: auto; }
body.centered-ui ul,
body.centered-ui ol,
body.centered-ui table { text-align: left; }

/* Ensure footers’ small text stays centered with the global layout */
body.centered-ui .site-footer .footer-grid { text-align: center; }
body.centered-ui .site-footer .footer-nav ul { justify-items: center; }

/* ------------------------------
   End
   ------------------------------ */
