/******** Vars ********/
:root {
  --ffv-blue: #21325f;
  --ffv-red: #e7162e;
  --bg: #f7f8fb;
  --ink: #1f2937;
  --muted: #6b7280;
  --card: #fff;
  --radius: 16px;
  --sidebar-w: 250px;
  /* largeur de la 1ère colonne de la grille */

  --shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  --maxw: 1200px;
  --glass-bg: rgba(255, 255, 255, 0.22);
  --glass-border: rgba(255, 255, 255, 0.35);
  --glass-shadow: 0 10px 30px rgba(16, 24, 40, 0.16);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img,
video,
iframe {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

/******** Header (desktop sticky / mobile glass fixed) ********/
.site-header {
  position: fixed;
  top: 0;
  z-index: 40;
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #eceff3;
  backdrop-filter: blur(8px);
}

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  width: 120px;
  height: auto;
}

.site-title {
  font-weight: 700;
  color: var(--ffv-blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Burger */
.menu-btn {
  margin-left: auto;
  width: 44px;
  height: 40px;
  border-radius: 12px;
  padding: 0;
  border: 1px solid #e6e9f2;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: 0 6px 16px rgba(33, 50, 95, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  display: none;
  place-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.menu-btn__bar {
  width: 20px;
  height: 2px;
  background: #21325f;
  border-radius: 2px;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.18s ease;
}

.menu-btn__bar+.menu-btn__bar {
  margin-top: 5px;
}

.menu-btn.is-open .menu-btn__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-btn.is-open .menu-btn__bar:nth-child(2) {
  opacity: 0;
}

.menu-btn.is-open .menu-btn__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile header glass */
@media (max-width: 900px) {
  .site-header {
    position: fixed;
    top: 0;
    z-index: 100;
    padding-top: max(8px, env(safe-area-inset-top));
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    background: linear-gradient(180deg,
        var(--glass-bg),
        rgba(255, 255, 255, 0.04));
    border-bottom: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: var(--glass-shadow);
  }

  .site-title {
    text-wrap: wrap;
    width: 70%;
  }

  .menu-btn {
    display: inline-grid;
  }
}

/******** Layout ********/
main.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  max-width: 1200px;
  gap: 24px;
  padding: 24px 20px;

  max-width: var(--maxw);
  margin-inline: auto;
  min-width: 0;
  margin: auto;
}

main.layout {
  overflow: visible;
}

@media (max-width: 900px) {
  main.layout {
    grid-template-columns: 1fr;
  }

  .content {
    margin-top: 64px;
  }

  /* espace sous header fixed */
}

/******** Sidebar desktop ********/
.sidebar-body {
  overflow: visible;
  max-height: none;
}

.nav {
  list-style: none;
  padding: 8px;
  margin: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  color: #111;
  text-decoration: none;
  word-break: break-word;
}

.nav a:hover {
  background: #f7f8fb;
}

.nav a.active {
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: var(--shadow);
}

@media (min-width: 901px) {

  /* Le grid reste 240px 1fr, on laisse l'<aside> dans le flux */
  main.layout {
    grid-template-columns: var(--sidebar-w) 1fr !important;
    overflow: visible !important;
  }

  /* L'aside sert de "placeholder" de largeur, pas de sticky ici */
  aside.sidebar {
    position: relative !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    z-index: 1;
  }

  /* Le contenu réel de la sidebar est fixé à l'écran */
  aside.sidebar .sidebar-inner {
    position: fixed !important;
    z-index: 30;
    width: var(--sidebar-w) !important;

    /* Aligner à la colonne gauche du conteneur centré (max-width + padding 20px) */
    left: calc(max(20px, (100vw - var(--maxw)) / 2 + 20px)) !important;

    /* Sous le header (valeur dynamique que ton JS met déjà à jour) + petite marge */
    top: calc(var(--header-h, 64px) + 10px) !important;
  }

  /* La partie qui scrolle dans la sidebar (pas toute la page) */
  aside.sidebar .sidebar-body {
    max-height: calc(100vh - (var(--header-h, 64px) + 10px) - 24px) !important;
    overflow: auto !important;
  }
}

/******** Drawer mobile ********/
@media (max-width: 900px) {
  aside.sidebar {
    position: fixed;
    top: 15%;
    left: 0;
    bottom: 0;
    width: min(84%, 360px);
    height: min(75%, 670px);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 50;
    background: #fff;
    border-right: 1px solid #eceff3;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
    box-shadow: 0 18px 60px rgba(16, 24, 40, 0.22);
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    contain: layout paint size;
  }

  .site-header {
    z-index: 100;
  }

  /* header */
  .drawer-overlay {
    z-index: 110;
  }

  /* overlay au-dessus */
  aside.sidebar {
    z-index: 120;
  }

  aside.sidebar.open {
    transform: translateX(0);
  }

  .drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 45;
    opacity: 0;
    pointer-events: none;
    background: rgba(10, 15, 25, 0.28);
    backdrop-filter: saturate(120%) blur(3px);
    transition: opacity 0.2s ease;
  }

  .drawer-overlay.show {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-inner {
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr;
    padding-inline: 12px;
  }

  .sidebar-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px;
    margin: 0 -12px 8px;
    background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.96));
    border-bottom: 1px solid #eceff3;
    backdrop-filter: blur(6px);
  }

  .sidebar-title {
    font-weight: 800;
    color: var(--ffv-blue);
  }

  .sidebar-close {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid #e6e9f2;
    background: #fff;
    box-shadow: 0 4px 12px rgba(33, 50, 95, 0.1);
    color: #21325f;
    cursor: pointer;
  }

  .sidebar-body {
    min-height: 0;
    overflow: auto;
    padding-bottom: 8px;
  }

  .nav {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
  }

  .nav li {
    border-bottom: 1px solid #f1f3f8;
  }

  .nav li:last-child {
    border-bottom: none;
  }

  .nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 8px;
    font-weight: 600;
    color: #0f172a;
    border-radius: 10px;
  }

  .nav a:hover {
    background: linear-gradient(0deg,
        rgba(33, 50, 95, 0.04),
        rgba(33, 50, 95, 0.04)),
      #fff;
  }

  .nav a::after {
    content: "";
    margin-left: auto;
    width: 16px;
    height: 16px;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 18l6-6-6-6' fill='%23000'/%3E%3C/svg%3E") no-repeat center/contain;
    background: #21325f;
    opacity: 0.65;
  }

  .nav a.active {
    background: linear-gradient(0deg,
        rgba(33, 50, 95, 0.06),
        rgba(33, 50, 95, 0.06)),
      #fff;
    box-shadow: 0 6px 16px rgba(33, 50, 95, 0.1);
    margin: 6px 4px;
  }

  .nav a.active::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ffv-red);
    box-shadow: 0 0 0 3px rgba(231, 22, 46, 0.15);
  }
}

