body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--couleur-texte-principal);
  background:
    radial-gradient(circle at 12% 8%, rgba(110, 48, 113, 0.2), transparent 32%),
    radial-gradient(circle at 88% 14%, rgba(225, 177, 77, 0.22), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(223, 213, 235, 0.3), transparent 30%),
    linear-gradient(180deg, #faf8fd 0%, #f3f1f7 54%, #eeecf4 100%);
}

header {
  background-color: #222;
  color: #eee;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

header h1 {
  margin: 0;
  font-weight: normal;
  font-size: 1.3rem;
  color: #eee;
  border: none;
  text-align: left;
}

.header-right {
  display: flex;
  align-items: center;
  position: relative;
}

.hamburger-btn {
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #eee;
  border-radius: 10px;
  padding: 0.48rem 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.hamburger-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(137, 134, 147, 0.45);
  box-shadow: 0 14px 34px rgba(47, 48, 49, 0.14);
  z-index: 30;
}

.hamburger-menu.open {
  display: block;
}

.hamburger-menu a {
  display: block;
  margin: 0;
  padding: 0.7rem 0.9rem;
  color: #2f3031;
  text-decoration: none;
  border-bottom: 1px solid rgba(137, 134, 147, 0.2);
}

.hamburger-menu a:last-child {
  border-bottom: none;
}

.hamburger-menu a:hover,
.hamburger-menu a[aria-current="page"] {
  background: rgba(223, 213, 235, 0.48);
  color: #6e3071;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.2rem;
}

.hero {
  background: linear-gradient(130deg, rgba(110, 48, 113, 0.92), rgba(66, 31, 77, 0.94));
  color: #f9f8fb;
  border-radius: 18px;
  padding: 1.3rem 1.4rem;
  box-shadow: 0 16px 30px rgba(47, 48, 49, 0.18);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -3rem -3rem auto;
  width: 11rem;
  height: 11rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(225, 177, 77, 0.22) 0%, rgba(225, 177, 77, 0) 70%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: -30% auto auto -20%;
  width: 13rem;
  height: 13rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(223, 213, 235, 0.18) 0%, rgba(223, 213, 235, 0) 68%);
  pointer-events: none;
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  margin: 0 0 0.4rem;
  color: #e9cb8f;
}

.hero h2 {
  margin: 0;
  color: #fff;
  border: none;
  padding: 0;
}

.hero p {
  margin: 0.45rem 0 0;
}

.fixed-galleries {
  margin-top: 1.2rem;
  margin-bottom: 1.4rem;
  border: 1px solid rgba(110, 48, 113, 0.2);
  border-radius: 20px;
  padding: 1rem 1.1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 246, 251, 0.92)),
    radial-gradient(circle at top right, rgba(225, 177, 77, 0.14), transparent 28%);
  box-shadow: 0 18px 40px rgba(47, 48, 49, 0.09);
}

.fixed-galleries h2 {
  margin: 0;
  padding: 0;
  border: none;
  color: #4a2352;
}

.fixed-galleries p {
  margin: 0.45rem 0 0.9rem;
}

.fixed-controls {
  border: 1px solid rgba(110, 48, 113, 0.2);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 0.9rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(249, 247, 250, 0.96)),
    radial-gradient(circle at 100% 0%, rgba(223, 213, 235, 0.16), transparent 30%);
  box-shadow: 0 12px 26px rgba(47, 48, 49, 0.07);
}

.fixed-search-wrap {
  margin-bottom: 0.8rem;
}

.fixed-filter-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.9rem;
  margin-bottom: 0.6rem;
}

.fixed-gallery-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.fixed-gallery-links.is-grouped {
  display: block;
}

.fixed-gallery-section {
  margin-bottom: 0.95rem;
}

.fixed-gallery-section-title {
  margin: 0 0 0.45rem;
  color: #4a2352;
  font-size: 0.98rem;
  border-bottom: 1px solid rgba(110, 48, 113, 0.2);
  padding-bottom: 0.18rem;
}

.fixed-gallery-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.fixed-gallery-link {
  display: block;
  text-decoration: none;
  border: 1px solid rgba(110, 48, 113, 0.28);
  border-radius: 16px;
  padding: 0.75rem 0.85rem;
  background:
    linear-gradient(130deg, rgba(110, 48, 113, 0.08), rgba(225, 177, 77, 0.12)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 246, 251, 0.98));
  box-shadow: 0 10px 24px rgba(47, 48, 49, 0.08);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, filter 150ms ease;
}

