/* ══════════════════════════════════════
   CACINT AKE — Photothèque
   ══════════════════════════════════════ */

/* ── Hero galerie ── */
.gallery-hero {
  margin-top: 68px;
  background: linear-gradient(135deg, var(--blue) 0%, #1a3a8a 60%, var(--red) 100%);
  padding: 70px 0 50px;
  text-align: center;
}
.gallery-hero-title {
  color: var(--white); font-size: 2.6rem; font-weight: 800; margin-bottom: 10px;
}
.gallery-hero-sub {
  color: rgba(255,255,255,.82); font-size: 1.1rem; margin-bottom: 30px;
}
.gallery-stats { display: flex; justify-content: center; gap: 40px; }
.g-stat { color: var(--white); text-align: center; }
.g-stat span { display: block; font-size: 2.2rem; font-weight: 800; color: #f0b429; line-height: 1; }
.g-stat { font-size: .9rem; opacity: .85; }

/* ── Filtres ── */
.gallery-filters { background: var(--white); border-bottom: 1px solid #e2e8f0; position: sticky; top: 68px; z-index: 100; }
.filters-bar { display: flex; gap: 10px; padding: 14px 0; flex-wrap: wrap; }
.filter-btn {
  padding: 8px 22px; border-radius: 30px; font-size: .9rem; font-weight: 600;
  text-decoration: none; color: #555; background: #f1f3f8;
  border: 2px solid transparent; transition: all .2s;
}
.filter-btn:hover { background: #e2e8f4; color: var(--blue); }
.filter-btn.active { background: var(--blue); color: var(--white); border-color: var(--blue); }

/* ── Section galerie ── */
.gallery-section { padding: 50px 0 80px; background: var(--gray); min-height: 400px; }

/* ── Grille masonry-like ── */
.gallery-grid {
  columns: 4 280px; column-gap: 16px;
}
.gallery-item {
  break-inside: avoid; margin-bottom: 16px;
  border-radius: 10px; overflow: hidden;
  position: relative; cursor: pointer;
  box-shadow: 0 3px 16px rgba(0,48,135,.10);
  transition: transform .25s, box-shadow .25s;
  background: #d1d9e6;
}
.gallery-item:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 10px 32px rgba(0,48,135,.2); }

.gallery-item img {
  width: 100%; height: auto; display: block;
  transition: transform .4s;
}
.gallery-item:hover img { transform: scale(1.05); }

/* ── Vignette vidéo ── */
.video-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #111; }
.video-thumb video { width: 100%; height: 100%; object-fit: cover; opacity: .7; }
.video-play-icon {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--white);
  background: rgba(0,0,0,.35); transition: background .2s;
}
.gallery-item:hover .video-play-icon { background: rgba(192,57,43,.6); }

/* ── Overlay info ── */
.gallery-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,20,60,.85));
  padding: 30px 14px 14px;
  transform: translateY(100%); transition: transform .3s;
}
.gallery-item:hover .gallery-overlay { transform: translateY(0); }
.overlay-content h4 { color: var(--white); font-size: .92rem; margin: 4px 0; }
.media-badge {
  display: inline-block; font-size: .72rem; padding: 2px 8px;
  border-radius: 12px; font-weight: 700; margin-bottom: 4px;
}
.photo-badge { background: var(--blue); color: var(--white); }
.video-badge { background: var(--red);  color: var(--white); }
.media-cat  { display: block; color: #f0b429; font-size: .78rem; }
.media-date { color: rgba(255,255,255,.65); font-size: .75rem; }

/* ── Vide ── */
.gallery-empty {
  text-align: center; padding: 80px 20px; color: #888;
}
.empty-icon { font-size: 5rem; margin-bottom: 20px; }
.gallery-empty h3 { color: var(--blue); font-size: 1.4rem; margin-bottom: 10px; }

/* ══════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════ */
.lightbox {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.94);
  display: none; align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }

.lb-content {
  max-width: 92vw; max-height: 92vh;
  display: flex; flex-direction: column;
  align-items: center; gap: 16px;
}
.lb-media { max-width: 88vw; max-height: 78vh; }
.lb-media img,
.lb-media video {
  max-width: 88vw; max-height: 78vh;
  border-radius: 8px; display: block;
  box-shadow: 0 8px 40px rgba(0,0,0,.7);
}
.lb-info { text-align: center; color: var(--white); }
.lb-info h3 { font-size: 1.1rem; margin-bottom: 4px; }
.lb-info p  { color: rgba(255,255,255,.7); font-size: .9rem; }
.lb-counter { display: inline-block; margin-top: 6px; color: rgba(255,255,255,.5); font-size: .8rem; }

.lb-close {
  position: fixed; top: 18px; right: 24px;
  background: rgba(255,255,255,.12); border: none; color: var(--white);
  font-size: 1.5rem; width: 44px; height: 44px; border-radius: 50%;
  cursor: pointer; transition: background .2s; z-index: 9010;
}
.lb-close:hover { background: var(--red); }
.lb-prev, .lb-next {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.1); border: none; color: var(--white);
  font-size: 2.5rem; width: 52px; height: 52px; border-radius: 50%;
  cursor: pointer; transition: background .2s; z-index: 9010; line-height: 1;
}
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-prev:hover, .lb-next:hover { background: var(--blue); }

/* ══════════════════════════════════════
   ADMIN — Upload & Gestion
   ══════════════════════════════════════ */
.admin-page { margin-top: 68px; min-height: calc(100vh - 68px); background: var(--gray); padding: 40px 0; }
.admin-card {
  background: var(--white); border-radius: 12px;
  box-shadow: var(--shadow); padding: 40px;
  max-width: 700px; margin: 0 auto 30px;
}
.admin-card h2 { color: var(--blue); margin-bottom: 20px; font-size: 1.4rem; }
.admin-card h2 span { color: var(--red); }

/* Zone de drop ── */
.drop-zone {
  border: 3px dashed #b0bdd6; border-radius: 10px;
  padding: 50px 20px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s; margin-bottom: 20px;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--blue); background: #f0f4ff; }
.drop-zone .dz-icon { font-size: 3rem; margin-bottom: 10px; }
.drop-zone p { color: #666; font-size: .95rem; }
.drop-zone input[type=file] { display: none; }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 20px; }
.preview-item { border-radius: 6px; overflow: hidden; position: relative; aspect-ratio: 1; background: #eee; }
.preview-item img, .preview-item video { width: 100%; height: 100%; object-fit: cover; }
.preview-remove {
  position: absolute; top: 4px; right: 4px; background: var(--red);
  color: var(--white); border: none; border-radius: 50%; width: 22px; height: 22px;
  cursor: pointer; font-size: .8rem; line-height: 22px; text-align: center;
}

/* Tableau gestion ── */
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th { background: var(--blue); color: var(--white); padding: 10px 14px; text-align: left; }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid #eee; vertical-align: middle; }
.admin-table tr:hover td { background: #f8faff; }
.admin-table img { width: 60px; height: 45px; object-fit: cover; border-radius: 4px; }
.btn-delete { background: var(--red); color: var(--white); border: none; padding: 5px 14px; border-radius: 4px; cursor: pointer; font-size: .82rem; }
.btn-delete:hover { background: var(--red-lt); }

/* ── Login admin ── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--blue); }
.login-card { background: var(--white); border-radius: 14px; padding: 50px 44px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); text-align: center; }
.login-card h2 { color: var(--blue); margin-bottom: 6px; }
.login-card p  { color: #888; font-size: .88rem; margin-bottom: 28px; }
.progress-bar { height: 5px; background: #eee; border-radius: 10px; margin: 16px 0 0; overflow: hidden; display: none; }
.progress-fill { height: 100%; background: var(--blue); width: 0; transition: width .4s; }

@media (max-width: 700px) {
  .gallery-grid { columns: 2 150px; }
  .lb-prev { left: 6px; } .lb-next { right: 6px; }
  .lb-prev, .lb-next { width: 38px; height: 38px; font-size: 1.8rem; }
}
@media (max-width: 420px) {
  .gallery-grid { columns: 1; }
}
