﻿:root {
  color-scheme: dark;
  font-family: "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: #111;
  color: #eee;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ----------- Layout gÃ©nÃ©rique page simple ----------- */

.page-header {
  padding: 2rem 1.5rem 1rem;
  text-align: center;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 600;
}

.page-content {
  width: min(1100px, 92vw);
  margin: 0 auto 3rem;
}

/* Liste des dates (ancienne home simple) */
.dates-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.dates-list li a {
  display: block;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  background-color: #1e1e1e;
  border: 1px solid #2d2d2d;
  font-size: 1.1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.dates-list li a:hover,
.dates-list li a:focus-visible {
  border-color: #4e8cff;
  transform: translateY(-2px);
}

/* ----------- Barre d'outils / recherche ----------- */

.toolbar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.toolbar .search-input {
  flex: 1 1 auto;
  min-width: 0;
}

.sort-toggle-btn {
  flex-shrink: 0;
  background: #2a2d45;
  color: #c5c8e8;
  border: 1px solid #3d4070;
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.sort-toggle-btn:hover {
  background: #323655;
  border-color: #4e8cff;
}
.sort-toggle-btn.active {
  background: #1a3060;
  border-color: #4e8cff;
  color: #7db8ff;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid #333;
  background-color: #1a1a1a;
  color: #f0f0f0;
  font-size: 1rem;
}

.search-input:focus {
  outline: 2px solid #4e8cff;
  outline-offset: 2px;
}

/* ----------- Grille journaux (page day) ----------- */

.journal-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 900px) {
  .journal-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.journal-card {
  background-color: #1e1e1e;
  border: 1px solid #2d2d2d;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.journal-card:hover,
.journal-card:focus-visible {
  border-color: #4e8cff;
  transform: translateY(-3px);
}

.journal-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
}

.preview-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  background: #1a1a1a;
  border: 1px dashed #333;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  text-align: center;
  padding: 0.5rem;
}

.journal-card .journal-name {
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  margin: 0 auto;
}

.journal-date {
  font-size: 0.85rem;
  color: #aaa;
  text-align: center;
}

.journal-actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: center;
}

/* Bouton "TÃ©lÃ©charger le PDF" */

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(78, 140, 255, 0.15);
  color: #dfe6ff;
  border: 1px solid rgba(78, 140, 255, 0.3);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.download-button:hover,
.download-button:focus-visible {
  transform: translateY(-2px);
  background: rgba(78, 140, 255, 0.25);
  border-color: rgba(78, 140, 255, 0.45);
}

/* Navigation prÃ©cÃ©dente / suivante (ancienne version, gardÃ©e pour fallback) */

.day-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
}

.nav-button {
  flex: 1;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid #2d2d2d;
  background-color: #1e1e1e;
  color: #eee;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-button:hover:not(:disabled),
.nav-button:focus-visible:not(:disabled) {
  border-color: #4e8cff;
  background-color: #242424;
}

.nav-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Messages info / erreur */

.message {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 8px;
  background-color: #1a1a1a;
  border: 1px solid #333;
  text-align: center;
}

.message-error {
  border-color: #ff5f5f;
  color: #ff9f9f;
}

/* ----------- Lightbox PDF plein Ã©cran ----------- */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.lightbox-content {
  position: relative;
  width: min(90vw, 1100px);
  height: min(90vh, 95vh);
  background-color: #121212;
  border: 1px solid #2d2d2d;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lightbox-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #2d2d2d;
}

.lightbox-toolbar a {
  color: #9db9ff;
  font-weight: 500;
}

.lightbox-close {
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  border: 1px solid #3a3a3a;
  background-color: #1f1f1f;
  color: #f0f0f0;
  cursor: pointer;
}

.lightbox-frame {
  flex: 1;
  border: none;
  width: 100%;
  background: #000;
}

/* =========================================================
   PAGE D'ACCUEIL MODERNE (derniers jours + "Presse Familia")
   ========================================================= */

.home-layout {
  min-height: 100vh;
  display: flex;
  background: radial-gradient(circle at top right, rgba(78, 140, 255, 0.08), transparent 55%), #101010;
  color: #f5f5f5;
}

.home-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 2.5rem clamp(1.5rem, 4vw, 4rem);
  gap: 2rem;
}

