/* ============================================================
   Gallery — Refined Editorial Theme
   Fonts: Playfair Display (display) + Inter (body)
   ============================================================ */

:root {
  --bg: #f9f7f4;
  --surface: #ffffff;
  --text: #1c1a17;
  --muted: #8a8580;
  --accent: #b8860b;
  --accent-2: #8b6914;
  --accent-soft: rgba(184, 134, 11, 0.10);
  --contrast: #ffffff;
  --border: #e8e3dc;
  --shadow-sm: 0 2px 10px rgba(28, 26, 23, 0.07);
  --shadow-md: 0 8px 28px rgba(28, 26, 23, 0.10);
  --shadow-lg: 0 20px 50px rgba(184, 134, 11, 0.20);
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---- Container ---- */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 80px 24px;
}

/* ---- Section Header ---- */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-eyebrow {
  display: inline-block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  padding: 6px 16px;
  border: 1px solid rgba(184, 134, 11, 0.3);
  border-radius: 30px;
  background: rgba(184, 134, 11, 0.05);
}

.section-header h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 12px;
  color: var(--text);
}

.section-header p {
  color: var(--muted);
  font-size: 16px;
  font-weight: 300;
}

/* ---- Filters ---- */
.isotope-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
}

.isotope-filters li {
  padding: 9px 22px;
  background: var(--surface);
  color: var(--muted);
  border-radius: 30px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.03em;
  transition: all 0.25s ease;
  border: 1px solid var(--border);
  user-select: none;
}

.isotope-filters li:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.isotope-filters li.filter-active {
  background: var(--text);
  color: var(--contrast);
  border-color: var(--text);
  box-shadow: var(--shadow-md);
}

/* ---- Gallery Grid ---- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  min-height: 200px;
}

.gallery-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  height: 300px;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.4s ease;
  animation: fadeUp 0.45s ease both;
}

.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* Category badge */
.gallery-card::before {
  content: attr(data-label);
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0;
  transform: translateY(-6px);
  transition: all 0.3s ease;
}

.gallery-card:hover::before {
  opacity: 1;
  transform: translateY(0);
}

.gallery-image {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: block;
}

.gallery-card:hover .gallery-image img {
  transform: scale(1.08);
}

/* Zoom icon overlay */
.gallery-zoom-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-card:hover .gallery-zoom-icon {
  opacity: 1;
}

.gallery-zoom-icon span {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.8);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gallery-card:hover .gallery-zoom-icon span {
  transform: scale(1);
}

.gallery-zoom-icon svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gallery-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 18px 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.80) 0%, rgba(0, 0, 0, 0) 100%);
  color: #fff;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.35s ease;
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
  transform: translateY(0);
}

.gallery-overlay h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 2px;
  line-height: 1.2;
  color: #fff;
}

.gallery-overlay p {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.75;
  letter-spacing: 0.04em;
  color: #fff;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
  font-size: 16px;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Pagination ---- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 56px;
  flex-wrap: wrap;
}

.page-btn {
  --size: 44px;
  min-width: var(--size);
  height: var(--size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  font: 500 14px/1 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.page-btn:hover:not(:disabled):not(.active) {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.page-btn.active {
  background: var(--text);
  color: var(--contrast);
  border-color: var(--text);
  box-shadow: var(--shadow-md);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.page-btn .icon {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-ellipsis {
  min-width: 32px;
  height: 44px;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 2px;
  padding-bottom: 12px;
}

/* ==============================================================
   LIGHTBOX
   ============================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 9, 8, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
}

.lightbox-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-height: 100dvh;
}

/* Close button */
.lb-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.lb-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: rotate(90deg);
}

.lb-close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Counter */
.lb-counter {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  text-transform: uppercase;
  align-self: flex-end;
  margin-right: 60px;
}

/* Stage */
.lb-stage {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

/* Arrows */
.lb-arrow {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.lb-arrow:hover {
  background: rgba(255, 255, 255, 0.20);
  transform: scale(1.1);
}

.lb-arrow:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  transform: none;
}

.lb-arrow svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Frame */
.lb-frame {
  flex: 1;
  min-width: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #111;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

.lb-img-wrap {
  width: 100%;
  max-height: 58vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0d0d0d;
}

.lb-img-wrap img {
  width: 100%;
  height: 100%;
  max-height: 58vh;
  object-fit: contain;
  display: block;
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lb-img-wrap img.lb-entering {
  opacity: 0;
  transform: scale(0.97);
}

.lb-caption {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #111;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.lb-caption h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 19px;
  font-weight: 600;
  color: #fff;
}

.lb-caption span {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  background: rgba(184, 134, 11, 0.15);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(184, 134, 11, 0.3);
}

/* Thumbnails */
.lb-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 4px 8px;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.lb-thumbs::-webkit-scrollbar {
  height: 4px;
}

.lb-thumbs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.lb-thumb {
  flex-shrink: 0;
  width: 62px;
  height: 46px;
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  opacity: 0.5;
}

.lb-thumb:hover {
  opacity: 0.8;
}

.lb-thumb.active {
  border-color: var(--accent);
  opacity: 1;
  box-shadow: 0 0 0 1px var(--accent);
}

.lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* ---- Keyboard hint ---- */
.lb-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.06em;
}

/* ==============================================================
   RESPONSIVE
   ============================================================== */
@media (max-width: 768px) {
  .lb-stage {
    gap: 8px;
  }

  .lb-arrow {
    width: 40px;
    height: 40px;
  }

  .lb-thumbs {
    gap: 6px;
  }

  .lb-thumb {
    width: 50px;
    height: 38px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
  }
}

@media (max-width: 570px) {
  .container {
    padding: 50px 16px;
  }

  .section-header h2 {
    font-size: 2rem;
  }

  .section-eyebrow {
    font-size: 10px;
  }

  .isotope-filters li {
    padding: 8px 16px;
    font-size: 12px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .gallery-card {
    height: 200px;
  }

  .lb-stage {
    gap: 4px;
  }

  .lb-arrow {
    width: 36px;
    height: 36px;
  }

  .lb-arrow svg {
    width: 18px;
    height: 18px;
  }

  .lb-img-wrap,
  .lb-img-wrap img {
    max-height: 46vh;
  }

  .lb-thumbs {
    gap: 5px;
  }

  .lb-thumb {
    width: 44px;
    height: 34px;
  }

  .lb-caption h3 {
    font-size: 15px;
  }

  .lb-caption span {
    font-size: 10px;
  }

  .lb-counter {
    margin-right: 46px;
  }
}

@media (max-width: 380px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .gallery-card {
    height: 220px;
  }

  .lb-arrow {
    width: 32px;
    height: 32px;
  }

  .lb-img-wrap,
  .lb-img-wrap img {
    max-height: 40vh;
  }
}

@media (max-width: 480px) {
  .page-btn {
    --size: 38px;
    padding: 0 10px;
    font-size: 13px;
  }

  .page-btn .label {
    display: none;
  }
}