/* ===== DESIGN TOKENS — Charte Saint-Gatien ===== */
:root, [data-theme="light"] {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem; --space-16: 4rem;

  /* Palette Saint-Gatien */
  --sg-deep-blue: #235a81;
  --sg-sea-blue: #0095c2;
  --sg-yellow: #ffcc00;
  --sg-orange: #ee7326;
  --sg-charcoal: #3c3c3c;
  --sg-grey: #706f6f;

  --color-bg: #fdf8f5;
  --color-surface: #ffffff;
  --color-surface-2: #fef2e8;
  --color-surface-offset: #fde8d4;
  --color-border: #f0c8a8;
  --color-text: #2a1a0d;
  --color-text-muted: #6b4a30;
  --color-text-faint: #c4966e;
  --color-primary: #ee7326;
  --color-primary-hover: #c75a18;
  --color-primary-highlight: #fdeede;
  --color-accent: #235a81;
  --color-accent-hover: #1a4562;
  --color-yellow: #ffcc00;
  --color-orange: #ee7326;

  --radius-sm: 0.375rem; --radius-md: 0.5rem;
  --radius-lg: 0.75rem; --radius-xl: 1rem; --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(238,115,38,0.08);
  --shadow-md: 0 4px 16px rgba(238,115,38,0.12);
  --shadow-lg: 0 12px 32px rgba(238,115,38,0.16);
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --font-body: 'Poppins', system-ui, sans-serif;
  --font-display: 'Outfit', system-ui, sans-serif;
}

[data-theme="dark"] {
  --color-bg: #0d1e2c;
  --color-surface: #132333;
  --color-surface-2: #1a2f42;
  --color-surface-offset: #1f3850;
  --color-border: #2a4a65;
  --color-text: #c8dae8;
  --color-text-muted: #7aa3bf;
  --color-text-faint: #3d6480;
  --color-primary: #f59050;
  --color-primary-hover: #f7a872;
  --color-primary-highlight: #3a2010;
  --color-accent: #4f98c8;
  --color-accent-hover: #6db3e0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0d1e2c; --color-surface: #132333; --color-surface-2: #1a2f42;
    --color-surface-offset: #1f3850; --color-border: #2a4a65;
    --color-text: #c8dae8; --color-text-muted: #7aa3bf; --color-text-faint: #3d6480;
    --color-primary: #f59050; --color-primary-hover: #f7a872;
    --color-primary-highlight: #3a2010;
    --color-accent: #4f98c8; --color-accent-hover: #6db3e0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3); --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
  }
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { min-height: 100dvh; font-family: var(--font-body); font-size: var(--text-base); color: var(--color-text); background: var(--color-bg); line-height: 1.6; }
img, svg { display: block; max-width: 100%; }
a, button { transition: color var(--transition), background var(--transition), border-color var(--transition); }
button { cursor: pointer; background: none; border: none; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.2; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ===== LAYOUT ===== */
.container { max-width: 1000px; margin: 0 auto; padding: 0 var(--space-6); }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 var(--space-6); }

/* ===== HEADER ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--sg-orange);
  border-bottom: 3px solid var(--sg-yellow);
  box-shadow: var(--shadow-md);
}
.header-inner {
  max-width: 1000px; margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  display: flex; align-items: center; gap: var(--space-3);
  text-decoration: none; color: white;
}
.logo-text { font-weight: 700; font-size: var(--text-base); font-family: var(--font-display); color: white; letter-spacing: -0.01em; }
.header-right { display: flex; align-items: center; gap: var(--space-4); }
.back-link {
  display: flex; align-items: center; gap: var(--space-2);
  color: rgba(255,255,255,0.85); text-decoration: none; font-size: var(--text-sm); font-weight: 500;
}
.back-link:hover { color: var(--sg-yellow); }
.theme-toggle {
  color: rgba(255,255,255,0.7); padding: var(--space-2); border-radius: var(--radius-md);
}
.theme-toggle:hover { color: var(--sg-yellow); background: rgba(255,255,255,0.1); }

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: var(--space-16) var(--space-6) var(--space-12);
  background: linear-gradient(160deg, #c75a18 0%, var(--sg-orange) 45%, #d96820 100%);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -80px; right: -80px;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,204,0,0.25) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; bottom: -60px; left: -60px;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-label {
  font-size: var(--text-sm); font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--sg-yellow); margin-bottom: var(--space-4);
  font-family: var(--font-display);
}
.hero h1 {
  font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700;
  color: white; margin-bottom: var(--space-4); line-height: 1.1;
}
.hero-sub {
  color: rgba(255,255,255,0.75); font-size: var(--text-base);
  max-width: 52ch; margin: 0 auto var(--space-8);
}
.search-box {
  position: relative; max-width: 560px; margin: 0 auto;
}
.search-icon {
  position: absolute; left: var(--space-4); top: 50%; transform: translateY(-50%);
  color: var(--color-text-faint); pointer-events: none;
}
#search {
  width: 100%; padding: var(--space-4) var(--space-4) var(--space-4) calc(var(--space-4) * 2.5 + 20px);
  font-size: var(--text-base); border: 2px solid var(--color-border);
  border-radius: var(--radius-xl); background: var(--color-surface);
  color: var(--color-text); outline: none;
  box-shadow: var(--shadow-md);
}
#search:focus { border-color: var(--color-primary); box-shadow: 0 0 0 4px var(--color-primary-highlight), var(--shadow-md); }
#search::placeholder { color: var(--color-text-faint); }

/* ===== CARDS ===== */
.results-section { padding: var(--space-10) var(--space-6); max-width: 1000px; margin: 0 auto; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-5); }
.card {
  display: flex; align-items: center; gap: var(--space-4);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-5);
  text-decoration: none; color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 5px; background: var(--card-accent, var(--sg-orange));
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--card-accent, var(--sg-orange)); }
.card-badge {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: var(--text-sm);
}
.card-body { flex: 1; min-width: 0; }
.card-name { font-weight: 700; font-size: var(--text-base); margin-bottom: var(--space-1); }
.card-spec { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-2); }
.card-loc { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-text-faint); }
.card-arrow { color: var(--color-text-faint); flex-shrink: 0; }
.card:hover .card-arrow { color: var(--card-accent); }
.no-results { text-align: center; color: var(--color-text-muted); padding: var(--space-10); }
.hidden { display: none !important; }

