:root {
  --navy: #12215a;
  --purple: #352399;
  --purple-deep: #24115f;
  --ink: #2a2d36;
  --muted: #5c6170;
  --gold: #f0b429;
  --gold-deep: #a16207;
  --line: #e4e2f0;
  --paper: #f3f4f9;
  --card: #ffffff;
  --shadow: 0 14px 40px rgba(18, 33, 90, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Sarabun, "Open Sans", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

img { max-width: 100%; display: block; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
  box-shadow: 0 2px 14px rgba(18, 33, 90, 0.08);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand img {
  height: 62px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-family: Poppins, sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-nav a {
  color: #2e2a44;
  text-decoration: none;
  font-weight: 500;
}

.header-nav a:hover { color: var(--purple); }

.header-current {
  color: var(--purple);
  font-weight: 600;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 0.15rem;
}

.gallery-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  text-align: center;
  padding: 3.6rem 1.25rem 4.8rem;
  background:
    linear-gradient(180deg, rgba(36, 14, 110, 0.2), rgba(22, 8, 72, 0.42)),
    url("https://wrc-isian-irs-2026.org/media/images/wrc2026-bg-countdown-timer.jpg") center 28% / cover no-repeat,
    linear-gradient(180deg, #3c1d9a 0%, #24115f 100%);
}

.hero-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(240, 180, 41, 0.18), transparent 45%),
    radial-gradient(ellipse at 80% 0%, rgba(120, 90, 255, 0.25), transparent 40%);
  pointer-events: none;
  animation: veil-drift 12s ease-in-out infinite alternate;
}

@keyframes veil-drift {
  from { transform: translateY(0) scale(1); opacity: 0.85; }
  to { transform: translateY(12px) scale(1.05); opacity: 1; }
}

.hero-inner {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  animation: hero-rise 0.8s ease both;
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-kicker {
  margin: 0 0 0.45rem;
  font-family: Poppins, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.gallery-hero h1 {
  margin: 0;
  font-family: Raleway, sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  letter-spacing: 0.01em;
}

.hero-thanks {
  margin: 0.95rem auto 0;
  max-width: 38rem;
  font-family: Caveat, "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(1.65rem, 3.2vw, 2.15rem);
  font-weight: 600;
  line-height: 1.4;
  color: #f6e2a8;
  text-shadow: 0 2px 14px rgba(18, 10, 48, 0.35);
  letter-spacing: 0.015em;
}

.hero-rule {
  width: 72px;
  height: 3px;
  margin: 1rem auto;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero-lead {
  margin: 0 auto 0.55rem;
  max-width: 36rem;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.92);
}

.hero-dates {
  margin: 0;
  font-family: Poppins, sans-serif;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.78);
}

.gallery-main {
  max-width: 1240px;
  margin: -2.2rem auto 0;
  padding: 0 1.25rem 4rem;
  position: relative;
  z-index: 2;
}

.day-tabs-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.day-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.4rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.day-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: Poppins, sans-serif;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.day-tab:hover {
  color: var(--purple);
  background: rgba(53, 35, 153, 0.06);
}

.day-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--purple) 0%, var(--navy) 100%);
  box-shadow: 0 8px 18px rgba(53, 35, 153, 0.28);
}

.day-tab.is-disabled {
  opacity: 0.55;
}

.day-tab .tab-meta,
.sub-tab .tab-meta {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.72rem;
  opacity: 0.8;
}

.sub-tabs-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 1.4rem;
}

.sub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.3rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(18, 33, 90, 0.06);
}

.sub-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: Poppins, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.sub-tab:hover {
  color: var(--purple);
  background: rgba(53, 35, 153, 0.06);
}

.sub-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, #5a3ec8 0%, #352399 100%);
}

.sub-tab.is-disabled { opacity: 0.55; }

.gallery-panel {
  animation: panel-in 0.45s ease both;
}

.gallery-panel[hidden] { display: none !important; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-intro {
  text-align: center;
  margin-bottom: 1.6rem;
}

.panel-intro h2 {
  margin: 0 0 0.35rem;
  font-family: Raleway, sans-serif;
  font-weight: 800;
  font-size: clamp(1.45rem, 2.5vw, 1.9rem);
  color: var(--navy);
}

.panel-intro p {
  margin: 0 auto;
  max-width: 34rem;
  color: var(--muted);
}

.album-block {
  margin-bottom: 2.4rem;
}

.album-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.album-head h3 {
  margin: 0;
  font-family: Poppins, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--purple-deep);
}

.album-count {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 0.85rem;
}

.photo-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #dfe3ef;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  box-shadow: 0 8px 22px rgba(18, 33, 90, 0.08);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  animation: card-in 0.5s ease both;
}

.photo-card:nth-child(2n) { animation-delay: 0.04s; }
.photo-card:nth-child(3n) { animation-delay: 0.08s; }
.photo-card:nth-child(4n) { animation-delay: 0.12s; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.photo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(18, 33, 90, 0.45));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-card .zoom-hint {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  z-index: 1;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(53, 35, 153, 0.85);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.photo-card:hover,
.photo-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(18, 33, 90, 0.18);
  outline: none;
}

