/* ==========================================
   PAGE GALERIE
   ========================================== */

.gallery-page {
  padding-bottom: 5rem;
}

/* ==========================================
   HERO
   ========================================== */

.gallery-hero {
  background: #2a180f;
}

.gallery-hero::after {
  background: linear-gradient(
    90deg,
    rgba(30, 12, 5, 0.8),
    rgba(45, 18, 7, 0.48) 40%,
    rgba(35, 14, 5, 0.06) 73%
  );
}

.gallery-hero__image {
  object-position: center 52%;
}

.gallery-hero__content > div {
  max-width: 520px;
}

.gallery-hero h1 {
  margin: 0;
  color: var(--nanna-ink);
  font-family: var(--nanna-serif);
  font-weight: 500;
}

.gallery-hero h1 {
  color: #fff;
  font-size: clamp(3rem, 5vw, 4.5rem);
}

.gallery-hero h1::after {
  display: block;
  width: 54px;
  height: 2px;
  margin-top: 0.75rem;
  content: "";
  background: var(--nanna-gold-soft);
}

.gallery-hero p {
  margin: 1rem 0 0;
  font-family: var(--nanna-serif);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-style: italic;
  line-height: 1.25;
}

/* ==========================================
   FILTRES — DESKTOP
   ========================================== */

.gallery-page .gallery-filters.site-shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;

  gap: 0.7rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 1.6rem auto 0;

  overflow: visible;
  box-sizing: border-box;
}

