/* ============================================
   DUC D'ALBE NEW GENERATION 2026
   Design tokens + base styles
   ============================================ */

:root {
  /* Colors - sport mode (default) */
  --ink: #0a1420;
  --ink-2: #1a2536;
  --paper: #f5f3ec;
  --paper-2: #ebe7da;
  --line: #d8d3c2;
  --muted: #6b7280;
  --accent: #e63946;
  --accent-2: #d62a39;
  --sea: #0d2a44;

  /* Typography */
  --f-display: "Bebas Neue", "Anton", "Impact", sans-serif;
  --f-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --f-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;

  /* Spacing */
  --gutter: clamp(16px, 3vw, 40px);
  --section-y: clamp(60px, 8vw, 120px);

  /* Radii */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 16px;
}

[data-theme="editorial"] {
  --ink: #0d1f2d;
  --paper: #f4efe6;
  --paper-2: #ebe4d4;
  --line: #ccc3ae;
  --accent: #c8401a;
  --accent-2: #a8321a;
  --sea: #16364f;
  --f-display: "Fraunces", "Playfair Display", Georgia, serif;
  --f-body: "Inter", -apple-system, sans-serif;
}

[data-theme="sport"][data-mode="dark"] {
  --ink: #f5f3ec;
  --ink-2: #d8d3c2;
  --paper: #0a1420;
  --paper-2: #14202f;
  --line: #243349;
  --muted: #8b95a5;
  --sea: #0a1420;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow-x: hidden; }

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

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ===== TYPOGRAPHY UTILITIES ===== */
.display {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 0.92;
  text-transform: uppercase;
}
[data-theme="editorial"] .display {
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 0.95;
  text-transform: none;
}

.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
}

.mono { font-family: var(--f-mono); }

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.container-wide {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ===== NAV ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--paper);
  border-bottom-color: var(--line);
}
.nav.on-hero {
  color: #fff;
}
.nav.on-hero.scrolled {
  color: var(--ink);
  background: var(--paper);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--f-display);
  font-size: 22px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
}
[data-theme="editorial"] .nav-brand {
  text-transform: none;
  letter-spacing: -0.02em;
  font-size: 24px;
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
}
.nav-link {
  position: relative;
  padding: 6px 0;
  cursor: pointer;
  transition: opacity 0.2s;
}
.nav-link:hover { opacity: 0.7; }
.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 2px;
  background: var(--accent);
}

/* Sous-menu déroulant */
.nav-item { position: relative; }
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 14px;
  min-width: 210px;
  display: none;
  flex-direction: column;
  z-index: 200;
}
.nav-item:hover .nav-dropdown { display: flex; }
.nav-dropdown > span {
  background: var(--paper);
  color: var(--ink);
  padding: 11px 18px;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--line);
  border-bottom: none;
  transition: background 0.15s;
}
.nav-dropdown > span:first-child { border-radius: var(--r-sm) var(--r-sm) 0 0; }
.nav-dropdown > span:last-child { border-bottom: 1px solid var(--line); border-radius: 0 0 var(--r-sm) var(--r-sm); box-shadow: 0 14px 30px -14px rgba(10,20,32,0.3); }
.nav-dropdown > span:hover { background: var(--paper-2); }
.nav-dropdown > span.active { color: var(--accent); }

.nav-cta {
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 0.2s, transform 0.2s;
}
.nav-cta:hover { background: var(--accent-2); transform: translateY(-1px); }

.nav-lang {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  display: flex;
  gap: 2px;
}
.nav-lang button {
  padding: 4px 6px;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.nav-lang button.active { opacity: 1; font-weight: 600; }

/* mobile nav */
.nav-burger { display: none; }
@media (max-width: 980px) {
  .nav-links { display: none; }
  .nav-burger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
  }
  .nav-burger span {
    width: 22px; height: 2px; background: currentColor; display: block;
  }
  .nav-cta { padding: 8px 14px; font-size: 12px; }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--r-sm);
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn-ghost { border-color: currentColor; color: inherit; background: transparent; }
.btn-ghost:hover { background: rgba(0,0,0,0.05); }
.btn-ghost.on-dark:hover { background: rgba(255,255,255,0.1); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ink-2); }

.btn-arrow::after {
  content: "→";
  transition: transform 0.2s;
}
.btn:hover .btn-arrow::after,
.btn-arrow:hover::after { transform: translateX(3px); }

/* ===== SECTION CHROME ===== */
.section {
  padding: var(--section-y) 0;
}
.section-tight { padding: calc(var(--section-y) * 0.6) 0; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 56px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--f-display);
  font-size: clamp(40px, 6vw, 88px);
  line-height: 0.9;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  flex: 1;
  min-width: 280px;
}
[data-theme="editorial"] .section-head h2 {
  text-transform: none;
  letter-spacing: -0.025em;
}

/* ===== TABLES ===== */
.t-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.t-table th {
  text-align: left;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.t-table td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.t-table tr:hover td { background: var(--paper-2); }

/* ===== CARDS ===== */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 28px;
}

/* ===== TAG / PILL ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}
.tag-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.tag-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ===== UTIL ===== */
.divider {
  height: 1px;
  background: var(--line);
  margin: 0;
  border: none;
}
.divider-thick {
  height: 2px;
  background: var(--ink);
}

.flex { display: flex; }
.grid { display: grid; }

/* live ticker dot */
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-right: 8px;
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

/* fade-in */
.fade-in {
  animation: fadeIn 0.6s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== FORM CONTROLS ===== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.field input, .field select, .field textarea {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  border-radius: var(--r-sm);
  transition: border-color 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--ink);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
}

