:root {
  --gallery-bg: #f5efe8;
  --gallery-surface: rgba(255, 252, 248, 0.82);
  --gallery-surface-strong: rgba(35, 25, 18, 0.82);
  --gallery-border: rgba(110, 78, 57, 0.18);
  --gallery-text: #2f241c;
  --gallery-text-soft: #6d5849;
  --gallery-accent: #b19d85;
  --gallery-accent-deep: #8c775f;
  --gallery-shadow: 0 22px 60px rgba(74, 44, 25, 0.14);
  --gallery-gutter: clamp(20px, 3.2vw, 34px);
  --gallery-container: min(1180px, calc(100% - (var(--gallery-gutter) * 2)));
  --gallery-font-body: "Sarabun", "Prompt", sans-serif;
  --gallery-font-heading: "Playfair Display", "Noto Serif Thai", serif;
  --gallery-font-ui: "Prompt", "Sarabun", sans-serif;
}

.gallery-page {
  position: relative;
  overflow: clip;
  background:
    radial-gradient(circle at top left, rgba(196, 154, 118, 0.16), transparent 30%),
    radial-gradient(circle at right 15%, rgba(127, 154, 126, 0.12), transparent 22%),
    linear-gradient(180deg, #f7f2ec 0%, #f4eee7 45%, #fbf8f4 100%);
  color: var(--gallery-text);
}

.gallery-page .hero-section {
  position: relative;
  min-height: 86vh !important;
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: clamp(118px, 14vw, 172px) var(--gallery-gutter) 96px !important;
}

.gallery-page .hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(17, 12, 8, 0.18), rgba(17, 12, 8, 0.58)),
    linear-gradient(90deg, rgba(26, 18, 12, 0.72), rgba(26, 18, 12, 0.18) 62%, rgba(26, 18, 12, 0.44));
  z-index: 1;
}

.gallery-page .hero_image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.04);
}

.gallery-page .hero-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(10px);
  z-index: 1;
  opacity: 0.7;
}

.gallery-page .hero-orb--one {
  right: 8%;
  top: 18%;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(210, 179, 133, 0.42), transparent 70%);
}

.gallery-page .hero-orb--two {
  left: 6%;
  bottom: 9%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(141, 177, 157, 0.22), transparent 68%);
}

.gallery-page .hero-text {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
  max-width: 720px;
  color: #fffaf5;
}

.gallery-page .hero-kicker,
.gallery-page .section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 244, 231, 0.25);
  border-radius: 0 !important;
  background: rgba(255, 247, 240, 0.08);
  backdrop-filter: blur(10px);
  color: #fff5e7;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gallery-page .section-kicker {
  color: var(--gallery-accent-deep);
  background: rgba(255, 251, 245, 0.9);
  border-color: rgba(157, 111, 73, 0.2);
}

.gallery-page .hero-text-en {
  margin: 18px 0 10px;
  font-size: clamp(2.35rem, 5vw, 4.45rem);
  font-weight: 600 !important;
  line-height: 1.03;
  text-transform: none !important;
  letter-spacing: 0.01em;
  text-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.gallery-page .hero-text-th {
  margin: 0;
  max-width: 580px;
  font-size: clamp(0.98rem, 1.7vw, 1.22rem);
  font-weight: 500 !important;
  line-height: 1.7;
  color: rgba(255, 247, 239, 0.92);
  text-transform: none !important;
  letter-spacing: 0.01em;
}

.gallery-page .hero-description {
  max-width: 620px;
  margin: 18px 0 0;
  color: rgba(255, 247, 238, 0.84);
  font-size: 0.96rem;
  line-height: 1.9;
}

.gallery-page .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

.gallery-page .hero-action,
.gallery-page .gallery-pill-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 0 !important;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: transform 0.28s ease, box-shadow 0.28s ease, background-color 0.28s ease, color 0.28s ease;
}

.gallery-page .hero-action--primary,
.gallery-page .gallery-pill-link {
  background: var(--gallery-accent);
  color: #fffaf4;
  box-shadow: 0 14px 30px rgba(97, 71, 47, 0.2);
}

.gallery-page .hero-action--secondary,
.gallery-page .gallery-pill-link--ghost {
  border: 1px solid rgba(177, 157, 133, 0.54);
  background: rgba(255, 251, 247, 0.14);
  color: #fff7ef;
}

.gallery-page .hero-action:hover,
.gallery-page .gallery-pill-link:hover {
  transform: translateY(-2px);
  background: var(--gallery-accent-deep);
  color: #fffaf4;
}