.gallery-page .gallery-filter {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;

  gap: 0.6rem;
  min-width: 0;
  min-height: 50px;
  padding: 0.7rem 1.1rem;

  border: 1px solid rgba(112, 73, 28, 0.11);
  border-radius: 10px;

  color: var(--nanna-ink);
  background: rgba(255, 253, 250, 0.9);
  box-shadow: 0 5px 14px rgba(67, 37, 22, 0.07);

  font: inherit;
  font-family: var(--nanna-serif);
  font-size: 0.96rem;
  font-weight: 700;
  white-space: nowrap;

  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.gallery-filter__label {
  display: inline;
}

/* ==========================================
   ICÔNES FONT AWESOME
   ========================================== */

.gallery-page .gallery-filter > i {
  display: inline-block;
  flex-shrink: 0;
  color: #a96808;
  font-size: 1.65rem;
  line-height: 1;
}

/* ==========================================
   ICÔNES PNG — PALMIER ET KSAR
   ========================================== */

.gallery-custom-icon {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  object-fit: contain;

  /*
      Recoloration dorée plus soutenue.
      Épaississement léger des contours PNG.
      Nécessite un PNG sur fond transparent.
    */
  filter: brightness(0) saturate(100%) invert(37%) sepia(90%) saturate(800%)
    hue-rotate(358deg) brightness(90%) contrast(120%)
    drop-shadow(0.5px 0 0 #a96808) drop-shadow(-0.5px 0 0 #a96808);
}

/* ==========================================
   ÉTATS DES FILTRES
   ========================================== */

.gallery-page .gallery-filter:hover,
.gallery-page .gallery-filter.is-active {
  border-color: var(--nanna-gold-dark);
  color: #fff;
  background: var(--nanna-gold-dark);
}

.gallery-page .gallery-filter:hover > i,
.gallery-page .gallery-filter.is-active > i {
  color: #fff;
}

.gallery-page .gallery-filter:hover .gallery-custom-icon,
.gallery-page .gallery-filter.is-active .gallery-custom-icon {
  filter: brightness(0) invert(1) drop-shadow(0.4px 0 0 #fff)
    drop-shadow(-0.4px 0 0 #fff);
}

/* Focus clavier visible */
.gallery-page .gallery-filter:focus-visible {
  outline: 3px solid var(--nanna-gold-dark);
  outline-offset: 3px;
}

/* ==========================================
   SECTIONS
   ========================================== */

.gallery-sections {
  padding-top: 2.7rem;
}

.gallery-section {
  padding: 2.25rem 0;
}

.gallery-section + .gallery-section {
  border-top: 1px solid rgba(124, 83, 34, 0.12);
}

/* ==========================================
   GRILLES PHOTOGRAPHIQUES
   ========================================== */

.gallery-strip {
  display: grid;
  gap: 0.65rem;
}

.gallery-strip--wide {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.gallery-tile,
.gallery-landscape__main,
.gallery-landscape__thumbs > a {
  display: block;
  overflow: hidden;
  border-radius: 12px;
  background: #e9ddcc;
}

.gallery-tile {
  min-height: 178px;
}

.gallery-tile img,
.gallery-landscape__main img,
.gallery-landscape__thumbs img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.gallery-tile:hover img,
.gallery-landscape__main:hover img,
.gallery-landscape__thumbs > a:hover img {
  transform: scale(1.035);
}

/* ==========================================
   BOUTONS +N PHOTOS
   ========================================== */

.gallery-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  min-height: 178px;
  border-radius: 12px;

  color: #fff;
  background:
    linear-gradient(rgba(59, 30, 14, 0.55), rgba(59, 30, 14, 0.78)),
    url("../../../img/original/Salon-marocain-chaleureux-et-lanternes-ornées.png")
      center / cover;

  text-align: center;
  text-decoration: none;
}

.gallery-more:hover,
.gallery-more:focus-visible {
  color: #fff;
  text-decoration: none;
}

.gallery-more i {
  margin-bottom: 0.35rem;
  font-size: 1.35rem;
}

.gallery-more strong {
  font-size: 1.45rem;
}

.gallery-more span {
  font-size: 0.9rem;
}

/* Images accessibles uniquement dans Fancybox */
.gallery-lightbox-only {
  display: none;
}

/* ==========================================
   PALMERAIE ET KSAR
   ========================================== */

.gallery-paired {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.25rem;
}

.gallery-paired .gallery-section {
  min-width: 0;
}

.gallery-landscape__main {
  height: 255px;
}

.gallery-landscape__thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.gallery-landscape__thumbs > a,
.gallery-more--small {
  height: 92px;
  min-height: 92px;
}

.gallery-more--small i {
  font-size: 1rem;
}

.gallery-more--small strong {
  font-size: 1.15rem;
}

.gallery-more--small span {
  font-size: 0.78rem;
}

/* Sections masquées par les filtres */
.gallery-section[hidden] {
  display: none;
}

/* ==========================================
   TABLETTE — 576 À 991 PX
   ========================================== */

@media (min-width: 576px) and (max-width: 991.98px) {
  .gallery-page .gallery-filters.site-shell {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .gallery-page .gallery-filter {
    flex: 0 0 auto;
    padding: 10px 14px;
    font-size: 13px;
  }
}

/* ==========================================
   TABLETTE ET ÉCRANS MOYENS
   ========================================== */

@media (max-width: 991.98px) {

  .gallery-strip--wide {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-tile,
  .gallery-more {
    min-height: 155px;
  }

  .gallery-paired {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .gallery-paired .gallery-section + .gallery-section {
    border-top: 1px solid rgba(124, 83, 34, 0.12);
  }
}

/* ==========================================
   MOBILE — MOINS DE 576 PX
   ========================================== */

@media (max-width: 575.98px) {
  .gallery-page {
    padding-bottom: 3rem;
  }

  /* HERO */


  .gallery-hero h1 {
    font-size: 2.75rem;
  }

  /* FILTRES — GRILLE 2 × 3 */

  .gallery-page .gallery-filters.site-shell {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    justify-content: stretch;

    gap: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 16px auto 0;
    padding: 0 12px;

    overflow: visible;
    box-sizing: border-box;
  }

  .gallery-page .gallery-filters .gallery-filter {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-width: 0;
    min-height: 62px;

    margin: 0;
    padding: 9px 10px;

    border-radius: 14px;
    box-sizing: border-box;
    gap: 0.55rem;
  }

  .gallery-page .gallery-filter__label {
    display: inline;
    overflow-wrap: anywhere;
    font-size: 0.82rem;
    line-height: 1.12;
  }

  /* Font Awesome */

  .gallery-page .gallery-filter > i {
    font-size: 1.25rem;
  }

  /* PNG Palmeraie et Ksar */

  .gallery-page .gallery-filter .gallery-custom-icon {
    width: 23px;
    height: 23px;
  }

  /* SECTIONS */

  .gallery-sections {
    padding-top: 1.5rem;
  }

  .gallery-section {
    padding: 1.75rem 0;
  }

  /* PHOTOGRAPHIES */

  .gallery-strip--wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-tile,
  .gallery-more {
    min-height: 132px;
  }

  .gallery-landscape__main {
    height: 210px;
  }

  .gallery-landscape__thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-landscape__thumbs > a,
  .gallery-more--small {
    height: 100px;
    min-height: 100px;
  }
}
