/*
 * responsive.css — Safari Immersif
 * Référentiel : WCAG 2.1 AA · Apple HIG · Material Design 3
 * Breakpoints : 375 (small phone) · 480 · 768 (tablet) · 1024 (small desktop) · 1280
 * Approche : mobile-first overrides + fluid typography + accessible touch targets
 */

/* ═══════════════════════════════════════════════════════════
   0. TOKENS & RESET COMPLÉMENTAIRE
═══════════════════════════════════════════════════════════ */

:root {
  /* Spacing system 4pt (multiples de 4) */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;

  /* Layout */
  --container: 1200px;
  --gutter-desktop: 48px;
  --gutter-tablet:  24px;
  --gutter-mobile:  20px;

  /* Touch targets (Apple HIG: 44px min) */
  --touch-min: 44px;

  /* Radius */
  --r-sm: 2px;
  --r-md: 4px;

  /* Transitions */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --dur-fast: .18s;
  --dur-base: .28s;
  --dur-slow: .45s;
}

/* Meilleure box-sizing base */
*, *::before, *::after { box-sizing: border-box; }

/* Empêcher le débordement horizontal global */
html { overflow-x: hidden; }
body { overflow-x: hidden; }

/* Accessibilité focus */
:focus-visible {
  outline: 2px solid var(--or, #C4880E);
  outline-offset: 3px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* Smooth scroll respectueux du mouvement réduit */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Images fluides par défaut */
img { max-width: 100%; height: auto; display: block; }

/* ═══════════════════════════════════════════════════════════
   1. CONTENEUR FLUIDE
═══════════════════════════════════════════════════════════ */

.wrap,
.container,
[style*="max-width:1200px"] {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter-desktop);
}

@media (max-width: 1024px) {
  .wrap,
  .container,
  [style*="max-width:1200px"] {
    padding-inline: var(--gutter-tablet);
  }
}

@media (max-width: 480px) {
  .wrap,
  .container,
  [style*="max-width:1200px"] {
    padding-inline: var(--gutter-mobile);
  }
}

/* ═══════════════════════════════════════════════════════════
   2. HEADER & NAVIGATION
═══════════════════════════════════════════════════════════ */

header {
  padding-inline: var(--gutter-desktop);
  height: 80px;
}

/* Hamburger button (caché par défaut sur desktop) */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: var(--touch-min);
  height: var(--touch-min);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-right: -8px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--laterite, #A07850);
  transition: transform var(--dur-base) var(--ease-out),
              opacity var(--dur-fast);
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Menu mobile overlay */
.nav-mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(247,241,232,.98);
  backdrop-filter: blur(12px);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-6);
}

.nav-mobile-menu.open { display: flex; }

.nav-mobile-menu a {
  font-size: 1.1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ebene, #2D1E10);
  text-decoration: none;
  font-weight: 300;
  padding: var(--sp-3) var(--sp-6);
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
}

.nav-mobile-menu a:hover { color: var(--argile, #C13A10); }

.nav-mobile-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: var(--touch-min);
  height: var(--touch-min);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  color: var(--laterite, #A07850);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1024px) {
  header { padding-inline: var(--gutter-tablet); height: 70px; }
  nav a:not(.nav-cta) { display: none; }
  .nav-hamburger { display: flex; }
}

@media (max-width: 480px) {
  header { padding-inline: var(--gutter-mobile); height: 60px; }
  .logo-block img { height: 42px !important; }
}

/* ═══════════════════════════════════════════════════════════
   3. HERO & BANDEAUX
═══════════════════════════════════════════════════════════ */

.hero,
.page-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero        { height: clamp(360px, 56vh, 780px); }
.page-hero   { height: clamp(320px, 52vh, 680px); }

/* Hero index : plus grand */
.hero-full   { height: clamp(460px, 68vh, 900px); }

.hero-bg {
  position: absolute;
  inset: 0;
  background: #1a1a18;
  background-size: cover;
  background-position: center;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Filtre neutre universel */
.hero-bg::before,
.page-hero .hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.68) 0%,
    rgba(0,0,0,.22) 55%,
    rgba(0,0,0,.08) 100%
  );
}

.hero-content,
.page-hero .hero-content {
  position: relative;
  z-index: 2;
  padding: 0 var(--gutter-desktop) clamp(32px, 5vw, 72px);
  max-width: 900px;
}

@media (max-width: 1024px) {
  .hero-content,
  .page-hero .hero-content { padding-inline: var(--gutter-tablet); }
}

@media (max-width: 768px) {
  .hero        { height: clamp(300px, 50vh, 480px); }
  .page-hero   { height: clamp(260px, 44vh, 400px); }
  .hero-content,
  .page-hero .hero-content {
    padding: 0 var(--gutter-mobile) clamp(24px, 4vh, 48px);
  }
}

@media (max-width: 480px) {
  .hero        { height: clamp(280px, 48vh, 420px); }
  .page-hero   { height: clamp(240px, 40vh, 360px); }
}

/* ═══════════════════════════════════════════════════════════
   4. TYPOGRAPHIE FLUIDE
═══════════════════════════════════════════════════════════ */