.home-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.home-header h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
}

.home-subtitle {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: #c9d3ff;
}

.home-header .toolbar {
  width: min(760px, 100%);
  margin: 0.25rem auto 0;
}

.recent-days {
  display: grid;
  gap: 1.5rem;
}

/* Carte par jour */

.day-preview {
  border: 1px solid rgba(78, 140, 255, 0.18);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(32, 34, 60, 0.6), rgba(20, 22, 30, 0.8));
  padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.day-preview h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  text-align: center;
  color: #e9ecff;
}

/* les miniatures en ligne pour "aperÃ§u du jour" */

.preview-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.preview-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: #0b0b0d;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 0.9rem;
  text-align: center;
  padding: 0.75rem;
  text-decoration: none;
  cursor: pointer;
}

.preview-card:hover,
.preview-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 16px 30px rgba(78, 140, 255, 0.25);
  border-color: rgba(78, 140, 255, 0.45);
}

.preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-card .preview-placeholder {
  width: 100%;
  height: 100%;
  padding: 0.75rem;
  border: 1px dashed rgba(120, 120, 145, 0.4);
  border-radius: 10px;
  background: rgba(20, 20, 35, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8c8caa;
  font-size: 0.85rem;
  text-align: center;
}

.preview-card--placeholder {
  cursor: default;
  pointer-events: none;
}

/* Bouton "Voir tous les journaux du â€¦" */

.see-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(78, 140, 255, 0.85), rgba(111, 95, 255, 0.85));
  color: #ffffff;
  border: 1px solid rgba(160, 180, 255, 0.45);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 12px 28px rgba(78, 140, 255, 0.28);
  align-self: center;
  margin-top: 1rem;
  position: relative;
  overflow: hidden;
}

.see-more:hover,
.see-more:focus-visible {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(78, 140, 255, 1), rgba(111, 95, 255, 1));
  box-shadow: 0 16px 32px rgba(78, 140, 255, 0.35);
}

.see-more::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.25), transparent 60%);
  transition: opacity 0.2s ease;
}

.see-more:hover::before,
.see-more:focus-visible::before {
  opacity: 1;
}

.see-more-label {
  position: relative;
  z-index: 1;
}

.see-more-arrow {
  position: relative;
  z-index: 1;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
}

/* Lien vers Archives globales (si tu l'utilises quelque part) */
.see-archives {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #cdd5ff;
  font-weight: 600;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease, transform 0.2s ease;
  margin: 0 auto;
}

.see-archives:hover,
.see-archives:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Responsive accueil */
@media (max-width: 768px) {
  .home-page {
    padding: 2rem 1.25rem;
    gap: 1.5rem;
  }

  .preview-row {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

/* =========================================================
   PAGE JOUR AVEC SIDEBAR ARCHIVES
   ========================================================= */

.layout {
  display: flex;
  min-height: 100vh;
  background: #111;
  color: #eee;
}

/* Sidebar Ã  gauche */
.sidebar {
  width: 240px;
  max-height: 100vh;
  overflow-y: auto;
  background: #1a1a1a;
  border-right: 1px solid #333;
  padding: 1rem;
}

.sidebar-header {
  margin-bottom: 1rem;
}

.sidebar-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.brand-logo {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f5f5f5;
}

.brand-tagline {
  font-size: 0.85rem;
  color: #9faad3;
  letter-spacing: 0.03em;
}

.archives-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.year-block {
  border: 1px solid #2d2d2d;
  border-radius: 10px;
  background: #161616;
  overflow: hidden;
}

.year-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #2d2d2d;
  font-weight: 600;
  font-size: 1rem;
}

.month-toggle {
  width: 100%;
  text-align: left;
  padding: 0.65rem 1rem;
  background: #1f1f1f;
  border: none;
  border-bottom: 1px solid #262626;
  color: #eee;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.month-toggle .chevron {
  font-size: 0.85rem;
  opacity: 0.8;
}

.month-toggle:hover,
.month-toggle:focus-visible {
  background: #222;
}

.days-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.day-link {
  padding: 0.55rem 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1f1f1f;
  transition: background 0.2s ease;
}

.day-link:last-child {
  border-bottom: none;
}

.day-link:hover,
.day-link:focus-visible {
  background: #252525;
}

.day-link.active-day {
  background: #333;
  border-left: 3px solid #888;
}

.day-label {
  flex: 1;
}

.day-link .day-count {
  background: #333;
  color: #fff;
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  border-radius: 0.4rem;
  margin-left: 0.5rem;
}

/* Colonne principale Ã  droite */

.layout .page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  margin: 0;
}

