/* =========================================
   OSLADOUM — Design System (Direction C)
   Style : Magazine Éditorial
   ========================================= */

/* Polices */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Inter:wght@300;400;500;600;700&family=Noto+Naskh+Arabic:wght@400;600;700&display=swap');

:root {
  --black: #0A0A0A;
  --ink: #1A1A1A;
  --grey: #5A5A5A;
  --grey-light: #B8B8B8;
  --line: #EAEAEA;
  --off-white: #F8F6F1;
  --accent: #B8261C;
  --accent-dark: #8A1C15;
  --container: 1400px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-xxl: 5rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--ink);
  background: white;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
}
body[dir="rtl"] { font-family: 'Noto Naskh Arabic', serif; }
h1, h2, h3, h4 {
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
body[dir="rtl"] h1, body[dir="rtl"] h2, body[dir="rtl"] h3, body[dir="rtl"] h4 {
  font-family: 'Noto Naskh Arabic', serif;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- HEADER ---------- */
.top-header {
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 0;
}
.top-header-inner {
  max-width: var(--container); margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 0 3rem; gap: 1rem;
}
.header-left {
  display: flex; gap: 1.5rem; align-items: center;
  font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--grey);
}
.header-center { text-align: center; }
.logo-image { height: 52px; width: auto; display: block; margin: 0 auto; }
.logo-sub {
  font-size: 0.7rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--grey);
  margin-top: 0.6rem;
}
.header-right {
  display: flex; justify-content: flex-end;
  gap: 1rem; align-items: center;
}
.lang-switch { display: flex; gap: 0.25rem; }
.lang-switch button {
  background: none; border: none;
  font-family: inherit; font-size: 0.8rem;
  font-weight: 500; padding: 0.25rem 0.5rem;
  cursor: pointer; color: var(--grey);
  transition: color 0.2s;
}
.lang-switch button.active { color: var(--accent); font-weight: 600; }
.lang-switch button + button { border-left: 1px solid var(--line); }
.cta-button {
  background: var(--black); color: white;
  padding: 0.5rem 1rem; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.15em;
  font-weight: 600; border: none; cursor: pointer;
  font-family: inherit; transition: background 0.2s;
}
.cta-button:hover { background: var(--accent); }

/* ---------- NAV ---------- */
.main-nav {
  border-bottom: 1px solid var(--line);
  background: white;
  position: sticky; top: 0; z-index: 100;
}
.main-nav ul {
  max-width: var(--container); margin: 0 auto;
  list-style: none; display: flex; justify-content: center;
  gap: 3rem; padding: 1rem 3rem;
}
.main-nav a {
  font-size: 0.8rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--ink);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.main-nav a:hover { color: var(--accent); }
.main-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- HERO ---------- */
.hero {
  min-height: 80vh;
  background: linear-gradient(135deg, #2a2a2a 0%, #0a0a0a 100%);
  color: white;
  position: relative;
  display: flex; align-items: flex-end;
  padding: 4rem 3rem;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 50%, rgba(184, 38, 28, 0.25) 0%, transparent 60%);
  z-index: 1;
}
.hero-rams {
  position: absolute; right: 0; bottom: 0;
  height: 92%;           /* l'image se cale en hauteur sur la hero */
  width: auto;           /* la largeur s'adapte au ratio */
  max-width: 50%;        /* mais ne dépasse pas la moitié */
  max-height: 760px;     /* plafond absolu sur grands écrans */
  opacity: 0.92; pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5));
  object-fit: contain;
}
/* En arabe (RTL), on bascule l'image à gauche pour ne pas chevaucher le texte */
body[dir="rtl"] .hero-rams {
  right: auto;
  left: 0;
  transform: scaleX(-1);
}
/* En arabe, le contenu hero passe à droite (ordre inversé) */
body[dir="rtl"] .hero-left {
  margin-left: auto;
  text-align: right;
}
.hero-inner {
  position: relative; z-index: 2;
  max-width: var(--container); margin: 0 auto;
  width: 100%;
}
.hero-left { max-width: 680px; }
.hero-kicker {
  font-size: 0.8rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.3em;
  font-weight: 600; margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2.8rem, 6.5vw, 5.5rem);
  color: white; margin-bottom: 2rem;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-byline {
  display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--grey-light);
}
.hero-byline strong { color: white; font-weight: 500; }

/* Hero compact (pages intérieures) */
.hero-compact {
  min-height: auto;
  padding: 4rem 3rem 3rem;
}
.hero-compact h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }

/* ---------- SECTIONS ---------- */
section.content {
  padding: 5rem 3rem;
}
.content-inner {
  max-width: var(--container); margin: 0 auto;
}
.section-title {
  text-align: center; margin-bottom: 4rem;
}
.section-title h2 {
  font-size: clamp(2rem, 4vw, 3rem); color: var(--black);
  margin-bottom: 0.5rem;
}
.section-title-rule {
  width: 60px; height: 2px; background: var(--accent);
  margin: 1rem auto;
}
.section-title p {
  color: var(--grey); font-size: 1.05rem;
  max-width: 720px; margin: 0 auto;
}
.eyebrow {
  font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.25em; color: var(--accent);
  font-weight: 600;
}

