:root {
  --brand: #DA4445;
  --text: #333333;
  --text-2: #666666;
  --text-3: #999999;
  --bg: #FDFCFA;
  --card: #FFFFFF;
  --line: #ECE8E1;
  --water: #DDEBF4;
  --water-2: #CFE2EF;
  --land: #F4F0E8;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: "Montserrat", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, p { margin: 0; }

/* ---------- Bandeau Windorah ---------- */
.offer {
  background: var(--brand);
  color: #fff;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  padding: 16px 20px;
  line-height: 1.4;
}
.offer a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.offer strong { font-weight: 800; font-size: 17px; letter-spacing: 0.02em; }

.sim-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #FFF3D6;
  color: #7A5300;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

/* ---------- En-tête ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 26px; height: 26px; fill: #fff; }
.brand h1 { font-size: 20px; font-weight: 700; color: var(--brand); letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--text-2); }
.clock { text-align: right; display: flex; flex-direction: column; }
#clock-time { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
#clock-date { font-size: 12px; color: var(--text-2); }

.banner {
  margin: 12px 24px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: #FBECEC;
  color: #8E2A2B;
  font-size: 14px;
}

/* ---------- Mise en page ---------- */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
  gap: 20px;
  padding: 20px 24px;
  align-items: start;
}

/* ---------- Plan ---------- */
.map-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  position: sticky;
  top: 16px;
}
.map-wrap { position: relative; }
#map { width: 100%; height: auto; display: block; border-radius: 10px; }

