/* ----------------------------------------------------------- */
/* Montserrat Alternates — compatibilité iOS / iPadOS          */
/* ----------------------------------------------------------- */
@font-face {
  font-family: "MontserratAlternates";
  src:
    url("../assets/fonts/MontserratAlternates-Regular.woff2") format("woff2"),
    url("../assets/fonts/MontserratAlternates-Regular.woff") format("woff"),
    url("../assets/fonts/MontserratAlternates-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "MontserratAlternates";
  src:
    url("../assets/fonts/MontserratAlternates-Bold.woff2") format("woff2"),
    url("../assets/fonts/MontserratAlternates-Bold.woff") format("woff"),
    url("../assets/fonts/MontserratAlternates-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ----------------------------------------------------------- */
/* Reset & base                                                */
/* ----------------------------------------------------------- */

* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
}

:root.theme-light {
  color-scheme: light;
}

body {
  margin: 0;
  font-family: "MontserratAlternates", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: #020617;
  color: #e5e7eb;
  transition: background 0.3s, color 0.3s;
}

/* ----------------------------------------------------------- */
/* Header Pressbook (base, non sticky pour tous)               */
/* ----------------------------------------------------------- */

.site-header {
  position: static;                 /* de base : non sticky (mobile y compris) */
  top: auto;
  z-index: 30;
  background: rgba(2, 6, 23, 0.96); /* fond sombre légèrement translucide */
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  padding: 1.2rem 2rem 0.9rem;      /* padding réduit */
}

/* Conteneur interne du header */
.header-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;                      /* interlignage vertical réduit */
  text-align: center;
}

/* Bloc titres */
.header-titles {
  display: flex;
  flex-direction: column;
}

/* Titre principal */
.site-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
  line-height: 1.05;                /* interlignage resserré */
}

/* Sous-titre (Pressbook) */
.site-header .subtitle {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0.05rem 0 0;
  line-height: 1.15;                /* plus serré */
}

/* Dates 1995–1997 */
.years {
  margin: 0.2rem 0 0.25rem;
  font-size: 1rem;
  color: #e5e7eb;
  letter-spacing: 0.03em;
}

/* Phrase d'accroche */
.tagline {
  margin: 0.3rem 0 0;
  max-width: 46rem;
  font-size: 0.95rem;
  line-height: 1.45;                /* un peu plus compact */
  color: #cbd5e1;
  font-style: italic;
}