/* ---------- FEATURED ARTICLES GRID ---------- */
.featured-header {
  display: flex; justify-content: space-between;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.5rem; margin-bottom: 3rem;
}
.featured-title { font-size: 2rem; color: var(--black); }
.featured-link {
  font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--grey);
}
.featured-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem;
}
.article { cursor: pointer; }
.article-image {
  background: linear-gradient(135deg, var(--off-white), #ddd);
  aspect-ratio: 4/3;
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.article-image img { width: 100%; height: 100%; object-fit: cover; }
.article-main .article-image { aspect-ratio: 16/10; }
.article-category {
  font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.25em; color: var(--accent);
  font-weight: 600; margin-bottom: 0.75rem;
  display: block;
}
.article-title {
  font-family: 'DM Serif Display', serif;
  color: var(--black); line-height: 1.15;
  margin-bottom: 0.75rem;
  transition: color 0.2s;
}
.article-main .article-title { font-size: 2.2rem; }
.article-side .article-title { font-size: 1.3rem; }
.article:hover .article-title { color: var(--accent); }
.article-excerpt { color: var(--grey); font-size: 0.95rem; margin-bottom: 1rem; }
.article-meta { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--grey-light); }

/* ---------- MANIFESTO / QUOTE ---------- */
.manifesto {
  background: var(--off-white);
  padding: 7rem 3rem;
}
.manifesto-inner { max-width: 900px; margin: 0 auto; text-align: center; }
.manifesto-mark {
  font-family: 'DM Serif Display', serif;
  font-size: 6rem; color: var(--accent);
  line-height: 0.5; margin-bottom: 2rem;
}
.manifesto blockquote {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--black); line-height: 1.3;
  margin-bottom: 2rem;
}
.manifesto blockquote em { color: var(--accent); font-style: italic; }
.manifesto-attribution {
  font-size: 0.85rem; color: var(--grey);
  text-transform: uppercase; letter-spacing: 0.2em;
}

/* ---------- NUMBERS ---------- */
.numbers {
  padding: 5rem 3rem;
  max-width: var(--container); margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border-top: 1px solid var(--line);
}
.number-item {
  padding: 2rem; text-align: center;
  border-right: 1px solid var(--line);
}
.number-item:last-child { border-right: none; }
.number-item strong {
  display: block;
  font-family: 'DM Serif Display', serif;
  font-size: 4rem; color: var(--black);
  line-height: 1; margin-bottom: 0.5rem;
}
.number-item span {
  font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--grey);
}

/* ---------- EPOCH (Musée) ---------- */
.epoch-list {
  display: flex; flex-direction: column;
  gap: 0;
}
.epoch {
  display: grid; grid-template-columns: 140px 1fr;
  gap: 3rem; padding: 4rem 0;
  border-bottom: 1px solid var(--line);
}
.epoch:last-child { border-bottom: none; }
.epoch-number {
  font-family: 'DM Serif Display', serif;
  font-size: 4rem; color: var(--accent);
  line-height: 1;
}
.epoch-period {
  font-size: 0.8rem; color: var(--grey);
  text-transform: uppercase; letter-spacing: 0.15em;
  margin-top: 1rem;
}
.epoch-body h3 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--black); margin-bottom: 0.5rem;
}
.epoch-subtitle {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem; color: var(--grey);
  font-style: italic; margin-bottom: 2rem;
}
.epoch-content { font-size: 1.05rem; line-height: 1.8; color: var(--ink); }
.epoch-content p { margin-bottom: 1.25rem; }

/* ----- Surlignage des precurseurs (Option A) ----- */
.precurseur-name {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.precurseur-sujet {
  color: var(--ink);
  font-weight: 600;
  font-style: italic;
  border-bottom: 1px dotted var(--accent);
  white-space: nowrap;
}

/* ----- Frise generationnelle (Option C) ----- */
.generations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 3rem 0 2.5rem;
  padding-top: 18px; /* place pour les medaillons qui debordent */
  position: relative;
}
.generations-grid::before {
  content: '';
  position: absolute;
  top: 0; left: 16%; right: 16%;
  height: 1px;
  border-top: 1px dashed var(--accent);
  z-index: 0;
}
.generation-card {
  position: relative;
  background: white;
  border: 1px solid var(--line);
  padding: 1.75rem 1.5rem;
  z-index: 1;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.generation-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}
.generation-num {
  position: absolute;
  top: -18px; left: 50%;
  transform: translateX(-50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
}
.generation-period {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey);
  text-align: center;
  margin-top: 0.75rem;
  margin-bottom: 0.6rem;
}
.generation-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.55rem;
  text-align: center;
  color: var(--ink);
  margin-bottom: 0.85rem;
  line-height: 1.2;
}
.generation-desc {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--grey);
  text-align: center;
  font-style: italic;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.generation-members {
  list-style: none;
  padding: 0; margin: 0;
}
.generation-members li {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem;
  text-align: center;
  padding: 0.45rem 0;
  color: var(--ink);
}
.generation-members li + li {
  border-top: 1px solid #f0eee8;
}
@media (max-width: 900px) {
  .generations-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-top: 0;
  }
  .generations-grid::before {
    top: 18px; bottom: 18px; left: 50%; right: auto;
    width: 1px; height: auto;
    border-top: none; border-left: 1px dashed var(--accent);
  }
}
.epoch-quote {
  border-left: 3px solid var(--accent);
  padding: 1.5rem 2rem; margin: 2.5rem 0;
  background: var(--off-white);
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem; color: var(--ink);
  font-style: italic;
}
body[dir="rtl"] .epoch-quote { border-left: none; border-right: 3px solid var(--accent); }
.epoch-quote-source {
  display: block;
  font-family: 'Inter', sans-serif; font-style: normal;
  font-size: 0.85rem; color: var(--grey);
  text-transform: uppercase; letter-spacing: 0.15em;
  margin-top: 1rem;
}
.epoch-facts {
  margin: 2rem 0; padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.epoch-facts h4 {
  font-family: 'Inter', sans-serif; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--accent); margin-bottom: 1rem; font-weight: 600;
}
.epoch-facts ul {
  list-style: none; padding: 0;
}
.epoch-facts li {
  padding: 0.4rem 0 0.4rem 1.5rem;
  position: relative;
  font-size: 0.95rem;
}
.epoch-facts li::before {
  content: '·'; position: absolute; left: 0.3rem;
  font-weight: 700; color: var(--accent); font-size: 1.5rem;
  line-height: 1;
}
body[dir="rtl"] .epoch-facts li { padding: 0.4rem 1.5rem 0.4rem 0; }
body[dir="rtl"] .epoch-facts li::before { left: auto; right: 0.3rem; }
.epoch-sources {
  font-size: 0.8rem; color: var(--grey-light);
  margin-top: 2rem;
}
.epoch-sources strong {
  display: block; margin-bottom: 0.5rem;
  text-transform: uppercase; letter-spacing: 0.15em;
  font-size: 0.75rem; color: var(--grey);
}