/******** Hero ********/
.hero {
  width: 100%;
  margin-top: 5rem;
  max-width: var(--maxw);
  height: 38svh;
  min-height: 260px;
  border-radius: 26px;
  overflow: hidden;
  background-image: url("../../Voile_VIrtuelle/img/Bandeau Transat virtuelle.jpg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/******** Classement en direct ********/
.section-block--first {
  margin-block: 2rem 3rem;
}

.ranking {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px 24px;
  background: var(--card);
  border: 1px solid #e5e7eb;
  border-left: 4px solid var(--ffv-blue);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.ranking__body {
  min-width: 0;
}

.ranking__body h2 {
  margin: 0 0 4px;
}

.ranking__body p {
  margin: 0;
  max-width: 60ch;
}

.ranking__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  color: #fff;
  background: var(--ffv-blue);
  transition: background 0.2s ease;
}

.ranking__cta:hover {
  background: var(--ffv-red);
}

.ranking__cta:focus-visible {
  outline: 3px solid var(--ffv-red);
  outline-offset: 2px;
}

.ranking__cta svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Parcours Saint-Malo -> Pointe-a-Pitre */
.ranking__route {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #eceff3;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.ranking__port {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ffv-blue);
  white-space: nowrap;
}

.ranking__port::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ffv-blue);
}

.ranking__port--finish {
  flex-direction: row-reverse;
}

.ranking__port--finish::before {
  background: var(--ffv-red);
}

.ranking__track {
  flex: 1;
  min-width: 12px;
  border-top: 2px dashed #cfd5e3;
}

.ranking__dist {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .ranking {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .ranking__cta {
    justify-content: center;
  }
}

/******** Sections & Cards ********/
.section-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-block: 5rem;
  min-width: 0;
}

section {
  scroll-margin-top: 90px;
}

.card {
  background: var(--card);
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

h2 {
  color: var(--ffv-blue);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px;
}

.list {
  padding-left: 20px;
}

.muted {
  color: var(--muted);
}

hr {
  border: none;
  border-top: 1px solid #eceff3;
  margin: 16px 0;
}

.callout {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ffv-red);
}

/* Intro split */
.card--split {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  align-items: start;
}

.card__body {
  min-height: 200px;
}

.card__media {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .card--split {
    grid-template-columns: 1fr;
  }

  .card__media {
    justify-content: flex-start;
  }
}

.video-vertical {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 9/16;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.16),
      rgba(0, 0, 0, 0.06));
}

.video-vertical video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

/******** Forms overlay ********/
.forms-wrapper {
  position: relative;
}

