.gallery-hero {
  position: relative;
  overflow: hidden;
  padding: 48px 0 34px;
}

.gallery-hero::before {
  content: "ภาพ";
  position: absolute;
  right: -3vw;
  top: 8px;
  color: rgba(180, 71, 31, 0.06);
  font-family: "Noto Serif Thai", "Cormorant Garamond", Georgia, serif;
  font-size: clamp(6rem, 14vw, 15rem);
  line-height: 0.9;
  pointer-events: none;
}

.gallery-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 0.82fr);
  gap: 58px;
  align-items: center;
}

.gallery-hero h1 {
  max-width: 680px;
}

.gallery-hero .hero-copy {
  max-width: 560px;
}

.gallery-hero-visual {
  position: relative;
  min-height: 352px;
}

.gallery-hero-visual::before {
  content: "";
  position: absolute;
  top: 28px;
  right: 0;
  width: 70%;
  height: 78%;
  border: 1px solid rgba(33, 31, 27, 0.12);
  background: var(--porcelain);
}

.gallery-hero-visual img {
  position: absolute;
  width: 100%;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.gallery-hero-main {
  top: 0;
  right: 26px;
  width: 72%;
  height: 262px;
}

.gallery-hero-side {
  left: 0;
  bottom: 0;
  width: 46%;
  height: 176px;
  border: 10px solid var(--paper);
}

.gallery-hero-note {
  position: absolute;
  right: 0;
  bottom: 8px;
  display: grid;
  grid-template-columns: auto minmax(0, 150px);
  gap: 12px;
  align-items: center;
  max-width: 250px;
  padding: 16px 18px;
  background: var(--jade-dark);
  color: var(--paper);
}

.gallery-hero-note strong {
  display: block;
  color: var(--gold);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.6rem;
  font-weight: 500;
  line-height: 1;
}

.gallery-hero-note span {
  display: block;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  line-height: 1.35;
  text-transform: uppercase;
}

.gallery-stats {
  padding: 26px 0 50px;
}

.gallery-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--white);
}

.gallery-stats-grid article {
  min-width: 0;
  padding: 22px 24px;
  border-right: 1px solid var(--line);
}

.gallery-stats-grid article:last-child {
  border-right: 0;
}

.gallery-stats-grid strong {
  display: block;
  color: var(--lacquer);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.9rem, 2.6vw, 2.75rem);
  font-weight: 500;
  line-height: 1;
}

.gallery-stats-grid span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.gallery-shell {
  padding: 64px 0 86px;
  background: var(--porcelain);
}

.gallery-section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.42fr);
  gap: 40px;
  align-items: end;
  margin-bottom: 32px;
}

.gallery-section-head h2 {
  max-width: 820px;
}

.gallery-section-head p:last-child {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.7;
}

.gallery-masonry {
  column-count: 3;
  column-gap: 18px;
}

.gallery-card {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 18px 42px rgba(34, 27, 18, 0.1);
  break-inside: avoid;
}

.gallery-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.gallery-card img {
  width: 100%;
  height: auto;
  transition: transform 180ms ease;
}

.gallery-card:hover img,
.gallery-card:focus-within img {
  transform: scale(1.018);
}

.gallery-card-media {
  display: block;
  overflow: hidden;
  background: var(--ink);
}

.gallery-card figcaption {
  display: grid;
  gap: 6px;
  padding: 14px 16px 16px;
}

.gallery-card figcaption span {
  color: var(--lacquer);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gallery-card figcaption strong {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.35;
}

.gallery-video {
  padding: 82px 0;
}

.gallery-video-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(420px, 1fr);
  gap: 54px;
  align-items: center;
}

.gallery-video-copy p:not(.kicker) {
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.gallery-video-card {
  display: grid;
  gap: 12px;
}

.gallery-video-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.gallery-video-card a {
  color: var(--lacquer);
  font-weight: 850;
  text-decoration: none;
}

.gallery-cta {
  padding: 0 0 86px;
}

.gallery-cta-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: 38px;
  background: var(--jade-dark);
  color: var(--paper);
}

