/* ORIENT'A NOU — design institutionnel premium */
:root {
  /* Couleurs Région Réunion */
  --bleu-profond: #003e7e;
  --bleu-clair: #0969da;
  --bleu-pale: #e7f1fb;
  --orange-soleil: #f77f00;
  --jaune-soleil: #fcbf49;
  --turquoise: #06a3a3;
  --rose: #d62976;
  --vert: #2d6a4f;

  /* Neutres */
  --bg: #f7f8fa;
  --bg-white: #ffffff;
  --fg: #1a1f29;
  --fg-soft: #2c333a;
  --muted: #57606a;
  --line: #d0d7de;
  --line-soft: #eaeef2;

  /* Sémantiques */
  --success: #1a7f37;
  --warning: #b15c00;
  --danger: #cf222e;

  /* Typo */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at 8% 0%, rgba(9,105,218,0.08), transparent 28rem),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 42rem);
  color: var(--fg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--bleu-clair); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ============================================ HEADER */
header.site-top {
  background: linear-gradient(135deg, var(--bleu-profond) 0%, #002a5c 100%);
  color: white;
  padding: 14px 20px;
}
header.site-top .top-wrap {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
header.site-top .brand {
  display: flex; align-items: center; gap: 14px; text-decoration: none; color: white;
}
header.site-top .brand .logo {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--orange-soleil), var(--jaune-soleil));
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; color: var(--bleu-profond);
}
header.site-top .brand .text { line-height: 1.1; }
header.site-top .brand .name { font-weight: 800; font-size: 17px; letter-spacing: 0; }
header.site-top .brand .tag { font-size: 11px; opacity: 0.9; margin-top: 2px; }
header.site-top .top-actions { font-size: 12.5px; opacity: 0.92; }
header.site-top .top-actions a { color: white; }

/* ============================================ NAVIGATION */
nav.site-nav {
  background: white;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
nav.site-nav .nav-wrap {
  max-width: 1280px; margin: 0 auto;
  display: flex; gap: 2px; overflow-x: auto;
  padding: 0 8px;
}
nav.site-nav a {
  padding: 14px 14px;
  font-size: 14px;
  color: var(--fg-soft);
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
}
nav.site-nav a:hover { color: var(--bleu-profond); background: var(--bleu-pale); border-bottom-color: var(--bleu-clair); }
nav.site-nav a.active { color: var(--bleu-profond); border-bottom-color: var(--orange-soleil); font-weight: 600; }

/* ============================================ HERO */
.hero {
  background:
    linear-gradient(135deg, rgba(0,62,126,0.98) 0%, rgba(0,51,102,0.96) 54%, rgba(0,105,130,0.92) 100%),
    radial-gradient(circle at 84% 12%, rgba(252,191,73,0.28), transparent 24rem);
  color: white;
  padding: 72px 20px 84px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: auto -5% -38% 38%;
  width: 620px; height: 620px;
  background: radial-gradient(circle, rgba(6,163,163,0.35) 0%, transparent 68%);
  opacity: 0.55; pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(90deg, rgba(0,0,0,0.34), transparent 72%);
  pointer-events: none;
}
.hero .wrap { max-width: 1120px; margin: 0 auto; position: relative; z-index: 1; }
.hero .hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 14px; padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #fff; font-size: 12px; font-weight: 800;
  letter-spacing: 0; text-transform: uppercase;
}
.hero h1 {
  margin: 0 0 12px; font-size: 68px; font-weight: 850; letter-spacing: 0; line-height: 0.98;
}
.hero h1 .accent { color: var(--jaune-soleil); }
.hero .subtitle { font-size: 26px; opacity: 0.98; margin: 0 0 10px; font-weight: 750; }
.hero .creole { font-size: 14px; opacity: 0.82; font-style: italic; margin: 0 0 26px; }
.hero .lead { font-size: 17px; line-height: 1.7; opacity: 0.95; max-width: 760px; margin: 0 0 30px; }
.hero .cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.hero .cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 750;
  text-decoration: none;
  transition: all 0.15s;
}
.hero .cta-primary { background: var(--orange-soleil); color: white; }
.hero .cta-primary:hover { background: #e07000; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(247,127,0,0.35); }
.hero .cta-secondary { background: rgba(255,255,255,0.15); color: white; backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.3); }
.hero .cta-secondary:hover { background: rgba(255,255,255,0.25); }
.hero .cta-install {
  background: white; color: var(--bleu-profond);
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}
.hero .cta-install:hover { background: #fff6e8; color: #002a5c; transform: translateY(-1px); text-decoration: none; }

/* Page header (smaller hero for inner pages) */
.page-header {
  background: linear-gradient(135deg, var(--bleu-profond) 0%, #002a5c 100%);
  color: white;
  padding: 36px 20px 28px;
}
.page-header .wrap { max-width: 1280px; margin: 0 auto; }
.page-header .breadcrumb { font-size: 12.5px; opacity: 0.8; margin-bottom: 8px; }
.page-header .breadcrumb a { color: white; opacity: 0.8; }
.page-header .breadcrumb a:hover { opacity: 1; }
.page-header h1 { margin: 0 0 6px; font-size: 32px; font-weight: 800; letter-spacing: 0; }
.page-header .subtitle { margin: 0; font-size: 15px; opacity: 0.9; }

/* ============================================ MAIN */
main.site-main { max-width: 1240px; margin: 0 auto; padding: 42px 20px 64px; }
section.section { margin-bottom: 52px; }
section.section h2 {
  font-size: 28px; color: var(--bleu-profond); margin: 0 0 10px;
  font-weight: 800; letter-spacing: 0;
}
section.section h2 .ico { margin-right: 8px; }
section.section .sec-intro { font-size: 15.5px; line-height: 1.65; color: var(--fg-soft); max-width: 860px; margin: 0 0 26px; }

/* ============================================ CARDS */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; align-items: stretch; }
.page-accueil .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-guide {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0,45,96,0.07);
  border: 1px solid rgba(0,62,126,0.13);
  display: flex; flex-direction: column;
  min-height: 100%;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.card-guide:hover { transform: translateY(-3px); box-shadow: 0 18px 34px rgba(0,45,96,0.14); border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); }