/* Titres h1 */
h1,
.hero h1,
.page-hero h1 {
  font-size: clamp(2rem, 5vw + 0.5rem, 5rem);
  line-height: 1.05;
}

/* Titres h2 sections */
h2,
.section-h2,
.titre {
  font-size: clamp(1.6rem, 3vw + 0.4rem, 3rem);
  line-height: 1.15;
}

/* Corps de texte */
body { font-size: clamp(14px, 1.5vw, 16px); line-height: 1.8; }

/* Empêcher le zoom forcé iOS sur les inputs */
input, textarea, select {
  font-size: max(16px, 1em);
}

/* Labels uppercase — taille fixe OK car très petits */
.eyebrow,
.section-label,
.label,
.hero-eyebrow {
  font-size: clamp(9px, 1.5vw, 11px);
  letter-spacing: clamp(2px, 0.4vw, 4px);
}

/* ═══════════════════════════════════════════════════════════
   5. SECTIONS & ESPACEMENT
═══════════════════════════════════════════════════════════ */

/* Padding sections fluide */
.section,
.botswana,
.testimonials,
.newsletter,
section[class*="section"] {
  padding-block: clamp(56px, 8vw, 120px);
}

@media (max-width: 1024px) {
  .section,
  .botswana,
  .testimonials,
  .newsletter,
  section[class*="section"] {
    padding-inline: var(--gutter-tablet);
  }
}

@media (max-width: 480px) {
  .section,
  .botswana,
  .testimonials,
  .newsletter,
  section[class*="section"] {
    padding-block: clamp(40px, 6vw, 72px);
    padding-inline: var(--gutter-mobile);
  }
}

/* ═══════════════════════════════════════════════════════════
   6. GRILLES RESPONSIVES
═══════════════════════════════════════════════════════════ */

/* Grille 3 colonnes → 1 col mobile */
.safari-grid,
.banner-inner,
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

/* Grille 2 colonnes */
.botswana-grid,
.newsletter-inner,
.pricing-grid,
.camp-split-grid,
.open-split,
.double-grid,
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

/* Footer 4 colonnes */
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-12);
}

/* Responsive grilles */
@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8);
  }
}

@media (max-width: 768px) {
  .safari-grid,
  .banner-inner,
  .testimonial-grid {
    grid-template-columns: 1fr;
  }

  .botswana-grid,
  .newsletter-inner,
  .pricing-grid,
  .camp-split-grid,
  .open-split,
  .double-grid,
  .intro-grid {
    grid-template-columns: 1fr;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8);
  }

  /* Itinéraire */
  .itinerary-step {
    grid-template-columns: 80px 1fr;
  }

  /* Pricing */
  .pricing-grid { gap: 2px; }

  /* Prog body */
  .prog-body {
    grid-template-columns: 1fr !important;
  }
  .prog-vignette {
    width: 100% !important;
    height: 180px !important;
  }
}

@media (max-width: 480px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }

  .itinerary-step {
    grid-template-columns: 64px 1fr;
  }

  /* Banner 1 col */
  .banner-inner { grid-template-columns: 1fr; }

  /* Safari cards full width */
  .safari-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   7. COMPOSANTS SPÉCIFIQUES
═══════════════════════════════════════════════════════════ */

/* ── Cartes safari ── */
.safari-card-img,
.s-card-photo {
  height: clamp(180px, 25vw, 320px);
}

@media (max-width: 768px) {
  .safari-card-img,
  .s-card-photo {
    height: clamp(200px, 45vw, 300px);
  }
}

/* ── Camp split photo ── */
.camp-split-photo,
.open-photo {
  min-height: clamp(280px, 45vw, 560px);
}

.camp-split-photo-placeholder,
.open-photo-placeholder {
  min-height: clamp(280px, 45vw, 560px);
}

@media (max-width: 768px) {
  .camp-split-text  { padding: var(--sp-10) var(--gutter-mobile); }
  .open-text        { padding: var(--sp-10) var(--gutter-mobile); }
}

/* ── Slider camp ── */
@media (max-width: 768px) {
  .camp-slider-item {
    width: clamp(180px, 60vw, 260px);
    height: clamp(130px, 35vw, 180px);
  }
}

/* ── Banner ── */
.banner { padding-block: clamp(32px, 5vw, 72px); }

.banner-item { padding: clamp(20px, 3vw, 40px); }