/* ---------- PANTHÉON ---------- */
.pantheon-region {
  margin-bottom: 4rem;
}
.pantheon-region-title {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem; color: var(--black);
  padding-bottom: 1rem; margin-bottom: 2.5rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.pantheon-group {
  margin-bottom: 2.5rem;
}
.pantheon-group-label {
  font-size: 0.75rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.25em;
  font-weight: 600; margin-bottom: 1rem;
}
.pantheon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.pantheon-item {
  background: white;
  padding: 1.25rem;
  display: flex; flex-direction: column;
  gap: 0.25rem;
  transition: background 0.2s;
}
.pantheon-item:hover { background: var(--off-white); }
.pantheon-item-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem; color: var(--black);
  display: flex; align-items: center; gap: 0.4rem;
  line-height: 1.2;
}
.pantheon-item-note {
  font-size: 0.8rem; color: var(--grey); font-style: italic;
}
.pantheon-item-icon {
  font-size: 0.9rem;
}
/* Pionnier spécial */
.pantheon-item.pionnier {
  background: linear-gradient(135deg, var(--black) 0%, #2a2a2a 100%);
  color: white;
  padding: 2rem;
}
.pantheon-item.pionnier .pantheon-item-name {
  color: white;
  font-size: 1.6rem;
}
.pantheon-item.pionnier::before {
  content: '★';
  color: var(--accent);
  font-size: 2rem;
  line-height: 1;
}

/* ---------- CARACTÉRISTIQUES ---------- */
.caract-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.caract-item {
  background: white; padding: 2rem;
  transition: background 0.2s;
}
.caract-item:hover { background: var(--off-white); }
.caract-icon {
  font-size: 1.8rem; margin-bottom: 0.75rem;
}
.caract-item h4 {
  font-size: 1.3rem; color: var(--black);
  margin-bottom: 0.5rem;
}
.caract-item p {
  font-size: 0.95rem; color: var(--grey);
  line-height: 1.7;
}

/* ---------- CHAMPIONS ---------- */
.champions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}
.champion-card {
  padding: 2rem;
  border: 1px solid var(--line);
  background: white;
  transition: all 0.2s;
  position: relative;
}
.champion-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.06);
}
.champion-year {
  font-size: 0.75rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.2em;
  font-weight: 600; margin-bottom: 0.5rem;
}
.champion-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.8rem; color: var(--black);
  margin-bottom: 0.25rem;
}
.champion-owner {
  font-size: 0.9rem; color: var(--grey);
  margin-bottom: 1rem;
  font-style: italic;
}
.champion-desc {
  font-size: 0.95rem; color: var(--ink);
  line-height: 1.7;
}
.champion-legend-badge {
  position: absolute; top: 1rem; right: 1rem;
  background: var(--accent); color: white;
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.15em; font-weight: 600;
}
body[dir="rtl"] .champion-legend-badge { right: auto; left: 1rem; }

/* ---------- TIMELINE (Évolution de la sélection) ---------- */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 140px;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--line);
}
body[dir="rtl"] .timeline::before { left: auto; right: 140px; }
.timeline-item {
  position: relative;
  padding: 1.5rem 0 1.5rem 180px;
  min-height: 80px;
}
body[dir="rtl"] .timeline-item { padding: 1.5rem 180px 1.5rem 0; }
.timeline-year {
  position: absolute;
  left: 0;
  top: 1.5rem;
  width: 110px;
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  color: var(--accent);
  text-align: right;
  line-height: 1;
}
body[dir="rtl"] .timeline-year { left: auto; right: 0; text-align: left; }
.timeline-year.empty { font-size: 1rem; font-style: italic; color: var(--grey-light); padding-top: 0.5rem; }
.timeline-dot {
  position: absolute;
  left: 133px;
  top: 2rem;
  width: 16px; height: 16px;
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 0 0 1px var(--line);
}
body[dir="rtl"] .timeline-dot { left: auto; right: 133px; }
.timeline-body h3 {
  font-size: 1.4rem;
  color: var(--black);
  margin-bottom: 0.5rem;
}
.timeline-body p { color: var(--grey); line-height: 1.7; }

