@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=Inter:wght@400;500;600&display=swap');
@import './tokens.css';

/* --- RESET TECHNIQUE ET FONDATIONS --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  transition: background-color var(--duration-reveal) var(--transition-bezier),
              color var(--duration-reveal) var(--transition-bezier);
  overflow-x: hidden;
}

/* Règle anti-défilement horizontal et discipline visuelle */
main, section, article, h1, h2, h3, p, label, button, a {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-hover) var(--transition-bezier),
              border-color var(--duration-hover) var(--transition-bezier);
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
}

button {
  cursor: pointer;
}

/* Accessibilité : Focus visible précis sans distraction */
:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
}

/* Typographie en chiffres tabulaires */
.tabular-nums, .price-display, .metric-number, time, .date-display {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* --- STRUCTURE ET GRILLE 12 COLONNES --- */
.site-container {
  width: 100%;
  max-width: var(--max-content-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--page-margin-desktop);
  padding-right: var(--page-margin-desktop);
}

@media (max-width: 768px) {
  .site-container {
    padding-left: var(--page-margin-mobile);
    padding-right: var(--page-margin-mobile);
  }
}

.section-spacing {
  padding-top: var(--section-spacing-desktop);
  padding-bottom: var(--section-spacing-desktop);
}

@media (max-width: 768px) {
  .section-spacing {
    padding-top: var(--section-spacing-mobile);
    padding-bottom: var(--section-spacing-mobile);
  }
}

/* --- TYPOGRAPHIE RIGUREUSE --- */
h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-tight);
  text-wrap: balance;
  color: var(--text-primary);
}

.font-italic {
  font-family: var(--font-display);
  font-style: italic;
}

.font-handwriting {
  font-family: var(--font-signature);
  font-weight: 500;
}

.text-hero {
  font-size: var(--text-hero);
  line-height: 1.08;
  letter-spacing: var(--tracking-tight);
}

.text-section {
  font-size: var(--text-section);
  line-height: 1.15;
  letter-spacing: var(--tracking-tight);
}

.text-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-subtitle);
  color: var(--text-secondary);
  line-height: var(--leading-snug);
}

.text-small {
  font-size: var(--text-small);
  line-height: var(--leading-normal);
}

.text-label {
  font-size: var(--text-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-spaced);
}

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

.text-secondary {
  color: var(--text-secondary);
}

/* Exergues littéraires */
.literary-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--color-blanc-kaolin);
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-gold);
  border-bottom: 1px solid var(--border-gold);
  margin: 2.5rem 0;
}

[data-theme="light"] .literary-quote {
  color: var(--color-noir-profond);
}

/* --- HAUT DE PAGE & NAVIGATION STRICTE (TOP BAR CONTRACT) --- */
.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-default);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  gap: 2rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-link img, .brand-link svg {
  height: 40px;
  width: auto;
  min-width: 120px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  list-style: none;
}

.nav-link {
  font-size: var(--text-small);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  color: var(--text-secondary);
  white-space: nowrap;
  position: relative;
  padding-bottom: 4px;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--accent-gold);
}

/* Menu mobile déclencheur discret */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-default);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: var(--text-label);
  letter-spacing: var(--tracking-spaced);
}

@media (max-width: 860px) {
  .header-inner {
    height: 64px;
  }
  .mobile-nav-toggle {
    display: block;
  }
  .nav-menu {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-default);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem var(--page-margin-mobile);
    gap: 1.25rem;
    transform: translateY(-120%);
    transition: transform var(--duration-reveal) var(--transition-bezier);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    z-index: 40;
  }
  .nav-menu.open {
    transform: translateY(0);
  }
  .nav-link {
    font-size: 1rem;
    width: 100%;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
  }
}

/* --- BOUTONS ET CONTRÔLES ÉDITORIAUX RECTANGULAIRES --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  font-size: var(--text-small);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-xs);
  transition: all var(--duration-hover) var(--transition-bezier);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border: 1px solid var(--text-primary);
}

.btn-primary:hover {
  background-color: transparent;
  color: var(--text-primary);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-outline:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.btn-gold {
  background-color: var(--color-or-precieux);
  color: var(--color-noir-profond);
  border: 1px solid var(--color-or-precieux);
  font-weight: 600;
}

.btn-gold:hover {
  background-color: transparent;
  color: var(--color-or-precieux);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--text-label);
}

/* Filtres horizontaux rectangulaires sobres */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border-default);
  padding-bottom: 1rem;
}

.filter-btn {
  padding: 0.45rem 1rem;
  font-size: var(--text-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-spaced);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  background: transparent;
  transition: all var(--duration-hover) var(--transition-bezier);
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-gold);
}

