/* ==================================================
   Variables (thème clair)
================================================== */
:root{
  --bg: #FDFDFD;
  --surface: #FFFFFF;
  --text: #0B1020;
  --muted: #4B5563;
  --border: #E5E7EB;

  /* Hauteur du header (utilisé pour le padding-top du body) */
  --header-h: 128px;

  /* Couleurs principales (logo) */
  --primary: #012271;
  --primary-2: #0A2782;
  --ink: #020306;

  /* Mise en page */
  --container: 1100px;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(2,3,6,.10);

  /* Focus (accessibilité) */
  --focus: #111827;
}

/* ==================================================
   Thème sombre
================================================== */
[data-theme="dark"]{
  --bg: #0b1020;
  --surface: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #1f2937;

  --primary: #93c5fd;
  --primary-2: #60a5fa;
  --ink: #e5e7eb;

  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --focus: #e5e7eb;
}

/* ==================================================
   Base
================================================== */
*{ box-sizing:border-box; }

html{ scroll-behavior:smooth; }

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;

  /* Header fixed : on décale le contenu */
  padding-top: var(--header-h);
}

img{ max-width:100%; height:auto; display:block; }

a{ color: var(--primary); text-underline-offset: 3px; }
a:hover{ color: var(--primary-2); }

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

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

/* Lien “Aller au contenu” (clavier) */
.skip-link{
  position:absolute;
  left:-999px;
  top:0;
  background: var(--focus);
  color:#fff;
  padding:.75rem 1rem;
  border-radius: 10px;
  z-index: 9999;
}
.skip-link:focus{
  left:1rem;
  top:1rem;
}

/* ==================================================
   Layout : hero / sections / cards
================================================== */
.hero{
  padding: 1.4rem 0 1.2rem;
}

.hero-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.hero-top{
  padding: 1.6rem 1.4rem;
  background: linear-gradient(
    110deg,
    color-mix(in srgb, var(--primary) 14%, transparent),
    color-mix(in srgb, var(--primary-2) 6%, transparent)
  );
}

.hero h1{
  margin: 0 0 .5rem;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  line-height:1.2;
}