.gallery-page .gallery-pill-link--ghost {
  border-color: rgba(177, 157, 133, 0.44);
  background: rgba(255, 251, 245, 0.84);
  color: var(--gallery-accent-deep);
}

.gallery-page .hero-scroll-cue {
  position: absolute;
  right: var(--gallery-gutter);
  bottom: 34px;
  z-index: 3;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 12px 14px 0;
  border: 1px solid rgba(255, 247, 238, 0.18);
  background: linear-gradient(180deg, rgba(24, 17, 12, 0.1), rgba(24, 17, 12, 0.4));
  backdrop-filter: blur(10px);
  color: rgba(255, 248, 240, 0.96);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-align: right;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
}

.gallery-page .hero-scroll-cue::after {
  content: "";
  display: block;
  width: 1px;
  height: 42px;
  margin-top: 10px;
  background: linear-gradient(180deg, rgba(255, 248, 240, 0.96), transparent);
  animation: gallery-scroll-cue 1.9s ease-in-out infinite;
}

.gallery-page .gallery-main {
  position: relative;
  z-index: 1;
  width: var(--gallery-container);
  max-width: var(--gallery-container) !important;
  margin: 0 auto;
  padding: 28px 0 96px;
}

.gallery-page .gallery-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 18px 0 10px;
  color: var(--gallery-text-soft);
}

.gallery-page .gallery-breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.gallery-page .gallery-breadcrumb li + li::before {
  content: "/";
  opacity: 0.45;
}

.gallery-page .gallery-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.gallery-page .gallery-intro,
.gallery-page .gallery-copy,
.gallery-page .gallery-seo-text,
.gallery-page .gallery-container {
  margin-top: 24px;
  border: 1px solid var(--gallery-border);
  border-radius: 0 !important;
  background: var(--gallery-surface);
  box-shadow: var(--gallery-shadow);
  backdrop-filter: blur(18px);
}

.gallery-page .gallery-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
  padding: clamp(24px, 4vw, 38px);
}

.gallery-page .gallery-intro__content h2,
.gallery-page .gallery-copy h2,
.gallery-page .gallery-section-head h2,
.gallery-page .gallery-seo-text h2 {
  margin: 18px 0 12px;
  font-size: clamp(1.75rem, 2.6vw, 2.45rem);
  font-weight: 600;
  line-height: 1.2;
  color: #241811;
}

.gallery-page .gallery-intro__content p,
.gallery-page .gallery-copy p,
.gallery-page .gallery-section-head p,
.gallery-page .gallery-seo-text p {
  margin: 0;
  color: var(--gallery-text-soft);
  font-size: 0.95rem;
  line-height: 1.85;
}

.gallery-page .gallery-intro__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-self: start;
}

.gallery-page .gallery-stat-card {
  min-height: 138px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  border-radius: 0 !important;
  background: linear-gradient(180deg, rgba(255, 249, 241, 0.95), rgba(246, 236, 227, 0.9));
  border: 1px solid rgba(157, 111, 73, 0.12);
}

.gallery-page .gallery-stat-card strong {
  font-size: clamp(1.35rem, 2.4vw, 2.2rem);
  line-height: 1;
  color: var(--gallery-accent-deep);
}

.gallery-page .gallery-stat-card span {
  display: block;
  margin-top: 12px;
  color: var(--gallery-text-soft);
  font-size: 0.93rem;
  line-height: 1.55;
}

.gallery-page .gallery-intro__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.gallery-page .gallery-copy,
.gallery-page .gallery-seo-text {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 24px;
  padding: clamp(22px, 3vw, 34px);
}

.gallery-page .gallery-container {
  padding: clamp(24px, 4vw, 36px);
}

.gallery-page .gallery-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 470px);
  gap: 20px;
  align-items: end;
  margin-bottom: 26px;
}

.gallery-page .masonry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 250px;
  gap: 18px;
  grid-auto-flow: dense;
}

.gallery-page .masonry-item {
  position: relative;
  overflow: hidden;
  border-radius: 0 !important;
  box-shadow: 0 18px 36px rgba(74, 44, 25, 0.12);
  content-visibility: auto;
  contain-intrinsic-size: 400px 300px;
}

.gallery-page .masonry-item.large {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-page .gallery-card {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  display: block;
  background: #e8ddd2;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
}

.gallery-page .gallery-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.45s ease, transform 0.8s ease;
}

.gallery-page .gallery-card__image.is-loaded {
  opacity: 1;
  transform: scale(1);
}

