/* =========================================================
   Laboratoire Cocard — feuille de style
   Bilingue FR / AR : toutes les marges utilisent des propriétés
   logiques (inline-start / inline-end) pour basculer en RTL.
   ========================================================= */

/* ---------- Police (auto-hébergée, OFL) ---------- */
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-display: swap;
  font-weight: 160 700;
  src: url("../fonts/readex-pro-arabic-wght-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-display: swap;
  font-weight: 160 700;
  src: url("../fonts/readex-pro-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-display: swap;
  font-weight: 160 700;
  src: url("../fonts/readex-pro-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Jetons ---------- */
:root {
  --navy: #0f4e79;        /* bleu Cocard (logo) */
  --navy-700: #0b3d60;
  --ink: #0b2a42;         /* texte */
  --muted: #4a6578;       /* texte secondaire */
  --red: #e3262d;         /* rouge molécule (logo) */
  --mist: #eef4f8;        /* fond de section */
  --mist-2: #dde9f2;
  --line: #cfdde8;
  --paper: #ffffff;
  --open: #157a4a;
  --soon: #b86a00;

  --font: "Readex Pro", system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: clamp(1.6rem, 1.2vw + 1.2rem, 1.95rem);
  --step-4: clamp(2rem, 2.4vw + 1.25rem, 2.9rem);

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 8px;

  --container: 1180px;
  --gutter: clamp(1.1rem, 3vw, 2rem);
  --section: clamp(4.5rem, 9vw, 8rem);
  --header-h: 76px;

  interpolate-size: allow-keywords;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  font-weight: 350;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
html[lang="ar"] body { line-height: 1.8; }

img, svg, picture, iframe { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a[href^="tel:"], a[href^="mailto:"] { white-space: nowrap; }
a:hover { color: var(--navy-700); }

strong { font-weight: 500; }

:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: var(--mist-2); color: var(--ink); }

/* Pas d'espacement de lettres en arabe : il casse les liaisons */
:lang(ar) { letter-spacing: 0 !important; }

.sprite { display: none; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1.1rem;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { top: 1rem; color: #fff; }

main:focus { outline: none; }

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon .fill, .icon-fill { fill: currentColor; stroke: none; }
.icon-lg { width: 30px; height: 30px; stroke-width: 1.5; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 48px;
  padding: 0.7em 1.3em;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 1rem;
  font-weight: 450;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-lg { min-height: 54px; padding-inline: 1.5em; font-size: 1.0625rem; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); color: #fff; }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.brand { display: block; flex: none; border-radius: 10px; }
.brand img { height: 58px; width: auto; }

.site-nav { margin-inline-start: auto; }
.site-nav ul { display: flex; gap: 0.25rem; }
.site-nav a {
  display: block;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.975rem;
  font-weight: 400;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.site-nav a:hover { background: var(--mist); color: var(--navy); }
.site-nav a[aria-current="true"] { color: var(--navy); background: var(--mist); }

.header-actions { display: flex; align-items: center; gap: 0.6rem; }

.lang-toggle {
  min-height: 44px;
  padding: 0.4rem 0.95rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font: inherit;
  font-size: 0.975rem;
  font-weight: 450;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.lang-toggle:hover { border-color: var(--navy); }

.btn-call { min-height: 44px; padding-inline: 1.05em; }

.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--mist);
  cursor: pointer;
  position: relative;
}
.menu-icon,
.menu-icon::before,
.menu-icon::after {
  position: absolute;
  left: 50%;
  width: 20px; height: 2px;
  margin-left: -10px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.menu-icon { top: 50%; margin-top: -1px; }
.menu-icon::before, .menu-icon::after { content: ""; left: 0; margin-left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Accueil ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) 0; }

.lockup {
  display: grid;
  grid-template-columns: auto minmax(3.5rem, 1fr) auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.75rem);
  color: var(--navy);
  font-weight: 350;
}
.lockup-side { display: block; }
.lockup-fr { text-align: left; }
.lockup-ar { text-align: right; }
.lockup .l1,
.lockup .l2,
.lockup .l3 { display: block; }
.lockup .l1 {
  font-size: clamp(1.35rem, 2.2vw + 0.6rem, 2.4rem);
  font-weight: 400;
  line-height: 1.1;
}
.lockup .l2 {
  font-size: clamp(3.4rem, 10vw + 0.5rem, 8.75rem);
  font-weight: 330;
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin-inline-start: -0.04em;
}
.lockup-ar .l1 { font-size: clamp(1.5rem, 2.5vw + 0.65rem, 2.7rem); line-height: 1.25; }
.lockup-ar .l2 { font-size: clamp(3.6rem, 10.8vw + 0.5rem, 9.4rem); line-height: 1.05; margin-inline-start: 0; }
.lockup .l3 {
  margin-top: 0.75rem;
  font-size: clamp(1rem, 0.9vw + 0.7rem, 1.4rem);
  font-weight: 400;
  color: var(--muted);
  line-height: 1.3;
}
.lockup-ar .l3 { font-size: clamp(1.1rem, 1vw + 0.75rem, 1.55rem); margin-top: 1.1rem; }

/* La liaison : deux noms, une même molécule */
.bond {
  position: relative;
  height: 14px;
  align-self: center;
  margin-top: -0.4rem;
}
.bond-line {
  position: absolute;
  inset-inline: 7px;
  top: 6px;
  height: 2px;
  background: var(--navy);
  transform-origin: left center;
  animation: bond-draw 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.25s both;
}
html[dir="rtl"] .bond-line { transform-origin: right center; }
.bond::before,
.bond::after {
  content: "";
  position: absolute;
  top: 0;
  width: 14px; height: 14px;
  border-radius: 50%;
}
.bond::before { left: 0; background: var(--red); }
.bond::after { right: 0; background: var(--navy); animation: node-in 0.35s ease 1.25s both; }
html[dir="rtl"] .bond::before { animation: node-in 0.35s ease 1.25s both; }
html[dir="rtl"] .bond::after { animation: none; }
/* Au centre, l'étoile à huit branches des zelliges de Fès */
.bond-star {
  position: absolute;
  top: -9px;
  left: 50%;
  width: 32px;
  height: 32px;
  margin-left: -16px;
  overflow: visible;
  animation: node-in 0.4s ease 0.9s both;
}

@keyframes bond-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes node-in { from { transform: scale(0); } to { transform: scale(1); } }

.hero-body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.75rem 3rem;
  margin-top: clamp(2.25rem, 4.5vw, 3.5rem);
}
.hero-intro {
  max-width: 36rem;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink);
}
html[lang="ar"] .hero-intro { line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero-media {
  position: relative;
  margin-top: clamp(2.25rem, 4.5vw, 3.5rem);
}
.hero-media img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  object-position: 60% 72%;
  border-radius: var(--radius-lg);
  background: var(--mist);
}

/* Statut ouvert / fermé */
.status {
  position: absolute;
  left: clamp(1rem, 2.5vw, 1.75rem); /* toujours à gauche : la photo montre l'équipe à droite */
  bottom: clamp(1rem, 2.5vw, 1.75rem);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.85rem;
  align-items: center;
  max-width: 23rem;
  padding: 1rem 1.3rem 1.05rem;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 18px 40px -22px rgba(11, 42, 66, 0.55);
  color: var(--ink);
  text-decoration: none;
}
.status:hover { color: var(--ink); }
.status:hover .status-link { color: var(--navy-700); }
.status-text { display: grid; }
.status-title { font-size: 1.0625rem; font-weight: 500; line-height: 1.35; }
.status-detail { color: var(--muted); font-size: 0.95rem; }
.status-link {
  grid-column: 2;
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.status-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(74, 101, 120, 0.15);
  flex: none;
}
[data-state="open"] .status-dot { background: var(--open); box-shadow: 0 0 0 4px rgba(21, 122, 74, 0.16); }
[data-state="soon"] .status-dot { background: var(--soon); box-shadow: 0 0 0 4px rgba(184, 106, 0, 0.16); }
[data-state="closed"] .status-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(227, 38, 45, 0.14); }
.status .status-dot { align-self: start; margin-top: 0.45rem; }

/* ---------- Sections ---------- */
.section { padding-block: var(--section); }

.section-title {
  font-size: var(--step-4);
  font-weight: 380;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem 3rem;
  align-items: end;
  margin-bottom: clamp(2.25rem, 4.5vw, 3.5rem);
}
.section-head p { max-width: 34rem; color: var(--muted); }

.lead { font-size: var(--step-1); line-height: 1.55; color: var(--ink); }

/* ---------- Le laboratoire ---------- */
.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2.5rem, 7vw, 6.5rem);
  align-items: end;
}
.lab-text .section-title { margin-bottom: 1.5rem; }
.lab-text p + p { margin-top: 1rem; color: var(--muted); max-width: 36rem; }
.lab-text .lead { max-width: 36rem; }

.pledge blockquote p {
  font-size: clamp(1.35rem, 1.3vw + 1rem, 1.9rem);
  font-weight: 320;
  line-height: 1.4;
  color: var(--navy);
  text-indent: -0.45em;
}
html[lang="ar"] .pledge blockquote p { line-height: 1.75; text-indent: 0; }
.pledge blockquote p::before { content: "«\00a0"; }
.pledge blockquote p::after { content: "\00a0»"; }
.pledge figcaption {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.pledge figcaption::before {
  content: "";
  width: 44px;
  height: 2px;
  background: linear-gradient(90deg, var(--red) 0 8px, var(--navy) 8px);
  border-radius: 2px;
}
html[dir="rtl"] .pledge figcaption::before { background: linear-gradient(270deg, var(--red) 0 8px, var(--navy) 8px); }

.values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
}
.values li {
  position: relative;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  color: var(--navy);
}
.values li::before {
  content: "";
  position: absolute;
  top: -5px;
  inset-inline-start: 0;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--navy);
}
.values h3 { margin: 1rem 0 0.4rem; font-size: 1.125rem; font-weight: 500; color: var(--ink); }
.values p { color: var(--muted); font-size: 0.985rem; }