.fixed-gallery-link:hover {
  transform: translateY(-2px);
  border-color: rgba(110, 48, 113, 0.62);
  box-shadow: 0 16px 30px rgba(47, 48, 49, 0.14);
  text-decoration: none;
  filter: saturate(1.06);
}

.fixed-gallery-link-title {
  display: block;
  font-weight: 700;
  color: #4a2352;
}

.fixed-gallery-link-meta {
  display: block;
  margin-top: 0.18rem;
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6e3071;
}

.fixed-gallery-link-desc {
  display: block;
  margin-top: 0.42rem;
  font-size: 0.89rem;
  color: #3c3240;
}

.fixed-gallery-link-tags {
  margin-top: 0.42rem;
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.fixed-gallery-tag {
  border: 1px solid rgba(110, 48, 113, 0.3);
  border-radius: 999px;
  padding: 0.14rem 0.45rem;
  font-size: 0.74rem;
  color: #6e3071;
  background: rgba(110, 48, 113, 0.06);
}

.fixed-footer-actions {
  margin-top: 0.7rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.controls {
  margin-top: 1.2rem;
  margin-bottom: 1.4rem;
  border: 1px solid rgba(110, 48, 113, 0.16);
  border-radius: 18px;
  padding: 1.2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(248, 246, 251, 0.95));
  backdrop-filter: blur(8px);
  box-shadow: 0 14px 30px rgba(47, 48, 49, 0.08);
}

.search-section {
  margin-bottom: 1.4rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(137, 134, 147, 0.2);
}

.search-label {
  display: block;
  margin-bottom: 0.6rem;
  font-weight: 700;
  font-size: 0.98rem;
  color: #412048;
  letter-spacing: 0.02em;
}

.search-input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1.5px solid rgba(137, 134, 147, 0.4);
  font-size: 1rem;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.search-input:focus {
  border-color: #6e3071;
  box-shadow: 0 0 0 3px rgba(110, 48, 113, 0.1);
  outline: none;
}

.filters-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  margin-bottom: 0.8rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.filter-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #412048;
  letter-spacing: 0.02em;
}

.sort-select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1.5px solid rgba(137, 134, 147, 0.4);
  font-size: 0.98rem;
  background: #fff;
  color: #2f3031;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.sort-select:focus {
  border-color: #6e3071;
  box-shadow: 0 0 0 3px rgba(110, 48, 113, 0.1);
  outline: none;
}

.chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.chip {
  border: 1.5px solid rgba(110, 48, 113, 0.45);
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  background: #fff;
  color: #4a2352;
  font-weight: 600;
  font-size: 0.93rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 120ms ease;
}

.chip:hover {
  border-color: #6e3071;
  background: rgba(110, 48, 113, 0.08);
}

.chip.is-active {
  background: #6e3071;
  color: #fff;
  border-color: #6e3071;
}

.gallery-count {
  margin: 0;
  font-size: 0.96rem;
  color: #5a3d60;
}

.controls-footer {
  margin-top: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.controls-toggles {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.secondary-btn {
  border: 1px solid rgba(110, 48, 113, 0.45);
  border-radius: 10px;
  padding: 0.48rem 0.8rem;
  font-weight: 700;
  background: #fff;
  color: #4a2352;
  cursor: pointer;
}

.secondary-btn:hover {
  background: rgba(110, 48, 113, 0.08);
}

.toggle-compact {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: #4a2352;
}

.controls-hint {
  margin: 0.55rem 0 0;
  font-size: 0.84rem;
  color: #6e3071;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.gallery-item {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(110, 48, 113, 0.12);
  background: linear-gradient(180deg, #fff 0%, #fbf9fd 100%);
  box-shadow: 0 10px 28px rgba(47, 48, 49, 0.11);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  animation: galleryCardReveal 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--card-index, 0) * 35ms);
}

.gallery-item::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, rgba(110, 48, 113, 0.96), rgba(225, 177, 77, 0.98));
  z-index: 1;
}
.gallery-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0.65rem 0.7rem;
}
.favorite-btn {
  border: 1px solid rgba(110, 48, 113, 0.35);
  border-radius: 999px;
  background: #fff;
  color: #6e3071;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.22rem 0.62rem;
  cursor: pointer;
}
.favorite-btn.is-active {
  background: #6e3071;
  border-color: #6e3071;
  color: #fff;
}
.gallery-grid.is-grouped {
  display: block;
}
.gallery-group {
  margin-bottom: 1rem;
}
.gallery-group-title {
  margin: 0 0 0.65rem;
  font-size: 1.02rem;
  color: #4a2352;
  border-bottom: 1px solid rgba(110, 48, 113, 0.24);
  padding-bottom: 0.25rem;
}
.gallery-group-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(47, 48, 49, 0.16);
  border-color: rgba(110, 48, 113, 0.28);
}