.gallery-page .gallery-card__overlay {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px 18px;
  color: #fff9f3;
  background: linear-gradient(180deg, transparent, rgba(13, 9, 6, 0.22) 16%, rgba(13, 9, 6, 0.8));
  transform: translateY(32px);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.gallery-page .gallery-card__eyebrow,
.gallery-page .gallery-card__tag,
.gallery-page .gallery-card__index {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 0 !important;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.gallery-page .gallery-card__index {
  top: 16px;
  left: 16px;
  background: rgba(255, 248, 241, 0.16);
  color: #fff8f0;
  border: 1px solid rgba(255, 248, 241, 0.18);
}

.gallery-page .gallery-card__tag {
  top: 16px;
  right: 16px;
  background: rgba(18, 12, 8, 0.44);
  color: #f6ddc1;
  border: 1px solid rgba(246, 221, 193, 0.2);
}

.gallery-page .gallery-card__eyebrow {
  position: static;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #f2d4b4;
  backdrop-filter: none;
}

.gallery-page .gallery-card__title {
  font-size: clamp(1.02rem, 1.6vw, 1.45rem);
  font-weight: 600;
  line-height: 1.2;
}

.gallery-page .gallery-card__hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 243, 228, 0.82);
  font-size: 0.82rem;
}

.gallery-page .gallery-card__hint::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 0 !important;
  border: 1px solid rgba(255, 243, 228, 0.34);
}

.gallery-page .gallery-card:hover .gallery-card__image,
.gallery-page .gallery-card:focus-visible .gallery-card__image {
  transform: scale(1.08);
}

.gallery-page .gallery-card:hover .gallery-card__overlay,
.gallery-page .gallery-card:focus-visible .gallery-card__overlay {
  transform: translateY(0);
  opacity: 1;
}

.gallery-page .gallery-card:focus-visible {
  outline: 2px solid rgba(157, 111, 73, 0.42);
  outline-offset: -2px;
}

.gallery-page .gallery-empty-state {
  margin: 0;
  padding: 32px;
  text-align: center;
  border-radius: 0 !important;
  background: rgba(255, 251, 247, 0.9);
  color: var(--gallery-text-soft);
}

.gallery-page .img-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, #d7cbc0 8%, #eee2d7 18%, #d7cbc0 33%);
  background-size: 200% 100%;
  animation: gallery-skeleton 1.4s linear infinite;
  transition: opacity 0.32s ease-out;
}

.gallery-page .lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 10, 7, 0.82);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.gallery-page .lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

body.lightbox-open {
  overflow: hidden;
}

.gallery-page .lightbox-backdrop {
  position: absolute;
  inset: 0;
}

.gallery-page .lightbox-content {
  position: relative;
  z-index: 1;
  width: min(100%, 1080px);
  margin: 0;
  padding: 18px 18px 14px;
  border-radius: 0 !important;
  background: rgba(27, 18, 13, 0.76);
  border: 1px solid rgba(255, 243, 228, 0.12);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
}

.gallery-page .lightbox-content img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 0 !important;
}

.gallery-page .lightbox-content figcaption {
  padding: 14px 12px 4px;
  color: rgba(255, 245, 233, 0.88);
  font-size: 0.94rem;
  text-align: center;
  line-height: 1.6;
}

.gallery-page .lightbox-close,
.gallery-page .lightbox-nav {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 0 !important;
  background: rgba(255, 246, 236, 0.12);
  color: #fff7ef;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.28s ease, background-color 0.28s ease;
}

.gallery-page .lightbox-close {
  top: -16px;
  right: -16px;
  font-size: 1.6rem;
}

.gallery-page .lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
}

.gallery-page .lightbox-nav--prev {
  left: -22px;
}

.gallery-page .lightbox-nav--next {
  right: -22px;
}

.gallery-page .lightbox-close:hover,
.gallery-page .lightbox-nav:hover {
  transform: translateY(-50%) scale(1.04);
  background: rgba(255, 246, 236, 0.2);
}

.gallery-page .lightbox-close:hover {
  transform: scale(1.04);
}

.gallery-page .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.75s ease, transform 0.75s ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.gallery-page .reveal.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes gallery-skeleton {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes gallery-scroll-cue {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.85;
  }
  50% {
    transform: translateY(8px);
    opacity: 0.4;
  }
}

