/* ===============================
   LAYOUT GLOBAL
================================ */
.archive-single-page,
.archive-page,
.archive-global-page {
  max-width: 900px;
  margin: auto;
  padding: 2rem 1rem 80px;
  font-family: system-ui, sans-serif;
}
.archive-single-page,
.archive-page {
  padding-inline: 24px;
}
.archive-global-page {
  padding-bottom: 80px;
}
.site-header {
  margin-bottom: 80px;
}
.site-footer {
  margin-top: 80px;
}
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

/* ===============================
   HERO — TOUTES VARIANTES
================================ */
.archive-hero,
.organizer-hero {
  padding: 56px 52px;
  margin-bottom: 60px;
  border-radius: 28px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.archive-hero {
  background: linear-gradient(135deg, #7b2cbf, #e0aaff);
}
.archive-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.12);
}
.archive-hero > * {
  position: relative;
  z-index: 1;
}
.archive-hero-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}
.archive-hero-title {
  font-size: 36px;
  line-height: 1.35;
  margin-bottom: 26px;
  max-width: 820px;
}
.archive-hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* Héro Organisateur */
.archive-organizer-page .archive-hero,
.archive-hero-organizer,
.organizer-hero {
  background: linear-gradient(135deg, #0f766e, #5eead4);
}
.organizer-hero {
  padding: 64px 48px;
}
.archive-hero-organizer .archive-hero-title,
.archive-organizer-page .archive-hero h1 {
  font-size: 36px;
  margin: 16px 0;
}
.archive-hero-organizer .archive-hero-subtitle,
.archive-organizer-page .archive-hero-subtitle {
  font-size: 17px;
  line-height: 1.8;
  max-width: 720px;
  opacity: 0.95;
}
.organizer-title {
  font-size: 36px;
  margin-bottom: 18px;
  line-height: 1.3;
}
.organizer-description {
  font-size: 16px;
  max-width: 720px;
  line-height: 1.9;
  opacity: .95;
}
.organizer-actions {
  margin-top: 30px;
}

/* ===============================
   BADGES & BOUTONS
================================ */
.badge {
  padding: .3rem .6rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
}
.archive-hero .badge {
  background: rgba(255,255,255,.16);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
}
.organizer-pill,
.ethics-pill.organizer,
.archive-hero-organizer .archive-hero-pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-size: 13px;
  margin-bottom: 14px;
  color: #fff;
  font-weight: 600;
}
.archive-count {
  background: rgba(255,255,255,.15);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
}

.btn {
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s ease;
}
.btn-primary {
  background: #fff;
  color: #7b2cbf;
}
.btn-secondary {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
}
.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1px dashed rgba(255,255,255,.4);
}

/* ===============================
   META — FICHE SIGNALÉTIQUE
================================ */
.archive-meta {
  background: #f9fafb;
  padding: 28px;
  border-radius: 18px;
  margin-bottom: 40px;
  border-right: 5px solid #7b2cbf;
}
.archive-meta p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
  font-size: 14px;
}
.archive-meta strong {
  min-width: 110px;
  font-weight: 700;
}

/* ===============================
   CONTENU ARCHIVE
================================ */
.archive-single-content {
  background: #fff;
  padding: 42px 46px;
  border-radius: 22px;
  box-shadow: 0 12px 34px rgba(0,0,0,.06);
  line-height: 1.9;
}

/* Contenu sensible */
.archive-sensitive-content.is-blurred {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}
.archive-sensitive-warning {
  background: #fff4f4;
  border-right: 4px solid #d93025;
  padding: 20px;
  border-radius: 14px;
  margin-bottom: 24px;
}
.archive-consent-btn {
  margin-top: 14px;
  background: #7b2cbf;
  color: #fff;
  border: none;
  padding: 10px 26px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

/* ===============================
   GALERIE & IMAGES
================================ */
.archive-gallery {
  margin: 70px 0 40px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  padding-bottom: 10px;
}
@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.archive-image-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #111;
}
.archive-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform .3s ease;
}
.archive-image-item:hover img {
  transform: scale(1.05);
}

/* Images sensibles */
.archive-image-item.is-sensitive img {
  filter: blur(16px);
  pointer-events: none;
}
.image-consent-btn {
  position: absolute;
  inset: auto auto 12px 12px;
  background: rgba(0,0,0,.75);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  z-index: 2;
}

/* =====================================
   LIGHTBOX
===================================== */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.9);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-lightbox-overlay {
  position: absolute;
  inset: 0;
}
.gallery-lightbox-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 90vh;
}
.gallery-lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}
.lb-prev,
.lb-next,
.lb-close {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}
.lb-prev,
.lb-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
}
.lb-prev { left: -3rem; }
.lb-next { right: -3rem; }
.lb-close {
  top: -3rem;
  right: 0;
  font-size: 2rem;
}
.lb-counter {
  position: absolute;
  bottom: -2rem;
  color: #ccc;
  font-size: 14px;
}
body:has(.gallery-lightbox:not([hidden])) {
  overflow: hidden;
}