/* ---------- COEFFICIENTS BARS ---------- */
.coef-group { margin-bottom: 3rem; }
.coef-group h3 {
  font-size: 1.3rem;
  color: var(--black);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline;
}
.coef-group h3 small {
  font-family: 'Inter', sans-serif;
  font-weight: 400; font-size: 0.8rem;
  color: var(--grey); text-transform: uppercase;
  letter-spacing: 0.15em;
}
.coef-bars {
  display: flex; flex-direction: column; gap: 1rem;
}
.coef-bar {
  display: grid;
  grid-template-columns: 1.2fr 2fr 70px;
  gap: 1.5rem;
  align-items: center;
}
.coef-bar-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}
.coef-bar-track {
  background: var(--line);
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
}
.coef-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  border-radius: 5px;
  transition: width 0.6s ease-out;
}
body[dir="rtl"] .coef-bar-fill {
  background: linear-gradient(270deg, var(--accent-dark), var(--accent));
}
.coef-bar-value {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem;
  color: var(--accent);
  text-align: right;
}
body[dir="rtl"] .coef-bar-value { text-align: left; }

/* Options femelles */
.femelle-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}
.femelle-option {
  border: 1px solid var(--line);
  padding: 1.5rem;
}
.femelle-option h4 {
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--grey); font-weight: 600;
  margin-bottom: 1rem;
}

/* ---------- RECORDS CARDS ---------- */
.records-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--line);
  border: 1px solid var(--line);
}
.record-card {
  background: white;
  padding: 2.5rem 1.5rem;
  text-align: center;
  transition: background 0.2s;
}
.record-card:hover { background: var(--off-white); }
.record-value {
  font-family: 'DM Serif Display', serif;
  font-size: 3.2rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.record-label {
  font-size: 0.8rem;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 600;
}

/* ---------- SALONS GRID ---------- */
.salons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.salon-item {
  background: white;
  padding: 1.5rem;
  transition: background 0.2s;
}
.salon-item:hover { background: var(--off-white); }
.salon-nom {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem;
  color: var(--black);
  margin-bottom: 0.25rem;
}
.salon-lieu {
  font-size: 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 500;
}
.salon-detail {
  font-size: 0.85rem;
  color: var(--grey);
  margin-top: 0.5rem;
  font-style: italic;
}

/* ---------- MÉDIAS ---------- */
.medias-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.media-item {
  border-left: 3px solid var(--accent);
  padding: 1rem 1.5rem;
  background: var(--off-white);
}
body[dir="rtl"] .media-item { border-left: none; border-right: 3px solid var(--accent); }
.media-nom {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  color: var(--black);
  margin-bottom: 0.25rem;
}
.media-presentateur {
  font-size: 0.85rem;
  color: var(--grey);
  font-style: italic;
}

/* Responsive pour tableau/mobile */
@media (max-width: 900px) {
  .timeline::before { left: 30px; }
  body[dir="rtl"] .timeline::before { right: 30px; }
  .timeline-item { padding: 1.5rem 0 1.5rem 70px; }
  body[dir="rtl"] .timeline-item { padding: 1.5rem 70px 1.5rem 0; }
  .timeline-year { position: relative; width: auto; text-align: left; top: 0; margin-bottom: 0.5rem; font-size: 1.4rem; left: 0; }
  body[dir="rtl"] .timeline-year { right: 0; text-align: right; }
  .timeline-dot { left: 23px; top: 2.5rem; }
  body[dir="rtl"] .timeline-dot { right: 23px; }
  .coef-bar { grid-template-columns: 1fr 50px; grid-template-rows: auto auto; }
  .coef-bar-track { grid-column: 1 / -1; }
  .records-grid { grid-template-columns: repeat(2, 1fr); }
  .femelle-options { grid-template-columns: 1fr; }
}

/* ---------- PAGE ASSOCIATION ---------- */
.asso-hero {
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  color: white;
  padding: 4rem 3rem;
  display: flex;
  align-items: center;
  gap: 3rem;
  min-height: 300px;
  position: relative;
  overflow: hidden;
}
.asso-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 50%, rgba(184, 38, 28, 0.25) 0%, transparent 60%);
}
.asso-hero-logo {
  position: relative; z-index: 2;
  width: 180px; height: 180px;
  background: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.asso-hero-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.asso-hero-logo.placeholder {
  background: var(--accent); color: white;
  font-family: 'DM Serif Display', serif;
  font-size: 3rem; font-weight: bold;
}
.asso-hero-text { position: relative; z-index: 2; flex: 1; }
.asso-hero-id {
  font-size: 0.8rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.3em;
  font-weight: 600; margin-bottom: 0.75rem;
}
.asso-hero-text h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  color: white;
  line-height: 1.15; margin-bottom: 0.75rem;
}
.asso-hero-sub {
  font-size: 1.1rem;
  color: var(--grey-light);
  max-width: 640px;
}
body[dir="rtl"] .asso-hero { flex-direction: row-reverse; }

