/* ============================================================================
   LBF Galerie Photos — Frontend v1.3.0
   © Gaëtan Davy – Gammes Digitales – https://www.gammesdigitales.fr
   ============================================================================ */

:root {
  --lbf-primary    : #3A4C69;
  --lbf-accent     : #5b72a0;
  --lbf-bg         : #f7f8fa;
  --lbf-white      : #ffffff;
  --lbf-radius-card: 14px;
  --lbf-shadow-sm  : 0 2px 10px rgba(0,0,0,.09);
  --lbf-shadow-md  : 0 8px 28px rgba(0,0,0,.16);
  --lbf-transition : .25s ease;
  --lbf-gap-h      : 15px;
  --lbf-gap-v      : 15px;
  --lbf-radius     : 8px;
  --lbf-col-d      : 3;
  --lbf-col-t      : 2;
  --lbf-col-m      : 1;
  --lbf-index-cols : 3;
}

/* ── PAGE GALERIE INDIVIDUELLE ────────────────────────────────────────────── */

.lbf-gallery-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 80px;
  box-sizing: border-box;
}

/* Header */
.lbf-gallery-header { margin-top: 70px; margin-bottom: 48px; text-align: center; }

/* Bouton retour */
.lbf-back-btn {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--lbf-accent); text-decoration: none;
  font-size: 13px; font-weight: 600; letter-spacing: .04em;
  margin-bottom: 20px; opacity: .75;
  transition: opacity var(--lbf-transition), gap var(--lbf-transition), color var(--lbf-transition);
}
.lbf-back-btn:hover       { opacity: 1; color: var(--lbf-primary); gap: 11px; }
.lbf-back-btn:hover svg   { transform: translateX(-3px); }
.lbf-back-btn svg         { transition: transform var(--lbf-transition); flex-shrink: 0; }

/* Titre */
.lbf-gallery-title {
  font-family: "Caveat Brush", "Caveat", cursive, sans-serif !important;
  font-size: 52px !important; font-weight: 600 !important;
  line-height: 1.2em !important; color: #3A4C69 !important;
  margin: 0 0 12px !important; padding: 0 !important;
}

/* Compteur */
.lbf-gallery-count {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--lbf-accent);
  opacity: .8; margin: 0 0 14px;
}

/* Description */
.lbf-gallery-description {
  max-width: 560px; margin: 0 auto;
  font-size: 15px; color: #666; line-height: 1.7;
  font-style: italic;
}

/* ── MASONRY ──────────────────────────────────────────────────────────────── */

.lbf-masonry-grid { position: relative; width: 100%; }

.lbf-masonry-item {
  position: absolute; overflow: hidden;
  border-radius: var(--lbf-radius); background: var(--lbf-bg);
  opacity: 0; transition: transform var(--lbf-transition), box-shadow var(--lbf-transition), opacity .35s ease;
  will-change: transform;
}
.lbf-masonry-item.lbf-visible { opacity: 1; }
.lbf-masonry-item.has-shadow  { box-shadow: var(--lbf-shadow-sm); }
.lbf-masonry-item:hover       { transform: translateY(-3px) scale(1.005); }
.lbf-masonry-item.has-shadow:hover { box-shadow: var(--lbf-shadow-md); }
.lbf-masonry-item img { display: block; width: 100%; height: auto; border-radius: var(--lbf-radius); cursor: pointer; }
.lbf-masonry-item a   { display: block; text-decoration: none; }

.lbf-no-photos { text-align: center; color: #999; padding: 60px 0; }

/* ── NAVIGATION PREV/NEXT ─────────────────────────────────────────────────── */

.lbf-gallery-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 60px; padding-top: 32px;
  border-top: 1px solid #e8ecf4;
  gap: 16px;
}

.lbf-nav-btn {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--lbf-accent);
  font-size: 13px; font-weight: 600;
  padding: 10px 18px; border-radius: 30px;
  border: 1px solid var(--lbf-accent);
  transition: background var(--lbf-transition), color var(--lbf-transition), transform var(--lbf-transition);
  max-width: 45%;
}
.lbf-nav-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbf-nav-btn:hover { background: var(--lbf-primary); color: #fff; border-color: var(--lbf-primary); }
.lbf-nav-btn:hover svg { stroke: #fff; }
.lbf-nav-btn svg { flex-shrink: 0; transition: transform var(--lbf-transition), stroke var(--lbf-transition); stroke: currentColor; }
.lbf-nav-prev:hover svg { transform: translateX(-3px); }
.lbf-nav-next:hover svg { transform: translateX(3px); }

/* ── LIGHTBOX ─────────────────────────────────────────────────────────────── */

.lbf-lightbox-overlay {
  display: none; position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,.88);
  align-items: center; justify-content: center;
  padding: 20px; box-sizing: border-box;
}
.lbf-lightbox-overlay.active { display: flex; }

.lbf-lightbox-container {
  position: relative; display: flex; align-items: center;
  gap: 16px; max-width: 92vw; max-height: 90vh;
}

.lbf-lb-image {
  max-width: 84vw; max-height: 88vh; width: auto; height: auto;
  border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6);
  object-fit: contain; transition: opacity .2s;
}
.lbf-lb-image.loading { opacity: .3; }