/* ---------- Analyses ---------- */
.tests { background: var(--mist); }

.tests-ui {
  display: grid;
  grid-template-columns: minmax(240px, 310px) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}

.tablist {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.tab {
  position: relative;
  display: grid;
  gap: 0.2rem;
  width: 100%;
  padding: 1rem 1.2rem 1.05rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.tab:hover { background: rgba(255, 255, 255, 0.6); }
.tab[aria-selected="true"] { background: #fff; border-color: var(--line); }
.tab[aria-selected="true"]::before {
  content: "";
  position: absolute;
  inset-inline-start: -1px;
  top: 1rem;
  bottom: 1rem;
  width: 3px;
  border-radius: 3px;
  background: var(--navy);
}
.tab-name { font-size: 1.0625rem; font-weight: 450; color: var(--navy); line-height: 1.3; }
.tab-meta { font-size: 0.875rem; color: var(--muted); line-height: 1.4; }

.pole {
  overflow: hidden;
  background: #fff;
  border-radius: var(--radius-lg);
}
.pole + .pole { margin-top: 1.5rem; }   /* sans JS : les pôles s'empilent */
.js .pole + .pole { margin-top: 0; }
.pole[hidden] { display: none; }
.pole.is-entering { animation: panel-in 0.32s ease both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pole:focus-visible { outline-offset: 4px; border-radius: var(--radius-lg); }

.pole img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  background: var(--mist-2);
}
.pole-body { padding: clamp(1.5rem, 3.2vw, 2.6rem); }
.pole h3 {
  margin-bottom: 1.75rem;
  font-size: var(--step-3);
  font-weight: 380;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.disciplines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.9rem 2.75rem;
}
.disciplines dt {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--ink);
}
.disciplines dt::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--navy);
  flex: none;
}
.disciplines dd { margin-top: 0.35rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem !important; }
.chip {
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--mist);
  color: var(--navy);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ---------- Préparer sa visite ---------- */