.gallery-cta h2 {
  font-size: clamp(2.5rem, 4vw, 4.8rem);
}

.gallery-cta p {
  max-width: 620px;
  margin: 12px 0 0;
  color: rgba(244, 237, 225, 0.72);
}

.gallery-cta .kicker {
  color: var(--gold);
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(20, 40, 34, 0.92);
}

.gallery-lightbox[aria-hidden="true"] {
  display: none;
}

.gallery-lightbox-panel {
  position: relative;
  width: min(1120px, 100%);
  max-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.gallery-lightbox-figure {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.3fr);
  min-height: 0;
}

.gallery-lightbox-image-wrap {
  display: grid;
  place-items: center;
  min-height: 0;
  background: var(--ink);
}

.gallery-lightbox-image {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
}

.gallery-lightbox-caption {
  display: grid;
  align-content: end;
  gap: 12px;
  padding: 28px;
  border-left: 1px solid var(--line);
}

.gallery-lightbox-count {
  color: var(--lacquer);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gallery-lightbox-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2rem, 3vw, 3.4rem);
  line-height: 1;
}

.gallery-lightbox-button {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(244, 237, 225, 0.32);
  background: rgba(20, 40, 34, 0.78);
  color: var(--paper);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-lightbox-button:hover,
.gallery-lightbox-button:focus-visible {
  background: var(--lacquer);
}

.gallery-lightbox-close {
  top: 14px;
  right: 14px;
}

.gallery-lightbox-prev,
.gallery-lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}

.gallery-lightbox-prev {
  left: 14px;
}

.gallery-lightbox-next {
  right: 14px;
}

body.gallery-lock {
  overflow: hidden;
}

@media (max-width: 980px) {
  .gallery-hero-grid,
  .gallery-video-grid,
  .gallery-section-head,
  .gallery-cta-inner,
  .gallery-lightbox-figure {
    grid-template-columns: 1fr;
  }

  .gallery-hero {
    padding-top: 48px;
  }

  .gallery-hero-visual {
    max-width: 680px;
    min-height: 382px;
    margin: 0 auto;
  }

  .gallery-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-stats-grid article:nth-child(2) {
    border-right: 0;
  }

  .gallery-stats-grid article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .gallery-masonry {
    column-count: 2;
  }

  .gallery-lightbox-caption {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .gallery-lightbox-image {
    max-height: calc(100vh - 260px);
  }
}

@media (max-width: 640px) {
  .gallery-hero,
  .gallery-shell,
  .gallery-video {
    padding-top: 52px;
    padding-bottom: 60px;
  }

  .gallery-hero-visual,
  .gallery-stats-grid {
    display: block;
  }

  .gallery-hero-visual {
    min-height: auto;
  }

  .gallery-hero-visual::before {
    display: none;
  }

  .gallery-hero-visual img,
  .gallery-hero-main,
  .gallery-hero-side,
  .gallery-hero-note {
    position: relative;
    inset: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
  }

  .gallery-hero-main,
  .gallery-hero-side {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .gallery-hero-side {
    border: 0;
  }

  .gallery-masonry {
    column-count: 1;
    column-gap: 0;
  }

  .gallery-hero-visual img,
  .gallery-hero-note {
    margin-bottom: 12px;
  }

  .gallery-stats-grid article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .gallery-stats-grid article:last-child {
    border-bottom: 0;
  }

  .gallery-card {
    display: block;
  }

  .gallery-cta-inner {
    padding: 28px 22px;
  }

  .gallery-lightbox {
    padding: 14px;
  }

  .gallery-lightbox-panel {
    max-height: calc(100vh - 28px);
  }

  .gallery-lightbox-caption {
    padding: 22px;
  }

  .gallery-lightbox-button {
    width: 40px;
    height: 40px;
  }
}
