/* Галерея — плейсхолдеры и альбомы */

.page-galereya .content-card {
  max-width: min(1140px, 100%);
}

.gallery-lead {
  margin: 0 0 1.75rem;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink-muted);
  max-width: 40rem;
}

/* Плейсхолдеры — уютные кабинеты */

.gallery-placeholders {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.65rem, 2vw, 1rem);
  margin: 0 0 2rem;
}

@media (min-width: 640px) {
  .gallery-placeholders {
    grid-template-columns: repeat(3, 1fr);
  }
}

.gal-ph {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(158, 212, 232, 0.35);
  box-shadow: var(--shadow-card);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.gal-ph:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(90, 168, 196, 0.14);
}

.gal-ph--wide {
  grid-column: span 2;
}

@media (min-width: 640px) {
  .gal-ph--wide {
    grid-column: span 2;
  }

  .gal-ph--hall.gal-ph--wide {
    grid-column: span 3;
  }
}

.gal-ph-inner {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  width: 100%;
  background-size: cover;
  background-position: center;
}

.gal-ph-inner::after {
  line-height: 1;
  pointer-events: none;
}

.gal-ph--cabinet .gal-ph-inner {
  background-image:
    linear-gradient(135deg, rgba(255, 248, 230, 0.9) 0%, rgba(212, 238, 248, 0.85) 100%),
    radial-gradient(circle at 70% 30%, rgba(255, 233, 168, 0.5) 0%, transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(184, 232, 216, 0.4) 0%, transparent 45%);
}

.gal-ph--cabinet .gal-ph-inner::after {
  content: "🪑";
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 2.5rem;
  opacity: 0.35;
}

.gal-ph--toys .gal-ph-inner {
  aspect-ratio: 1;
  background-image: linear-gradient(160deg, #fff5e6 0%, #ffe0d0 50%, #d4eef8 100%);
}

.gal-ph--toys .gal-ph-inner::after {
  content: "🧸";
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 2.25rem;
  opacity: 0.4;
}

.gal-ph--play .gal-ph-inner {
  background-image: linear-gradient(145deg, #e8f8f0 0%, #fff8ee 100%);
}

.gal-ph--play .gal-ph-inner::after {
  content: "🎨";
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 2.25rem;
  opacity: 0.4;
}

.gal-ph--desk .gal-ph-inner {
  background-image: linear-gradient(145deg, #f0f8fd 0%, #fff5e0 100%);
}

.gal-ph--desk .gal-ph-inner::after {
  content: "📖";
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 2.25rem;
  opacity: 0.4;
}

.gal-ph--hall .gal-ph-inner {
  aspect-ratio: 21 / 9;
  background-image: linear-gradient(90deg, #faf6ef 0%, #d4eef8 50%, #fff8ee 100%);
}

.gal-ph--hall .gal-ph-inner::after {
  content: "🏠";
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 2.5rem;
  opacity: 0.35;
}

.gal-ph--books .gal-ph-inner {
  aspect-ratio: 1;
  background-image: linear-gradient(165deg, #fff 0%, #c8e8f0 100%);
}

.gal-ph--books .gal-ph-inner::after {
  content: "📚";
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 2.25rem;
  opacity: 0.4;
}

.gal-ph figcaption {
  padding: 0.55rem 0.65rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  color: var(--ink-muted);
}

.gallery-cta-text {
  text-align: center;
  margin: 0 0 1rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

.gallery-cta-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}

@media (min-width: 480px) {
  .gallery-cta-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
}

.gallery-cta-actions .btn-primary,
.page-galereya .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.65rem 1.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  text-decoration: none !important;
  color: var(--brand-night) !important;
  background: linear-gradient(180deg, var(--sunny) 0%, var(--sunny-mid) 100%);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 20px rgba(245, 184, 74, 0.3);
}

/* Альбомы (фото из БД) */

.page-gallery-album .content-card {
  max-width: min(1140px, 100%);
}

.page-gallery-album .album-photo-mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-rows: 8px;
  gap: clamp(0.5rem, 1.5vw, 0.85rem);
}

.page-gallery-album .album-photo-mosaic figure.gallery-item {
  grid-row-end: span var(--mosaic-span, 26);
  border-radius: var(--radius-lg);
  cursor: zoom-in;
}

.page-gallery-album .album-photo-mosaic figure.gallery-item > a {
  position: relative;
}

.page-gallery-album .album-photo-mosaic figure.gallery-item img {
  aspect-ratio: auto;
  min-height: 120px;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.album-lightbox-close {
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-lightbox-img {
  animation: album-lightbox-in 0.35s ease;
}

@keyframes album-lightbox-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 520px) {
  .gallery-placeholders {
    grid-template-columns: 1fr;
  }

  .gal-ph--wide,
  .gal-ph--hall.gal-ph--wide {
    grid-column: span 1;
  }

  .page-gallery-album .album-photo-mosaic {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .album-lightbox-img {
    animation: none;
  }
}