.map-status {
  position: absolute;
  left: 12px; bottom: 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.map-status:empty { display: none; }

.legend {
  list-style: none;
  margin: 10px 4px 2px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 12.5px;
  color: var(--text-2);
}
.legend li { display: flex; align-items: center; gap: 8px; }

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

/* Éléments SVG */
.land { fill: var(--land); }
.water { fill: var(--water); }
.map-label { font-family: "Montserrat", sans-serif; fill: #A79F90; font-weight: 700; font-size: 17px; letter-spacing: 0.18em; }
.map-water-label { font-family: "Montserrat", sans-serif; fill: #8FB2C9; font-style: italic; font-size: 20px; }
.route { fill: none; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.route.dashed { stroke-width: 5; stroke-dasharray: 2 10; }
.station { cursor: pointer; }
.station-pin { fill: #fff; stroke: var(--text); stroke-width: 3.5; transition: fill .15s; }
.station:hover .station-pin, .station.active .station-pin { fill: var(--brand); stroke: var(--brand); }
.station-name { font-family: "Montserrat", sans-serif; font-size: 21px; font-weight: 700; fill: var(--text); }
.station-town { font-family: "Montserrat", sans-serif; font-size: 15px; font-weight: 500; fill: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; }
.station.active .station-name { fill: var(--brand); }

.boat { transition: opacity .4s; }
.boat-hull { fill: #fff; }
.boat-ring {
  fill: none;
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
  animation: ripple 2.4s ease-out infinite;
}
@keyframes ripple {
  from { transform: scale(0.9); opacity: 0.8; }
  to { transform: scale(1.9); opacity: 0; }
}
.boat-tag { font-family: "Montserrat", sans-serif; font-size: 14px; font-weight: 700; fill: var(--text); paint-order: stroke; stroke: #fff; stroke-width: 4px; }

/* ---------- Tableau des départs ---------- */
.board { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.board-head { display: flex; flex-direction: column; gap: 10px; }
.board-head h2 { font-size: 18px; font-weight: 700; }

.stop-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
  cursor: pointer;
}
.chip:hover { border-color: #D8D2C8; color: var(--text); }
.chip[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.board-list { display: flex; flex-direction: column; gap: 12px; }

.stop-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stop-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px 8px;
}
.stop-card-head h3 { font-size: 16px; font-weight: 700; }
.stop-card-head .town { font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }

.dep {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
}
.dep-dest { min-width: 0; }
.dep-dest strong { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dep-dest span { font-size: 12.5px; color: var(--text-2); }
.dep-when { text-align: right; }
.dep-when .eta { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dep-when .eta.soon { color: var(--brand); }
.dep-when .at { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }

.empty { padding: 12px 16px 14px; font-size: 13.5px; color: var(--text-2); border-top: 1px solid var(--line); }

.day-list { padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.day-list h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.day-group + .day-group { margin-top: 12px; }
.day-group-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.times { display: flex; flex-wrap: wrap; gap: 4px; }
.times span {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  padding: 3px 6px;
  border-radius: 5px;
  background: #F4F1EC;
}
.times span.past { color: var(--text-3); background: transparent; text-decoration: line-through; }
.times span.next { background: var(--brand); color: #fff; font-weight: 700; }

/* ---------- Texte de présentation (SEO) ---------- */
.seo {
  width: 100%;
  min-width: 0;
  max-width: 860px;
  margin: 12px auto 36px;
  padding: 0 24px;
  color: var(--text);
}
.seo h2 { font-size: 22px; font-weight: 700; color: var(--brand); margin-bottom: 12px; }
.seo h3 { font-size: 17px; font-weight: 700; margin: 26px 0 10px; }
.seo p { margin: 0 0 12px; }
.seo ul { margin: 0; padding-left: 20px; }
.seo li { margin-bottom: 6px; }
.seo a { color: var(--brand); font-weight: 600; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; color: var(--text-2); }
.seo-maj { font-size: 13px; color: var(--text-2); }
.seo-lines .badge { margin-right: 4px; transform: translateY(-1px); }
.seo-lines li { margin-bottom: 10px; }

.tt-scroll { overflow-x: auto; margin: 0 0 8px; -webkit-overflow-scrolling: touch; }
.seo table { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.seo caption { text-align: left; font-weight: 600; font-size: 13.5px; padding: 6px 0; }
.facts { width: 100%; min-width: 620px; }
.facts th, .facts td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.facts th { font-size: 12px; color: var(--text-2); font-weight: 600; }
.facts small { color: var(--text-2); }
.tt th, .tt td { padding: 5px 7px; border: 1px solid var(--line); white-space: nowrap; }
.tt th { position: sticky; left: 0; background: var(--bg); text-align: left; font-weight: 600; }
.tt td.x { background: #FDF0E6; }
.tt-note { font-size: 12.5px; color: var(--text-2); margin: 0 0 6px !important; }
.tt-line { border-top: 1px solid var(--line); padding: 12px 0; }
.tt-line:last-of-type { border-bottom: 1px solid var(--line); }
.tt-line summary { cursor: pointer; font-weight: 600; }
.tt-line[open] summary { margin-bottom: 10px; }

.seo-credit { margin-top: 24px !important; font-size: 13.5px; color: var(--text-2); }

/* ---------- Pied de page ---------- */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--line);
  background: var(--card);
}
.disclaimer { font-size: 12px; color: var(--text-2); max-width: 720px; }
.signature {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-2); font-size: 12px; text-decoration: none; flex-shrink: 0;
}
.signature img { height: 28px; width: auto; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .seo { padding: 0 16px; font-size: 14px; line-height: 1.55; }
  .seo h2 { font-size: 19px; line-height: 1.3; }
  .seo h3 { font-size: 16px; margin-top: 22px; }
  .seo-lines { padding-left: 0; list-style: none; }
  .seo-lines li { margin-bottom: 12px; }
  .seo table { font-size: 12.5px; }
  .faq summary { font-size: 14px; }
  .tt-line summary { font-size: 14px; line-height: 1.6; }
  .footer .disclaimer { font-size: 11.5px; }

  /* Horaires en bref : une fiche par ligne au lieu d'un tableau */
  .facts { min-width: 0; }
  .facts thead { display: none; }
  .facts caption { display: block; width: 100%; }
  .facts, .facts tbody { display: block; }
  .facts tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 14px;
    position: relative;
    padding: 10px 0 10px 48px;
    border-bottom: 1px solid var(--line);
  }
  .facts td { padding: 0; border: 0; }
  .facts .c-ligne { position: absolute; left: 0; top: 11px; }
  .facts .c-trajet { flex-basis: 100%; font-weight: 600; font-size: 13.5px; }
  .facts .c-jours { flex-basis: 100%; order: -1; font-size: 12px; color: var(--text-2); }
  .facts .c-info::before { content: attr(data-label) " "; color: var(--text-2); }
  .offer { font-size: 14.5px; padding: 12px 16px; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; gap: 16px; }
  .map-panel { position: static; padding: 8px; }
  .topbar { padding: 12px 16px; }
  .banner { margin: 12px 16px 0; }
  .footer { flex-direction: column; align-items: flex-start; padding: 16px; }
}
@media (max-width: 480px) {
  .brand h1 { font-size: 17px; }
  .brand-sub { display: none; }
  #clock-time { font-size: 19px; }
  .map-status { left: 6px; bottom: 6px; font-size: 11.5px; padding: 4px 9px; }
}
