/* Gallery page: shared branding lives in styles.css. */
.gallery-intro {
  padding: 44px 0 48px;
  border-bottom: 1px solid #29334b;
  background:
    radial-gradient(ellipse at 90% 10%, #1c405b70, transparent 60%),
    radial-gradient(ellipse at 10% 100%, #70274a25, transparent 55%);
}
.gallery-back {
  display: block;
  width: fit-content;
  margin-bottom: 35px;
  color: #aebccc;
  text-decoration: none;
  font-size: 13px;
}
.gallery-intro h1 {
  font-size: clamp(48px, 6vw, 78px);
  line-height: 1;
}
.gallery-intro p {
  max-width: 620px;
  font-size: 16px;
  color: #bbc7d6;
}
.gallery-intro-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 28px;
}
.gallery-total {
  font-weight: 600;
  font-size: 13px;
}
.gallery-total span {
  color: #98a8bc;
  display: block;
  font-weight: 400;
  margin-top: 4px;
}
.gallery-section {
  padding: 36px 0 72px;
}
.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gallery-filter {
  padding: 10px 15px;
  min-height: 44px;
  color: #bfcadd;
  background: #131a29;
  border: 1px solid #33415a;
  border-radius: 24px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.gallery-filter:hover {
  color: white;
  border-color: var(--cyan);
}
.gallery-filter.selected {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #07111b;
}
#gallery-count {
  color: #98a8bc;
  white-space: nowrap;
  font-size: 12px;
}
.gallery-hint {
  color: #98a8bc;
  font-size: 12px;
  margin: 16px 0 24px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.gallery-card {
  display: block;
  color: white;
  text-decoration: none;
  background: #121927;
  border: 1px solid #2c3950;
  border-radius: 14px;
  overflow: hidden;
  transition:
    border-color 0.2s,
    transform 0.2s;
}
.gallery-card[hidden] {
  display: none;
}
.gallery-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
}
.gallery-card figure {
  margin: 0;
}
.gallery-photo {
  position: relative;
  overflow: hidden;
  background: #080d16;
  aspect-ratio: 4 / 3;
}
.gallery-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.gallery-card:hover img {
  transform: scale(1.04);
}
.gallery-expand {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #070c16cf;
  border: 1px solid #ffffff55;
  font-size: 20px;
}
.gallery-card figcaption {
  padding: 18px 20px;
}
.gallery-card figcaption > span {
  color: var(--cyan);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.gallery-card h3 {
  font-size: 24px;
  margin: 8px 0 0;
  line-height: 1.15;
}
.links a[aria-current="page"] {
  color: var(--cyan);
}
/* Native dialog keeps focus inside the viewer and restores it on close. */
body.viewer-open {
  overflow: hidden;
}
.lightbox {
  width: min(1120px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 16px 22px;
  background: #0c111d;
  color: white;
  border: 1px solid #334965;
  border-radius: 18px;
  box-shadow: 0 20px 100px #000b;
}
.lightbox::backdrop {
  background: #02050bf2;
  backdrop-filter: blur(10px);
}
.lightbox-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}
#lightbox-count {
  color: #aebccc;
  font-size: 13px;
}
.viewer-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid #526079;
  border-radius: 50%;
  background: #182233e8;
  color: white;
  cursor: pointer;
  font-size: 24px;
}
.viewer-button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
.lightbox-stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: min(65dvh, 700px);
  border-radius: 8px;
  background: #050810;
  touch-action: pan-y;
}
.lightbox-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.lightbox-prev,
.lightbox-next {
  position: absolute;
  z-index: 1;
  top: calc(50% - 22px);
  font-size: 34px;
}
.lightbox-prev {
  left: 10px;
}
.lightbox-next {
  right: 10px;
}
.lightbox-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
}
#lightbox-category {
  color: var(--cyan);
  font-size: 11px;
  margin: 0 0 5px;
}
#lightbox-title {
  font-size: 28px;
  line-height: 1.1;
  margin: 0;
}
#lightbox-original {
  color: #c4d4e8;
  font-size: 12px;
  white-space: nowrap;
  text-underline-offset: 4px;
}
.lightbox-help {
  color: #8798ae;
  font-size: 11px;
  margin: 14px 0 0;
}
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
  .gallery-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }
}
@media (max-width: 540px) {
  .gallery-intro {
    padding: 28px 0 32px;
  }
  .gallery-back {
    margin-bottom: 28px;
  }
  .gallery-intro h1 {
    font-size: 48px;
  }
  .gallery-section {
    padding: 28px 0 48px;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .gallery-filter {
    padding: 10px 13px;
    font-size: 11px;
  }
  .lightbox {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    padding: 12px;
    border-radius: 12px;
  }
  .lightbox-stage {
    height: 57dvh;
  }
  .lightbox-bottom {
    gap: 12px;
    flex-wrap: wrap;
  }
  #lightbox-title {
    font-size: 25px;
  }
  .lightbox-help {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-card,
  .gallery-photo img {
    transition: none;
  }
}