.photo-card:hover img,
.photo-card:focus-visible img {
  transform: scale(1.06);
}

.photo-card:hover::after,
.photo-card:focus-visible::after,
.photo-card:hover .zoom-hint,
.photo-card:focus-visible .zoom-hint {
  opacity: 1;
  transform: translateY(0);
}

.photo-card .card-caption {
  position: absolute;
  left: 0.7rem;
  right: 2.6rem;
  bottom: 0.65rem;
  z-index: 1;
  margin: 0;
  color: #fff;
  font-size: 0.72rem;
  font-family: Poppins, sans-serif;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  text-align: left;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

.photo-card:hover .card-caption,
.photo-card:focus-visible .card-caption {
  opacity: 1;
  transform: translateY(0);
}

.more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.btn-more {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--purple);
  font-family: Poppins, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(18, 33, 90, 0.08);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-more span { color: var(--muted); font-size: 0.78rem; margin-left: 0.2rem; }

.btn-more:hover,
.btn-more:focus-visible {
  background: linear-gradient(135deg, var(--purple), var(--navy));
  color: #fff;
  outline: none;
}

.btn-more:hover span,
.btn-more:focus-visible span { color: rgba(255, 255, 255, 0.8); }

.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
}

.empty-state i {
  font-size: 2.2rem;
  color: var(--purple);
  opacity: 0.7;
}

.empty-state h3 {
  margin: 0.8rem 0 0.35rem;
  font-family: Raleway, sans-serif;
  color: var(--navy);
}

.empty-state p { margin: 0; }

.site-footer {
  background: linear-gradient(180deg, #1a1450, #120d38);
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
  padding: 2.4rem 1.25rem;
  font-size: 0.92rem;
}

.footer-title {
  margin: 0 0 0.35rem;
  font-family: Raleway, sans-serif;
  font-weight: 700;
  color: #fff;
  font-size: 1.05rem;
}

.site-footer p { margin: 0.2rem 0; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  /* side padding reserves room for the Back / Next buttons */
  padding: 4rem 4.5rem 1.25rem;
  background: rgba(10, 8, 28, 0.92);
  backdrop-filter: blur(8px);
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
  -webkit-user-select: none;
  user-select: none;
}

.lightbox[hidden] { display: none !important; }

.lb-figure {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  text-align: center;
}

.lb-figure img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  max-height: calc(100dvh - 9rem);
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  object-fit: contain;
  background: #0d0a1f;
  -webkit-user-drag: none;
}

.lb-figure img.slide-next { animation: lb-slide-next 0.28s ease both; }
.lb-figure img.slide-prev { animation: lb-slide-prev 0.28s ease both; }

@keyframes lb-slide-next {
  from { opacity: 0.2; transform: translateX(36px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes lb-slide-prev {
  from { opacity: 0.2; transform: translateX(-36px); }
  to { opacity: 1; transform: translateX(0); }
}

.lb-figure figcaption {
  margin-top: 0.85rem;
  color: rgba(255, 255, 255, 0.88);
  font-family: Poppins, sans-serif;
  font-size: 0.9rem;
}

.lb-close,
.lb-nav {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lb-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
}

.lb-close:hover,
.lb-nav:hover {
  background: rgba(240, 180, 41, 0.85);
  color: #1a1450;
}

.lb-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  font-size: 1.35rem;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.16);
}

.lb-nav:hover { transform: translateY(-50%) scale(1.06); }
.lb-prev { left: 0.9rem; }
.lb-next { right: 0.9rem; }

body.lb-open { overflow: hidden; }

@media (max-width: 720px) {
  .brand img { height: 48px; }
  .day-tabs {
    width: 100%;
    border-radius: 18px;
    justify-content: center;
  }
  .day-tab {
    flex: 1 1 calc(50% - 0.45rem);
    text-align: center;
    padding: 0.65rem 0.7rem;
    font-size: 0.78rem;
  }
  .sub-tabs {
    width: 100%;
    border-radius: 16px;
    justify-content: center;
  }
  .sub-tab {
    flex: 1 1 calc(33% - 0.4rem);
    text-align: center;
    padding: 0.55rem 0.5rem;
    font-size: 0.76rem;
  }
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.65rem;
  }
  /* Phones: image uses full width, swipe left/right to navigate; arrows stay as small overlays */
  .lightbox { padding: 3.5rem 0.5rem 1rem; }
  .lb-nav {
    width: 2.4rem;
    height: 2.4rem;
    font-size: 1.1rem;
    background: rgba(10, 8, 28, 0.55);
  }
  .lb-prev { left: 0.5rem; }
  .lb-next { right: 0.5rem; }
  .lb-figure img { max-height: calc(100vh - 8rem); max-height: calc(100dvh - 8rem); }
}