.lbf-lb-close, .lbf-lb-prev, .lbf-lb-next {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  cursor: pointer; border-radius: 50%; width: 44px; height: 44px;
  font-size: 20px; display: flex; align-items: center; justify-content: center;
  transition: background var(--lbf-transition); flex-shrink: 0; backdrop-filter: blur(6px);
}
.lbf-lb-close:hover, .lbf-lb-prev:hover, .lbf-lb-next:hover { background: rgba(255,255,255,.3); }
.lbf-lb-close { position: absolute; top: -50px; right: 0; }
.lbf-lb-counter { position: absolute; bottom: -36px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.7); font-size: 13px; white-space: nowrap; }

/* ── INDEX DES GALERIES ───────────────────────────────────────────────────── */

.lbf-galleries-index {
  max-width: 1400px; margin: 0 auto;
  padding: 60px 24px 80px; box-sizing: border-box;
}

.lbf-galleries-grid {
  display: grid;
  grid-template-columns: repeat(var(--lbf-index-cols, 3), 1fr);
  gap: 28px; align-items: start;
}
@media (max-width: 1024px) { .lbf-galleries-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width:  580px) { .lbf-galleries-grid { grid-template-columns: 1fr; } }

/* Carte */
.lbf-gallery-card {
  background: var(--lbf-white); border-radius: var(--lbf-radius-card);
  overflow: hidden; box-shadow: var(--lbf-shadow-sm);
  transition: box-shadow var(--lbf-transition), transform var(--lbf-transition);
}
.lbf-gallery-card:hover { box-shadow: var(--lbf-shadow-md); transform: translateY(-5px); }

/* Slider */
.lbf-card-slider { width: 100%; aspect-ratio: 4/3; overflow: hidden; background: var(--lbf-bg); }
.lbf-card-slider .swiper-slide { overflow: hidden; }
.lbf-card-slider .swiper-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

.lbf-card-slider .swiper-button-prev,
.lbf-card-slider .swiper-button-next {
  width: 32px; height: 32px; background: rgba(0,0,0,.45); border-radius: 50%;
  color: #fff !important; opacity: 0; transition: opacity var(--lbf-transition);
}
.lbf-gallery-card:hover .swiper-button-prev,
.lbf-gallery-card:hover .swiper-button-next { opacity: 1; }
.lbf-card-slider .swiper-button-prev::after,
.lbf-card-slider .swiper-button-next::after { font-size: 12px; font-weight: 700; }
.lbf-card-slider .swiper-pagination-bullet        { background: rgba(255,255,255,.7); opacity: 1; }
.lbf-card-slider .swiper-pagination-bullet-active { background: #fff; }

/* Infos carte */
.lbf-card-info { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; }

.lbf-card-meta { display: flex; align-items: center; gap: 10px; }

.lbf-card-count {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--lbf-accent); display: flex; align-items: center; gap: 5px;
}

.lbf-card-locked { color: var(--lbf-accent); opacity: .7; display: flex; align-items: center; }

.lbf-card-title {
  font-family: "Caveat Brush", "Caveat", cursive, sans-serif;
  font-size: 26px; font-weight: 600; color: var(--lbf-primary);
  line-height: 1.2; margin: 0; padding: 0;
}

