/* ==========================================================================
   Wonders Kids — Gallery
   1. Album filter   2. Masonry grid   3. Lightbox   4. Responsive
   Loaded with pages.css (banner, empty state, pagination).
   ========================================================================== */

.gallery { padding-top: 80px; }

/* 1. ALBUM FILTER ========================================================== */
.album-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: -10px auto 46px; }
.album-filter__btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px 10px 16px; border-radius: 50px;
  background: #fff; border: 1px solid #E4E4EE; color: var(--heading);
  font-family: var(--font-heading); font-weight: 600; font-size: 15px;
  transition: background .25s, color .25s, border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.album-filter__btn .wk-icon { width: 17px; height: 17px; color: var(--primary); }
.album-filter__btn:hover { border-color: var(--primary); transform: translateY(-2px); }
.album-filter__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot, var(--primary)); }
.tone-dot-purple { --dot: #5751E1; } .tone-dot-yellow { --dot: #F2B01E; } .tone-dot-green { --dot: #6FB33A; }
.tone-dot-pink   { --dot: #E0479A; } .tone-dot-blue   { --dot: #1C9BD1; }
.album-filter__count {
  min-width: 24px; height: 22px; padding: 0 7px; border-radius: 50px; display: inline-grid; place-items: center;
  background: #F1F1F7; color: var(--body); font-family: var(--font-body); font-size: 12px; font-weight: 700;
}
.album-filter__btn.is-active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 12px 22px -10px rgba(87, 81, 225, .7); }
.album-filter__btn.is-active .wk-icon { color: #fff; }
.album-filter__btn.is-active .album-filter__dot { background: var(--yellow); }
.album-filter__btn.is-active .album-filter__count { background: rgba(255,255,255,.2); color: #fff; }

/* 2. MASONRY =============================================================== */
.masonry { columns: 4 260px; column-gap: 20px; }
.masonry__item { break-inside: avoid; margin-bottom: 20px; }
.photo {
  position: relative; display: block; overflow: hidden; border-radius: 22px; background: #F1F1F7;
  box-shadow: 0 16px 36px -26px rgba(22, 20, 57, .5); cursor: zoom-in;
}
.masonry__item:nth-child(4n+2) .photo { border-radius: 22px 22px 60px 22px; }
.masonry__item:nth-child(4n+3) .photo { border-radius: 60px 22px 22px 22px; }
.photo img { width: 100%; height: auto; min-height: 140px; object-fit: cover; transition: transform .8s var(--ease), filter .5s; }
.photo:hover img { transform: scale(1.08); }
.photo__overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 16px;
  background: linear-gradient(180deg, rgba(22, 20, 57, 0) 40%, rgba(22, 20, 57, .82) 100%);
  opacity: 0; transition: opacity .35s;
}
.photo:hover .photo__overlay, .photo:focus-visible .photo__overlay { opacity: 1; }
.photo__zoom {
  align-self: flex-end; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow); color: var(--heading); transform: scale(.6) rotate(-30deg); transition: transform .4s var(--ease);
}
.photo:hover .photo__zoom { transform: none; }
.photo__zoom .wk-icon { width: 20px; height: 20px; }
.photo__text { color: #fff; transform: translateY(10px); transition: transform .4s var(--ease); }
.photo:hover .photo__text { transform: none; }
.photo__text small { display: block; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--yellow); margin-bottom: 2px; }
.photo__text strong { display: block; font-family: var(--font-heading); font-weight: 600; font-size: 16px; line-height: 1.35; }

/* 3. LIGHTBOX ============================================================== */
.lightbox { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 70px 90px; }
.lightbox[hidden] { display: none !important; }
.lightbox__backdrop { position: absolute; inset: 0; background: rgba(6, 4, 46, .94); animation: lbFade .3s ease; }
.lightbox__stage { position: relative; margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; animation: lbZoom .35s var(--ease); }
.lightbox__img { max-width: min(1200px, 100%); max-height: calc(100vh - 190px); width: auto; height: auto; border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.5); user-select: none; transition: opacity .2s; }
.lightbox__img.is-loading { opacity: .3; }
.lightbox__caption { text-align: center; color: #fff; }
.lightbox__caption:empty { display: none; }
.lightbox__album { display: block; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--yellow); }
.lightbox__title { font-family: var(--font-heading); font-weight: 600; font-size: 18px; }
.lightbox__counter { position: absolute; top: 24px; left: 28px; color: #C9C7F2; font-family: var(--font-heading); font-weight: 600; font-size: 15px; }
.lightbox__btn {
  position: absolute; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.15);
  transition: background .2s, color .2s, transform .25s var(--ease);
}
.lightbox__btn .wk-icon { width: 24px; height: 24px; }
.lightbox__btn:hover { background: var(--yellow); color: var(--heading); border-color: var(--yellow); }
.lightbox__close { top: 16px; right: 20px; }
.lightbox__close:hover { transform: rotate(90deg); }
.lightbox__prev { left: 20px; top: 50%; margin-top: -26px; }
.lightbox__next { right: 20px; top: 50%; margin-top: -26px; }
.lightbox.is-single .lightbox__prev, .lightbox.is-single .lightbox__next { display: none; }
@keyframes lbFade { from { opacity: 0; } }
@keyframes lbZoom { from { opacity: 0; transform: scale(.94); } }

/* 4. RESPONSIVE ============================================================ */
@media (max-width: 767px) {
  .gallery { padding-top: 60px; }
  .album-filter { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin-inline: -15px; padding: 4px 15px 10px; scrollbar-width: none; }
  .album-filter::-webkit-scrollbar { display: none; }
  .album-filter__btn { flex-shrink: 0; }
  .masonry { columns: 2 140px; column-gap: 12px; }
  .masonry__item { margin-bottom: 12px; }
  .photo { border-radius: 16px; }
  .masonry__item:nth-child(4n+2) .photo { border-radius: 16px 16px 36px 16px; }
  .masonry__item:nth-child(4n+3) .photo { border-radius: 36px 16px 16px 16px; }
  .photo__overlay { opacity: 1; justify-content: flex-end; background: linear-gradient(180deg, transparent 50%, rgba(22, 20, 57, .75)); padding: 10px; }
  .photo__zoom { display: none; }
  .photo__text { transform: none; }
  .photo__text strong { font-size: 13.5px; }
  .photo__text small { font-size: 10.5px; }
  .lightbox { padding: 64px 12px 90px; }
  .lightbox__img { max-height: calc(100vh - 220px); border-radius: 12px; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 20px; margin-top: 0; }
  .lightbox__prev { left: calc(50% - 64px); }
  .lightbox__next { right: calc(50% - 64px); }
}