/* ============================================
   Ligue contre la violence routière — Recherche documentaire
   Charte graphique alignée sur violenceroutiere.fr :
     rouge marque, noir/anthracite, fond blanc,
     bandeau utilitaire gris clair, bannières dégradé rouge/noir
   ============================================ */

:root {
  /* ── Palette Ligue contre la violence routière ── */
  --page-bg:   #ffffff;   /* fond blanc */
  --sky:       #f2f2f2;   /* gris clair neutre - surfaces / badges */
  --sky-dark:  #e0e0e0;   /* gris - bordures */
  --sand:      #dbe9fb;   /* bleu clair - badges localisation / stats */
  --sand-dark: #b9d0ef;   /* bleu clair foncé */
  --blue:      #1a1a1a;   /* anthracite - accents / liens (remplace le bleu) */
  --blue-dark: #0d0d0d;   /* noir - fonds foncés / hover */
  --red:       #e8392c;   /* rouge Ligue (CTA, accents) */
  --red-dark:  #c42a1f;
  --ink:       #171717;   /* texte principal */
  --ink-soft:  #4a4a4a;
  --white:     #ffffff;
  --cream:     #f8f7f3;
  --gray-bar:  #ececec;   /* bandeau utilitaire */

  /* ── Dérivés UI ── */
  --border:    rgba(0,0,0,0.12);
  --shadow:    0 2px 16px rgba(0,0,0,0.10);
  --shadow-strong: 0 8px 32px rgba(0,0,0,0.18);

  --font-serif: 'Outfit', system-ui, sans-serif;
  --font-sans:  'Outfit', system-ui, sans-serif;
  --font-mono:  'DM Mono', monospace;
  --radius:     8px;
  --radius-lg:  12px;
  --transition: 0.18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--page-bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--ink); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--red); }

.chev { width: 9px; height: 7px; fill: none; stroke: currentColor; stroke-width: 1.6; }