/* ── Boutons & CTA — touch targets ── */
.btn,
.nav-cta,
.cta,
button,
[role="button"] {
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Liens nav desktop — touch target */
nav a {
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
}

/* ── Footer ── */
footer { padding: clamp(40px, 6vw, 80px) var(--gutter-desktop); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

@media (max-width: 1024px) {
  footer { padding-inline: var(--gutter-tablet); }
}

@media (max-width: 480px) {
  footer { padding-inline: var(--gutter-mobile); }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  .footer-contact-link { min-height: var(--touch-min); }
}

/* ── Formulaires ── */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  width: 100%;
  min-height: var(--touch-min);
  padding: var(--sp-3) var(--sp-4);
  font-size: max(16px, 1em); /* empêche zoom iOS */
  border-radius: var(--r-sm);
}

/* ── Contenus légaux ── */
.main-wrap,
.legal-wrap {
  padding-inline: clamp(var(--gutter-mobile), 5vw, var(--gutter-desktop));
  padding-block: clamp(40px, 6vw, 80px);
}

/* ── Page hero hero-back ── */
.hero-back,
.back-to-safaris {
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
}

/* ═══════════════════════════════════════════════════════════
   8. SCROLL SNAPPING MOBILE (galeries, sliders)
═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Grilles qui deviennent scroll horizontal sur mobile */
  .safari-grid-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 2px;
    padding-bottom: var(--sp-4);
    scrollbar-width: none;
  }
  .safari-grid-scroll::-webkit-scrollbar { display: none; }
  .safari-grid-scroll > * {
    flex: 0 0 80vw;
    scroll-snap-align: start;
  }
}

/* ═══════════════════════════════════════════════════════════
   9. ACCESSIBILITÉ
═══════════════════════════════════════════════════════════ */

/* Skip to content */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  z-index: 9999;
  background: var(--argile, #C13A10);
  color: #fff;
  padding: var(--sp-3) var(--sp-5);
  font-size: 14px;
  text-decoration: none;
  border-radius: var(--r-md);
}
.skip-link:focus { top: var(--sp-4); }

/* Réduction de mouvement */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .camp-slider-track {
    animation: none !important;
  }
}

/* Contraste renforcé */
@media (forced-colors: active) {
  .hero-bg::before,
  .page-hero .hero-bg::before { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   10. PRINT
═══════════════════════════════════════════════════════════ */

@media print {
  header, footer, .hero-bg, nav, .scroll-hint,
  .camp-slider-wrap, .newsletter { display: none !important; }
  body { color: #000; background: #fff; }
  h1, h2 { color: #000; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 10px; }
}


/* ═══════════════════════════════════════════════════════════
   11. CORRECTIFS PAGES SPÉCIFIQUES
═══════════════════════════════════════════════════════════ */

/* ── Journal (05_journal-v2) ── */
@media (max-width: 768px) {
  .billet-featured {
    grid-template-columns: 1fr !important;
  }
  .billet-item {
    grid-template-columns: 1fr !important;
  }
  .billet-item-thumb {
    width: 100% !important;
    height: clamp(160px, 45vw, 220px) !important;
  }
}

/* ── Réservation (06_reserver) ── */
@media (max-width: 768px) {
  .form-section {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .form-card {
    padding: 28px 20px !important;
  }
  .field-row,
  .fields-row {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* ── Carnet (04_carnet-v2) ── */
@media (max-width: 768px) {
  .saisons-grid,
  .shop-grid {
    grid-template-columns: 1fr !important;
  }
  .galerie-photos {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  .galerie-photos {
    grid-template-columns: 1fr !important;
  }
}

/* ── Safari pages (grilles itinéraire) ── */
@media (max-width: 768px) {
  .prog-body {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .prog-vignette {
    width: 100% !important;
    height: clamp(180px, 45vw, 240px) !important;
  }
  .camp-split-grid {
    grid-template-columns: 1fr !important;
  }
  .open-split {
    grid-template-columns: 1fr !important;
  }
}

/* ── Footer colonnes ── */
@media (max-width: 480px) {
  .footer-top {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .footer-bottom {
    flex-direction: column !important;
    text-align: center !important;
    gap: 8px !important;
  }
}

/* ── Sections avec padding inline dur ── */
@media (max-width: 480px) {
  [style*="padding:100px 48px"],
  [style*="padding: 100px 48px"] {
    padding: 52px 20px !important;
  }
}

/* ── Texte légal/CGV ── */
@media (max-width: 768px) {
  .legal-content,
  .cgv-content,
  .main-content {
    padding-inline: var(--gutter-mobile) !important;
  }
  .legal-content h2,
  .cgv-content h2 {
    font-size: 1.4rem !important;
  }
}

/* ── Livre d'or & Témoignages ── */
@media (max-width: 768px) {
  .temoignages-grid,
  .avis-grid {
    grid-template-columns: 1fr !important;
  }
  .temoignage-card,
  .avis-card {
    padding: 24px 20px !important;
  }
}

/* ── Overflow horizontal — filet de sécurité global ── */
/* NE PAS mettre overflow-x:hidden sur section/.wrap : masque du contenu sur iOS */
main, article {
  max-width: 100%;
}

/* ── Images hero sur pages safari ── */
@media (max-width: 480px) {
  .page-hero {
    height: clamp(220px, 42vw, 320px) !important;
  }
  .hero {
    height: clamp(260px, 50vw, 380px) !important;
  }
}

/* ── Boutons pleine largeur sur mobile ── */
@media (max-width: 480px) {
  .btn-primary,
  .btn-secondary {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .hero-content .btn-primary {
    width: auto;
  }
}

/* ── Nav hamburger — affichage correct ── */
@media (min-width: 1025px) {
  .nav-hamburger {
    display: none !important;
  }
  .nav-mobile-menu {
    display: none !important;
  }
}