/* Liste des éditions */
.editions-list {
  display: flex; flex-direction: column; gap: 2rem;
}
.edition-card {
  background: white;
  border: 1px solid var(--line);
  padding: 2rem;
  transition: border-color 0.2s;
}
.edition-card:hover { border-color: var(--accent); }
.edition-header {
  display: flex; justify-content: space-between;
  align-items: baseline; flex-wrap: wrap; gap: 1rem;
  padding-bottom: 1rem; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.edition-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.8rem; color: var(--black);
}
.edition-meta {
  display: flex; gap: 1rem; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--grey);
}
.edition-status {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  border-radius: 2px;
}
.edition-status.extracted { background: #D4EDDA; color: #155724; }
.edition-status.partial { background: #FFF3CD; color: #856404; }
.edition-status.images-only { background: #E7F1FF; color: #004085; }
.edition-status.no-table { background: #F8D7DA; color: #721C24; }
.edition-description {
  font-size: 0.95rem; color: var(--ink);
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--line);
}
body[dir="rtl"] .edition-description { padding-left: 0; padding-right: 1rem; border-left: none; border-right: 3px solid var(--line); }
.edition-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.edition-image-item {
  aspect-ratio: 3/2;
  background: var(--off-white);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s;
}
.edition-image-item:hover { transform: scale(1.02); }
.edition-image-item img { width: 100%; height: 100%; object-fit: cover; }
.edition-link-data {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--black); color: white;
  font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.15em;
  font-weight: 600;
  transition: background 0.2s;
}
.edition-link-data:hover { background: var(--accent); }

/* Associations grid (pour liste générale) */
.assos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem;
}
.asso-card {
  background: white;
  border: 1px solid var(--line);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.2s;
  display: block;
}
.asso-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.06);
}
.asso-card-logo {
  width: 90px; height: 90px;
  margin: 0 auto 1.25rem;
  display: flex; align-items: center; justify-content: center;
}
.asso-card-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.asso-card-logo.placeholder {
  background: var(--off-white);
  border-radius: 50%;
  color: var(--grey);
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
}
.asso-card-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem;
  color: var(--black); margin-bottom: 0.25rem;
}
.asso-card-region {
  font-size: 0.8rem;
  color: var(--grey);
  text-transform: uppercase; letter-spacing: 0.15em;
}
.asso-card-editions {
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: 0.75rem;
  font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.15em;
}

/* Responsive asso */
@media (max-width: 900px) {
  .asso-hero { flex-direction: column; text-align: center; padding: 3rem 1.5rem; }
  body[dir="rtl"] .asso-hero { flex-direction: column; }
  .asso-hero-logo { width: 140px; height: 140px; padding: 1rem; }
}

/* ---------- RECHERCHE PAR SUJET / PROPRIÉTAIRE ---------- */
.search-hero {
  background: linear-gradient(135deg, var(--off-white) 0%, #fff 100%);
  border: 1px solid var(--line);
  padding: 2.5rem;
  margin-top: 2rem;
  position: relative;
}
.search-input-wrap {
  display: flex; gap: 0.5rem;
  align-items: stretch;
}
.search-input-big {
  flex: 1;
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
  font-family: inherit;
  background: white;
  border: 2px solid var(--line);
  color: var(--ink);
  transition: border-color 0.2s;
}
.search-input-big:focus {
  outline: none;
  border-color: var(--accent);
}
.search-input-big::placeholder {
  color: var(--grey-light);
}
.search-clear-btn {
  padding: 1rem 1.5rem;
  background: var(--black);
  color: white;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.search-clear-btn:hover { background: var(--accent); }

.search-info {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--grey);
}
.search-suggestions {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--grey);
}
.search-suggestions strong {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.search-suggestion-tag {
  display: inline-block;
  margin: 0.2rem 0.3rem 0.2rem 0;
  padding: 0.3rem 0.7rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--ink);
  transition: all 0.15s;
}
.search-suggestion-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--off-white);
}