/* Bouton Day / Night — style identique à la home */
.theme-toggle {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;                 /* réduit */
  padding: 0.35rem 0.75rem 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.theme-toggle__label {
  white-space: nowrap;
}

.theme-toggle__icon {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: #0b1120;
}

/* Lune par défaut, soleil masqué */
.theme-toggle__icon--sun {
  display: none;
}

/* État visuel en mode clair */
:root.theme-light .theme-toggle {
  background: #f9fafb;
  color: #0f172a;
  border-color: rgba(148, 163, 184, 0.6);
}

:root.theme-light .theme-toggle__icon {
  background: #e5e7eb;
}

/* Switch icônes selon le thème */
:root.theme-light .theme-toggle__icon--moon {
  display: none;
}

:root.theme-light .theme-toggle__icon--sun {
  display: flex;
}

/* Centrer le bouton dans le header */
.site-header .theme-toggle {
  margin-left: auto;
  margin-right: auto;
}

/* Filtres intégrés au header */
.site-header .filters {
  margin-top: 1.2rem;               /* un peu plus près du header */
  margin-bottom: 0;
}

/* ----------------------------------------------------------- */
/* Header Pressbook compact + sticky + mode ultra compact      */
/* Desktop & tablette (>= 769px)                               */
/* ----------------------------------------------------------- */

@media (min-width: 769px) {

  /* Header collé en haut + base compacte */
  .site-header {
    position: sticky;
    top: 0;
    padding: 0.8rem 2rem 0.7rem;
  }

  /* Ligne verticale globale du header */
  .header-top {
    flex-direction: column;
    gap: 0.4rem;
  }

  /* Bloc contenant H1 + sous-titre + années sur une seule ligne */
  .header-titles {
    flex-direction: row;
    align-items: baseline;
    gap: 0.6rem;
  }

  .site-header h1 {
    font-size: 1.9rem;
    line-height: 1.0;
    margin: 0;
    white-space: nowrap; /* pas de retour à la ligne */
  }

  .site-header .subtitle {
    font-size: 1.35rem;
    margin: 0;
    line-height: 1.0;
    white-space: nowrap;
  }

  .years {
    margin: 0;
    font-size: 1.05rem;
    white-space: nowrap;
  }

  /* Petit séparateur — entre les blocs */
  .header-titles > *:not(:last-child)::after {
    content: "—";
    margin: 0 0.45rem;
    color: #94a3b8;
    font-weight: 400;
  }

  /* Tagline un peu réduite en hauteur */
  .tagline {
    margin: 0.2rem 0 0;
    font-size: 0.9rem;
    line-height: 1.3;
    max-width: 46rem;
  }

  /* Centrage des filtres dans le header */
  .site-header .filters {
    justify-content: center;
    align-items: center;
    margin-top: 1.1rem;
  }

  .site-header .filters .field {
    align-items: center;
    text-align: center;
  }

  /* ==============================
     Mode "ultra compact" sticky
     (au scroll : classe .is-sticky-compact)
     ============================== */

  .site-header.is-sticky-compact {
    padding: 0.6rem 2rem 0.35rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .site-header.is-sticky-compact h1 {
    font-size: 1.55rem;
    line-height: 1.05;
  }

  .site-header.is-sticky-compact .subtitle {
    font-size: 1.05rem;
    margin-top: 0;
  }

  .site-header.is-sticky-compact .years {
    font-size: 0.85rem;
    margin-top: 0.15rem;
  }

  /* On masque la tagline en mode ultra compact */
  .site-header.is-sticky-compact .tagline {
    display: none !important;
  }

  /* On réserve de la place à droite pour le bouton pilule */
  .site-header.is-sticky-compact .filters {
    margin-top: 0.6rem;
    padding-right: 7.5rem; /* espace pour le bouton Night mode */
  }

  /* Bouton Night mode placé visuellement sur la même ligne
     que les champs Albums / Recherche (coin bas droit du header) */
  .site-header.is-sticky-compact .theme-toggle {
    position: absolute;
    right: 2rem;
    bottom: 0.45rem;
    transform: scale(0.88);
    margin: 0;
  }
}

/* ----------------------------------------------------------- */
/* Filters                                                     */
/* ----------------------------------------------------------- */

.layout {
  padding: 1.5rem 2rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  margin-bottom: 2rem;
}

.filters .field {
  display: flex;
  flex-direction: column;
}

.filters label {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: #cbd5e1;
}

.filters select,
.filters input {
  background: #0f172a;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 0.45rem 0.6rem;
  border-radius: 0.4rem;
}

.filters input::placeholder {
  color: #64748b;
}



/* ----------------------------------------------------------- */
/* Results & items                                             */
/* ----------------------------------------------------------- */

.results {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.press-item {
  background: #0a0f1f;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.8rem;
  padding: 1.2rem 1.6rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

/* Publication */
.press-publication {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

/* Title + Subtitle */
.press-titles {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.press-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.press-separator {
  color: #fbbf24;
  font-weight: 700;
  font-size: 1.2rem;
}

.press-subtitle {
  font-size: 1.2rem;
  font-weight: 400;
  opacity: 0.9;
}

/* Author */
.press-author {
  margin: 0.3rem 0;
  color: #cbd5e1;
  font-size: 0.95rem;
}

/* Meta */
.press-meta {
  margin: 0.3rem 0 1.1rem;
  color: #94a3b8;
  font-size: 0.95rem;
}

/* Séparateur ︱ pour la ligne n° / date */
.press-meta-separator {
  color: #fbbf24;
  font-weight: 700;
}

/* Ligne Titre + Sous-titre */
.press-title-line {
  margin: 0.15rem 0 0.4rem 0;
  font-size: 1rem;
}

/* Titre et sous-titre : bold + italic (même style) */
.press-title-main,
.press-title-sub {
  font-family: "MontserratAlternates", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-weight: 700;
  font-style: italic;
}

/* Séparateur coloré ︱ */
.press-title-separator {
  color: #fbbf24;
  font-weight: 700;
}

/* Zone des vignettes */
.press-images {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0 1.2rem;
  align-items: flex-start; /* chaque vignette garde sa propre hauteur */
}

/* Bouton-vignette : même taille que l’image, pas de “carte” trop grande */
.press-images .thumb {
  padding: 0;
  margin: 0;
  background: #111827;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0.45rem;
  overflow: hidden; /* on découpe à la forme arrondie */
  display: inline-block;
}

/* Image à l’intérieur du bouton */
.press-images .thumb img {
  display: block;
  width: 138px; /* largeur fixe, hauteur selon le ratio réel */
  height: auto;
}

/* Excerpt + Full text */
.press-excerpt {
  margin-bottom: 0.8rem;
  line-height: 1.55;
}

.press-full {
  margin-top: 0.6rem;
  line-height: 1.55;
}

.toggle-full {
  margin-top: 0.7rem;
  padding: 0.4rem 0.7rem;
  background: #1e293b;
  border: 1px solid #64748b;
  border-radius: 0.4rem;
  cursor: pointer;
  color: #e2e8f0;
  font-size: 0.85rem;
}

/* ----------------------------------------------------------- */
/* Lightbox                                                    */
/* ----------------------------------------------------------- */

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

#lightbox .lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
}

.lightbox-content {
  position: relative;
  z-index: 2;
  background: #111827;
  padding: 1rem 1.4rem 1.2rem;
  border-radius: 0.75rem;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#lightboxImg {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 0.5rem;
}

#lightboxCaption {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  text-align: center;
  color: #e5e7eb;
}

.lightbox-close {
  position: absolute;
  top: 0.4rem;
  right: 0.7rem;
  font-size: 1.6rem;
  background: none;
  border: none;
  color: #fbbf24;
  cursor: pointer;
}

/* ----------------------------------------------------------- */
/* Overrides thème clair                                       */
/* ----------------------------------------------------------- */

:root.theme-light body {
  background: #f9fafb;
  color: #020617;
}

/* Header clair (textes) */
:root.theme-light .site-header {
  background: rgba(241, 242, 224, 0.96);
  border-bottom-color: rgba(148, 163, 184, 0.45);
}

:root.theme-light .site-header h1,
:root.theme-light .site-header .subtitle {
  color: #020617;
}

:root.theme-light .years,
:root.theme-light .tagline {
  color: #1e293b;
}

/* Zone filtre + fond général */
:root.theme-light .layout {
  background: #e5e7eb;
}

/* Cartes d’articles */
:root.theme-light .press-item {
  background: #eeefd0;  /* jaune clair harmonisé */
  border-color: rgba(148, 163, 184, 0.6);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

/* Textes dans les cartes */
:root.theme-light .press-publication,
:root.theme-light .press-title-main,
:root.theme-light .press-title-sub,
:root.theme-light .press-author,
:root.theme-light .press-excerpt,
:root.theme-light .press-full {
  color: #020617;
}

:root.theme-light .press-meta {
  color: #475569;
}

:root.theme-light .press-album {
  color: #b45309; /* doré/brun lisible sur fond clair */
}

/* Inputs / selects en clair */
:root.theme-light .filters select,
:root.theme-light .filters input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #020617;
}

/* ----------------------------------------------------------- */
/* Pressbook — Lisibilité des filtres en thème clair           */
/* ----------------------------------------------------------- */

:root.theme-light .site-header .filters label {
  color: #020617; /* noir lisible */
}

:root.theme-light .site-header .filters select,
:root.theme-light .site-header .filters input {
  color: #020617;        /* texte noir */
  border-color: #cbd5e1; /* cohérent avec ton thème clair */
}

:root.theme-light .site-header .filters input::placeholder {
  color: #475569; /* gris lisible */
}

:root.theme-light .filters input::placeholder {
  color: #9ca3af;
}

/* Thumbnails en clair */
:root.theme-light .press-images img {
  background: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.7);
}

/* Bouton Voir plus */
:root.theme-light .toggle-full {
  background: #e5e7eb;
  border-color: #cbd5e1;
  color: #020617;
}

/* Lightbox en clair */
:root.theme-light #lightbox .lightbox-backdrop {
  background: rgba(15, 23, 42, 0.7);
}

:root.theme-light .lightbox-content {
  background: #ffffff;
}

:root.theme-light #lightboxCaption {
  color: #1f2933;
}



/* ----------------------------------------------------------- */
/* Responsive                                                  */
/* ----------------------------------------------------------- */



@media (max-width: 900px) {
  .press-images img {
    width: 120px;
  }
}

@media (max-width: 600px) {
  .layout {
    padding: 1.2rem;
  }

  .press-images {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .press-images img {
    width: 110px;
  }
}

/* ----------------------------------------------------------- */
/* Sticky uniquement Desktop + tablette (>= 769px)             */
/* ----------------------------------------------------------- */


/* Masquer le compteur de résultats */
.field.count,
#resultsCount {
  display: none;
}

/* ----------------------------------------------------------- */
/* Header Pressbook ultra compact + sticky — MOBILE            */
/* ----------------------------------------------------------- */

@media (max-width: 768px) {

  /* Header collé en haut, très compact */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 0.55rem 0.9rem 0.35rem;
  }

  .header-top {
    gap: 0.25rem;
  }

  /* On garde les titres en colonne pour éviter la casse de ligne */
  .header-titles {
    flex-direction: column;
    align-items: center;
  }

  .site-header h1 {
    font-size: 1.5rem;
    line-height: 1.05;
  }

  .site-header .subtitle {
    font-size: 1.1rem;
    margin-top: 0.1rem;
  }

  .years {
    font-size: 0.9rem;
    margin-top: 0.1rem;
  }

  /* On enlève complètement la tagline sur mobile sticky
     pour ne pas manger de hauteur */
  .tagline {
    display: none;
  }

  /* Bouton Night mode proche des filtres, mais sans position absolue */
  .theme-toggle {
    margin-top: 0.35rem;
    transform: scale(0.94);
  }

  /* Filtres plus compacts */
  .site-header .filters {
    margin-top: 0.4rem;
    gap: 0.6rem 0.8rem;
    justify-content: center;
  }

  .site-header .filters .field {
    align-items: center;
    text-align: center;
  }

  /* Quand la classe JS .is-sticky-compact est présente,
     on compresse encore un peu le header */
  .site-header.is-sticky-compact {
    padding: 0.45rem 0.9rem 0.3rem;
  }

  .site-header.is-sticky-compact h1 {
    font-size: 1.4rem;
  }

  .site-header.is-sticky-compact .subtitle {
    font-size: 1.0rem;
  }

  .site-header.is-sticky-compact .years {
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {

  /* Titre en UNE seule ligne */
  .header-titles {
    flex-direction: row;        /* plus de colonne */
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: nowrap;          /* interdit le retour à la ligne */
    white-space: nowrap;        /* interdit aussi la casse */
  }

  /* Réduction des tailles pour tenir sur 1 ligne */
  .site-header h1 {
    font-size: 1.1rem;
    line-height: 1.0;
    margin: 0;
  }

  .site-header .subtitle {
    font-size: 1rem;
    line-height: 1.0;
    margin: 0;
  }

  .years {
    font-size: 0.9rem;
    margin: 0;
  }

  /* Séparateur encore visible mais discret */
  .header-titles > *:not(:last-child)::after {
    content: "—";
    margin: 0 0.3rem;
    color: #64748b;
    font-size: 0.9rem;
  }

  /* En sticky compact → encore un peu plus petit */
  .site-header.is-sticky-compact h1 {
    font-size: 1rem;
  }
  .site-header.is-sticky-compact .subtitle {
    font-size: 0.9rem;
  }
  .site-header.is-sticky-compact .years {
    font-size: 0.8rem;
  }
}

/* Mobile : header non sticky, scrolle avec la page */
@media (max-width: 768px) {
  .site-header {
    position: static;
    top: auto;
  }
}

/* FORCE MOBILE NON-STICKY — fix Safari iOS */
@media (max-width: 768px) {
  .site-header {
    position: static !important;
    top: auto !important;
  }
}
