.gallery2-hero {
  position: relative;
  overflow: hidden;
  padding: 54px 0 42px;
}

.gallery2-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;
}

.gallery2-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(420px, 0.76fr);
  gap: 56px;
  align-items: center;
}

.gallery2-hero h1 {
  max-width: 720px;
}

.gallery2-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 28px;
}

.gallery2-back-link {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.gallery2-back-link:hover,
.gallery2-back-link:focus-visible {
  color: var(--lacquer);
}

.gallery2-hero-photo {
  position: relative;
  min-height: 390px;
}

.gallery2-hero-photo img {
  width: 100%;
  height: 390px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.gallery2-hero-note {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 170px);
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  background: var(--jade-dark);
  color: var(--paper);
}

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

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

.gallery2-shell {
  padding: 66px 0 82px;
  background: var(--porcelain);
}

.gallery2-section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 0.38fr);
  gap: 40px;
  align-items: end;
  margin-bottom: 30px;
}

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

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

.gallery2-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.gallery2-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
}

.gallery2-tab {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid rgba(33, 31, 27, 0.16);
  background: rgba(255, 250, 242, 0.62);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.gallery2-tab span {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
}

.gallery2-tab.is-active {
  border-color: var(--jade-dark);
  background: var(--jade-dark);
  color: var(--paper);
}

.gallery2-description-list {
  min-height: 1.7em;
  margin-bottom: 24px;
}

.gallery2-description {
  display: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery2-description.is-active {
  display: block;
}

.gallery2-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.gallery2-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 30px;
}

.gallery2-pagination[hidden] {
  display: none;
}

.gallery2-page-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.gallery2-page-control,
.gallery2-page-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(33, 31, 27, 0.16);
  background: rgba(255, 250, 242, 0.72);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.gallery2-page-number {
  padding: 0;
}

.gallery2-page-control:hover,
.gallery2-page-control:focus-visible,
.gallery2-page-number:hover,
.gallery2-page-number:focus-visible,
.gallery2-page-number.is-active {
  border-color: var(--jade-dark);
  background: var(--jade-dark);
  color: var(--paper);
}

.gallery2-page-control:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.gallery2-page-control.is-disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.gallery2-card {
  display: none;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 14px 34px rgba(34, 27, 18, 0.1);
}

.gallery2-card.is-active {
  display: block;
}

.gallery2-card a {
  display: grid;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.gallery2-card-media {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--ink);
}

.gallery2-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.gallery2-card-media img[data-focus="lower"] {
  object-position: 50% 82%;
}

.gallery2-card-media img[data-focus="upper"] {
  object-position: 50% 18%;
}

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

.gallery2-card figcaption {
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 12px 14px 14px;
}

.gallery2-card figcaption strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery2-card figcaption em {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery2-cta {
  padding: 0 0 86px;
  background: var(--porcelain);
}

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

.gallery2-cta h2 {
  font-size: clamp(2.3rem, 3.6vw, 4.4rem);
}

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

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

@media (max-width: 1180px) {
  .gallery2-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .gallery2-hero-photo {
    max-width: 680px;
    min-height: auto;
  }
}

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

  .gallery2-hero-photo img {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .gallery2-hero-note {
    position: relative;
    right: auto;
    bottom: auto;
    margin-top: 12px;
  }

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

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

  .gallery2-tab {
    min-height: 46px;
    padding: 9px 10px;
  }

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

@media (max-width: 460px) {
  .gallery2-grid {
    grid-template-columns: 1fr;
  }
}
