/* ============================================================
   page-ressources.css : bibliothèque publique /ressources
   Piste A du mockup validé (v2-prep/ressources-bibliotheque-variantes.html)
   Dépend de framework-v2.css (tokens couleurs, typo, thème)
   Aucun bleu : accent rouge #E8000A, violet réservé à la vidéo.
   ============================================================ */

.res-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- HERO ---------- */
.res-hero {
  padding: 5rem 1.5rem 2.5rem;
  text-align: center;
}
.res-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase;
  font-weight: 600; color: var(--color-text-secondary, #94a3b8);
  margin-bottom: 1rem;
}
.res-hero__eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-rouge-teco, #E8000A);
}
.res-hero__h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 1rem;
  color: var(--color-text-primary, #e8eaf2);
}
.res-hero__h1 em {
  font-style: italic; color: var(--color-rouge-teco, #E8000A);
}
.res-hero__sub {
  max-width: 680px; margin: 0 auto;
  font-size: 1.05rem; line-height: 1.6;
  color: var(--color-text-secondary, #94a3b8);
}

/* ---------- FILTRES (chips, liens GET) ---------- */
.res-filters {
  display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: center;
  padding: 0 1.5rem 0.75rem; max-width: 1100px; margin: 0 auto;
}
.res-filters--sub { padding-bottom: 2rem; }

.res-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.44rem 0.95rem; border-radius: 999px;
  background: var(--color-bg-elevated, rgba(255,255,255,0.04));
  border: 1px solid var(--color-border-subtle, rgba(255,255,255,0.12));
  color: var(--color-text-secondary, #94a3b8);
  font-family: inherit; font-size: 0.8rem; font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.res-chip:hover {
  color: var(--color-text-primary, #e8eaf2);
  border-color: rgba(255, 255, 255, 0.24);
}
.res-chip.is-active {
  background: var(--color-rouge-teco, #E8000A);
  border-color: var(--color-rouge-teco, #E8000A);
  color: #ffffff;
}
.res-chip__ic { width: 13px; height: 13px; flex: none; }

.res-filters--sub .res-chip {
  padding: 0.3rem 0.78rem; font-size: 0.73rem;
}
.res-filters--sub .res-chip.is-active {
  background: rgba(232, 0, 10, 0.10);
  border-color: rgba(232, 0, 10, 0.35);
  color: var(--color-rouge-teco, #E8000A);
}

/* ---------- GRILLE ---------- */
.res-wrapper {
  max-width: 1200px; margin: 0 auto;
  padding: 0.5rem 1.5rem 4rem;
}
.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 258px), 1fr));
  gap: 1rem;
}

.res-card {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--color-bg-elevated, rgba(255,255,255,0.04));
  border: 1px solid var(--color-border-subtle, rgba(255,255,255,0.12));
  border-radius: 0.85rem;
  padding: 1rem;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.res-card:hover {
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.res-card.is-soon {
  border-style: dashed;
}
.res-card.is-soon:hover {
  transform: none; box-shadow: none;
  border-color: var(--color-border-subtle, rgba(255,255,255,0.12));
}

.res-card__top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 0.5rem; margin-bottom: 0.7rem;
}
.res-tico {
  width: 34px; height: 34px; border-radius: 0.625rem; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.res-tico svg { width: 17px; height: 17px; }
.res-tico--doc   { background: rgba(232, 0, 10, 0.10);   color: var(--color-rouge-teco, #E8000A); }
.res-tico--lien  { background: rgba(255, 255, 255, 0.07); color: var(--color-text-secondary, #94a3b8); }
.res-tico--video { background: rgba(139, 92, 246, 0.14); color: #8b5cf6; }
.res-tico--outil { background: rgba(245, 158, 11, 0.14); color: var(--color-or-esprit, #F59E0B); }

.res-badge {
  font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--color-text-secondary, #94a3b8);
  border: 1px solid var(--color-border-subtle, rgba(255,255,255,0.12));
  border-radius: 999px; padding: 0.22rem 0.55rem;
  white-space: nowrap;
}

.res-card__title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.95rem; font-weight: 700; line-height: 1.3;
  margin: 0 0 0.35rem;
  color: var(--color-text-primary, #e8eaf2);
  overflow-wrap: anywhere;
}
.res-card__desc {
  font-size: 0.8rem; line-height: 1.5; flex: 1;
  color: var(--color-text-secondary, #94a3b8);
  margin: 0;
  overflow-wrap: anywhere;
}

.res-card__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin-top: 0.9rem; flex-wrap: wrap;
}
.res-meta {
  font-size: 0.7rem; font-weight: 600;
  color: var(--color-text-muted, rgba(255,255,255,0.55));
  min-width: 0;
}

.res-btn {
  display: inline-flex; align-items: center; gap: 0.38rem;
  background: var(--color-rouge-teco, #E8000A);
  color: #ffffff;
  border: none; border-radius: 0.5rem;
  padding: 0.44rem 0.8rem;
  font-family: inherit; font-size: 0.74rem; font-weight: 700;
  text-decoration: none; cursor: pointer;
  transition: background 0.15s ease;
}
.res-btn:hover { background: var(--color-rouge-deep, #C40014); color: #ffffff; }
.res-btn svg { width: 12px; height: 12px; flex: none; }

.res-soon {
  font-size: 0.64rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--color-text-muted, rgba(255,255,255,0.55));
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 999px; padding: 0.3rem 0.7rem;
}

/* ---------- FAÇADE VIDÉO (aucune iframe avant le clic) ---------- */
.res-vig {
  position: relative; display: block; width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.7rem; overflow: hidden;
  margin-bottom: 0.8rem;
  padding: 0; cursor: pointer;
  border: 1px solid var(--color-border-subtle, rgba(255,255,255,0.12));
  background:
    radial-gradient(120% 130% at 85% 10%, rgba(232, 0, 10, 0.20), transparent 55%),
    linear-gradient(135deg, #1F2230 0%, #0a0c12 100%);
  font-family: inherit; color: var(--color-text-primary, #e8eaf2);
}
.res-vig img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.res-vig__play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--color-rouge-teco, #E8000A);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 26px rgba(232, 0, 10, 0.45);
  transition: transform 0.15s ease;
}
.res-vig__play svg { width: 20px; height: 20px; color: #ffffff; margin-left: 2px; }
.res-vig:hover .res-vig__play { transform: translate(-50%, -50%) scale(1.07); }
.res-vig:focus-visible {
  outline: 2px solid var(--color-rouge-teco, #E8000A);
  outline-offset: 2px;
}

.res-player {
  border-radius: 0.7rem; overflow: hidden;
  border: 1px solid var(--color-border-subtle, rgba(255,255,255,0.12));
  margin-bottom: 0.8rem; background: #000;
  aspect-ratio: 16 / 9;
}
.res-player iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- ÉTAT VIDE ---------- */
.res-empty {
  text-align: center; padding: 3.5rem 1.5rem 4rem;
  color: var(--color-text-muted, rgba(255,255,255,0.55));
}
.res-empty svg {
  width: 46px; height: 46px; opacity: 0.5; margin-bottom: 1rem;
}
.res-empty p { font-size: 0.95rem; margin: 0; }
.res-empty__reset {
  display: inline-block; margin-top: 1rem;
  font-size: 0.82rem; font-weight: 600;
  color: var(--color-rouge-teco, #E8000A);
  text-decoration: none;
}
.res-empty__reset:hover { text-decoration: underline; }

/* ---------- PAGINATION ---------- */
.res-pagination {
  display: flex; flex-wrap: wrap; justify-content: center;
  align-items: center; gap: 0.4rem; margin-top: 2.5rem;
}
.res-pagination a,
.res-pagination span {
  min-width: 2.25rem; padding: 0.45rem 0.75rem;
  border-radius: 0.5rem; text-align: center;
  font-size: 0.82rem; font-weight: 600; text-decoration: none;
  border: 1px solid var(--color-border-subtle, rgba(255,255,255,0.12));
  color: var(--color-text-secondary, #94a3b8);
}
.res-pagination a:hover {
  color: var(--color-text-primary, #e8eaf2);
  border-color: rgba(255, 255, 255, 0.24);
}
.res-pagination .current {
  background: var(--color-rouge-teco, #E8000A);
  border-color: var(--color-rouge-teco, #E8000A);
  color: #ffffff;
}

/* ---------- MOBILE ---------- */
@media (max-width: 600px) {
  .res-hero { padding: 3.5rem 1.25rem 2rem; }
  .res-filters { padding-left: 1rem; padding-right: 1rem; }
  .res-wrapper { padding-left: 1rem; padding-right: 1rem; }
  .res-grid { gap: 0.85rem; }
  .res-card__foot { gap: 0.45rem; }
}

/* ============================================================
   THÈME CLAIR
   ============================================================ */
[data-theme="light"] .res-hero__h1 { color: rgba(0, 0, 0, 0.9); }
[data-theme="light"] .res-hero__sub { color: rgba(0, 0, 0, 0.65); }
[data-theme="light"] .res-hero__eyebrow { color: rgba(0, 0, 0, 0.6); }

[data-theme="light"] .res-chip {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.10);
  color: rgba(0, 0, 0, 0.75);
}
[data-theme="light"] .res-chip:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(232, 0, 10, 0.4);
  color: rgba(0, 0, 0, 0.9);
}
[data-theme="light"] .res-chip.is-active {
  background: var(--color-rouge-teco, #E8000A);
  border-color: var(--color-rouge-teco, #E8000A);
  color: #ffffff;
}
[data-theme="light"] .res-filters--sub .res-chip.is-active {
  background: rgba(232, 0, 10, 0.08);
  border-color: rgba(232, 0, 10, 0.32);
  color: var(--color-rouge-teco, #E8000A);
}

[data-theme="light"] .res-card {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .res-card:hover {
  border-color: rgba(0, 0, 0, 0.16);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .res-card.is-soon:hover { border-color: rgba(0, 0, 0, 0.08); }
[data-theme="light"] .res-card__title { color: rgba(0, 0, 0, 0.9); }
[data-theme="light"] .res-card__desc { color: rgba(0, 0, 0, 0.65); }
[data-theme="light"] .res-meta { color: rgba(0, 0, 0, 0.55); }
[data-theme="light"] .res-badge {
  color: rgba(0, 0, 0, 0.6);
  border-color: rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .res-tico--lien {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.6);
}
[data-theme="light"] .res-soon {
  color: rgba(0, 0, 0, 0.5);
  border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .res-empty { color: rgba(0, 0, 0, 0.55); }
[data-theme="light"] .res-pagination a,
[data-theme="light"] .res-pagination span {
  color: rgba(0, 0, 0, 0.65);
  border-color: rgba(0, 0, 0, 0.10);
}
[data-theme="light"] .res-pagination a:hover { color: rgba(0, 0, 0, 0.9); }
[data-theme="light"] .res-pagination .current { color: #ffffff; }

[data-theme="light"] .res-vig {
  background:
    radial-gradient(120% 130% at 85% 10%, rgba(232, 0, 10, 0.12), transparent 55%),
    linear-gradient(135deg, #F2EEE6 0%, #E8E2D6 100%);
  border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .res-player { border-color: rgba(0, 0, 0, 0.08); }

/* ---------- MOUVEMENT RÉDUIT ---------- */
@media (prefers-reduced-motion: reduce) {
  .res-card, .res-card:hover,
  .res-vig__play, .res-vig:hover .res-vig__play { transition: none; transform: none; }
}