.forms-grid--locked {
  filter: grayscale(0.3) opacity(0.45);
  pointer-events: none;
  user-select: none;
}

.forms-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 2;
}

.forms-overlay__text {
  transform: rotate(-8deg);
  border: 3px solid var(--ffv-red);
  border-radius: 12px;
  padding: 10px 32px;
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
}

.forms-overlay__label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--ffv-red);
  font-weight: 700;
}

.forms-overlay__date {
  display: block;
  font-size: 28px;
  font-weight: 900;
  color: var(--ffv-red);
  line-height: 1.2;
}

/******** Capsules formulaires ********/
.forms-grid--capsules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  min-width: 0;
}

@media (max-width: 900px) {
  .forms-grid--capsules {
    grid-template-columns: repeat(1, 1fr);
  }
}

.form-chip {
  --size: 58px;
  --radius: 999px;
  --ring: 1px solid #e5e7eb;
  display: grid;
  grid-template-columns: var(--size) 1fr 28px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 10px;
  border-radius: var(--radius);
  text-decoration: none;
  color: #111;
  background: #fff;
  border: var(--ring);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transition: transform 0.14s ease, box-shadow 0.2s ease, border-color 0.2s ease,
    background 0.2s ease;
}

.form-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(33, 50, 95, 0.16);
  border-color: #d9deea;
}

.form-chip:focus-visible {
  outline: 3px solid #21325f;
  outline-offset: 2px;
}

.form-chip__thumb--icon {
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #21325f, #2c4687);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
  border: 2px solid #fff;
}

.form-chip__thumb--icon svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}

.form-chip__text strong {
  font-weight: 800;
  color: #21325f;
  letter-spacing: 0.2px;
}

.form-chip__chev {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #21325f;
  background: linear-gradient(135deg,
      rgba(33, 50, 95, 0.08),
      rgba(231, 22, 46, 0.08));
  border: 1px solid #e7eaf4;
  transition: transform 0.14s ease, background 0.2s ease;
}

.form-chip:hover .form-chip__chev {
  transform: translateX(2px);
}

/******** Kits ********/
.kits {
  display: grid;
  gap: 18px;
  margin-top: 10px;
  min-width: 0;
}

.kit-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .kit-card {
    grid-template-columns: 1fr;
  }
}

.kit-media {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.kit-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kit-body {
  display: grid;
  gap: 10px;
}

.kit-title {
  margin: 0;
  color: #21325f;
  font-size: 20px;
  font-weight: 800;
}

.kit-lead {
  margin: 0;
  color: #374151;
}

.kit-bullets {
  margin: 0;
  padding-left: 18px;
  color: #111;
}

.kit-bullets li {
  margin: 4px 0;
}

.kit-cta {
  margin-top: 4px;
}

/******** Link with icon ********/
.link-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #21325f;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid #e7eaf4;
  background: linear-gradient(135deg,
      rgba(33, 50, 95, 0.06),
      rgba(231, 22, 46, 0.04));
  transition: background 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease;
}

.link-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(33, 50, 95, 0.12);
}

.link-icon svg {
  width: 16px;
  height: 16px;
  fill: #21325f;
  display: block;
}

/******** Media helpers ********/
.media {
  margin-top: 16px;
  border-radius: 16px;
  overflow: hidden;
}

.media img,
.media video {
  width: 100%;
  height: auto;
  border-radius: 16px;
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox.show {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__inner {
  max-width: min(1100px, 92vw);
  max-height: 86vh;
}

.lightbox__inner img,
.lightbox__inner video {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

/* parallax */
.media--parallax {
  perspective: 800px;
}

.media--parallax img,
.media--parallax video {
  transform: translateZ(0);
  transition: transform 0.15s ease-out;
}

/* glass */
.media--glass {
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.55),
      rgba(255, 255, 255, 0.15));
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px;
}

.media--glass img,
.media--glass video {
  border-radius: 12px;
}

/******** YouTube grid ********/
.yt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

@media (max-width: 900px) {
  .yt-grid {
    grid-template-columns: 1fr;
  }
}

.yt-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  transition: transform 0.14s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.yt-card:hover {
  transform: translateY(-2px);
  border-color: #dbe1ef;
  box-shadow: 0 14px 32px rgba(33, 50, 95, 0.16);
}

.yt-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.yt-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.yt-title {
  margin: 12px 4px 2px;
  font-size: 16px;
  font-weight: 700;
  color: #21325f;
}

.yt-caption {
  margin: 0 4px 4px;
  font-size: 13px;
}

/******** Reveal ********/
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js .reveal {
  opacity: 0.999;
  transform: translateY(8px);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/******** Footer ********/
footer {
  border-top: 1px solid #eceff3;
  padding: 20px;
  color: #6b7280;
  max-width: var(--maxw);
  margin-inline: auto;
}