.gallery-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 251, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(207, 162, 171, 0.22);
  padding: 0.75rem 0;
}

body.dark .gallery-header {
  background: rgba(31, 27, 28, 0.9);
}

.gallery-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(207, 162, 171, 0.3);
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
}

.back-btn:hover {
  background: var(--pink);
  color: var(--text);
}

body.dark .back-btn {
  background: rgba(255, 255, 255, 0.08);
}

.brand-small {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 700;
}

.gallery-main {
  padding: 2.5rem 0 4rem;
  min-height: 70vh;
}

.gallery-hero {
  margin-bottom: 1.4rem;
}

.gallery-hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  margin: 0.2rem 0 0.6rem;
}

.gallery-hero p {
  color: var(--muted);
  max-width: 62ch;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.gallery-state {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 30vh;
}

.blog-state__spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid rgba(217, 165, 174, 0.25);
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.blog-state__error {
  text-align: center;
  color: var(--muted);
}

.blog-state__error h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.8rem;
  margin: 0 0 0.5rem;
}

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

.gallery-page-item {
  position: relative;
  width: 100%;
  min-height: 44px;
  border: 0;
  padding: 0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--card);
  cursor: pointer;
  aspect-ratio: 4 / 5;
}

.gallery-page-item img,
.gallery-page-item video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-page-item:hover img,
.gallery-page-item:hover video,
.gallery-page-item:focus-visible img,
.gallery-page-item:focus-visible video {
  transform: scale(1.03);
}

.gallery-page-item__badge,
.gallery-page-item__caption {
  position: absolute;
  left: 0.75rem;
  border-radius: 999px;
  background: rgba(31, 27, 28, 0.72);
  color: #fff;
  backdrop-filter: blur(10px);
}

.gallery-page-item__badge {
  top: 0.75rem;
  padding: 0.32rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.gallery-page-item__caption {
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
  text-align: left;
}

@media (min-width: 768px) {
  .gallery-page-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .gallery-page-item:nth-child(3n + 2) {
    aspect-ratio: 1 / 1;
  }
}
