/* ══════════════════════════════
   GALLERY PAGE
   ══════════════════════════════ */

.gallery-main {
  min-height: 100vh;
  padding: 8rem 2rem 5rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Page header ── */
.gallery-header {
  text-align: center;
  margin-bottom: 2.8rem;
}

.gallery-header-pre {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.gallery-header-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-rose);
}

.ornament-small {
  font-size: 0.5rem;
  color: var(--color-gold);
}

.gallery-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 600;
  font-style: italic;
  color: var(--color-ink);
  line-height: 1;
  margin-bottom: 0.8rem;
}

.gallery-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 200px;
  margin: 0 auto;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
}

.divider-gem {
  font-size: 0.45rem;
  color: var(--color-gold);
}

/* ── Tab bar ── */
.gallery-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 3rem;
}

.tab-btn {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-ink);
  background: transparent;
  border: 1px solid rgba(196, 148, 58, 0.3);
  border-radius: 100px;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  position: relative;
  transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.tab-btn:hover:not(:disabled) {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.tab-btn.active {
  background: var(--color-ink);
  color: var(--color-cream);
  border-color: var(--color-ink);
}

.tab-btn--soon {
  opacity: 0.4;
  cursor: default;
}

.soon-tag {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: var(--color-rose);
  background: rgba(196, 120, 138, 0.12);
  border-radius: 100px;
  padding: 0.1rem 0.45rem;
}

/* ── Masonry grid ── */
.gallery-grid-wrap {
  width: 100%;
}

.gallery-grid {
  columns: 4;
  column-gap: 1rem;
}

.gallery-card {
  break-inside: avoid;
  margin-bottom: 1rem;
  position: relative;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  display: block;
}

.gallery-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.45s cubic-bezier(0.25, 0, 0.2, 1);
}

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

/* Overlay on hover */
.gallery-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(42, 31, 20, 0.82) 0%, rgba(42, 31, 20, 0.2) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem 0.9rem;
}

.gallery-card:hover .gallery-card-overlay {
  opacity: 1;
}

.overlay-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  font-style: italic;
  color: var(--color-cream);
  line-height: 1.2;
}

.overlay-meta {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(247, 237, 216, 0.7);
  margin-top: 0.2rem;
}

/* Series badge (shown when artwork has > 1 image) */
.series-badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(42, 31, 20, 0.7);
  color: var(--color-gold-light);
  font-family: var(--font-body);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  backdrop-filter: blur(4px);
}

/* ── Lightbox ── */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 31, 20, 0.92);
  backdrop-filter: blur(6px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.lightbox-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  gap: 1.2rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 900px;
  min-height: 0;
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 14rem);
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  transition: opacity 0.2s ease;
}

.lightbox-img.fade {
  opacity: 0;
}

.lightbox-meta {
  text-align: center;
  flex-shrink: 0;
}

.lb-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  font-style: italic;
  color: var(--color-cream);
  margin-bottom: 0.3rem;
}

.lb-details {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(247, 237, 216, 0.55);
}

.lb-counter {
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--color-gold-light);
  margin-top: 0.35rem;
  min-height: 1em;
}

/* Navigation arrows */
.lightbox-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(247, 237, 216, 0.08);
  border: 1px solid rgba(247, 237, 216, 0.2);
  color: var(--color-cream);
  font-size: 2rem;
  line-height: 1;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
  z-index: 1002;
}

.lightbox-arrow:hover {
  background: rgba(247, 237, 216, 0.18);
  border-color: rgba(247, 237, 216, 0.5);
}

.lightbox-arrow:disabled {
  opacity: 0.2;
  cursor: default;
}

.lightbox-arrow--prev { left: 1.5rem; }
.lightbox-arrow--next { right: 1.5rem; }

/* Close button */
.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: 1px solid rgba(247, 237, 216, 0.3);
  color: var(--color-cream);
  font-size: 0.9rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
  z-index: 1002;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(247, 237, 216, 0.12);
  border-color: rgba(247, 237, 216, 0.6);
}

/* Senior Work badge */
.senior-badge {
  position: absolute;
  bottom: 0.6rem;
  left: 0.6rem;
  background: rgba(155, 142, 196, 0.88);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  backdrop-filter: blur(4px);
}

/* Video-only card placeholder */
.card-video-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold);
}

/* Lightbox iframe (YouTube) */
.lightbox-iframe {
  width: 100%;
  max-width: 860px;
  aspect-ratio: 16 / 9;
  border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  border: none;
}

/* Lightbox local video (mp4) */
.lightbox-mp4 {
  max-width: 100%;
  max-height: calc(100vh - 14rem);
  border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  background: #000;
}

/* Disclaimer text in lightbox */
.lb-disclaimer {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-style: italic;
  color: rgba(247, 237, 216, 0.45);
  margin-top: 0.45rem;
  max-width: 480px;
  line-height: 1.5;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .gallery-grid { columns: 3; }
}

@media (max-width: 700px) {
  .gallery-grid { columns: 2; }
  .gallery-main { padding: 7rem 1.2rem 4rem; }
  .lightbox { padding: 1.5rem; gap: 0.8rem; }
  .lightbox-arrow--prev { left: 0.5rem; }
  .lightbox-arrow--next { right: 0.5rem; }
  .lightbox-img { max-height: calc(100vh - 12rem); }
}

@media (max-width: 400px) {
  .gallery-grid { columns: 1; }
}
