/* ==========================================================================
   base.css — shared foundation for every page of guideinteractif.fr
   --------------------------------------------------------------------------
   1. Design tokens (CSS custom properties). Default palette = Fablia on white.
      A city page overrides the tokens in its own <style> block (see the
      "City palette" comment in les-sables-d-olonne/index.html).
   2. Reset + typography (system font stack: zero web-font requests).
   3. Layout primitives: .container, .section, .grid
   4. Shared components: header, footer, buttons, cards, badges, FAQ, notice
   Page-specific rules live in home.css and guide.css.
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  /* Brand */
  --brand: #0d9488;          /* primary action colour (Fablia teal, darkened for white bg) */
  --brand-strong: #0f766e;   /* hover / active */
  --brand-soft: #e6f4f2;     /* tinted surfaces */
  --accent: #b88700;         /* secondary accent (Fablia gold, darkened for contrast) */
  --ink: #0a1f1a;            /* headings (Fablia dark green) */
  /* Neutrals */
  --text: #22322e;
  --muted: #5c6b67;
  --bg: #ffffff;
  --surface: #f4f8f7;
  --line: #dbe5e2;
  /* Buttons */
  --cta-bg: var(--brand);
  --cta-text: #ffffff;
  /* Shape & type */
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 6px 24px rgba(10, 31, 26, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --container: 1100px;
}

/* 2. Reset & typography ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--brand-strong); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
ul { padding-left: 1.2em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* 3. Layout ---------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section--alt { background: var(--surface); }
.section__intro { max-width: 680px; margin-bottom: 2rem; }
.section__intro p { color: var(--muted); font-size: 1.1rem; }
.eyebrow {
  display: inline-block; color: var(--brand-strong); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; margin-bottom: .6rem;
}
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }   /* 6 cards -> 3 + 3 */
.grid--2-fixed { grid-template-columns: repeat(2, 1fr); }                    /* 4 cards -> 2 + 2 */
@media (max-width: 700px) { .grid--2-fixed { grid-template-columns: 1fr; } }

/* 4. Components ------------------------------------------------------------ */

/* Header */
.header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; }
.brand__text { font-size: 1.05rem; line-height: 1.15; white-space: nowrap; }
.brand__text small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.nav { display: flex; gap: 18px; align-items: center; }
.nav a { color: var(--text); text-decoration: none; font-weight: 500; white-space: nowrap; }
@media (max-width: 1080px) { .nav__links { display: none; } }   /* section anchors only; the buttons matter more */
.nav a:hover { color: var(--brand-strong); }
@media (max-width: 760px) {
  .header__inner { gap: 10px; }
  .header .btn--primary { display: none; }   /* the demo button is repeated in the hero and the contact section */
  .header .btn--secondary { font-size: .8rem; padding: .5em .8em; white-space: nowrap; }   /* visitor entry stays */
  .brand__text { font-size: .95rem; }
  .brand__text small { display: none; }
  .header .lang-menu summary { font-size: 0; padding: 6px 8px; }     /* flag only on phones */
  .header .lang-menu summary .flag { font-size: 1.05rem; }
}

/* Language menu: a native <details> dropdown, no script. One <a> per page version;
   the same links are declared as hreflang alternates in <head>. */
.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px;
  font-size: .85rem; font-weight: 600; color: var(--text); user-select: none;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: ""; border: 4px solid transparent; border-top-color: currentColor; border-bottom: 0; margin-left: 2px; }
.lang-menu[open] summary::after { transform: rotate(180deg); }
.lang-menu ul {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 170px;
  margin: 0; padding: 6px; list-style: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.lang-menu li a {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px;
  color: var(--text); text-decoration: none; font-size: .95rem; white-space: nowrap;
}
.lang-menu li a:hover { background: var(--surface); }
.lang-menu li a[aria-current] { font-weight: 700; color: var(--brand-strong); }
.lang-menu .flag { font-size: 1.05rem; line-height: 1; }

/* Buttons */
.header .btn { padding: .65em 1.15em; }   /* slightly tighter in the crowded header */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .8em 1.4em; border-radius: 999px; font-weight: 700; font-size: 1rem;
  text-decoration: none; border: 2px solid transparent; cursor: pointer; line-height: 1.2;
  transition: background .15s, color .15s, transform .15s;
}
.btn--primary { background: var(--cta-bg); color: var(--cta-text); }
.btn--primary:hover { background: var(--brand-strong); color: #fff; transform: translateY(-1px); }
.btn--secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn--lg { font-size: 1.15rem; padding: 1em 1.8em; }
.btn--block { width: 100%; }

/* Cards */
.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: none;
}
.card h3 { margin-top: .2em; }
.card p:last-child { margin-bottom: 0; }

/* Numbered steps */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 60px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center;
}

/* Badges (trust chips) */
.badges { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.badge {
  display: inline-flex; align-items: center; gap: .4em; padding: .35em .8em;
  border-radius: 999px; background: var(--brand-soft); color: var(--ink); font-size: .9rem; font-weight: 600;
}

/* Notice (AI Act transparency) */
.notice {
  border-left: 4px solid var(--accent); background: var(--surface); padding: 14px 18px;
  border-radius: var(--radius-sm); font-size: .95rem;
}

/* FAQ — native <details>, no JS */
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand-strong); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

/* Footer */
.footer { background: var(--ink); color: #d7e3df; padding: 44px 0 28px; margin-top: 48px; font-size: .95rem; }
.footer a { color: #fff; }
.footer__grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.footer h4 { color: #fff; font-size: 1rem; margin-bottom: .6em; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: .4em; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: 28px; padding-top: 18px; font-size: .85rem; color: #9fb3ad; }

/* Responsive tweaks */
@media (max-width: 600px) {
  .section { padding: 44px 0; }
  .btn--lg { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