/* ===============================
   CARTES ARCHIVES
================================ */
.archive-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
  padding: 28px;
}
.archive-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 45px rgba(0,0,0,.12);
}
.archive-card::before {
  content: "📄";
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 14px;
  opacity: .4;
}
.archive-card:has(.badge-sensitive) {
  border: 1px solid #fdecea;
  background: #fffafa;
}
.archive-organizer-page .archive-card:hover {
  border-color: #0f766e;
}
.archive-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.archive-card-badges {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
}
.archive-card a {
  display: block;
  height: 100%;
  padding: 20px;
}

/* Grille Organisateur */
.archive-organizer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 30px;
}
.archive-organizer-grid .archive-card {
  padding: 0;
}
.archive-organizer-grid .archive-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.archive-organizer-grid .archive-title {
  font-size: 18px;
  margin: 12px 16px 6px;
  line-height: 1.4;
}
.archive-organizer-grid .archive-excerpt {
  font-size: 14px;
  color: #555;
  margin: 0 16px 20px;
}

/* Grille Globale */
.archive-global-grid {
  margin-top: 30px;
  margin-bottom: 60px;
}
.archive-global-grid .archive-card {
  padding: 0;
}
.archive-global-grid .archive-thumb img {
  border-radius: 0;
}
.archive-global-grid .archive-title {
  font-size: 18px;
  margin: 14px 16px 8px;
}
.archive-global-grid .archive-excerpt {
  font-size: 14px;
  color: #555;
  margin: 0 16px 20px;
}

/* ===============================
   ARCHIVES LIÉES
================================ */
.archive-related {
  margin-top: 70px;
  padding: 40px 30px;
  background: #f8f9fb;
  border-radius: 20px;
  border-right: 6px solid #2f6f6d;
}
.archive-related-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 30px;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 10px;
}
.archive-related-title::before {
  content: "🏛️";
  font-size: 24px;
}
.archive-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.archive-related-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0,0,0,.06);
  transition: transform .25s ease, box-shadow .25s ease;
}
.archive-related-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,0,0,.12);
}
.archive-related-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.archive-related-card h3 {
  padding: 16px;
  font-size: 15px;
  line-height: 1.5;
  color: #111827;
}

/* ===============================
   FILTRES
================================ */
.archive-filters {
  margin-bottom: 50px;
  background: #faf7fc;
  padding: 28px;
  border-radius: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}
.archive-filters select {
  height: 48px;
  line-height: 48px;
  padding: 0 14px 0 42px;
  font-size: 15px;
  border-radius: 12px;
  border: 1px solid #ddd;
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%237b2cbf' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M5.5 7l4.5 5 4.5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: left 14px center;
  background-size: 18px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}
.archive-filters-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 10px;
}
.archive-filter-apply {
  height: 48px;
  padding: 0 28px;
  border-radius: 999px;
  border: none;
  background: #7b2cbf;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease;
}
.archive-filter-apply:hover {
  background: #5a189a;
}
.archive-filter-reset {
  font-size: 14px;
  color: #7b2cbf;
  text-decoration: underline;
  cursor: pointer;
}
.archive-active-filters {
  margin: 20px 0 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}
.active-filter-pill {
  background: #eef2ff;
  color: #3730a3;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
}

/* ===============================
   ÉTATS VIDES
================================ */
.archive-empty-state {
  text-align: center;
  padding: 80px 20px;
  background: #fafafa;
  border-radius: 20px;
  margin-top: 40px;
}
.archive-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.archive-empty-state h3 {
  font-size: 22px;
  margin-bottom: 10px;
}
.archive-empty-state p {
  font-size: 15px;
  color: #555;
  margin-bottom: 20px;
}

/* ===============================
   PAGINATION
================================ */
.sf-pagination {
  margin-top: 56px;
  display: flex;
  justify-content: center;
}
.sf-pagination ul {
  display: flex;
  gap: 12px;
  padding: 0;
  list-style: none;
  align-items: center;
  direction: rtl;
}
.sf-pagination li a,
.sf-pagination li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all .25s ease;
}
.sf-pagination li span.current {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(107,78,255,.35);
}
.sf-pagination li a {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5d8f2;
}
.sf-pagination li a:hover {
  background: #f3e8ff;
  color: #4338ca;
  transform: translateY(-2px);
}
.sf-pagination li a.prev,
.sf-pagination li a.next {
  font-size: 18px;
  font-weight: 700;
}

/* Animation résultats */
.archive-results {
  animation: sfFadeUp .35s ease-out both;
}
@keyframes sfFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===============================
   IMPRESSION
================================ */
@media print {
  .archive-gallery,
  .archive-actions,
  .archive-related,
  .sf-lightbox {
    display: none !important;
  }
  .archive-single-content {
    box-shadow: none;
    padding: 0;
  }
  a::after {
    content: "";
  }
}