.hero p{
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

.hero-actions{
  display:flex;
  gap:.75rem;
  flex-wrap:wrap;
  padding: 1rem 1.4rem 1.4rem;
}

/* Boutons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  padding:.7rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration:none;
  color: var(--ink);
}

.btn:hover{
  background: color-mix(in srgb, var(--ink) 3%, var(--surface));
}

.btn.primary{
  background: var(--primary);
  border-color: var(--primary);
  color:#fff;
}

.btn.primary:hover{
  background: var(--primary-2);
  border-color: var(--primary-2);
}

/* Sections + grille */
.section{
  padding: 1.25rem 0 2rem;
}

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

.card{
  grid-column: span 6;
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.card h2{
  margin: 0 0 .35rem;
  font-size: 1.05rem;
}

.card p{
  margin:0;
  color: var(--muted);
}

@media (max-width: 920px){
  .card{ grid-column: span 12; }
}

/* ==================================================
   Accessibilité / divers
================================================== */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
}

iframe{ max-width: 100%; }

/* ==================================================
   Listes de documents
================================================== */
.doc-list{
  margin: .75rem 0 0;
  padding-left: 1.1rem;
}
.doc-list li{ margin: .35rem 0; }
.doc-list a{ font-weight: 600; }

/* ==================================================
   Formulaires
================================================== */
.form{
  display:grid;
  gap:.75rem;
  margin-top: .75rem;
}

.field{ display:grid; gap:.35rem; }

label{ font-weight: 650; }

input, textarea, select{
  width: 100%;
  padding: .75rem .85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}

textarea{
  min-height: 140px;
  resize: vertical;
}

.help{
  font-size: .95rem;
  color: var(--muted);
}

/* ==================================================
   Badges / stacks
================================================== */
.badge{
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  padding:.35rem .6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  color: var(--muted);
  font-size: .9rem;
}

.stack{
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
  margin-top:.5rem;
}

/* ==================================================
   Listes simples
================================================== */
.list-clean{
  margin: .75rem 0 0;
  padding-left: 1.1rem;
}
.list-clean li{ margin: .35rem 0; }

/* ==================================================
   Notices / alertes
================================================== */
.notice,
.alert{
  border: 1px solid var(--border);
  border-left: 6px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border-radius: var(--radius);
  padding: 1rem;
}

/* ==================================================
   Tableaux
================================================== */
.table{
  width:100%;
  border-collapse: collapse;
  margin-top:.75rem;
  border:1px solid var(--border);
  border-radius: var(--radius);
  overflow:hidden;
}

.table th,
.table td{
  padding:.75rem .85rem;
  border-bottom:1px solid var(--border);
  text-align:left;
  vertical-align: top;
}

.table th{
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  font-weight: 700;
}

.table tr:last-child td{ border-bottom:0; }

/* ==================================================
   FAQ (details/summary)
================================================== */
details{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: .85rem 1rem;
}
details + details{ margin-top: .75rem; }

summary{
  cursor: pointer;
  font-weight: 700;
}
summary::marker{ color: var(--primary); }

details p{
  margin: .6rem 0 0;
  color: var(--muted);
}

/* ==================================================
   Tuiles (accès directs)
================================================== */
.tiles{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.tile{
  grid-column: span 3;
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-decoration:none;
  color: var(--ink);
  box-shadow: none;
}

.tile:hover{
  background: color-mix(in srgb, var(--ink) 2%, var(--surface));
}

.tile strong{ display:block; margin-bottom:.25rem; }
.tile span{ color: var(--muted); font-size:.95rem; }

@media (max-width: 920px){
  .tile{ grid-column: span 6; }
}
@media (max-width: 560px){
  .tile{ grid-column: span 12; }
}

/* ==================================================
   Hero split (badge internat)
================================================== */
.hero-split{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.hero-text{ flex: 1; }

.hero-badge{ flex-shrink: 0; }

.hero-badge img{
  max-width: 140px;
  height: auto;
  opacity: .9;
}

@media (max-width: 720px){
  .hero-split{
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-badge{ display: none; }
}

/* ==================================================
   Injection header/footer + anti “saut”
================================================== */
#header,
#footer{
  min-height: 0;
}

/* On masque tant que header/footer ne sont pas injectés */
html.is-loading body{
  visibility: hidden;
}

/* (Optionnel) si tu l’utilises un jour */
html.is-ready body{
  opacity: 1;
  transition: opacity .12s ease;
}

/* Espace au-dessus du contenu (à ajuster si besoin) */
main{
  padding-top: 4rem;
}

/* Accueil : on colle le hero sous le slider */
.home-slider + main .hero{
  padding-top: 0 !important;
}

.home-slider{
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

.home-slider + main .hero-card{
  margin-top: 0 !important;
}

/* ==================================================
   Actualités (table + badge)
================================================== */
.table[aria-label*="Actualités"]{
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
}

.table thead th{
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.table tbody td{
  line-height: 1.45;
}

.table tbody tr:nth-child(even) td{
  background: color-mix(in srgb, var(--ink) 2%, transparent);
}

.table tbody tr:hover td{
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

/* Badge “Nouveau” */
.news-badge{
  display:inline-flex;
  align-items:center;
  margin-left: .5rem;
  padding: .2rem .5rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 40%, var(--border));
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary);
  font-size: .85rem;
  font-weight: 750;
  white-space: nowrap;
}

.news-row--new td{
  background: color-mix(in srgb, var(--primary) 7%, transparent);
}

@media (max-width: 560px){
  .news-badge{
    margin-left: .35rem;
    font-size: .82rem;
  }
}

/* ==================================================
   Accueil uniquement : cards moins fades (index.html)
================================================== */
.page-home .card.card--home{
  padding: 0;
  overflow: hidden;
  border-radius: calc(var(--radius) + 2px);
  box-shadow: 0 6px 18px rgba(2,3,6,.06);
}

.page-home .card.card--home > h2{
  margin: 0;
  padding: .95rem 1.05rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    110deg,
    color-mix(in srgb, var(--primary) 10%, transparent),
    color-mix(in srgb, var(--primary-2) 5%, transparent)
  );
}

.page-home .card.card--home > *:not(h2){
  padding-left: 1.05rem;
  padding-right: 1.05rem;
}

.page-home .card.card--home > p,
.page-home .card.card--home > .help{
  margin: 0;
  padding-top: .85rem;
  padding-bottom: .85rem;
  color: var(--muted);
}

.page-home .card.card--home .btn{
  margin-top: .75rem;
}

.page-home .card.card--home:hover{
  border-color: color-mix(in srgb, var(--primary) 22%, var(--border));
  box-shadow: 0 10px 26px rgba(2,3,6,.10);
  transform: translateY(-1px);
  transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease;
}

/* ==================================================
   Infos pratiques : petits helpers (évite les <br>)
================================================== */
.hours{ line-height: 1.6; }

.hours-row{
  display:flex;
  gap:.4rem;
  align-items:center;
  margin-top: .5rem;
}
.hours-row:first-child{ margin-top: 0; }

.hours-time{ margin-left: 1.4rem; }

.transport-cta{
  margin-top: 1rem;
  text-align: center;
}

.transport-notes{
  margin-top: 1rem;
}