/* Résultats de recherche */
.search-results {
  margin-top: 2rem;
}
.search-results-summary {
  font-size: 0.85rem;
  color: var(--grey);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.search-results-summary strong {
  color: var(--accent);
  font-weight: 600;
}

.sujet-result {
  background: white;
  border: 1px solid var(--line);
  padding: 1.5rem 2rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}
.sujet-result:hover { border-color: var(--accent); }
.sujet-result-header {
  display: flex; justify-content: space-between;
  align-items: baseline; flex-wrap: wrap; gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.sujet-result-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  color: var(--black);
}
.sujet-result-name em {
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--grey);
  font-weight: 400;
  margin-left: 0.5rem;
}
.sujet-result-count {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.sujet-result-participations {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.sujet-participation {
  display: block;
  padding: 0.75rem 1rem;
  background: var(--off-white);
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}
.sujet-participation:hover {
  border-color: var(--accent);
  background: white;
}
.sujet-participation-foire {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--black);
}
.sujet-participation-cat {
  font-size: 0.75rem;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.15rem;
}
.sujet-participation-stats {
  display: flex; gap: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.sujet-participation-stats span strong {
  color: var(--accent);
}
.sujet-participation-rank {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-family: 'DM Serif Display', serif;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  font-size: 0.85rem;
  margin-right: 0.5rem;
}
.sujet-participation-rank.podium-1 { background: #C9A227; }
.sujet-participation-rank.podium-2 { background: #888; }
.sujet-participation-rank.podium-3 { background: #B26B2C; }

.search-no-results {
  text-align: center;
  padding: 3rem;
  color: var(--grey);
}
.search-empty-hint {
  text-align: center;
  padding: 2rem;
  color: var(--grey-light);
  font-style: italic;
  font-size: 0.95rem;
}

@media (max-width: 700px) {
  .search-hero { padding: 1.5rem; }
  .search-input-wrap { flex-direction: column; }
  .search-clear-btn { padding: 0.8rem; }
  .sujet-result-participations { grid-template-columns: 1fr; }
}

/* ---------- FILTRES (Base de données) ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--off-white);
  border: 1px solid var(--line);
  margin-bottom: 2rem;
  align-items: end;
}
.filter-group { display: flex; flex-direction: column; gap: 0.4rem; min-width: 160px; }
.filter-label {
  font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--grey);
  font-weight: 600;
}
.filter-select, .filter-search {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  background: white;
  font-family: inherit; font-size: 0.95rem;
  color: var(--ink);
  cursor: pointer;
}
.filter-select:focus, .filter-search:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.filter-search { cursor: text; min-width: 220px; }
.filter-reset {
  padding: 0.6rem 1.2rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--grey);
  font-family: inherit; font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.15em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-reset:hover { background: var(--accent); color: white; border-color: var(--accent); }

.results-count {
  font-size: 0.85rem; color: var(--grey);
  margin-bottom: 1rem;
  text-transform: uppercase; letter-spacing: 0.15em;
}

/* ---------- TABLE DES FOIRES ---------- */
.foires-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 0.95rem;
}
.foires-table thead {
  background: var(--off-white);
  border-top: 1px solid var(--line);
  border-bottom: 2px solid var(--line);
}
.foires-table th {
  padding: 0.9rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--grey);
  font-weight: 600;
}
body[dir="rtl"] .foires-table th { text-align: right; }
.foires-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.foires-table tbody tr { transition: background 0.15s; }
.foires-table tbody tr:hover { background: var(--off-white); }
.foires-table tbody tr.clickable { cursor: pointer; }
.foires-table .col-nom strong {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem; color: var(--black);
}
.foires-table .col-nom small {
  display: block;
  font-size: 0.75rem; color: var(--grey);
  margin-top: 0.15rem;
}
.foires-table .col-asso {
  font-weight: 600; color: var(--accent);
}
.foires-table .col-annee {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem; color: var(--ink);
}

/* ---------- CLASSEMENT DÉTAILLÉ (d'une foire) ---------- */
.classement-header {
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 1rem;
  padding-bottom: 1.5rem; margin-bottom: 2rem;
  border-bottom: 2px solid var(--accent);
}
.classement-header h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: 0.25rem;
}
.classement-header-meta {
  font-size: 0.85rem; color: var(--grey);
}
.classement-back {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.15em;
  font-weight: 600;
  transition: all 0.2s;
}
.classement-back:hover { background: var(--black); color: white; border-color: var(--black); }

.classement-bareme {
  background: var(--off-white);
  padding: 1rem 1.5rem;
  border-left: 3px solid var(--accent);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  font-style: italic;
}
body[dir="rtl"] .classement-bareme { border-left: none; border-right: 3px solid var(--accent); }

.categorie-group { margin-bottom: 3rem; }
.categorie-title {
  font-size: 1.5rem;
  color: var(--black);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.classement-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: white;
}
.classement-table thead {
  background: var(--black);
  color: white;
}
.classement-table th {
  padding: 0.7rem 0.6rem;
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  white-space: nowrap;
}
body[dir="rtl"] .classement-table th { text-align: right; }
.classement-table td {
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.classement-table tr.podium-1 td:first-child,
.classement-table tr.podium-2 td:first-child,
.classement-table tr.podium-3 td:first-child {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: bold;
}
.classement-table tr.podium-1 { background: #FFF8E7; }
.classement-table tr.podium-2 { background: #F5F5F5; }
.classement-table tr.podium-3 { background: #FCECE3; }
.classement-table .num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
body[dir="rtl"] .classement-table .num { text-align: left; }

/* Responsive table — scroll horizontal sur mobile */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Indication visuelle qu'on peut scroller */
  background:
    linear-gradient(to right, white 30%, rgba(255,255,255,0)),
    linear-gradient(to right, rgba(255,255,255,0), white 70%) 0 100%,
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,0.08), rgba(0,0,0,0)),
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,0.08), rgba(0,0,0,0)) 0 100%;
  background-repeat: no-repeat;
  background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
  background-position: 0 0, 100% 0, 0 0, 100% 0;
  background-attachment: local, local, scroll, scroll;
}

/* Adaptations mobile du tableau de classement */
@media (max-width: 700px) {
  .classement-table { font-size: 0.82rem; }
  .classement-table th,
  .classement-table td {
    padding: 0.5rem 0.55rem;
    white-space: nowrap;        /* evite l'etirement vertical des lignes */
  }
  /* La colonne "Notes" peut contenir du texte long — on tronque sur mobile */
  .classement-table th:last-child,
  .classement-table td:last-child {
    max-width: 160px;
    white-space: normal;
    font-size: 0.75rem;
    color: var(--grey);
  }
  /* Le sujet peut casser sur 2 lignes si necessaire */
  .classement-table td strong { white-space: normal; }
  /* Tete numerique des podiums un peu plus petite sur mobile */
  .classement-table tr.podium-1 td:first-child,
  .classement-table tr.podium-2 td:first-child,
  .classement-table tr.podium-3 td:first-child {
    font-size: 1rem;
  }
}

/* ---------- LIGNÉES ---------- */
.lignees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
}
.lignee-card {
  background: white;
  border: 1px solid var(--line);
  padding: 0;
  cursor: pointer;
  transition: all 0.25s;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.lignee-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.08);
}
.lignee-card-photo {
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--off-white), #DDD);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.lignee-card-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.lignee-card-photo .placeholder-emoji {
  font-size: 5rem; opacity: 0.3;
}
.lignee-card-rank {
  position: absolute; top: 1rem; left: 1rem;
  background: var(--accent); color: white;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Serif Display', serif; font-size: 1rem; font-weight: bold;
}
body[dir="rtl"] .lignee-card-rank { left: auto; right: 1rem; }
.lignee-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.lignee-card-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.7rem; color: var(--black);
  line-height: 1.1;
}
.lignee-card-surnom {
  font-style: italic;
  color: var(--accent);
  font-size: 0.95rem;
}
.lignee-card-meta {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
  font-size: 0.8rem;
  color: var(--grey);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.lignee-card-bergerie { font-size: 0.85rem; color: var(--grey); margin-top: 0.25rem; }

/* MODAL FICHE DÉTAILLÉE */
.lignee-modal {
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.85);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.lignee-modal.open { opacity: 1; pointer-events: auto; }
.lignee-modal-content {
  background: white;
  width: 100%; max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 0;
  position: relative;
}
.lignee-modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: white; border: 1px solid var(--line);
  width: 36px; height: 36px;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
body[dir="rtl"] .lignee-modal-close { right: auto; left: 1rem; }
.lignee-modal-close:hover { background: var(--accent); color: white; border-color: var(--accent); }
.lignee-modal-photo {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.lignee-modal-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.lignee-modal-photo .placeholder-emoji { font-size: 8rem; opacity: 0.4; }
.lignee-modal-body { padding: 3rem; }
.lignee-modal-rank {
  font-size: 0.75rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.25em;
  font-weight: 600; margin-bottom: 0.75rem;
}
.lignee-modal-body h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--black);
  margin-bottom: 0.25rem;
}
.lignee-modal-body .surnom-big {
  font-family: 'DM Serif Display', serif; font-style: italic;
  color: var(--accent);
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
}
.lignee-modal-meta-row {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem;
  padding: 1rem 0; margin-bottom: 2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.lignee-modal-meta-row strong {
  display: block; font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--grey); margin-bottom: 0.25rem;
}
.lignee-modal-section { margin-bottom: 2rem; }
.lignee-modal-section h3 {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  font-family: 'Inter', sans-serif; font-weight: 600;
}
.lignee-modal-section p {
  line-height: 1.8;
  color: var(--ink);
  margin-bottom: 1rem;
}
.lignee-modal-sources {
  font-size: 0.85rem;
  color: var(--grey-light);
  font-style: italic;
}
.lignee-modal-audio {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--off-white);
  border-left: 3px solid var(--accent);
}
body[dir="rtl"] .lignee-modal-audio { border-left: none; border-right: 3px solid var(--accent); }
.lignee-modal-audio audio { width: 100%; }
.lignee-modal-audio-label {
  font-size: 0.75rem; color: var(--grey);
  text-transform: uppercase; letter-spacing: 0.15em;
  font-weight: 600; margin-bottom: 0.5rem;
}

