.gallery-intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 88% 12%, rgba(214, 154, 116, 0.17), transparent 31%),
    linear-gradient(135deg, #fbfaf7 0%, var(--paper) 62%, #eee9df 100%);
}
.gallery-intro::after {
  position: absolute;
  z-index: -1;
  top: -210px;
  right: max(-130px, calc((100vw - var(--page-width)) / 2 - 150px));
  width: clamp(340px, 42vw, 620px);
  aspect-ratio: 1;
  border: 1px solid rgba(168, 95, 62, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(168, 95, 62, 0.025), 0 0 0 58px rgba(168, 95, 62, 0.02);
  content: "";
  pointer-events: none;
}
.gallery-intro-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding-block: 48px 34px;
}
.gallery-intro .section-kicker {
  margin: 0 0 23px;
  color: var(--accent);
}
.gallery-intro-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 17px;
}
.gallery-intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(54px, 12vw, 86px);
  font-weight: 400;
  letter-spacing: -.065em;
  line-height: .98;
}
.gallery-intro h1 em { color: var(--accent); font-weight: 400; }
.gallery-intro-copy > p {
  max-width: 500px;
  margin: 0;
  color: #59655f;
  font-size: 14px;
  line-height: 1.8;
}
.gallery-count {
  display: inline-flex;
  width: fit-content;
  align-items: baseline;
  gap: 10px;
  margin-top: 24px;
  padding: 8px 13px;
  border: 1px solid rgba(29, 41, 37, 0.1);
  border-radius: 4px;
  background: rgba(251, 250, 247, 0.82);
  box-shadow: 0 7px 20px rgba(29, 41, 37, 0.045);
  color: var(--accent);
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
}
.gallery-count span {
  color: #65716b;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .12em;
}
.gallery-section {
  padding-block: 30px 58px;
  background: var(--paper-light);
}
.gallery-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}
.gallery-card {
  min-width: 0;
  margin: 0;
  padding: 5px;
  border: 1px solid rgba(29, 41, 37, 0.09);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(29, 41, 37, 0.055);
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}
.gallery-image-link {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 3px;
  background: #dedbd2;
}
.gallery-card-group .gallery-image-link { aspect-ratio: 4 / 3; }
.gallery-image-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.65,.3,1), filter .3s ease;
}
.gallery-card-portrait img { object-position: center 34%; }
.gallery-card-community img { object-position: center 48%; }
.gallery-card-group img { object-position: center 68%; }
.gallery-image-link:hover img { transform: scale(1.035); filter: saturate(1.04); }
.gallery-back {
  padding-block: 0 58px;
  background: var(--paper-light);
}

/* Keep the lightbox in the same restrained palette as the portfolio. */
.glightbox-clean .gclose,
.glightbox-clean .gnext,
.glightbox-clean .gprev { color: #f5f2eb; }
.glightbox-clean .gslide-description { background: rgba(29, 41, 37, .94); }
.glightbox-clean .gdesc-inner { padding: 14px 18px; }
.glightbox-clean .gslide-title { color: #f5f2eb; font-family: var(--serif); font-size: 20px; font-weight: 400; }
.glightbox-clean .gslide-desc { color: rgba(245, 242, 235, .82); font-family: var(--sans); font-size: 12px; line-height: 1.6; }

@media (hover: hover) and (pointer: fine) {
  .gallery-card:hover {
    transform: translateY(-4px);
    border-color: rgba(168, 95, 62, .28);
    box-shadow: 0 16px 32px rgba(29, 41, 37, .11);
  }
}

@media (min-width: 681px) {
  .gallery-intro-inner { grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; }
  .gallery-intro .section-kicker { grid-column: 1 / -1; }
  .gallery-intro-copy { grid-column: 1; }
  .gallery-intro-inner { padding-block: clamp(68px, 8vw, 102px) 42px; }
  .gallery-intro .section-kicker { margin-bottom: 32px; }
  .gallery-intro-copy {
    grid-template-columns: minmax(0, 1fr) minmax(250px, .72fr);
    align-items: end;
    gap: clamp(28px, 5vw, 72px);
  }
  .gallery-intro h1 { font-size: clamp(68px, 9vw, 116px); }
  .gallery-intro-copy > p { max-width: 410px; margin: 0 0 8px; font-size: 15px; }
  .gallery-count { grid-column: 2; grid-row: 2; align-self: end; justify-self: end; margin-top: -2px; }
  .gallery-section { padding-block: 50px 88px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .gallery-back { padding-bottom: 76px; }
}

@media (min-width: 901px) {
  .gallery-intro-inner { grid-template-columns: minmax(0, 1fr) auto; column-gap: 42px; }
  .gallery-intro .section-kicker { grid-column: 1 / -1; }
  .gallery-intro-copy { grid-column: 1; grid-template-columns: minmax(0, 1fr) minmax(280px, .62fr); }
  .gallery-count { grid-column: 2; grid-row: 2; align-self: end; margin-bottom: 7px; }
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.2vw, 30px); }
}

html[lang="ne"] .gallery-intro h1 {
  font-family: "Khand", "Mukta", sans-serif;
  font-size: clamp(58px, 12vw, 90px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.1;
}
html[lang="ne"] .gallery-intro-copy > p,
html[lang="ne"] .gallery-count span {
  font-family: "Mukta", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
html[lang="ne"] .gallery-count { font-family: "Khand", "Mukta", sans-serif; font-size: 32px; }
html[lang="ne"] .gallery-count span { font-size: 13px; }
html[lang="ne"] .glightbox-clean .gslide-title,
html[lang="ne"] .glightbox-clean .gslide-desc { font-family: "Mukta", sans-serif; line-height: 1.65; }
html[lang="ne"] .glightbox-clean .gslide-title { font-size: 18px; }
html[lang="ne"] .glightbox-clean .gslide-desc { font-size: 15px; }

@media (max-width: 380px) {
  .gallery-grid { gap: 12px; }
  .gallery-section { padding-block: 22px 44px; }
  .gallery-card { padding: 4px; }
  html[lang="ne"] .gallery-intro h1 { font-size: clamp(48px, 15vw, 60px); }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-card,
  .gallery-image-link img { transition: none; }
}