/* ── HEADER ── */
.site-header {
  background: var(--white);
  color: var(--ink);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--sky-dark);
}
.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 1.5rem;
}
.header-brand { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.brand-sigil {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: bold;
  background: var(--red);
  color: var(--white);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  letter-spacing: -1px;
}
.header-brand h1 { font-size: 1rem; font-weight: 600; color: var(--ink); }
.brand-sub { font-size: 0.72rem; color: var(--ink-soft); font-family: var(--font-mono); }
/* ── LOGO ── */
.header-photo {
  height: 46px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.header-nav { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.header-user { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; font-size: 0.8rem; }
.header-user-email { color: var(--ink-soft); font-family: var(--font-mono); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-user-logout { color: var(--red); font-weight: 600; }
.header-user-logout:hover { color: var(--red-dark); }
.site-visit-counter { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); }
.site-visit-counter strong { color: var(--red); }
.nav-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
  transition: all var(--transition);
}
.nav-link .chev { color: var(--ink-soft); }
.nav-link:hover, .nav-link.active {
  color: var(--red);
}
.nav-link:hover .chev, .nav-link.active .chev { color: var(--red); }
.api-badge {
  background: var(--sky) !important;
  color: var(--ink) !important;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

/* ── HEADER CTA (boutons pilule rouge) ── */
.header-cta {
  display: flex; align-items: stretch;
  border-radius: 40px; overflow: hidden;
  background: var(--red);
  flex-shrink: 0;
}
.cta-pill-left, .cta-pill-right {
  color: var(--white); font-size: 0.82rem; font-weight: 700;
  padding: 0.65rem 1.25rem; white-space: nowrap;
  transition: background var(--transition);
}
.cta-pill-left:hover, .cta-pill-right:hover { background: var(--red-dark); color: var(--white); }
.cta-divider { width: 1px; background: rgba(255,255,255,0.4); }


/* ── HERO (bannière sombre dégradé rouge diagonal) ── */
.hero {
  background:
    linear-gradient(115deg, transparent 0%, transparent 38%, rgba(232,57,44,0.55) 46%, rgba(232,57,44,0.15) 58%, transparent 68%),
    linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 55%, #2b1512 100%);
  color: var(--white);
  padding: 5rem 2rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 50% 60% at 85% 20%, rgba(232,57,44,0.18) 0%, transparent 60%);
  pointer-events: none;
}
.hero-content { max-width: 720px; position: relative; z-index: 1; }
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #ff8f7f;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.08;
  margin-bottom: 1.5rem;
  font-weight: 800;
}
.hero-title em { color: #ff8f7f; font-style: normal; }
.hero-desc {
  color: rgba(255,255,255,0.78);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

/* Search */
.hero-search { width: 100%; max-width: 600px; margin: 0 auto 3rem; }
.search-wrapper {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: 50px;
  padding: 0.5rem 0.5rem 0.5rem 1.25rem;
  gap: 0.75rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}
.search-icon { width: 18px; height: 18px; color: var(--ink-soft); flex-shrink: 0; }
.search-input {
  flex: 1;
  border: none; outline: none;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--ink);
  background: transparent;
}
.search-input::placeholder { color: rgba(0,0,0,0.35); }
.search-btn {
  background: var(--red);
  color: var(--white);
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: 40px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.search-btn:hover { background: var(--red-dark); }

/* Hero stats */
.hero-stats { display: flex; gap: 1.5rem; position: relative; z-index: 1; flex-wrap: wrap; justify-content: center; }
.stat-card {
  text-align: center;
  padding: 1rem 1.5rem;
  border: 1px solid rgba(204,222,255,0.25);
  border-radius: var(--radius-lg);
  background: rgba(204,222,255,0.08);
  backdrop-filter: blur(8px);
}
.stat-num {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--sky);
  line-height: 1;
}
.stat-label { font-size: 0.78rem; color: rgba(255,255,255,0.6); margin-top: 0.25rem; }

/* ── MAIN LAYOUT WRAPPER ── */
.themes-section, .featured-section, .types-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4rem 2rem;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 2rem;
  color: var(--white);
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 40px; height: 3px;
  background: var(--red);
  margin-top: 0.5rem;
}

/* ── THEMES GRID ── */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.theme-card {
  background: var(--sky);
  border: 1px solid var(--sky-dark);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: block;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  color: var(--ink);
}
.theme-card::before {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transition: transform var(--transition);
}
.theme-card:hover {
  box-shadow: var(--shadow-strong);
  transform: translateY(-2px);
  background: var(--white);
  color: var(--ink);
}
.theme-card:hover::before { transform: scaleX(1); }
.theme-card:hover .theme-arrow { transform: translateX(4px); }
.theme-icon { font-size: 1.8rem; margin-bottom: 0.75rem; }
.theme-name { font-size: 1rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--blue-dark); }
.theme-desc { font-size: 0.8rem; color: var(--ink-soft); line-height: 1.4; margin-bottom: 1rem; }
.theme-arrow { font-size: 1rem; color: var(--red); transition: transform var(--transition); }

/* ── FEATURED DOCS ── */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.doc-card {
  background: var(--white);
  border: 1px solid var(--sky-dark);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition);
}
.doc-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.doc-meta { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; align-items: center; }
.doc-cat {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--sky);
  color: var(--blue-dark);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  text-transform: uppercase;
}
.doc-year { font-family: var(--font-mono); font-size: 0.78rem; color: var(--red); font-weight: 600; }
.doc-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; line-height: 1.3; }
.doc-title a { color: var(--ink); }
.doc-title a:hover { color: var(--red); }
.doc-snippet { font-size: 0.84rem; color: var(--ink-soft); line-height: 1.5; margin-bottom: 1rem; }
.doc-link { font-size: 0.85rem; color: var(--red); font-weight: 600; }

/* ── TYPES GRID ── */
.types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.type-card {
  background: var(--sand);
  border: 1px solid rgba(0,68,187,0.12);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all var(--transition);
  color: var(--ink);
  display: block;
}
.type-card:hover {
  background: var(--blue-dark);
  color: var(--white);
  transform: translateY(-3px);
  box-shadow: var(--shadow-strong);
  border-color: var(--blue-dark);
}
.type-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.type-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.type-count { font-size: 0.78rem; font-family: var(--font-mono); opacity: 0.6; }