.layout .page-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #333;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
}

.header-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}

/* Bouton "Retour accueil" */

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #3a3a3a;
  background: #1e1e1e;
  color: #d0d0d0;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.back-home:hover,
.back-home:focus-visible {
  background: #2a2a2a;
  transform: translateY(-1px);
}

.back-home-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 0.5rem;
}

.back-home-container .back-home {
  margin-right: 0;
}

.layout .page-header h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
  font-weight: 600;
}

.count-line {
  color: #bbb;
  font-size: 0.95rem;
}

/* Bouton ouverture menu archives en mobile */
.menu-toggle {
  display: none;
  background: #222;
  color: #fff;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
}

/* La galerie de journaux du jour */
.gallery {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 1.5rem;
  flex: 1;
}

.layout .message {
  margin: 0 1.5rem 1.5rem;
}

/* Footer de la page jour */
.page-footer {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border-top: 1px solid #333;
}

/* On masque l'ancienne nav bas de page en mode desktop, on s'appuie plutÃ´t sur la sidebar */
.day-navigation {
  display: none;
}

@media (min-width: 900px) {
  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ----------- Responsive mobile pour la page jour + sidebar ----------- */

@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 1000;
    width: 80%;
    max-width: 300px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-toggle {
    display: inline-block;
  }

  .layout .page-header {
    padding: 1rem 1.25rem;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 1.25rem;
  }

  .layout .message {
    margin: 0 1.25rem 1.25rem;
  }

  .page-footer {
    padding: 1.25rem;
    flex-direction: column;
    gap: 0.75rem;
  }

  .back-home-container {
    margin: 0.5rem 1.25rem 1rem;
  }

  .download-button {
    width: 100%;
  }
}

/* ----------- Bloc logout dans la sidebar ----------- */