.filter-btn.active {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

/* --- SÉPARATEURS ET ORNEMENTS DE CRAFT CULTUREL --- */
.hairline-divider {
  width: 100%;
  height: 1px;
  background-color: var(--border-default);
  margin: 0;
}

.gold-divider {
  width: 100%;
  height: 1px;
  background-color: var(--border-gold);
  margin: 0;
}

/* Micro-boucle du 'a' en SVG filaire réutilisable */
.ayinu-loop-mark {
  display: inline-block;
  width: 20px;
  height: 20px;
  vertical-align: middle;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

/* --- CADRES D'IMAGES AVEC PROTECTION 4:5 / 16:9 / 1:1 --- */
.aspect-portrait {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  position: relative;
}

.aspect-landscape {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  position: relative;
}

.aspect-square {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  position: relative;
}

.aspect-portrait img, .aspect-landscape img, .aspect-square img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-reveal) var(--transition-bezier);
}

.aspect-portrait:hover img, .aspect-landscape:hover img, .aspect-square:hover img {
  transform: scale(1.02);
}

/* --- TABLEAUX ÉDITORIAUX SOBRES --- */
.editorial-table {
  width: 100%;
  border-collapse: collapse;
}

.editorial-table th, .editorial-table td {
  padding: 1.25rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-default);
  vertical-align: baseline;
}

.editorial-table th {
  font-size: var(--text-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-spaced);
  color: var(--text-muted);
}

.editorial-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* --- FORMULAIRES MINIMALISTES RÉACTIFS (MAX 5 CHAMPS) --- */
.form-group {
  margin-bottom: 1.75rem;
}

.form-label {
  display: block;
  font-size: var(--text-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-spaced);
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-body);
  transition: border-color var(--duration-hover) var(--transition-bezier);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent-gold);
  background-color: var(--bg-surface-elevated);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* --- PIED DE PAGE AUTHENTIQUE --- */
.site-footer {
  border-top: 1px solid var(--border-default);
  padding: 4.5rem 0 3rem;
  background-color: var(--bg-primary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .footer-links {
    gap: 0;
  }
  .footer-links li {
    margin-bottom: 16px;
  }
  .footer-links li:last-child {
    margin-bottom: 0;
  }
}

.footer-title {
  font-size: var(--text-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-spaced);
  color: var(--accent-gold);
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  font-size: var(--text-small);
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 2rem;
  font-size: var(--text-small);
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

/* Interrupteur de thème discret en pied de page */
.theme-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-spaced);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-xs);
  background: transparent;
}

.theme-switch-btn:hover {
  border-color: var(--accent-gold);
  color: var(--text-primary);
}

/* =============================================
   PATCH MOBILE, 23/10/2026, Claude Opus 4.7
   Objet : corriger les débordements horizontaux
   constatés sur viewport ≤ 480px.
   Ne pas déplacer ailleurs dans le fichier,
   ce bloc doit rester en fin pour écraser les
   déclarations plus tôt.
   ============================================= */

html, body {
  overflow-x: hidden;

/* =============================================
   PATCH MOBILE v2, 23/10/2026, Claude Opus 4.7
   Objet : corriger les débordements horizontaux
   sur viewport ≤ 480px. Les styles inline des
   pages écrasent les variables, donc on force
   avec !important là où nécessaire.
   ============================================= */

html, body {
  overflow-x: hidden;
}

@media (max-width: 480px) {
  /* Titres : plus petits, s'autorisent à casser. */
  .hero-headline,
  h1, h2.text-section, h1.text-hero {
    font-size: clamp(1.7rem, 7.5vw, 2.3rem) !important;
    max-width: 100% !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    hyphens: auto !important;
    -webkit-hyphens: auto !important;
    text-wrap: wrap !important;
  }

  /* Paragraphes : plus de max-width en caractères. */
  .hero-description,
  p[style*="72ch"],
  p[style*="62ch"],
  p[style*="60ch"] {
    max-width: 100% !important;
  }

  /* Tous les paragraphes et spans se brisent. */
  p, span, a, li, strong, time, label, td, th {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  /* Barre méta : colonne. */
  .exp-meta-strip {
    flex-direction: column !important;
    gap: 1.25rem !important;
  }

  /* Le Pouls : 1 colonne. */
  .pouls-item {
    grid-template-columns: 1fr !important;
    gap: 0.35rem !important;
  }

  /* Boutons : peuvent se briser. */
  .btn {
    white-space: normal !important;
  }

  .theme-switch-btn {
    white-space: normal !important;
    text-align: center;
  }

  /* Pied de page. */
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 48px !important;
  }
  .footer-links { gap: 0 !important; }
  .footer-links li { margin-bottom: 16px; }

  /* Image en entête Expérience. */
  .featured-exp-img-wrap {
    height: 220px !important;
  }

  /* Tableaux. */
  table.editorial-table,
  .editorial-table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Logo barre : taille mobile. */
  .brand-link img,
  .brand-link svg {
    height: 32px !important;
    min-width: 0 !important;
  }
}

/* Patch secondaire pour tablette large (≤ 768px) : la grille
   Date / Lieu / Accès / Capacité qui est en 2 colonnes
   repasse en colonne unique. */
@media (max-width: 768px) {
  .exp-meta-strip {
    flex-direction: column !important;
  }
}