/* ── AI SECTION ── */
.ai-section {
  background: #1a6e3a;
  color: var(--white);
  padding: 3rem 2rem;
}
.ai-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.ai-text h2 { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 400; margin-bottom: 0.75rem; }
.ai-text p { color: rgba(255,255,255,0.82); max-width: 560px; font-size: 0.9rem; }
.ai-links { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.ai-btn {
  padding: 0.7rem 1.5rem;
  border-radius: 40px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all var(--transition);
  display: inline-block;
}
.ai-btn.primary { background: var(--white); color: #1a6e3a; }
.ai-btn.primary:hover { background: var(--sky); }
.ai-btn.secondary { border: 2px solid rgba(255,255,255,0.45); color: var(--white); }
.ai-btn.secondary:hover { border-color: var(--white); background: rgba(255,255,255,0.12); }

/* ── SUPPORT BAND (bandeau CTA sombre dégradé, avant le footer) ── */
.support-band {
  background:
    linear-gradient(115deg, transparent 0%, transparent 35%, rgba(232,57,44,0.55) 46%, rgba(232,57,44,0.15) 60%, transparent 74%),
    linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 55%, #2b1512 100%);
  color: var(--white);
  padding: 3.5rem 2rem;
  text-align: center;
}
.support-inner { max-width: 760px; margin: 0 auto; }
.support-tags {
  display: flex; justify-content: center; gap: 1.25rem; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.5px;
  color: rgba(255,255,255,0.6); margin-bottom: 1.25rem;
}
.support-title { font-family: var(--font-serif); font-size: 1.9rem; font-weight: 800; margin-bottom: 1rem; }
.support-desc { color: rgba(255,255,255,0.78); font-size: 0.95rem; margin-bottom: 1.75rem; }
.support-cta {
  display: inline-block; background: var(--red); color: var(--white);
  padding: 0.75rem 2rem; border-radius: 30px; font-weight: 700; font-size: 0.92rem;
  transition: background var(--transition);
}
.support-cta:hover { background: var(--red-dark); color: var(--white); }

/* ── FOOTER ── */
.site-footer {
  background: var(--gray-bar);
  color: var(--ink-soft);
  padding: 3rem 2rem;
  border-top: 1px solid var(--sky-dark);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2rem;
}
.footer-col strong { color: var(--ink); display: block; margin-bottom: 0.75rem; }
.footer-col a { color: var(--ink-soft); font-size: 0.88rem; }
.footer-col a:hover { color: var(--red); }
.footer-col { font-size: 0.88rem; line-height: 1.8; }
.footer-version { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-soft); }

/* ── PAGE HERO BANNER (bandeau sombre dégradé, pages internes) ── */
.page-hero-banner {
  background:
    linear-gradient(115deg, transparent 0%, transparent 35%, rgba(232,57,44,0.5) 45%, rgba(232,57,44,0.12) 60%, transparent 72%),
    linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 55%, #2b1512 100%);
  color: var(--white);
  padding: 2.5rem 2rem 2.75rem;
}
.page-hero-inner { max-width: 1280px; margin: 0 auto; }
.page-hero-breadcrumb { font-size: 0.8rem; color: rgba(255,255,255,0.65); margin-bottom: 0.75rem; }
.page-hero-breadcrumb a { color: rgba(255,255,255,0.8); }
.page-hero-breadcrumb a:hover { color: #ff8f7f; }
.page-hero-banner .page-title { color: var(--white); margin-bottom: 0.5rem; }
.page-hero-banner .page-subtitle { color: rgba(255,255,255,0.75); margin-bottom: 0; }

/* ── PAGE CONTAINERS (search, catalogue, stats) ── */
.page-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  background: var(--white);
  min-height: calc(100vh - 76px);
}
.page-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--ink);
}
.page-subtitle { color: var(--ink-soft); margin-bottom: 2rem; }

/* ── FILTERS PANEL ── */
.filters-panel {
  background: var(--white);
  border: 1px solid var(--sky-dark);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}