/* radio cards */
.radio-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.radio-card {
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--paper);
}
.radio-card:hover { border-color: var(--ink); }
.radio-card.selected {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 6%, var(--paper));
  box-shadow: inset 0 0 0 1px var(--accent);
}
.radio-card .price {
  font-family: var(--f-display);
  font-size: 32px;
  letter-spacing: 0;
  margin-top: 8px;
}
[data-theme="editorial"] .radio-card .price { font-weight: 600; }

/* ===== RESPONSIVE HELPERS ===== */
.hide-mobile { display: initial; }
.show-mobile { display: none; }
@media (max-width: 720px) {
  .hide-mobile { display: none; }
  .show-mobile { display: initial; }
}

/* ===== RESPONSIVE GRIDS ===== */
@media (max-width: 900px) {
  .intro-grid { grid-template-columns: 1fr !important; }
  .affiche-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
  .facts-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .prog-grid { grid-template-columns: 1fr !important; }
  .photo-strip { grid-template-columns: 1fr !important; height: auto !important; }
  .photo-strip > div { aspect-ratio: 16/9; }
  .prices-grid { grid-template-columns: 1fr !important; }
  .hist-grid { grid-template-columns: 1fr !important; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .prog-detail { grid-template-columns: 1fr !important; }
  .map-grid { grid-template-columns: 1fr !important; }
  .track-grid { grid-template-columns: 1fr !important; }
  .press-grid { grid-template-columns: 1fr !important; }
  .infos-grid { grid-template-columns: 1fr !important; }
  .contact-grid { grid-template-columns: 1fr !important; }
  .packs-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .why-grid { grid-template-columns: 1fr !important; }
  .quick-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 540px) {
  .facts-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .packs-grid { grid-template-columns: 1fr !important; }
  .quick-grid { grid-template-columns: 1fr !important; }
}

/* ===== MOBILE FINITION (téléphone) ===== */
/* Bloc intro accueil : 2 colonnes de texte -> 1 */
@media (max-width: 700px) {
  .two-col { grid-template-columns: 1fr !important; gap: 20px !important; }
}

@media (max-width: 600px) {
  /* Titres de section : ne plus forcer 280px de large */
  .section-head h2 { min-width: 0; }
  /* Timeline programme : colonne heure plus étroite (inline -> !important) */
  .prog-timeline-row { grid-template-columns: 64px 1fr !important; gap: 12px !important; }
  /* Lignes Infos pratiques : libellé au-dessus de la valeur */
  .info-row { grid-template-columns: 1fr !important; gap: 2px !important; }
  /* Recherche inscrits : pleine largeur, ne déborde plus */
  .inscrits-search { width: 100% !important; min-width: 0 !important; }
  /* HUD tracking « Sélection » : recadré, sans débordement */
  .track-hud {
    min-width: 0 !important;
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    padding: 10px !important;
  }
}

/* Très petits écrans : resserrer paddings denses + tableaux */
@media (max-width: 400px) {
  .card { padding: 20px !important; }
  .t-table th, .t-table td { padding: 8px 10px; }
}

/* ===== SCROLL BEHAVIOR ===== */
html { scroll-behavior: smooth; }

::selection { background: var(--accent); color: #fff; }

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 32, 0.96);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox img {
  max-height: 90vh;
  max-width: 90vw;
  object-fit: contain;
  border-radius: var(--r-sm);
}
.lightbox-close {
  position: absolute;
  top: 24px; right: 24px;
  color: #fff;
  font-size: 28px;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 32px;
  width: 56px; height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  transition: background 0.2s;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.1); }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

/* ===== TICKER (marquee) ===== */
.ticker {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  background: var(--ink);
  color: var(--paper);
}
.ticker-track {
  display: flex;
  align-items: center;
  gap: 48px;
  white-space: nowrap;
  animation: ticker 45s linear infinite;
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ticker-track > span { display: inline-flex; align-items: center; gap: 12px; line-height: 1; }
.ticker-track .ticker-star { display: inline-flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; transform: translateY(-1px); }
.ticker-track .ticker-text { display: inline-flex; align-items: center; line-height: 1; }
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ===== LEAFLET MARKERS (carte plan d'eau) ===== */
.da-marker { background: transparent !important; border: 0 !important; }
.da-marker .da-marker-wrap { position: relative; width: 32px; height: 32px; }
.da-marker .da-marker-pin {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  border: 3px solid #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, background 0.2s ease;
  cursor: pointer;
}
.da-marker:hover .da-marker-pin { transform: scale(1.15); }
.da-marker.active .da-marker-pin { background: var(--accent); }
.da-marker .da-marker-label {
  position: absolute;
  top: 38px; left: 50%; transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.92);
  padding: 3px 8px;
  border-radius: 3px;
  color: var(--ink);
  border: 1px solid var(--line);
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.da-marker.active .da-marker-label {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.leaflet-container { font-family: var(--f-mono); font-size: 11px; }

/* ===== FOOTER ===== */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding: 80px 0 32px;
  margin-top: 80px;
}
.footer .grid {
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
@media (max-width: 880px) {
  .footer .grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 520px) {
  .footer .grid { grid-template-columns: 1fr; }
}
.footer h4 {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 16px;
  color: rgba(245, 243, 236, 0.5);
  font-weight: 500;
}
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer a { transition: opacity 0.2s; cursor: pointer; }
.footer a:hover { opacity: 0.6; }
.footer-bottom {
  border-top: 1px solid rgba(245, 243, 236, 0.15);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 243, 236, 0.5);
}