@media (max-width: 1200px) {
  :root {
    --gallery-gutter: clamp(18px, 3vw, 28px);
  }

  .gallery-page .gallery-intro,
  .gallery-page .gallery-copy,
  .gallery-page .gallery-seo-text,
  .gallery-page .gallery-section-head {
    grid-template-columns: 1fr;
  }

  .gallery-page .masonry-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --gallery-gutter: clamp(16px, 4vw, 24px);
  }

  .gallery-page .hero-section {
    min-height: 74vh !important;
    padding-bottom: 88px !important;
  }

  .gallery-page .hero-text {
    max-width: 100%;
  }

  .gallery-page .hero-actions {
    gap: 10px;
  }

  .gallery-page .gallery-intro__stats {
    grid-template-columns: 1fr;
  }

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

  .gallery-page .masonry-item.large {
    grid-column: span 2;
    grid-row: span 2;
  }

  .gallery-page .lightbox-nav--prev {
    left: 8px;
  }

  .gallery-page .lightbox-nav--next {
    right: 8px;
  }
}

@media (max-width: 640px) {
  :root {
    --gallery-gutter: clamp(12px, 4vw, 18px);
  }

  .gallery-page .hero-section {
    padding-top: 118px !important;
    padding-bottom: 104px !important;
  }

  .gallery-page .hero-text-en {
    font-size: clamp(1.95rem, 9vw, 2.65rem);
    line-height: 1.08;
  }

  .gallery-page .hero-text-th {
    font-size: 0.96rem;
    line-height: 1.7;
  }

  .gallery-page .hero-description {
    font-size: 0.9rem;
    line-height: 1.8;
  }

  .gallery-page .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .gallery-page .hero-action,
  .gallery-page .gallery-pill-link {
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
    font-size: 0.88rem;
  }

  .gallery-page .gallery-main {
    padding-bottom: 72px;
  }

  .gallery-page .gallery-breadcrumb ol {
    gap: 8px;
    padding-top: 12px;
    font-size: 12px;
  }

  .gallery-page .gallery-intro,
  .gallery-page .gallery-copy,
  .gallery-page .gallery-seo-text,
  .gallery-page .gallery-container {
    border-radius: 0 !important;
  }

  .gallery-page .gallery-intro,
  .gallery-page .gallery-copy,
  .gallery-page .gallery-seo-text,
  .gallery-page .gallery-container {
    padding: 18px 16px;
  }

  .gallery-page .gallery-intro__content h2,
  .gallery-page .gallery-copy h2,
  .gallery-page .gallery-section-head h2,
  .gallery-page .gallery-seo-text h2 {
    font-size: 1.45rem;
    line-height: 1.3;
  }

  .gallery-page .gallery-intro__content p,
  .gallery-page .gallery-copy p,
  .gallery-page .gallery-section-head p,
  .gallery-page .gallery-seo-text p {
    font-size: 0.9rem;
    line-height: 1.8;
  }

  .gallery-page .gallery-stat-card {
    min-height: 120px;
    padding: 18px;
  }

  .gallery-page .gallery-card__title {
    font-size: 0.98rem;
  }

  .gallery-page .gallery-card__hint {
    font-size: 0.76rem;
  }

  .gallery-page .masonry-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 260px;
  }

  .gallery-page .masonry-item.large {
    grid-column: span 1;
    grid-row: span 1;
  }

  .gallery-page .gallery-card__overlay {
    transform: translateY(0);
    opacity: 1;
    padding: 52px 16px 16px;
    background: linear-gradient(180deg, rgba(14, 9, 6, 0.02), rgba(14, 9, 6, 0.82));
  }

  .gallery-page .hero-scroll-cue {
    right: var(--gallery-gutter);
    bottom: 18px;
    padding: 10px 12px 0;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
  }

  .gallery-page .hero-scroll-cue::after {
    height: 30px;
  }

  .gallery-page .lightbox {
    padding: 12px;
  }

  .gallery-page .lightbox-content {
    padding: 12px 12px 8px;
  }

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

  .gallery-page .lightbox-nav {
    bottom: 18px;
    top: auto;
    transform: none;
  }

  .gallery-page .lightbox-nav--prev {
    left: 12px;
  }

  .gallery-page .lightbox-nav--next {
    right: 12px;
  }

  .gallery-page .lightbox-nav:hover,
  .gallery-page .lightbox-close:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-page .reveal,
  .gallery-page .hero-scroll-cue::after,
  .gallery-page .img-skeleton,
  .gallery-page .gallery-card__image,
  .gallery-page .gallery-card__overlay,
  .gallery-page .hero-action,
  .gallery-page .gallery-pill-link,
  .gallery-page .lightbox,
  .gallery-page .lightbox-close,
  .gallery-page .lightbox-nav {
    animation: none !important;
    transition: none !important;
  }

  .gallery-page .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