.filters-row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 0.4rem; flex: 1; min-width: 160px; }
.filter-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
}
.filter-select, .filter-input {
  border: 1px solid #d5d5d5;
  border-radius: 30px;
  padding: 0.6rem 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition);
}
.filter-select:focus, .filter-input:focus { border-color: var(--red); }
.filter-btn {
  background: var(--red);
  color: var(--white);
  border: none;
  padding: 0.6rem 1.6rem;
  border-radius: 30px;
  font-family: var(--font-sans);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--transition);
  white-space: nowrap;
  display: inline-block;
  text-decoration: none;
}
.filter-btn:hover { background: var(--red-dark); color: var(--white); }
.filter-btn.secondary { background: var(--white); color: var(--red); border: 1.5px solid var(--red); }
.filter-btn.secondary:hover { background: #fdecea; color: var(--red-dark); border-color: var(--red-dark); }

/* ── PANEL HEADER (bandeau au-dessus d'un bloc filtres) ── */
.panel-header {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── QUICK ACCESS ROW (auteur / localisation) ── */
.quickaccess-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 1rem; }
.quickaccess-label {
  font-size: 0.72rem; font-family: var(--font-mono); color: var(--blue-dark);
  margin-right: 0.3rem; font-weight: 600;
}
.chip-author {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.28rem 0.7rem; border-radius: 20px;
  font-size: 0.76rem; font-weight: 600;
  background: #f3e6ff; color: #6b21a8; border: 1px solid #e2c8fb;
  text-decoration: none; transition: all 0.15s;
}
.chip-author:hover, .chip-author.active { background: #6b21a8; color: var(--white); border-color: #6b21a8; }
.chip-geo {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.28rem 0.7rem; border-radius: 20px;
  font-size: 0.76rem; font-weight: 700;
  background: var(--sand); color: #0d3f96; border: 1.5px solid var(--sand-dark);
  text-decoration: none; transition: all 0.15s;
}
.chip-geo:hover, .chip-geo.active { background: #0d3f96; color: var(--white); border-color: #0d3f96; }

/* ── DIVIDER BETWEEN FILTER PANELS ── */
.panel-divider { height: 1.25rem; }

/* ── RESULTS ── */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.results-count strong { color: var(--blue-dark); font-family: var(--font-mono); }
.sort-control { display: flex; align-items: center; gap: 0.5rem; }
.results-grid { display: grid; gap: 0.85rem; }
.result-item {
  background: var(--white);
  border: 1px solid var(--sky-dark);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: start;
  transition: all var(--transition);
}
.result-item:hover { box-shadow: var(--shadow); border-color: var(--red); }
.result-type-badge {
  width: 44px; height: 44px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.badge-html  { background: #dbeafe; }
.badge-pdf   { background: #fee2e2; }
.badge-image { background: #d1fae5; }
.badge-excel { background: #fef3c7; }
.badge-pptx  { background: #ede9fe; }
.result-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }
.result-title a { color: var(--ink); }
.result-title a:hover { color: var(--red); }
.result-snippet { font-size: 0.82rem; color: var(--ink-soft); line-height: 1.5; margin-bottom: 0.5rem; }
.result-tags { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-family: var(--font-mono);
  background: var(--sky);
  color: var(--blue-dark);
}
.tag-vitesse     { background: #dbeafe; color: #1e40af; }
.tag-alcool      { background: #f3e8ff; color: #6b21a8; }
.tag-ecologie    { background: #d1fae5; color: #065f46; }
.tag-mortalite   { background: #fee2e2; color: #991b1b; }
.tag-legislation { background: #fef3c7; color: #92400e; }
.result-actions { display: flex; flex-direction: column; gap: 0.4rem; }
.result-btn {
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  display: inline-block;
  text-decoration: none;
}
.result-btn.primary { background: var(--red); color: var(--white); }
.result-btn.primary:hover { background: var(--red-dark); color: var(--white); }
.result-btn.outline { border: 1px solid var(--sky-dark); color: var(--ink-soft); background: var(--white); }
.result-btn.outline:hover { border-color: var(--red); color: var(--red); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 2rem; flex-wrap: wrap; }
.page-btn {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--sky-dark);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--blue-dark);
  background: var(--white);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-block;
}
.page-btn:hover { background: var(--red); color: var(--white); border-color: var(--red); }
.page-btn.active { background: var(--red); color: var(--white); border-color: var(--red); }

/* ── VIEWER ── */
.viewer-content {
  background: var(--white);
  border: 1px solid var(--sky-dark);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  line-height: 1.7;
}
.viewer-content h1, .viewer-content h2 { font-family: var(--font-serif); font-weight: 400; color: var(--blue-dark); }
.viewer-content p { margin-bottom: 1rem; }
.viewer-content table { width: 100%; border-collapse: collapse; }
.viewer-content td, .viewer-content th { border: 1px solid var(--sky-dark); padding: 0.5rem; }
.meta-box {
  background: var(--white);
  border: 1px solid var(--sky-dark);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.meta-box h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-mono);
  color: var(--blue-dark);
  margin-bottom: 0.75rem;
}
.meta-key { font-size: 0.72rem; color: var(--ink-soft); font-family: var(--font-mono); }
.meta-val { font-size: 0.88rem; font-weight: 500; color: var(--blue-dark); }
.meta-row { display: flex; flex-direction: column; gap: 0.1rem; margin-bottom: 0.75rem; }
.pdf-frame { width: 100%; height: 80vh; border: none; border-radius: var(--radius-lg); }
.img-viewer { max-width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--sky-dark); }
.unavailable-box {
  background: var(--sky);
  border: 1px solid var(--sky-dark);
  border-radius: var(--radius-lg);
  padding: 3rem;
  text-align: center;
}

/* ── API PAGE ── */
.api-container { max-width: 960px; margin: 0 auto; padding: 3rem 2rem; }
.api-endpoint {
  background: var(--blue-dark);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
}
.api-method { color: var(--sky); font-size: 0.78rem; font-weight: 500; margin-bottom: 0.3rem; }
.api-path { font-size: 1rem; margin-bottom: 0.5rem; }
.api-desc { font-size: 0.84rem; color: rgba(255,255,255,0.65); }
pre.code-block {
  background: var(--blue-dark);
  color: #a8ff78;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
}

/* ── CATALOGUE TOOLBAR ── */
.catalogue-toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; align-items: center; }
.toolbar-chip {
  padding: 0.35rem 0.85rem;
  border-radius: 40px;
  border: 1px solid var(--sky-dark);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
}
.toolbar-chip:hover, .toolbar-chip.active {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

/* Image cards */
.img-card {
  background: var(--white);
  border: 1px solid var(--sky-dark);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: block;
  color: var(--ink);
}
.img-card:hover { box-shadow: var(--shadow-strong); transform: translateY(-2px); }
.img-thumb { width: 100%; height: 180px; object-fit: cover; display: block; background: var(--sky); }
.img-info { padding: 0.75rem 1rem; }
.img-title { font-size: 0.82rem; font-weight: 600; margin-bottom: 0.25rem; word-break: break-all; color: var(--blue-dark); }
.img-context { font-size: 0.74rem; color: var(--ink-soft); font-family: var(--font-mono); }

/* ── STATISTICS PAGE ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stats-card {
  background: var(--white);
  border: 1px solid var(--sky-dark);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.stats-card h3 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--blue-dark);
  margin-bottom: 1.25rem;
}
.bar-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; }
.bar-label { font-size: 0.82rem; min-width: 130px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 10px; background: var(--sky); border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; background: var(--red); }
.bar-count { font-size: 0.78rem; font-family: var(--font-mono); color: var(--blue-dark); min-width: 36px; text-align: right; }
.timeline-container { overflow-x: auto; }
.timeline-chart { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding: 0 0.5rem; min-width: 500px; }
.timeline-bar {
  flex: 1; min-width: 4px;
  background: var(--red);
  border-radius: 2px 2px 0 0;
  opacity: 0.65;
  transition: opacity 0.2s;
  cursor: pointer;
  position: relative;
}
.timeline-bar:hover { opacity: 1; background: var(--red); }
.timeline-bar::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 4px); left: 50%;
  transform: translateX(-50%);
  background: var(--blue-dark); color: var(--white);
  padding: 2px 6px; border-radius: 3px;
  font-size: 0.7rem; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.2s;
  font-family: var(--font-mono);
}
.timeline-bar:hover::after { opacity: 1; }
.timeline-labels {
  display: flex; justify-content: space-between;
  font-size: 0.7rem; font-family: var(--font-mono);
  color: var(--blue-dark); margin-top: 0.4rem;
  min-width: 500px; padding: 0 0.5rem;
}

/* ── UTILITIES ── */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--ink-soft); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.badge-pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.65rem; border-radius: 100px;
  font-size: 0.72rem; font-family: var(--font-mono);
}
.badge-red   { background: #fee2e2; color: #991b1b; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-blue  { background: var(--sky); color: var(--blue-dark); }
mark { background: #fef3c7; color: var(--ink); border-radius: 2px; padding: 0 2px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero { padding: 3rem 1.5rem 2.5rem; }
  .hero-stats { flex-wrap: wrap; justify-content: center; }
  .stat-card { min-width: 120px; }
  .header-nav { display: none; }
  .ai-inner { flex-direction: column; }
  .result-item { grid-template-columns: auto 1fr; }
  .result-actions { grid-column: 2; flex-direction: row; }
}