/* PEDIGREE BANNER */
.pedigree-banner {
  background: linear-gradient(135deg, #2a2a2a, #0a0a0a);
  color: white;
  padding: 3rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}
.pedigree-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 50%, rgba(184, 38, 28, 0.25) 0%, transparent 60%);
}
.pedigree-banner-icon {
  font-size: 4rem;
  position: relative; z-index: 2;
}
.pedigree-banner-text { position: relative; z-index: 2; flex: 1; }
.pedigree-banner h3 {
  color: white;
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}
.pedigree-banner p {
  color: var(--grey-light);
  font-size: 1rem;
}
.pedigree-banner-tag {
  background: var(--accent);
  color: white;
  padding: 0.4rem 0.9rem;
  font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.2em;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 0.75rem;
}

@media (max-width: 700px) {
  .lignees-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
  .lignee-card-name { font-size: 1.3rem; }
  .lignee-card-body { padding: 1rem; }
  .lignee-modal { padding: 0; }
  .lignee-modal-content { max-height: 100vh; height: 100vh; }
  .lignee-modal-body { padding: 1.5rem; }
  .lignee-modal-meta-row { grid-template-columns: 1fr; }
  .pedigree-banner { flex-direction: column; text-align: center; padding: 2rem 1.5rem; }
}

/* -

*/

/* ---------- FOOTER (restauré) ---------- */
footer {
  background: var(--ink);
  color: var(--grey-light);
  padding: 4rem 3rem 2rem;
  border-top: 4px solid var(--accent);
}
.footer-inner {
  max-width: var(--container); margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 4rem; padding: 0 0 3rem;
}
.footer-brand .logo-image { filter: invert(1); margin: 0 0 1rem; }
.footer-brand .logo-sub { color: var(--grey-light); margin-bottom: 1.25rem; text-align: left; }
.footer-brand p { font-size: 0.9rem; line-height: 1.7; color: var(--grey-light); }
footer h4 {
  color: white; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.2em;
  font-family: 'Inter', sans-serif; font-weight: 600;
  margin-bottom: 1.25rem;
}
footer ul { list-style: none; }
footer li { margin-bottom: 0.6rem; }
footer a { font-size: 0.9rem; color: var(--grey-light); transition: color 0.2s; }
footer a:hover { color: var(--accent); }

.footer-tribute {
  max-width: var(--container); margin: 0 auto 2rem;
  padding: 2rem 0 1.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  font-family: 'DM Serif Display', serif;
}
.footer-tribute p {
  font-size: 0.9rem; line-height: 1.75;
  color: var(--grey-light);
  font-style: italic;
  margin: 0 auto 0.75rem;
  max-width: 820px;
}
.footer-tribute p:last-child { margin-bottom: 0; }
.footer-tribute strong {
  color: white;
  font-style: normal;
  font-weight: 400;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}