.lbf-card-description {
  font-size: 13px; color: #888; line-height: 1.5;
  margin: 0; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* Bouton */
.lbf-card-btn {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  background: var(--lbf-primary); color: #ffffff !important; text-decoration: none !important;
  font-size: 14px; font-weight: 600; padding: 10px 20px;
  border-radius: 30px; margin-top: 4px;
  transition: background var(--lbf-transition), transform var(--lbf-transition), gap var(--lbf-transition);
  letter-spacing: .02em; line-height: 1;
}
.lbf-card-btn:hover { background: var(--lbf-accent); color: #ffffff !important; transform: translateY(-2px); gap: 12px; }
.lbf-card-btn svg   { stroke: #ffffff; flex-shrink: 0; transition: transform var(--lbf-transition); }
.lbf-card-btn:hover svg { transform: translateX(3px); }

.lbf-no-galleries { text-align: center; padding: 80px 20px; color: #999; font-size: 16px; }

/* ── Responsive galerie ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .lbf-gallery-title  { font-size: 38px !important; }
}
@media (max-width: 640px) {
  .lbf-gallery-title  { font-size: 30px !important; }
  .lbf-gallery-header { margin-top: 50px; margin-bottom: 32px; }
  .lbf-gallery-nav    { flex-direction: column; align-items: stretch; }
  .lbf-nav-btn        { max-width: 100%; justify-content: center; }
}

/* ── FILTRES INDEX ────────────────────────────────────────────────────────── */

.lbf-filters {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-bottom: 48px;
  padding: 28px 32px;
  background: #fff;
  border: 1px solid #e8ecf4;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
}

/* Barre de recherche */
.lbf-search-wrap {
  display: flex; align-items: center; gap: 10px;
  background: #f7f8fb; border: 1.5px solid #e4e8f0;
  border-radius: 40px; padding: 11px 20px;
  width: 100%; max-width: 420px;
  transition: border-color .2s, box-shadow .2s;
}
.lbf-search-wrap:focus-within {
  border-color: var(--lbf-accent);
  box-shadow: 0 0 0 3px rgba(91,114,160,.12);
  background: #fff;
}
.lbf-search-wrap svg   { flex-shrink: 0; color: #bbb; }
.lbf-search-wrap input {
  border: none; outline: none; background: none;
  font-size: 14px; color: #333; width: 100%;
}
.lbf-search-wrap input::placeholder { color: #bbb; }
.lbf-clear-btn {
  background: none; border: none; cursor: pointer;
  color: #bbb; font-size: 13px; padding: 0; line-height: 1;
  transition: color .15s; flex-shrink: 0;
}
.lbf-clear-btn:hover { color: var(--lbf-primary); }

/* Séparateur léger */
.lbf-filters::after {
  content: none;
}

/* Pills années */
.lbf-year-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
}

.lbf-pill {
  padding: 9px 22px; border-radius: 40px;
  border: 1.5px solid #e4e8f0; background: #f7f8fb;
  font-size: 13px; font-weight: 600; color: #888;
  cursor: pointer; transition: all .18s;
  white-space: nowrap; letter-spacing: .01em;
}
.lbf-pill:hover  {
  border-color: var(--lbf-accent);
  color: var(--lbf-accent);
  background: #fff;
  transform: translateY(-1px);
}
.lbf-pill.active {
  background: var(--lbf-primary);
  border-color: var(--lbf-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(58,76,105,.28);
}

/* Compteur */
.lbf-filter-count {
  font-size: 12px; color: #bbb; margin: 0;
  font-style: italic; min-height: 16px; text-align: center;
}

/* Transitions cartes */
.lbf-gallery-card {
  transition: opacity .25s ease, transform .25s ease;
}
.lbf-gallery-card.lbf-hidden-card {
  display: none;
}

/* Aucun résultat */
.lbf-no-results {
  text-align: center; padding: 60px 20px; color: #aaa;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.lbf-no-results svg { opacity: .4; }
.lbf-no-results p   { font-size: 16px; margin: 0; }
.lbf-no-results button {
  padding: 10px 22px; border-radius: 30px;
  border: 1.5px solid var(--lbf-accent); color: var(--lbf-accent);
  background: none; cursor: pointer; font-size: 13px; font-weight: 600;
  transition: background .2s, color .2s;
}
.lbf-no-results button:hover {
  background: var(--lbf-primary);
  border-color: var(--lbf-primary);
  color: #fff;
}

/* ── BOUTON TÉLÉCHARGEMENT ZIP ────────────────────────────────────────────── */

.lbf-download-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-top: 50px; padding-top: 40px;
  border-top: 1px solid #e8ecf4;
}

.lbf-download-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; color: var(--lbf-primary) !important;
  text-decoration: none !important;
  border: 2px solid var(--lbf-primary);
  font-size: 14px; font-weight: 700;
  padding: 13px 28px; border-radius: 30px;
  letter-spacing: .02em; transition: all .2s;
}
.lbf-download-btn:hover {
  background: var(--lbf-primary); color: #fff !important;
  transform: translateY(-2px); box-shadow: 0 8px 24px rgba(58,76,105,.25);
}
.lbf-download-btn:hover svg { stroke: #fff; }
.lbf-download-btn svg { stroke: var(--lbf-primary); transition: stroke .2s; flex-shrink: 0; }
.lbf-dl-count { font-weight: 400; opacity: .7; font-size: 13px; }
.lbf-dl-note  { font-size: 11px; color: #bbb; }