.gallery-btn {
  border: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  text-align: left;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 5;
  min-height: 220px;
  object-fit: cover;
  display: block;
  background: #ddd;
  transition: transform 220ms ease, filter 220ms ease;
}

.gallery-item:hover img {
  transform: scale(1.03);
  filter: saturate(1.05) contrast(1.02);
}

.gallery-grid.is-compact {
  gap: 0.65rem;
}

.gallery-grid.is-compact .gallery-item img {
  height: 165px;
}

.gallery-grid.is-compact .gallery-meta {
  padding: 0.5rem 0.58rem 0.62rem;
}
.gallery-grid.is-compact .gallery-actions {
  padding: 0 0.55rem 0.55rem;
}

.gallery-grid.is-compact .gallery-title {
  font-size: 0.9rem;
}

.gallery-grid.is-compact .gallery-universe {
  font-size: 0.76rem;
}

.gallery-meta {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  padding: 0.85rem 0.9rem 0.95rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 246, 251, 0.99)),
    radial-gradient(circle at top left, rgba(225, 177, 77, 0.08), transparent 42%);
}

.gallery-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #2f3031;
  line-height: 1.3;
}

.gallery-universe {
  margin: 0;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 0.17rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6e3071;
  background: linear-gradient(135deg, rgba(110, 48, 113, 0.1), rgba(225, 177, 77, 0.14));
}

.empty-state {
  margin-top: 1rem;
  background: rgba(225, 177, 77, 0.14);
  border: 1px dashed rgba(110, 48, 113, 0.45);
  padding: 0.8rem;
  border-radius: 10px;
}

.load-more-wrap {
  margin-top: 1rem;
  text-align: center;
}

.load-more-btn {
  border: 1px solid rgba(110, 48, 113, 0.45);
  border-radius: 12px;
  padding: 0.62rem 1.15rem;
  background: linear-gradient(120deg, rgba(110, 48, 113, 0.98), rgba(85, 39, 96, 0.98));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(47, 48, 49, 0.2);
}

.load-more-btn:hover {
  filter: brightness(1.06);
}

.lightbox {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(110, 48, 113, 0.18), rgba(14, 12, 18, 0.94) 62%),
    rgba(14, 12, 18, 0.9);
  display: grid;
  place-items: center;
  z-index: 2000;
  padding: 1rem;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox figure {
  margin: 0;
  max-width: min(92vw, 1050px);
  max-height: 88vh;
}

.lightbox img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 10px;
  background: #121212;
  box-shadow:
    0 0 0 1px rgba(225, 177, 77, 0.2),
    0 18px 40px rgba(0, 0, 0, 0.34),
    0 0 42px rgba(110, 48, 113, 0.18);
}

.lightbox figcaption {
  color: #fff;
  margin-top: 0.55rem;
  text-align: center;
}

.lightbox-close,
.lightbox-nav {
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 1.2rem;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  font-size: 1.9rem;
  line-height: 1;
}

.lightbox-nav.prev {
  left: 1rem;
}

.lightbox-nav.next {
  right: 1rem;
}

@keyframes galleryCardReveal {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gallery-grid .gallery-item,
.gallery-grid .gallery-item::before,
.gallery-grid .gallery-item::after {
  will-change: transform, opacity;
}

footer {
  text-align: center;
  padding: 1rem;
  background-color: #222;
  color: #eee;
  font-size: 0.9rem;
  margin-top: 2rem;
}

@media (max-width: 900px) {
  .fixed-filter-row {
    grid-template-columns: 1fr;
  }

  .filters-section {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .gallery-group-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gallery-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  header {
    padding: 0.9rem 1rem;
  }

  header h1 {
    font-size: 1.05rem;
  }

  main {
    padding: 1rem;
  }

  .controls {
    padding: 1rem;
  }

  .search-section {
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
  }

  .filters-section {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .gallery-item img {
    height: 185px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .gallery-group-grid {
    grid-template-columns: 1fr;
  }

  .chip {
    font-size: 0.88rem;
    padding: 0.38rem 0.75rem;
  }

  .lightbox-nav {
    width: 38px;
    height: 38px;
    font-size: 1.5rem;
  }
}