.card-guide .card-header {
  padding: 22px 24px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark, var(--bleu-clair)));
  color: white;
}
.card-guide .card-header .audience {
  display: inline-block; background: rgba(255,255,255,0.22); padding: 3px 10px;
  border-radius: 12px; font-size: 11px; font-weight: 600; letter-spacing: 0;
  text-transform: uppercase; margin-bottom: 10px;
}
.card-guide .card-header h3 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; }
.card-guide .card-body { padding: 18px 24px 22px; flex: 1; display: flex; flex-direction: column; }
.card-guide .card-body p { font-size: 14px; line-height: 1.55; color: var(--fg-soft); margin: 0 0 16px; flex: 1; }
.card-guide .card-actions { display: flex; flex-direction: column; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 7px;
  font-size: 13.5px; font-weight: 750; text-decoration: none;
  transition: all 0.15s; border: none; cursor: pointer;
}
.btn-primary { background: var(--bleu-profond); color: white; }
.btn-primary:hover { background: #002a5c; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0,62,126,0.22); text-decoration: none; }
.btn-secondary { background: var(--bleu-pale); color: var(--bleu-profond); }
.btn-secondary:hover { background: #d0e3f7; }
.btn-orange { background: var(--orange-soleil); color: white; }
.btn-orange:hover { background: #e07000; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(247,127,0,0.22); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--bleu-profond); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bleu-pale); border-color: var(--bleu-clair); text-decoration: none; }

/* ============================================ FORMS / FILTERS */
.search-bar {
  background: white; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.search-bar input[type="text"] {
  width: 100%; border: none; outline: none;
  font-size: 16px; padding: 6px 0;
}
.filter-row {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-top: 10px;
}
.filter-row select, .filter-row input {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13.5px; background: white;
}
.filter-row .count { margin-left: auto; color: var(--muted); font-size: 13px; }
.pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  padding: 7px 13px; border: 1px solid rgba(0,62,126,0.16); border-radius: 999px;
  background: white; font-size: 12.5px; font-weight: 650; cursor: pointer; user-select: none;
  transition: all 0.12s;
  box-shadow: 0 4px 12px rgba(0,45,96,0.04);
}
.pill:hover { background: var(--bleu-pale); border-color: var(--bleu-clair); text-decoration: none; }
.pill.active { background: var(--bleu-profond); color: white; border-color: var(--bleu-profond); }

/* ============================================ PROFILES (Je suis...) */
.profiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-top: 18px; }
.profile {
  background: white; border: 1px solid rgba(0,62,126,0.14); border-radius: 10px;
  padding: 18px 16px; text-align: left; cursor: pointer;
  text-decoration: none; color: var(--fg);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  min-height: 132px;
}
.profile:hover { border-color: var(--bleu-clair); box-shadow: 0 12px 24px rgba(9,105,218,0.12); transform: translateY(-2px); text-decoration: none; }
.profile .ico {
  width: 42px; height: 42px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--bleu-pale);
  font-size: 24px;
}
.profile .label { font-size: 14px; font-weight: 800; color: var(--bleu-profond); line-height: 1.25; }
.profile span { display: block; margin-top: 5px; color: var(--muted); font-size: 12.5px; line-height: 1.35; }

/* ============================================ AIDES */
.aides-categories { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.aide-card {
  background: white; border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 22px; transition: box-shadow 0.15s;
}
.aide-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.aide-card .head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.aide-card .ico {
  width: 52px; height: 52px; border-radius: 12px;
  background: linear-gradient(135deg, var(--bleu-pale), white);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
}
.aide-card .head h3 { margin: 0; font-size: 17px; color: var(--bleu-profond); }
.aide-card .head .cat { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0; font-weight: 600; }
.aide-card .montant {
  display: inline-block; background: var(--orange-soleil); color: white;
  padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  margin-bottom: 12px;
}
.aide-card dl { margin: 0; font-size: 13.5px; line-height: 1.55; }
.aide-card dt { font-weight: 600; color: var(--fg); margin-top: 10px; }
.aide-card dd { margin: 2px 0 0; color: var(--fg-soft); }
.aide-card .actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================ ACTORS */
.acteur-card {
  background: white; border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; transition: all 0.15s;
}
.acteur-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.acteur-card .head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.acteur-card .ico { font-size: 28px; }
.acteur-card h3 { margin: 0; font-size: 16px; color: var(--bleu-profond); }
.acteur-card .role { font-size: 13.5px; line-height: 1.5; color: var(--fg-soft); margin: 6px 0; }
.acteur-card .meta-line { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.acteur-card .meta-line strong { color: var(--fg); }

/* ============================================ TIMELINE / CALENDRIER */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px;
  width: 2px; background: linear-gradient(to bottom, var(--bleu-profond), var(--turquoise));
}
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item::before {
  content: ""; position: absolute; left: -25px; top: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: white; border: 3px solid var(--bleu-profond);
}
.timeline-item.cat-info::before { border-color: var(--bleu-clair); }
.timeline-item.cat-decouverte::before { border-color: var(--turquoise); }
.timeline-item.cat-voeux::before { border-color: var(--orange-soleil); }
.timeline-item.cat-decision::before { border-color: var(--rose); }
.timeline-item.cat-examen::before { border-color: var(--danger); }
.timeline-item.cat-resultat::before { border-color: var(--success); }
.timeline-item.cat-inscription::before { border-color: var(--vert); }
.timeline-item.cat-rentree::before { border-color: var(--jaune-soleil); }
.timeline-item.cat-candidature::before { border-color: var(--turquoise); }
.timeline-item .date { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0; }
.timeline-item .event { font-size: 14.5px; color: var(--fg); margin-top: 2px; }

/* ============================================ FOOTER */
footer.site-foot {
  background: var(--bleu-profond); color: white;
  padding: 36px 20px 24px;
  margin-top: 48px;
}
footer.site-foot .wrap {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px;
}
@media (max-width: 720px) {
  footer.site-foot .wrap { grid-template-columns: 1fr; }
}
footer.site-foot h4 { margin: 0 0 12px; font-size: 14px; color: var(--jaune-soleil); }
footer.site-foot ul { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
footer.site-foot li { margin-bottom: 6px; }
footer.site-foot a { color: rgba(255,255,255,0.85); }
footer.site-foot a:hover { color: var(--jaune-soleil); }
footer.site-foot .credit { font-size: 12px; opacity: 0.7; margin-top: 8px; line-height: 1.5; }
footer.site-foot .bottom {
  max-width: 1280px; margin: 24px auto 0; padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 12px; opacity: 0.7; text-align: center;
}

/* ============================================ FORMATIONS / MAP (sous-sites guides) */
.formations-layout { display: grid; grid-template-columns: 1fr 360px; gap: 16px; }
@media (max-width: 980px) { .formations-layout { grid-template-columns: 1fr; } #map-aside { order: -1; } }
#map { width: 100%; height: 460px; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
#map-aside { position: sticky; top: 60px; align-self: start; }
.formations-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.f-card {
  background: white; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; cursor: pointer; transition: all 0.15s;
}
.f-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); transform: translateY(-1px); }
.f-card.hidden { display: none; }
.f-card h4 { margin: 0 0 4px; font-size: 14.5px; line-height: 1.3; }
.f-card .badges { display: flex; gap: 5px; margin-bottom: 6px; flex-wrap: wrap; }
.badge {
  font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 10px;
  letter-spacing: 0;
}
.badge.niv-CAP, .badge.niv-Bac-Pro { background: #fff8c5; color: var(--warning); }
.badge.niv-Bac-Techno { background: #f1e7ff; color: #6f42c1; }
.badge.niv-Bac-General, .badge.niv-Bac { background: var(--bleu-pale); color: var(--bleu-profond); }
.badge.niv-Seconde { background: var(--line-soft); color: var(--muted); }
.badge.niv-BTS, .badge.niv-BUT, .badge.niv-Licence, .badge.niv-Bac-2, .badge.niv-Bac-3, .badge.niv-Bac-5 { background: #ffebe9; color: var(--danger); }
.badge.voie { background: var(--line-soft); color: var(--muted); }
.f-card .desc { font-size: 12.5px; color: var(--fg-soft); margin: 6px 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.f-card .meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.f-card .sites-count { color: var(--bleu-clair); font-weight: 600; }
.formation-card-link {
  display: inline-flex; margin-top: 10px;
  color: var(--bleu-clair); font-size: 12.5px; font-weight: 700;
  text-decoration: none;
}
.formation-card-link:hover { text-decoration: underline; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: none; z-index: 200; }
.modal-bg.open { display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: white; border-radius: 14px; max-width: 720px; width: 100%; max-height: 88vh;
  overflow-y: auto; padding: 24px 26px; box-shadow: 0 16px 48px rgba(0,0,0,0.25); position: relative; }
.modal h2 { margin: 0 0 6px; font-size: 22px; color: var(--bleu-profond); line-height: 1.25; }
.modal-close {
  position: absolute; top: 14px; right: 18px;
  background: white; border: 1px solid var(--line);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 24px;
  line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg); font-family: Arial, Helvetica, sans-serif;
}
.modal .desc-full { font-size: 14px; line-height: 1.55; margin: 14px 0; }
.modal .sites-list h4 { margin: 18px 0 8px; font-size: 14px; }
.formation-modal-map-block h4 { margin: 18px 0 8px; font-size: 14px; }
.formation-modal-map {
  height: 280px; width: 100%;
  border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: var(--line-soft);
}
.modal .site-item {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  margin-bottom: 8px; font-size: 13px;
}
.modal .site-item .name { font-weight: 600; }
.modal .meta-line { color: var(--muted); font-size: 12px; margin-top: 3px; }

/* Editorial blocks */
.editorial {
  background: white; border: 1px solid var(--line); border-radius: 12px;
  padding: 24px 26px; font-size: 14.5px; line-height: 1.65; color: var(--fg-soft);
}
.editorial p { margin: 0 0 12px; }
.editorial p:last-child { margin: 0; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.info-box {
  background: white; border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px;
}
.info-box h4 { margin: 0 0 8px; font-size: 15px; color: var(--bleu-profond); }
.info-box p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.55; color: var(--fg-soft); }

/* Stats banner */
.stats-banner {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  margin-top: 24px; padding: 14px;
  background: rgba(255,255,255,0.12); backdrop-filter: blur(10px);
  border-radius: 12px; border: 1px solid rgba(255,255,255,0.2);
  max-width: 820px;
}
.stats-banner .stat {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(255,255,255,0.08);
}
.stats-banner .stat b { font-size: 24px; font-weight: 850; display: block; color: var(--jaune-soleil); line-height: 1; }
.stats-banner .stat span { font-size: 12px; opacity: 0.94; line-height: 1.3; display: block; margin-top: 6px; }

/* ============================================ ACCESSIBILITY */
.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 999;
  padding: 8px 14px; background: var(--bleu-profond); color: white;
  border-radius: 0 0 8px 0; font-size: 14px; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ============================================ LOGO SVG */
header.site-top .logo-svg { width: auto; height: 48px; display: block; filter: brightness(0) invert(1); }
header.site-top .region-mark { font-size: 12.5px; opacity: 0.9; }

/* ============================================ MOBILE NAV (HAMBURGER) */
nav.site-nav .nav-toggle {
  display: none;
  align-items: center; gap: 8px;
  padding: 12px 16px; background: white; border: none;
  font-size: 14px; font-weight: 600; color: var(--bleu-profond);
  cursor: pointer;
}
nav.site-nav .nav-toggle-bar {
  display: inline-block; width: 22px; height: 2px;
  background: var(--bleu-profond); position: relative;
}
nav.site-nav .nav-toggle-bar + .nav-toggle-bar { margin-top: 4px; }
nav.site-nav .nav-toggle-label { margin-left: 4px; }
@media (max-width: 860px) {
  nav.site-nav .nav-toggle { display: flex; flex-direction: row; flex-wrap: wrap; }
  nav.site-nav .nav-toggle-bar { display: block; }
  nav.site-nav .nav-wrap { display: none; flex-direction: column; padding: 8px 0 12px; }
  nav.site-nav.open .nav-wrap { display: flex; }
  nav.site-nav a { padding: 12px 18px; border-bottom: 1px solid var(--line-soft); border-bottom-width: 1px; }
  nav.site-nav a.active { border-left: 3px solid var(--orange-soleil); border-bottom-color: var(--line-soft); padding-left: 15px; }
}

/* ============================================ ALERT BANNERS */
.alert {
  padding: 14px 18px; border-radius: 10px; margin-bottom: 18px;
  font-size: 13.5px; line-height: 1.55;
}
.alert-info {
  background: var(--bleu-pale); color: var(--bleu-profond);
  border-left: 4px solid var(--bleu-clair);
}
.alert-info strong { color: var(--bleu-profond); }
.alert a { font-weight: 600; }

/* ============================================ CARDS WITH COVERS */
.card-guide .card-cover {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, white), var(--accent-dark, var(--bleu-profond))),
    radial-gradient(circle at 70% 15%, rgba(255,255,255,0.26), transparent 12rem);
  padding: 24px 24px 0;
  display: flex; align-items: flex-end; justify-content: center;
  min-height: 226px;
}
.card-guide .card-cover img {
  width: 100%; max-width: 205px; height: 190px;
  object-fit: contain; object-position: bottom center;
  border-radius: 7px 7px 0 0;
  box-shadow: 0 -7px 22px rgba(0,0,0,0.2);
  display: block;
  background: rgba(255,255,255,0.08);
}
.card-guide .card-body { padding: 18px 22px 20px; flex: 1; display: flex; flex-direction: column; }
.card-guide .card-body .audience {
  display: inline-block; align-self: flex-start;
  background: color-mix(in srgb, var(--accent) 14%, white);
  color: var(--accent); font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: 999px; letter-spacing: 0; text-transform: uppercase; margin-bottom: 10px;
}
.resource-kind {
  align-self: flex-start;
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.card-guide .card-body h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.22; color: var(--fg); }
.card-guide .card-body p { font-size: 13.8px; line-height: 1.58; color: var(--fg-soft); margin: 0 0 18px; flex: 1; }
.card-guide .card-actions { display: flex; flex-direction: column; gap: 8px; }

/* GUIDE INTRO (cover side-by-side with mot d'accueil) */
.guide-intro-row { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: flex-start; }
@media (max-width: 720px) {
  .guide-intro-row { grid-template-columns: 1fr; }
  .guide-intro-row .guide-cover { max-width: 200px; margin: 0 auto; }
}
.guide-cover {
  width: 100%; height: auto; border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  display: block;
}
.editorial .signed { font-style: italic; color: var(--muted); margin-top: 14px; font-size: 13px; }

/* ============================================ ELIGIBILITY BOX */
.elig-box {
  background: var(--bleu-pale);
  border-left: 4px solid var(--bleu-clair);
  padding: 14px 18px; border-radius: 8px;
  font-size: 14px; line-height: 1.55;
}
.elig-box p { margin: 0; }

/* Aides categories pills */
.aides-categories button.pill { font-family: var(--font-sans); }

/* ============================================ GLOBAL SEARCH (in header) */
.global-search {
  display: flex; align-items: center; gap: 0;
  background: white; border-radius: 24px;
  padding: 4px 4px 4px 14px;
  flex: 1; max-width: 480px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}
.global-search .gs-icon { color: var(--muted); display: flex; align-items: center; }
.global-search input {
  flex: 1; border: none; outline: none; padding: 8px 10px;
  font-size: 13.5px; background: transparent; color: var(--fg);
}
.global-search .gs-submit {
  background: var(--orange-soleil); color: white; border: none;
  padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.global-search .gs-submit:hover { background: #e07000; }
@media (max-width: 720px) {
  .global-search { display: none; }
}

/* ============================================ HERO SEARCH (on homepage) */
.hero-search {
  display: flex; gap: 10px; flex-wrap: wrap;
  background: white; border-radius: 12px;
  padding: 8px;
  margin: 0 0 18px;
  box-shadow: 0 16px 36px rgba(0,0,0,0.2);
  max-width: 720px;
  border: 1px solid rgba(255,255,255,0.5);
}
.hero-search input {
  flex: 1; min-width: 200px;
  border: none; outline: none; padding: 10px 12px;
  font-size: 15px; color: var(--fg);
}
.hero-search:focus-within { box-shadow: 0 0 0 4px rgba(252,191,73,0.35), 0 16px 36px rgba(0,0,0,0.2); }
.hero-search button { white-space: nowrap; padding: 10px 18px; }

@media (max-width: 980px) {
  .page-accueil .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-banner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .hero { padding: 48px 18px 58px; }
  .hero .wrap,
  main.site-main,
  section.section { width: 100%; max-width: 100%; }
  .hero .subtitle,
  .hero .creole,
  .hero .lead,
  .hero-search,
  .hero .cta-row,
  .stats-banner,
  section.section h2,
  section.section .sec-intro {
    max-width: 354px;
    overflow-wrap: break-word;
  }
  .hero h1 { font-size: 38px; line-height: 1.04; overflow-wrap: anywhere; }
  .hero .subtitle { font-size: 19px; line-height: 1.28; }
  .hero .creole { font-size: 13px; }
  .hero .lead { font-size: 15.5px; }
  .hero-search { display: grid; grid-template-columns: 1fr; width: 100%; max-width: 100%; }
  .hero-search input { min-width: 0; }
  .hero-search button { width: 100%; }
  .hero .cta { width: 100%; justify-content: center; }
  .stats-banner { grid-template-columns: 1fr; }
  .page-accueil .cards-grid { grid-template-columns: 1fr; gap: 18px; }
  main.site-main { padding: 34px 16px 54px; }
  section.section h2 { font-size: 24px; }
}

/* ============================================ SEARCH HERO (réutilisable) */
.search-hero {
  background: linear-gradient(135deg, var(--bleu-pale), white);
  border-radius: 14px; padding: 28px 28px;
  border: 1px solid var(--line);
}
.search-hero h2 { font-size: 22px; color: var(--bleu-profond); }
.search-hero .search-hero-help { font-size: 14px; color: var(--muted); margin: 0 0 16px; }
.search-hero .search-hero-input {
  display: flex; align-items: center; gap: 12px;
  background: white; border: 2px solid var(--bleu-clair); border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(9,105,218,0.08);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-hero .search-hero-input:focus-within {
  border-color: var(--bleu-profond);
  box-shadow: 0 4px 22px rgba(0,62,126,0.18);
}
.search-hero .sh-icon { color: var(--bleu-clair); display: flex; align-items: center; }
.search-hero input {
  flex: 1; border: none; outline: none;
  font-size: 16px; padding: 6px 0; background: transparent;
  color: var(--fg);
}
.search-hero .search-hero-example {
  font-size: 12.5px; color: var(--muted); margin: 12px 0 0;
}
.search-hero .search-hero-example b { color: var(--fg); }
.search-feedback {
  margin-top: 14px; padding: 10px 14px;
  background: white; border-left: 4px solid var(--orange-soleil);
  border-radius: 8px; font-size: 13.5px;
}
.search-feedback .results-count { font-weight: 700; color: var(--bleu-profond); }
.search-feedback .clear-search {
  margin-left: 8px; font-size: 12px; color: var(--bleu-clair);
  text-decoration: underline; cursor: pointer; background: none; border: none; padding: 0;
}

/* ============================================ GUIDE SUBNAV (sticky tabs inside a guide page) */
nav.guide-subnav {
  background: white;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 51px; /* below site-nav */
  z-index: 90;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
nav.guide-subnav { display: flex; max-width: 1280px; margin: 0 auto; padding: 0 12px; gap: 4px; overflow-x: auto; }
nav.guide-subnav a {
  padding: 12px 14px; font-size: 13.5px; font-weight: 500;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  border-bottom: 3px solid transparent; transition: all 0.15s;
}
nav.guide-subnav a:hover { color: var(--bleu-profond); background: var(--bleu-pale); }
nav.guide-subnav a.active { color: var(--bleu-profond); border-bottom-color: var(--orange-soleil); font-weight: 600; }

/* ============================================ TOC OF SECTIONS (on guide main pages) */
.sections-toc {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px; margin-top: 16px;
}
.section-card {
  display: flex; align-items: center; gap: 14px;
  background: white; border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; text-decoration: none; color: var(--fg);
  transition: all 0.18s;
}
.section-card:hover {
  border-color: var(--bleu-clair); box-shadow: 0 6px 22px rgba(9,105,218,0.12);
  transform: translateY(-2px); text-decoration: none;
}
.section-card-icon {
  font-size: 32px; flex-shrink: 0; line-height: 1;
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  background: var(--bleu-pale); border-radius: 10px;
}
.section-card h3 { margin: 0 0 4px; font-size: 16px; color: var(--bleu-profond); }
.section-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.section-card-arrow { color: var(--muted); font-size: 22px; flex-shrink: 0; }
.section-card:hover .section-card-arrow { color: var(--bleu-clair); transform: translateX(3px); }

/* ============================================ SECTION DETAIL PAGE */
.page-guide-section .page-header { padding: 32px 20px 28px; }
.page-guide-section .page-header h1 { font-size: 30px; }
.page-guide-section .page-header .subtitle { font-size: 15px; }

.section-page-intro .lead {
  font-size: 17px; line-height: 1.65; color: var(--fg-soft);
  background: var(--bleu-pale); padding: 18px 24px;
  border-left: 4px solid var(--bleu-clair); border-radius: 8px;
}

.section-page-content { margin-top: 28px; }
.section-page-content .sec-block {
  background: white; border: 1px solid var(--line); border-radius: 12px;
  padding: 22px 26px; margin-bottom: 18px;
}
.section-page-content .sec-block h3 {
  margin: 0 0 14px; font-size: 19px; color: var(--bleu-profond);
  padding-bottom: 10px; border-bottom: 2px solid var(--bleu-pale);
}
.section-page-content .sec-block-body { font-size: 14.5px; line-height: 1.65; color: var(--fg-soft); }
.section-page-content .sec-block-body p { margin: 0 0 12px; }
.section-page-content .sec-block-body p:last-child { margin: 0; }
.section-page-content .sec-block-body ul { margin: 0 0 12px; padding-left: 22px; }
.section-page-content .sec-block-body li { margin-bottom: 6px; }
.section-page-content .sec-block-body b { color: var(--fg); }
.section-page-content .sec-block-body a { font-weight: 500; }

.section-page-cta {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 24px; padding: 18px 0; border-top: 1px solid var(--line);
}

/* "Voir aussi" */
.voir-aussi { margin-top: 32px; padding-top: 28px; border-top: 2px solid var(--line-soft); }
.voir-aussi h3 { font-size: 15px; color: var(--bleu-profond); margin: 0 0 14px;
  text-transform: uppercase; letter-spacing: 0; }
.voir-aussi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.section-card-mini {
  display: flex; align-items: center; gap: 10px;
  background: white; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 14px; text-decoration: none; color: var(--fg);
  font-size: 13.5px; font-weight: 500;
  transition: all 0.15s;
}
.section-card-mini:hover {
  border-color: var(--bleu-clair); background: var(--bleu-pale); text-decoration: none;
}
.section-card-mini .section-card-icon {
  font-size: 18px; width: auto; height: auto; background: none; padding: 0;
}

/* ============================================ CATEGORIZED TOC PAGE (/<guide>/guide/) */
.toc-cat {
  background: white; border-radius: 14px;
  border: 1px solid var(--line); margin-bottom: 22px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.toc-cat-head {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 24px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--cat-color) 12%, white), white 70%);
  border-bottom: 1px solid var(--line);
}
.toc-cat-icon {
  width: 48px; height: 48px;
  background: var(--cat-color); color: white;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
}
.toc-cat-head h2 {
  margin: 0; font-size: 20px; color: var(--cat-color);
  font-weight: 700; letter-spacing: 0;
}
.toc-cat-chapters { display: flex; flex-direction: column; }

.chapter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.12s;
}
.chapter-row:last-child { border-bottom: 0; }
.chapter-row:hover {
  background: color-mix(in srgb, var(--cat-color) 6%, white);
}
.chapter-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 14px 0 14px 24px;
  text-decoration: none;
  color: var(--fg);
}
.chapter-row-main:hover {
  text-decoration: none;
}
.chapter-row .ch-title {
  font-size: 14.5px; font-weight: 500; color: var(--fg);
  line-height: 1.45;
  min-width: 0;
  padding-top: 1px;
}
.chapter-row .ch-meta {
  display: inline-flex; align-items: center; gap: 12px;
  flex-shrink: 0; flex-wrap: nowrap;
}
.chapter-row .ch-page {
  font-size: 12.5px; color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0;
  white-space: nowrap;
  min-width: 56px; text-align: right;
}
.chapter-row .ch-arrow {
  color: var(--cat-color); opacity: 0.5;
  font-size: 16px; transition: transform 0.12s, opacity 0.12s;
  display: inline-flex; align-items: center;
}
.chapter-row:hover .ch-arrow { opacity: 1; transform: translateX(3px); }

.ch-badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700;
  padding: 4px 12px; border-radius: 999px;
  text-decoration: none;
  white-space: nowrap; line-height: 1;
}
.chapter-row > .ch-badge { margin-right: 24px; }
.ch-badge-catalogue { background: var(--orange-soleil); color: white; }
.ch-badge-catalogue:hover { background: #e07000; text-decoration: none; }

@media (max-width: 600px) {
  .chapter-row { grid-template-columns: 1fr; gap: 0; }
  .chapter-row-main { grid-template-columns: 1fr; gap: 8px; padding: 14px 18px 8px; }
  .chapter-row .ch-meta { width: 100%; justify-content: space-between; }
  .chapter-row .ch-arrow { display: none; }
  .chapter-row > .ch-badge { justify-self: start; margin: 0 18px 14px; }
}

/* ============================================ STUB PAGES */
.stub-notice {
  background: linear-gradient(135deg, #fff8e6, white);
  border: 1px solid #fcbf49;
  border-left: 5px solid var(--orange-soleil);
  border-radius: 12px;
  padding: 24px 28px;
}
.stub-notice h2 { color: var(--orange-soleil); }
.stub-notice p { font-size: 14.5px; line-height: 1.65; color: var(--fg-soft); }
.stub-notice ul { font-size: 14px; line-height: 1.7; color: var(--fg-soft); padding-left: 22px; margin: 12px 0; }

/* ============================================ HERO IMAGES (extracted from InDesign) */
.section-hero-img {
  width: 100%;
  height: 280px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin: 0 0 8px;
  border-radius: 0;
  position: relative;
  box-shadow: inset 0 -100px 80px -40px rgba(0,0,0,0.35);
}
@media (max-width: 720px) {
  .section-hero-img { height: 200px; }
}

.page-guide-section main.site-main,
.page-guide-stub main.site-main {
  padding-top: 0;
}
.page-guide-section .section-hero-img,
.page-guide-stub .section-hero-img {
  margin-top: -1px; /* tight to header */
  margin-bottom: 28px;
}

/* ============================================ PRÉSIDENTE BLOCK */
.presidente-block {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: start;
  padding: 28px;
  background: linear-gradient(135deg, var(--bleu-pale), white);
  border: 1px solid var(--line);
  border-radius: 14px;
}
@media (max-width: 720px) {
  .presidente-block { grid-template-columns: 1fr; text-align: center; }
}
.presidente-portrait {
  width: 100%; height: auto; max-width: 200px;
  border-radius: 10px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.18);
  margin: 0 auto;
  display: block;
}
.presidente-text .lead {
  font-size: 17px; font-weight: 500;
  line-height: 1.55; color: var(--bleu-profond);
  margin: 0 0 10px;
}
.presidente-text p { font-size: 14.5px; line-height: 1.6; color: var(--fg-soft); margin: 0 0 10px; }

/* ============================================ TYPOGRAPHY IMPROVEMENTS */
body { font-feature-settings: "kern", "liga", "ss01"; text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { letter-spacing: 0; }
h1 { letter-spacing: 0; }
.editorial p, .sec-block-body p { hyphens: auto; -webkit-hyphens: auto; }

/* ============================================ FORMATION DETAIL PAGES */
.page-formation-detail .page-header h1,
.page-etab-detail .page-header h1 {
  font-size: 26px; line-height: 1.25;
}
.site-detail-card {
  background: white; border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px;
}
.site-detail-card h3 {
  margin: 0 0 6px; font-size: 16px; color: var(--bleu-profond);
}
.site-detail-card h3 a { color: inherit; text-decoration: none; }
.site-detail-card h3 a:hover { text-decoration: underline; color: var(--bleu-clair); }
.formation-detail-map {
  height: 420px; width: 100%;
  border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; background: var(--line-soft);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
@media (max-width: 700px) {
  .formation-detail-map { height: 320px; }
}

/* ============================================ INSTALL APP PAGE */
.install-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 260px;
  align-items: center; gap: 28px;
}
.install-actions {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px;
}
.pwa-install-button[hidden] { display: none; }
.install-phone {
  justify-self: center;
  width: 210px; height: 380px; border-radius: 28px;
  padding: 18px; background: #111827;
  box-shadow: 0 20px 42px rgba(0,0,0,0.22);
}
.install-phone-screen {
  height: 100%; border-radius: 20px;
  background: linear-gradient(180deg, #f7fbff 0%, #e7f1fb 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; color: var(--bleu-profond);
  padding: 20px;
}
.install-phone-screen img {
  width: 86px; height: 86px; border-radius: 18px;
  box-shadow: 0 8px 18px rgba(0,62,126,0.25);
}
.install-phone-screen strong { font-size: 18px; }
.install-phone-screen span { color: var(--muted); font-size: 12px; }
.install-steps {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
}
.install-step {
  background: white; border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px;
}
.install-step b { color: var(--bleu-profond); display: block; margin-bottom: 6px; }
.install-step p { margin: 0; font-size: 14px; color: var(--fg-soft); }
@media (max-width: 820px) {
  .install-hero { grid-template-columns: 1fr; }
  .install-phone { width: 180px; height: 320px; }
  .install-steps { grid-template-columns: 1fr; }
}

.formations-by-niv .niv-block {
  background: white; border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 20px; margin-bottom: 14px;
}
.formations-by-niv .niv-block h3 {
  margin: 0 0 10px; font-size: 16px; color: var(--bleu-profond);
  display: flex; align-items: center; gap: 8px;
}
.formations-by-niv .niv-block ul {
  list-style: none; padding: 0; margin: 0;
}
.formations-by-niv .niv-block li {
  padding: 6px 0; font-size: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.formations-by-niv .niv-block li:last-child { border-bottom: 0; }
.formations-by-niv .niv-block li a {
  color: var(--fg); text-decoration: none;
}
.formations-by-niv .niv-block li a:hover { color: var(--bleu-clair); text-decoration: underline; }

/* ============================================ GUIDE READER */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.reader-promo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 24px;
  align-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--reader-accent) 14%, white), white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}
.reader-promo-kicker {
  color: var(--reader-accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}
.reader-promo h2 { margin: 0 0 8px; }
.reader-promo p { color: var(--fg-soft); margin: 0 0 16px; max-width: 760px; }
.reader-promo .guide-cover { max-width: 160px; justify-self: center; }
.reader-promo-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.page-guide-reader .site-foot { margin-top: 0; }
.guide-reader {
  background: #eef2f6;
  max-width: none;
  min-height: calc(100vh - 220px);
  padding: 0;
}
.reader-toolbar {
  position: sticky;
  top: 47px;
  z-index: 90;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  backdrop-filter: blur(8px);
}
.reader-toolbar-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.reader-tool,
.reader-tool-link,
.reader-icon-tool {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--fg);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 11px;
  text-decoration: none;
}
.reader-icon-tool {
  width: 34px;
  padding: 0;
  font-size: 18px;
}
.reader-tool:hover,
.reader-tool-link:hover,
.reader-icon-tool:hover {
  background: var(--bleu-pale);
  border-color: var(--bleu-clair);
  text-decoration: none;
}
.reader-tool:disabled,
.reader-icon-tool:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.reader-tool[aria-pressed="true"] {
  background: var(--reader-accent);
  border-color: var(--reader-accent);
  color: white;
}
.reader-page-jump {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.reader-page-jump input {
  width: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  text-align: center;
}
.reader-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: calc(100vh - 260px);
}
.reader-sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  max-height: calc(100vh - 104px);
  overflow: auto;
  padding: 14px;
  position: sticky;
  top: 104px;
}
.reader-panel {
  border-bottom: 1px solid var(--line-soft);
  padding: 0 0 16px;
  margin-bottom: 16px;
}
.reader-panel h2 {
  color: var(--bleu-profond);
  font-size: 15px;
  margin: 0 0 10px;
}
.reader-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  padding: 9px 10px;
}
.reader-muted {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 0;
}
.reader-results,
.reader-toc {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}
.reader-result,
.reader-toc-row {
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
  color: var(--fg);
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  text-align: left;
}
.reader-result:hover,
.reader-toc-row:hover {
  border-color: var(--bleu-clair);
  background: var(--bleu-pale);
}
.reader-result-page,
.reader-toc-page {
  color: var(--bleu-clair);
  font-size: 11px;
  font-weight: 800;
}
.reader-toc-cat {
  color: var(--toc-color);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.reader-toc-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}
.reader-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.reader-thumb {
  border: 2px solid transparent;
  border-radius: 7px;
  background: white;
  cursor: pointer;
  padding: 4px;
  position: relative;
}
.reader-thumb img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.reader-thumb span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0,0,0,0.72);
  border-radius: 999px;
  color: white;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 4px 6px;
}
.reader-thumb.active {
  border-color: var(--reader-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--reader-accent) 22%, white);
}
.reader-stage {
  min-width: 0;
  overflow: auto;
  padding: 24px;
}
.reader-spread {
  --reader-zoom: 1;
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: center;
  margin: 0 auto;
  min-width: min-content;
}
.reader-page {
  margin: 0;
  width: calc(620px * var(--reader-zoom));
  max-width: calc(100vw - 390px);
}
.reader-spread.is-two-page .reader-page {
  width: calc(520px * var(--reader-zoom));
}
.reader-page img {
  width: 100%;
  height: auto;
  background: white;
  border-radius: 4px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.24);
}
.reader-page figcaption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
  text-align: center;
}
.guide-reader button:focus-visible,
.guide-reader a:focus-visible,
.guide-reader input:focus-visible,
.reader-promo a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--orange-soleil) 75%, white);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .reader-layout { grid-template-columns: 1fr; }
  .reader-sidebar {
    max-height: none;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .reader-panel-thumbs { display: none; }
  .reader-stage { padding: 16px 10px 24px; }
  .reader-spread { min-width: 0; }
  .reader-page,
  .reader-spread.is-two-page .reader-page {
    width: min(calc(100vw - 28px), calc(640px * var(--reader-zoom)));
    max-width: none;
  }
  .reader-toolbar { top: 0; }
}

@media (max-width: 720px) {
  .reader-promo { grid-template-columns: 1fr; }
  .reader-promo .guide-cover { max-width: 130px; }
  .reader-toolbar { align-items: stretch; }
  .reader-toolbar-group { width: 100%; justify-content: center; }
  .reader-tool,
  .reader-tool-link { flex: 1 1 auto; }
  .reader-icon-tool { flex: 0 0 38px; }
  .reader-page-jump { flex: 0 0 auto; }
}