.footer-bottom {
  max-width: var(--container); margin: 0 auto;
  display: flex; justify-content: space-between;
  font-size: 0.8rem; color: var(--grey-light);
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2.5rem; padding: 0 0 2rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
  footer { padding: 3rem 1.5rem 1.5rem; }
  .footer-tribute p { font-size: 0.85rem; }
}
@media (max-width: 600px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* =========================================
   RESPONSIVE MOBILE — bloc consolide final
   Place en derniere position pour primer sur les media queries precedentes
   ========================================= */
@media (max-width: 700px) {
  /* ----- Header compact ----- */
  .top-header { padding: 0.75rem 0; }
  .top-header-inner {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0 1rem;
    text-align: center;
  }
  .header-left { display: none; }                /* "Portail international du Ladoum" redondant */
  .header-center .logo-image { height: 42px; }
  .logo-sub { font-size: 0.6rem; letter-spacing: 0.2em; margin-top: 0.3rem; }
  .header-right {
    justify-content: center;
    gap: 0.5rem;
    padding-top: 0.5rem;
  }
  .cta-button { display: none; }                  /* Newsletter retiree sur mobile */
  .lang-switch button {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
  }

  /* ----- Navigation ----- */
  .main-nav { position: relative; top: auto; }    /* on retire le sticky pour eviter scroll bizarre */
  .main-nav ul {
    gap: 0;
    padding: 0.6rem 0;
    justify-content: space-around;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .main-nav li { flex-shrink: 0; }
  .main-nav a {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    padding: 0.2rem 0.5rem;
    white-space: nowrap;
  }

  /* ----- Hero plus discret ----- */
  .hero { min-height: 55vh; padding: 2.5rem 1rem; }
  .hero-compact { min-height: auto; padding: 2.5rem 1rem 2rem; }
  .hero h1 { font-size: clamp(1.7rem, 7vw, 2.4rem); margin-bottom: 1rem; }
  .hero-kicker { font-size: 0.7rem; margin-bottom: 1rem; }
  .hero-rams {
    opacity: 0.18;
    max-width: 70%;
    max-height: 60%;
    height: auto;
    width: auto;
    right: -10%;
  }
  body[dir="rtl"] .hero-rams { left: -10%; right: auto; }

  /* ----- Sections : padding maitrise ----- */
  section.content { padding: 2.5rem 1rem; }
  .content-inner { padding: 0; }
  .section-title { margin-bottom: 2rem; }
  .section-title h2 { font-size: clamp(1.6rem, 6vw, 2rem); }
  .section-title p { font-size: 0.95rem; }

  /* ----- Tableau de classement : prend toute la largeur ----- */
  .classement-table {
    width: 100%;
    min-width: 480px;            /* assez large pour rester lisible, scroll horizontal si necessaire */
    font-size: 0.78rem;
  }
  .classement-table th,
  .classement-table td {
    padding: 0.45rem 0.4rem;
    white-space: nowrap;
  }
  .classement-table th { font-size: 0.62rem; letter-spacing: 0.05em; }
  .classement-table td:last-child { max-width: 140px; white-space: normal; font-size: 0.7rem; }

  .classement-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
  .classement-header h2 { font-size: 1.4rem; }
  .classement-back { font-size: 0.8rem; }
  .classement-bareme { padding: 1rem; font-size: 0.85rem; }
  .categorie-title { font-size: 1.2rem; padding: 1rem 0 0.5rem; }

  /* ----- Tableau des foires (page base.html) ----- */
  .foires-table { font-size: 0.8rem; }
  .foires-table th, .foires-table td { padding: 0.5rem 0.4rem; }
  .foires-table .col-asso { display: none; }     /* on cache la colonne Association sur mobile */

  /* ----- Filtres ----- */
  .filters {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  .filter-group { width: 100%; }
  .filter-select, .filter-search { width: 100%; font-size: 0.9rem; }

  /* ----- Recherche hero ----- */
  .search-input-big { font-size: 1rem; padding: 0.8rem 1rem; }
  .search-clear-btn { font-size: 0.8rem; }

  /* ----- Grilles : 1 ou 2 colonnes selon contenu ----- */
  .assos-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .asso-card { padding: 1rem 0.5rem; }
  .asso-card-name { font-size: 0.95rem; }
  .asso-card-region { font-size: 0.75rem; }
  .asso-card-editions { font-size: 0.7rem; }

  .lignees-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .lignee-card-name { font-size: 1.4rem; }

  .caract-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .caract-card { padding: 1.5rem 1.25rem; }

  .champions-grid { grid-template-columns: 1fr; gap: 1.25rem; }

  .pantheon-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .pantheon-item { padding: 1rem 0.5rem; }

  /* ----- Article asso (page asso) ----- */
  .asso-hero { flex-direction: column; gap: 1.5rem; text-align: center; }
  .asso-hero-text h1 { font-size: 1.8rem; }
  .editions-list { gap: 1rem; }
  .edition-card { padding: 1.25rem; }
  .edition-card h3 { font-size: 1.1rem; }

  /* ----- Manifesto ----- */
  .manifesto blockquote { font-size: 1.2rem; line-height: 1.4; }
  .manifesto { padding: 3rem 1rem; }

  /* ----- Footer ----- */
  footer { padding: 2.5rem 1rem 1rem; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; padding-bottom: 1.5rem; }
  .footer-tribute p { font-size: 0.8rem; padding: 0; }
  .footer-bottom { flex-direction: column; gap: 0.4rem; text-align: center; font-size: 0.75rem; }

  /* ----- Generations grid (Histoire) ----- */
  .generations-grid::before { display: none; }

  /* ----- Epoques (Histoire) : passage en 1 colonne sur mobile ----- */
  .epoch {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 2.5rem 0;
  }
  .epoch-number {
    font-size: 2.2rem;
  }
  .epoch-period {
    margin-top: 0.25rem;
    font-size: 0.7rem;
  }
  .epoch-body h3 {
    font-size: 1.5rem;
  }
  .epoch-subtitle {
    font-size: 1rem;
    margin-bottom: 1.25rem;
  }
  .epoch-content { font-size: 0.95rem; line-height: 1.7; }
}

@media (max-width: 380px) {
  /* ecrans tres petits */
  .main-nav a { font-size: 0.6rem; padding: 0.2rem 0.35rem; }
  .hero h1 { font-size: 1.6rem; }
  .section-title h2 { font-size: 1.4rem; }
  .assos-grid { grid-template-columns: 1fr; }
}