.prep-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.steps { display: grid; gap: 2.5rem; }
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-inline-start: 23px;
  top: 48px;
  bottom: -2.5rem;
  width: 2px;
  background: var(--line);
}
.step {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: 1.4rem;
}
.step-num {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  font-size: 1.125rem;
  font-weight: 500;
}
.step h3 { margin: 0.6rem 0 0.45rem; font-size: var(--step-1); font-weight: 450; color: var(--navy); }
.step p { color: var(--muted); max-width: 34rem; }

.bring {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border-radius: var(--radius-lg);
  background: var(--navy);
  color: #fff;
}
.bring h3 { margin-bottom: 1rem; font-size: var(--step-2); font-weight: 380; }
.checklist li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 0.8rem;
  align-items: start;
  padding-block: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.checklist .icon { width: 24px; height: 24px; color: #9fcbea; margin-top: 0.1rem; }
.bring-note { margin-top: 1.25rem; color: #cfe2f0; font-size: 0.95rem; }
.bring a { color: #fff; font-weight: 500; }
.bring :focus-visible { outline-color: #fff; }

/* ---------- Questions fréquentes ---------- */
.faq { background: var(--mist); }
.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: start;
}
.faq-head .section-title { margin-bottom: 1.25rem; }
.faq-head p { color: var(--muted); max-width: 26rem; }
.faq-head a { font-weight: 500; white-space: nowrap; }

.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:first-child { border-top: 1px solid var(--line); }
.faq-list summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding-block: 1.3rem;
  font-size: 1.125rem;
  font-weight: 450;
  color: var(--ink);
  list-style: none;
  cursor: pointer;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "";
  flex: none;
  width: 28px; height: 28px;
  margin-top: -0.05rem;
  border-radius: 50%;
  background:
    linear-gradient(var(--navy), var(--navy)) center / 12px 2px no-repeat,
    linear-gradient(var(--navy), var(--navy)) center / 2px 12px no-repeat,
    #fff;
  transition: transform 0.25s ease;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list summary:hover { color: var(--navy); }
.answer { padding-bottom: 1.4rem; padding-inline-end: 3rem; color: var(--muted); max-width: 40rem; }

/* Ouverture animée là où le navigateur le permet */
.faq-list details::details-content {
  block-size: 0;
  overflow: clip;
  transition: block-size 0.3s ease, content-visibility 0.3s allow-discrete;
}
.faq-list details[open]::details-content { block-size: auto; }

/* ---------- Horaires et accès ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2rem);
  align-items: stretch;
}

.hours-card {
  padding: clamp(1.5rem, 3vw, 2.4rem);
  border-radius: var(--radius-lg);
  background: var(--mist);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.hours-card h3, .access h3 { font-size: var(--step-2); font-weight: 380; color: var(--navy); }

.hours-status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 1.6em;
  margin: 0.4rem 0 1.5rem;
  font-weight: 450;
}

.hours { width: 100%; border-collapse: collapse; }
.hours tr {
  display: grid;
  grid-template-columns: 6.75rem 9.25rem minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding-block: 0.6rem;
  border-top: 1px solid var(--line);
}
.hours th { text-align: start; font-weight: 400; line-height: 1.35; }
.hours .time { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.hours tr.is-closed .time { color: var(--muted); }
.hours tr.is-today {
  margin-inline: -0.85rem;
  padding-inline: 0.85rem;
  border-top-color: transparent;
  border-radius: 14px;
  background: #fff;
}
.hours tr.is-today + tr { border-top-color: transparent; }
.hours tr.is-today .track { background: var(--mist); }
.hours tr.is-today th, .hours tr.is-today .time { font-weight: 500; color: var(--navy); }
.hours tr.is-today th::after {
  content: attr(data-today);
  display: block;
  width: fit-content;
  margin-top: 0.15rem;
  padding: 0 0.45rem;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 450;
  line-height: 1.6;
  vertical-align: 0.12em;
  white-space: nowrap;
}

.track {
  position: relative;
  display: block;
  height: 10px;
  border-radius: 999px;
  background: #fff;
}
.bar {
  position: absolute;
  top: 0; bottom: 0;
  inset-inline-start: calc(var(--from) / 780 * 100%);
  width: calc((var(--to) - var(--from)) / 780 * 100%);
  border-radius: 999px;
  background: #9dbad2;
}
.is-today .bar { background: var(--navy); }
.now {
  position: absolute;
  top: -8px; bottom: -8px;
  inset-inline-start: calc(var(--now) / 780 * 100%);
  width: 2px;
  margin-inline-start: -1px;
  background: var(--red);
  border-radius: 2px;
}
.now::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
}

.hours-axis {
  position: relative;
  height: 1.4rem;
  margin-top: 0.35rem;
  margin-inline-start: calc(6.75rem + 9.25rem + 2rem);
  color: var(--muted);
  font-size: 0.78rem;
}
.hours-axis span {
  position: absolute;
  top: 0;
  inset-inline-start: calc(var(--at) / 780 * 100%);
  transform: translateX(-50%);
  white-space: nowrap;
}
html[dir="rtl"] .hours-axis span { transform: translateX(50%); }
.hours-axis span:last-child { transform: translateX(-100%); }
html[dir="rtl"] .hours-axis span:last-child { transform: translateX(100%); }

.hours-note { margin-top: 1.25rem; font-size: 0.9rem; color: var(--muted); }

.contact-side { display: flex; flex-direction: column; gap: clamp(1.25rem, 2.5vw, 2rem); }
.access {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
address { font-style: normal; }
.address-line { margin: 0.5rem 0 1.25rem; font-size: var(--step-1); line-height: 1.45; }
.contact-list div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.75rem;
  border-top: 1px solid var(--line);
}
.contact-list dt { color: var(--muted); }
.contact-list a { font-weight: 450; text-decoration: none; overflow-wrap: anywhere; }
.contact-list a:hover { text-decoration: underline; }
.with-icon { display: inline-flex; align-items: center; gap: 0.5rem; }
.with-icon .icon { width: 1.05em; height: 1.05em; }

.route-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }

.map {
  flex: 1 1 auto;
  width: 100%;
  min-height: 280px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--mist);
}
.map iframe { width: 100%; height: 100%; border: 0; }

/* ---------- Frise de zellige (Fès) ---------- */
.zellige {
  height: 72px;
  background: url("../img/zellige.svg") center / 64px 64px repeat-x, #e6f0f7;
  border-block: 4px solid var(--navy);
}

/* ---------- Pied de page ---------- */
.site-footer {
  background: var(--ink);
  color: #c4d4e1;
  font-size: 0.95rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
  padding-block: clamp(3.5rem, 6vw, 5rem) 2.5rem;
}
.footer-logo {
  display: inline-block;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #fff;
}
.footer-logo img { height: 76px; width: auto; }
.footer-brand p { margin-top: 1.25rem; max-width: 22rem; }
.footer-title { margin-bottom: 0.9rem; font-size: 1rem; font-weight: 500; color: #fff; }
.footer-links { display: grid; gap: 0.55rem; }
.site-footer a { color: #c4d4e1; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer :focus-visible { outline-color: #fff; }
.footer-bottom {
  padding-block: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #93abbf;
  font-size: 0.875rem;
}

/* ---------- Barre mobile & retour en haut ---------- */
.action-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 40;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  padding: 0.7rem var(--gutter) calc(0.7rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  transform: translateY(110%);
  transition: transform 0.3s ease;
}
.action-bar.is-visible { transform: none; }

.to-top {
  position: fixed;
  inset-inline-end: 1.5rem;
  bottom: 1.5rem;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 24px -12px rgba(11, 42, 66, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--navy-700); }
.to-top .icon { width: 22px; height: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .menu-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    margin: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -28px rgba(11, 42, 66, 0.5);
    display: none;
  }
  .site-header.is-open .site-nav { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav li + li { border-top: 1px solid var(--mist-2); }
  .site-nav a { padding: 0.95rem 0.25rem; border-radius: 0; font-size: 1.125rem; }
  .site-nav a:hover, .site-nav a[aria-current="true"] { background: transparent; }
  .header-actions { margin-inline-start: auto; }

  .values { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 2rem; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .lab-grid,
  .prep-grid,
  .faq-grid,
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .section-head { grid-template-columns: minmax(0, 1fr); }

  .tests-ui { grid-template-columns: minmax(0, 1fr); }
  .tablist {
    position: static;
    flex-direction: row;
    gap: 0.5rem;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    padding-bottom: 0.25rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .tablist::-webkit-scrollbar { display: none; }
  .tab {
    flex: none;
    width: auto;
    padding: 0.7rem 1.05rem;
    border-color: var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    scroll-snap-align: start;
  }
  .tab-meta { display: none; }
  .tab-name { font-size: 1rem; white-space: nowrap; }
  .tab[aria-selected="true"] { background: var(--navy); border-color: var(--navy); }
  .tab[aria-selected="true"] .tab-name { color: #fff; }
  .tab[aria-selected="true"]::before { display: none; }

  .bring { position: static; }
  .map { flex: none; aspect-ratio: 4 / 3; min-height: 0; }
}

@media (max-width: 720px) {
  :root { --header-h: 66px; }
  .brand img { height: 46px; }
  .btn-call { width: 44px; padding: 0; }
  .btn-call-number { display: none; }

  .lockup {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.1rem;
  }
  .lockup-ar { text-align: right; }
  .bond { width: 100%; margin-top: 0; }

  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 12rem; }

  .hero-media img { aspect-ratio: 4 / 3; border-radius: 22px; object-position: 70% 50%; }
  .status {
    position: relative;
    inset: auto;
    left: auto;
    max-width: none;
    margin: -3.25rem 0.85rem 0;
  }

  .disciplines { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .pole img { aspect-ratio: 16 / 9; }

  .hours tr { grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem 1rem; padding-block: 0.75rem; }
  .hours .track-cell { grid-column: 1 / -1; }
  .hours-axis { margin-inline-start: 0; }

  .contact-list div { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .route-actions .btn { flex: 1 1 14rem; }

  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .site-footer { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

  .action-bar { display: grid; }
  .zellige { height: 56px; background-size: 48px 48px; }
  .to-top { display: none; }
}

@media (max-width: 420px) {
  .values { grid-template-columns: minmax(0, 1fr); }
  .lang-toggle { padding-inline: 0.75rem; }
}

/* ---------- Préférences d'accessibilité ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header, .action-bar, .to-top, .map, .hero-media, .route-actions { display: none !important; }
  .pole[hidden] { display: block !important; }
  .section { padding-block: 1.5rem; }
  body { color: #000; }
}