.admin-link {
  display: block;
  margin: 0 1.5rem 1.25rem;
  padding: 0.65rem 1rem;
  text-align: center;
  border-radius: 12px;
  background: #1d1d1d;
  border: 1px solid #333;
  color: #e6e6e6;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-link:hover,
.admin-link:focus-visible {
  background: #272727;
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 1.5rem 1.5rem;
}

.logout-block {
  margin-top: 2rem;
  border-top: 1px solid #333;
  padding-top: 1rem;
}

.logout-button {
  width: 100%;
  background: #2a2a2a;
  color: #fff;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.logout-button:hover {
  background: #3a3a3a;
}

/* ----------- Footer lÃ©gal du site ----------- */

.legal-footer {
  font-size: 0.75rem;
  color: #888;
  text-align: center;
  padding: 1rem 0;
  border-top: 1px solid #333;
  background: #0d0d0d;
  margin-top: 2rem;
}

/* ----------- Loading spinner / Ã©tat chargement ----------- */

.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 0;
  color: #cfd6ff;
  font-size: 1.05rem;
  text-align: center;
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(205, 214, 255, 0.25);
  border-top-color: rgba(205, 214, 255, 0.85);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.loading-text {
  margin: 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: #93a3ff;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================================
   PAGE LOGIN
   ========================================================= */

.login-page {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at top left, rgba(78, 140, 255, 0.18), transparent 55%), #08090d;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f7f9ff;
  font-family: "Segoe UI", Roboto, sans-serif;
}

.login-wrapper {
  width: min(420px, 92vw);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.login-card {
  background: rgba(24, 26, 40, 0.92);
  border: 1px solid rgba(110, 140, 255, 0.18);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  padding: clamp(1.8rem, 4vw, 2.75rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.2rem, 3vw, 1.8rem);
  backdrop-filter: blur(8px);
}

.login-brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: center;
}

.login-brand .brand-logo {
  font-size: clamp(1.6rem, 4vw, 2rem);
  letter-spacing: 0.12em;
}

.login-brand .brand-tagline {
  color: #a6b4ff;
  font-size: 0.95rem;
}

.login-error {
  margin: 0;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  background: rgba(255, 95, 95, 0.12);
  border: 1px solid rgba(255, 95, 95, 0.35);
  color: #ffbfbf;
  font-size: 0.9rem;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-field label {
  font-size: 0.95rem;
  color: #d7dcff;
  letter-spacing: 0.02em;
}

.form-field input {
  padding: 0.75rem 0.95rem;
  border-radius: 10px;
  border: 1px solid rgba(110, 140, 255, 0.25);
  background: rgba(12, 13, 20, 0.85);
  color: #f5f7ff;
  font-size: 1rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.form-field input:focus {
  outline: none;
  border: 1px solid rgba(110, 140, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(110, 140, 255, 0.25);
}

.primary-button {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #4e8cff, #6f5fff);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(79, 140, 255, 0.35);
}

.login-button {
  width: 100%;
}

.login-button:focus-visible {
  outline: none;
}

@media (max-width: 540px) {
  .login-card {
    padding: 1.75rem;
  }
}

/* ----------- Admin page ----------- */
.admin-page {
  padding: 1.5rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.admin-page .page-header h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
}

.admin-subtitle {
  margin: 0.75rem 0 0;
  color: #b8bcc7;
  font-size: 0.95rem;
}

.admin-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.admin-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 1px solid #3a3a3a;
  background: #1e1e1e;
  color: #f0f0f0;
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-button:hover,
.admin-button:focus-visible {
  background: #2d2d2d;
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
}

.admin-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.admin-stats {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.admin-stat-card {
  background: #1a1a1a;
  border: 1px solid #2d2d2d;
  border-radius: 14px;
  padding: 1rem 1.25rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9aa0ab;
}

.admin-stat-value {
  font-size: 1.9rem;
  font-weight: 600;
  color: #f7f7f7;
}

.admin-top-ips {
  background: #151515;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.admin-top-ips h2 {
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
}

.admin-top-list {
  list-style: decimal;
  margin: 0;
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: #d9dde5;
}

.ip-geo {
  font-size: 0.78em;
  color: #888;
  margin-left: 0.35em;
}

.admin-top-empty {
  list-style: none;
  padding-left: 0;
  color: #9ba0ac;
}

.admin-table-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-table-wrapper {
  background: #101010;
  border: 1px solid #242424;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table thead {
  background: #1d1d1d;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #bfc4d2;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #242424;
}

.admin-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.admin-table tbody tr:hover {
  background: rgba(78, 140, 255, 0.08);
}

.admin-status.success {
  color: #5ad674;
}

.admin-status.fail {
  color: #ff6b6b;
}

.admin-loading-row td {
  text-align: center;
  color: #aeb3c0;
  font-style: italic;
}

@media (max-width: 900px) {
  .admin-actions {
    width: 100%;
  }

  .admin-page {
    padding: 1.25rem 1.25rem 1.75rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 0.6rem 0.75rem;
  }
}

@media (max-width: 600px) {
  .admin-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-button {
    width: 100%;
  }

  .admin-top-ips {
    padding: 1rem 1.2rem;
  }
}

/* =========================================================
   SKELETON LOADING
   Animation "shimmer" qui remplace les spinners
   ========================================================= */

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #1a1a1f 25%,
    #252530 50%,
    #1a1a1f 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
  border-radius: 8px;
}

/* Titre de section squelette (page accueil) */
.skeleton-title {
  height: 2rem;
  width: 45%;
  margin: 0 auto 1rem;
}

/* Carte image squelette (même ratio que les vraies cartes) */
.skeleton-card {
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* Image squelette dans une journal-card (page jour) */
.skeleton-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
}

/* Ligne de texte squelette */
.skeleton-text {
  height: 1rem;
  width: 70%;
  margin: 0.6rem auto 0;
}

/* Ligne de texte secondaire plus courte */
.skeleton-text-sm {
  height: 0.75rem;
  width: 45%;
  margin: 0.4rem auto 0;
}

/* Bouton squelette (page accueil, bouton "Voir tous") */
.skeleton-btn {
  height: 2.4rem;
  width: 60%;
  max-width: 320px;
  margin: 0.5rem auto 0;
  border-radius: 999px;
}

/* =========================================================
   BADGE "Aujourd'hui" SUR LES MINIATURES
   ========================================================= */

.badge-new {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  background: linear-gradient(135deg, #4e8cff, #6f5fff);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(78, 140, 255, 0.55);
}

/* =========================================================
   TITRE DU JOURNAL EN OVERLAY (cartes page accueil)
   Gradient sombre du bas vers le haut pour la lisibilité
   ========================================================= */

.preview-card-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 55%, transparent);
  padding: 2rem 0.6rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #f0f0f0;
  text-align: center;
  line-height: 1.3;
  pointer-events: none;
  border-radius: 0 0 12px 12px;
}

/* =========================================================
   BOUTON TÉLÉCHARGEMENT SURVOL (cartes page accueil)
   Apparaît en haut à droite au hover
   ========================================================= */

.card-download {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  background: rgba(0, 0, 0, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #fff;
  padding: 0.28rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(4px);
}

.preview-card:hover .card-download,
.preview-card:focus-visible .card-download {
  opacity: 1;
}

/* =========================================================
   TOAST "Nouvelles éditions disponibles"
   ========================================================= */

@keyframes toast-slide-up {
  from { transform: translateY(110%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.toast-notification {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  background: #1b2035;
  border: 1px solid rgba(78, 140, 255, 0.45);
  border-radius: 14px;
  padding: 0.85rem 1.1rem;
  color: #dde4ff;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 360px;
  animation: toast-slide-up 0.3s ease;
}

.toast-refresh-btn {
  background: rgba(78, 140, 255, 0.2);
  border: 1px solid rgba(78, 140, 255, 0.4);
  color: #a8c4ff;
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.toast-refresh-btn:hover {
  background: rgba(78, 140, 255, 0.35);
}

.toast-dismiss-btn {
  background: none;
  border: none;
  color: #6b7a9e;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.toast-dismiss-btn:hover {
  color: #e0e0e0;
}

/* =========================================================
   LIGHTBOX — titre + navigation prev/next
   ========================================================= */

/* Le titre du journal dans la barre d'outils */
.lightbox-title {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  color: #c8d4ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  padding: 0 0.4rem;
}

/* Compteur "2 / 5" */
.lightbox-counter {
  font-size: 0.78rem;
  color: #5a6480;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Boutons ← et → */
.lightbox-nav {
  flex-shrink: 0;
  padding: 0.38rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #3a3a3a;
  background: #1f1f1f;
  color: #f0f0f0;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}

.lightbox-nav:hover:not(:disabled) {
  background: #2c2c2c;
  border-color: #4e8cff;
}

.lightbox-nav:disabled {
  opacity: 0.22;
  cursor: not-allowed;
}

/* =========================================================
   RÉSULTATS DE RECHERCHE EN DEUX SECTIONS (page jour)
   Séparateur visuel entre résultats locaux et globaux
   ========================================================= */

.results-section-heading {
  grid-column: 1 / -1;       /* s'étend sur toute la largeur de la grille */
  margin: 0.5rem 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #7a85a8;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #252535;
}

/* =========================================================
   ADMIN — Statistiques catalogue
   ========================================================= */

.admin-section-title {
  margin: 0 0 0.9rem;
  font-size: 1rem;
  font-weight: 600;
  color: #d0d6e8;
}

.admin-catalogue-section {
  background: #151515;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.admin-catalogue-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.admin-catalogue-card {
  background: #1a1a1a;
  border: 1px solid #2d2d2d;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.admin-catalogue-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9aa0ab;
}

.admin-catalogue-value {
  font-size: 1.65rem;
  font-weight: 600;
  color: #f0f0f0;
}

.admin-catalogue-sub {
  font-size: 0.78rem;
  color: #5a6070;
  margin-top: 0.15rem;
}

/* =========================================================
   ADMIN — Sparkline connexions
   ========================================================= */

.admin-sparkline-section {
  background: #151515;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.admin-sparkline-legend {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  color: #888;
}

.admin-sparkline-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.legend-success::before { background: #5ad674; }
.legend-fail::before    { background: #ff6b6b; }

.admin-sparkline-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 64px;
  overflow: hidden;
}

.sparkline-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.sparkline-bar-success {
  background: #5ad674;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height 0.4s ease;
}

.sparkline-bar-fail {
  background: #ff6b6b;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height 0.4s ease;
}

.sparkline-col-label {
  position: absolute;
  bottom: -1.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  color: #44485a;
  white-space: nowrap;
}

.admin-sparkline-empty {
  color: #555;
  font-size: 0.9rem;
  font-style: italic;
  padding: 1rem 0;
}

/* ===================================================
   PAGE JOURNAUX.HTML — Grille de tous les titres
   =================================================== */

.titres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
  padding: 1rem 0 2rem;
}

/* Carte d'un titre de journal */
.titre-card {
  display: flex;
  flex-direction: column;
  background: #1a1d2e;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid #252840;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}

.titre-card:hover,
.titre-card:focus-visible {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  border-color: #4e8cff;
  outline: none;
}

/* Conteneur image */
.titre-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #111320;
  overflow: hidden;
}

.titre-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.titre-card:hover .titre-card-img {
  transform: scale(1.04);
}

/* Logo SVG générique (fallback) : centré avec fond neutre */
.titre-card-img-fallback {
  object-fit: contain;
  padding: 1.5rem;
  background: #111320;
  opacity: 0.5;
}

/* Badge nombre d'éditions */
.titre-card-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(78, 140, 255, 0.88);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
}

/* Infos textuelles sous l'image */
.titre-card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0.6rem 0.75rem 0.75rem;
}

.titre-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e8eaf6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.titre-card-date {
  font-size: 0.7rem;
  color: #7a7f9a;
}

.titre-card-date.recent {
  color: #f97316;
  font-weight: 600;
}

/* Badge "Nouveau" sur les éditions récentes (≤ 48h) */
.badge-nouveau {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

/* ===================================================
   PAGE JOURNAL.HTML — En-tête avec logo
   =================================================== */

.journal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.journal-logo-header {
  height: 40px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
  padding: 3px 6px;
  flex-shrink: 0;
}

/* Overlay date sur les cartes d'édition */
.edition-date-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1.2rem 0.5rem 0.4rem;
  text-align: center;
  pointer-events: none;
}

/* Liens de navigation dans la sidebar */
.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0 0.75rem 1rem;
}

.admin-nav-link {
  display: block;
  color: #a0aec0;
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.admin-nav-link:hover,
.admin-nav-link:focus-visible {
  background: #252840;
  color: #e8eaf6;
  outline: none;
}

/* Liens d'accès rapide dans le header de l'accueil */
.home-nav-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  align-items: center;
}

.see-archives-journaux {
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
  color: #fff !important;
  border-radius: 10px;
  padding: 0.65rem 1.4rem;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  box-shadow: 0 3px 10px rgba(249, 115, 22, 0.4);
  transition: opacity 0.18s, transform 0.18s, box-shadow 0.18s;
}

.see-archives-journaux:hover {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(249, 115, 22, 0.55);
}