/* ===== INFO BANNER ===== */
.info-banner { margin: var(--space-6) auto var(--space-8); }
.info-banner--warning .info-inner {
  background: #fff7ed;
  border: 1.5px solid #ee7326;
  color: #7c3310;
}
.info-banner--warning .info-inner svg { color: #ee7326; }
.info-banner--warning .info-inner p { color: #7c3310; }
.info-banner--warning .info-inner strong { color: #c75a18; }
.info-inner {
  display: flex; align-items: flex-start; gap: var(--space-4);
  background: var(--color-primary-highlight); border: 1px solid var(--color-primary);
  border-radius: var(--radius-lg); padding: var(--space-5) var(--space-6);
  color: var(--color-primary);
}
.info-inner svg { flex-shrink: 0; margin-top: 2px; }
.info-inner p { font-size: var(--text-sm); color: var(--color-text); }
.info-inner strong { color: var(--color-primary); }

/* ===== MEDECIN PAGE ===== */
.medecin-hero {
  background: linear-gradient(160deg, #c75a18 0%, var(--sg-orange) 100%);
  padding: var(--space-10) 0 var(--space-8);
  border-bottom: 3px solid var(--sg-yellow);
  position: relative; overflow: hidden;
}
.medecin-hero::before {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,204,0,0.2) 0%, transparent 70%);
  pointer-events: none;
}
.medecin-badge {
  display: inline-block; color: white; font-weight: 700; font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-full);
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: var(--space-4);
}
.medecin-name {
  font-family: var(--font-display); font-size: var(--text-xl);
  color: var(--color-text); margin-bottom: var(--space-2);
}
.medecin-name span { color: var(--color-text-muted); font-size: 0.7em; font-family: var(--font-body); font-weight: 400; }
.medecin-spec { font-size: var(--text-lg); color: var(--color-text-muted); margin-bottom: var(--space-5); }
.medecin-meta { display: flex; flex-wrap: wrap; gap: var(--space-5); }
.medecin-meta span { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--color-text-muted); }

/* ===== MEDECIN BODY ===== */
.medecin-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-10);
  padding-top: var(--space-10); padding-bottom: var(--space-10);
}
@media (max-width: 700px) { .medecin-body { grid-template-columns: 1fr; } }

.section-title {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: var(--text-lg); font-weight: 600; color: var(--color-text);
  margin-bottom: var(--space-6);
}

/* ===== STEPS ===== */
.steps-list { list-style: none; display: flex; flex-direction: column; gap: var(--space-4); }
.step-item {
  display: grid; grid-template-columns: 32px 32px 1fr; align-items: start;
  gap: var(--space-3); padding: var(--space-4) var(--space-5);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.step-num {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: var(--text-sm); flex-shrink: 0;
  font-family: var(--font-display);
}
.step-icon { color: var(--color-text-muted); flex-shrink: 0; padding-top: 4px; }
.step-text { font-size: var(--text-sm); line-height: 1.6; color: var(--color-text); padding-top: 4px; }
.step-text strong { color: var(--color-text); }

/* ===== PLAN SVG ===== */
.plan-wrapper {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-4);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.floor-plan { width: 100%; height: auto; }
.zone-label { font-family: var(--font-body); font-size: 11px; font-weight: 700; fill: var(--color-text); }
.room-label { font-family: var(--font-body); font-size: 9px; fill: var(--color-text-muted); }
.dest-label { font-family: var(--font-body); font-size: 11px; font-weight: 700; fill: var(--route-color); }
.plan-caption { font-size: var(--text-xs); color: var(--color-text-faint); margin-top: var(--space-3); font-style: italic; }

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-6);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-faint);
}
