.tc-gallery-page {
  --cream: #fefcef;
  --sand: #dedcd0;
  --sand-40: rgba(222, 220, 208, 0.4);
  --sand-25: rgba(222, 220, 208, 0.25);
  --sand-12: rgba(222, 220, 208, 0.12);
  --sand-06: rgba(222, 220, 208, 0.06);
  --bg: #080808;
  --easing: cubic-bezier(.22,.61,.36,1);
  background: var(--bg);
  color: var(--cream);
  min-height: 100vh;
}

/* ─── HERO (archive) ─────────────────────────────────────── */
.tc-gallery-hero,
.tc-gallery-album-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14vh 5vw 10vh;
  overflow: hidden;
  border-bottom: 1px solid var(--sand-12);
}

/* Radial glow — kept for album hero; archive hero gets its own overlay layer */
.tc-gallery-album-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(222,220,208,0.08) 0%, transparent 70%);
  z-index: 1;
}

/* ── Slideshow stack ── */
.tc-gallery-hero-slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.tc-gallery-hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  filter: brightness(0.32) saturate(0.8) blur(0px);
  transform: scale(1.06);
  transition:
    opacity 1.4s cubic-bezier(.4,0,.2,1),
    filter  1.4s cubic-bezier(.4,0,.2,1),
    transform 8s linear;
}

.tc-gallery-hero-slide.active {
  opacity: 1;
  filter: brightness(0.38) saturate(0.9) blur(0px);
  transform: scale(1.0);
}

/* blur-out as slide leaves */
.tc-gallery-hero-slide.leaving {
  opacity: 0;
  filter: brightness(0.15) saturate(0.5) blur(14px);
  transform: scale(1.08);
  transition:
    opacity 1.2s cubic-bezier(.4,0,.2,1),
    filter  1.2s cubic-bezier(.4,0,.2,1),
    transform 1.2s ease-in;
}

/* Ken-Burns subtle drift while active */
@keyframes tcHeroKenBurns {
  0%   { transform: scale(1.0) translate(0, 0); }
  50%  { transform: scale(1.04) translate(-0.8%, 0.4%); }
  100% { transform: scale(1.0) translate(0, 0); }
}
.tc-gallery-hero-slide.active {
  animation: tcHeroKenBurns 12s ease-in-out infinite;
}

/* ── Overlay gradients ── */
.tc-gallery-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(222,220,208,0.06) 0%, transparent 70%),
    linear-gradient(to bottom, rgba(8,8,8,0.45) 0%, rgba(8,8,8,0.15) 40%, rgba(8,8,8,0.55) 100%);
  pointer-events: none;
}

/* ── Watermark / stroke text ── */
.tc-gallery-hero-wm {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

@keyframes tcWmDrift {
  0%   { transform: translateX(0)   skewX(0deg); }
  25%  { transform: translateX(-1%) skewX(-0.4deg); }
  75%  { transform: translateX(1%)  skewX(0.4deg); }
  100% { transform: translateX(0)   skewX(0deg); }
}

@keyframes tcWmStroke {
  0%,100% { -webkit-text-stroke-color: rgba(222,220,208,0.07); }
  50%      { -webkit-text-stroke-color: rgba(222,220,208,0.14); }
}

.tc-gallery-hero-wm span {
  font-size: clamp(8rem, 32vw, 34rem);
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 0.8px rgba(222,220,208,0.07);
  text-transform: uppercase;
  white-space: nowrap;
  animation:
    tcWmDrift  18s ease-in-out infinite,
    tcWmStroke 6s ease-in-out infinite;
  will-change: transform;
}

/* ── Hero inner content ── */
.tc-gallery-hero-inner,
.tc-gallery-album-hero-inner {
  position: relative;
  z-index: 4;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
}

/* Old single bg-img selector (album hero still uses it) */
.tc-gallery-hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.28) blur(2px);
  opacity: 0.45;
  z-index: 0;
}

.tc-gallery-eyebrow,
.tc-gallery-search-label,
.tc-gallery-filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--sand);
}

.tc-gallery-hero-title,
.tc-gallery-album-title {
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin: 0;
}

.tc-gallery-album-title {
  max-width: 1100px;
}

.tc-gallery-hero-subtitle,
.tc-gallery-album-description {
  max-width: 720px;
  font-size: clamp(0.95rem, 1.4vw, 1.2rem);
  color: rgba(222,220,208,0.72);
  margin: 0;
}

.tc-gallery-hero-divider {
  width: 80px;
  height: 1px;
  background: var(--sand-25);
}

.tc-gallery-back {
  border: 1px solid var(--sand-25);
  color: var(--sand-40);
  padding: 0.7rem 1rem;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  transition: all 0.25s ease;
}

.tc-gallery-back:hover {
  color: var(--cream);
  border-color: var(--cream);
  background: var(--sand-06);
}

.tc-gallery-album-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  color: rgba(222,220,208,0.68);
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
}

.tc-gallery-album-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 0.7rem;
  color: var(--sand-25);
}

.tc-gallery-filters {
  border-bottom: 1px solid var(--sand-12);
}

.tc-gallery-filter-wrap {
  position: relative;
  padding: 5vh 5vw 3vh;
}

.tc-gallery-filter-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(222,220,208,0.05) 0%, transparent 60%);
  pointer-events: none;
}

.tc-gallery-filter-group {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto 1.4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.3rem;
}

.tc-gallery-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.tc-gallery-pill,
.tc-gallery-pagination button,
.tc-gallery-load-more,
.tc-gallery-lightbox-actions button,
.tc-gallery-download,
.tc-gallery-download-disabled {
  border: 1px solid var(--sand-25);
  background: rgba(222,220,208,0.02);
  color: var(--sand-40);
  padding: 0.75rem 1.15rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all 0.3s var(--easing);
}

.tc-gallery-pill:hover,
.tc-gallery-pill.active,
.tc-gallery-pagination button:hover,
.tc-gallery-load-more:hover,
.tc-gallery-lightbox-actions button:hover,
.tc-gallery-download:hover {
  border-color: var(--cream);
  color: var(--cream);
  background: rgba(222,220,208,0.08);
}

.tc-gallery-search {
  padding: 4vh 5vw;
}

.tc-gallery-search-box {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

.tc-gallery-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  border: 1px solid var(--sand-25);
  background: rgba(222,220,208,0.025);
  transition: all 0.3s ease;
}

.tc-gallery-search-input-wrap:focus-within {
  border-color: var(--sand-40);
  background: rgba(222,220,208,0.06);
}

.tc-gallery-search-input {
  width: 100%;
  background: none;
  border: 0;
  outline: 0;
  color: var(--cream);
  font-size: 1rem;
}

.tc-gallery-search-clear {
  width: 34px;
  height: 34px;
  border: 1px solid var(--sand-25);
  border-radius: 50%;
  background: transparent;
  color: var(--sand-40);
  font-size: 1.2rem;
}

.tc-gallery-search-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--sand-40);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tc-gallery-sort {
  border: 1px solid var(--sand-25);
  background: #080808;
  color: var(--cream);
  padding: 0.72rem 0.9rem;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.tc-gallery-albums,
.tc-gallery-photo-section {
  padding: 6vh 5vw 9vh;
}

.tc-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  max-width: 1500px;
  margin: 0 auto;
}

.tc-gallery-card {
  border: 1px solid var(--sand-12);
  background: #080808;
  overflow: hidden;
  opacity: 0;
  animation: tcGalleryItemIn 0.8s var(--easing) forwards;
  transition: transform 0.4s var(--easing), border-color 0.4s var(--easing), box-shadow 0.4s var(--easing);
}

.tc-gallery-card:hover {
  transform: translateY(-10px);
  border-color: var(--sand-40);
  box-shadow: 0 20px 80px rgba(0,0,0,0.7);
}

.tc-gallery-card-link {
  display: block;
  height: 100%;
}

.tc-gallery-card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #000;
}

.tc-gallery-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.82) saturate(0.95);
  transition: transform 0.7s var(--easing), filter 0.7s var(--easing);
}

.tc-gallery-card:hover .tc-gallery-card-img {
  transform: scale(1.09);
  filter: brightness(1.06) saturate(1.08);
}

.tc-gallery-card-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--sand-25);
  font-weight: 900;
  letter-spacing: 0.1em;
}

.tc-gallery-card-count {
  position: absolute;
  right: 1rem;
  top: 1rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--sand-25);
  background: rgba(0,0,0,0.58);
  color: var(--cream);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.tc-gallery-card-body {
  padding: 1.5rem;
}

.tc-gallery-card-meta {
  color: var(--sand);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 0.7rem;
}

.tc-gallery-card-title {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.05;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.tc-gallery-card-details {
  min-height: 3.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: rgba(222,220,208,0.64);
  font-size: 0.78rem;
}

.tc-gallery-card-cta {
  display: inline-flex;
  margin-top: 1.2rem;
  border-bottom: 1px solid var(--sand-25);
  color: var(--cream);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@keyframes tcGalleryItemIn {
  from { opacity: 0; transform: translateY(36px); }
  to { opacity: 1; transform: translateY(0); }
}

.tc-gallery-empty {
  display: none;
  text-align: center;
  padding: 8vh 5vw;
  color: var(--sand-40);
}

.tc-gallery-empty.show {
  display: block;
}

.tc-gallery-empty-icon {
  font-size: 4rem;
  opacity: 0.24;
  margin-bottom: 1rem;
}

.tc-gallery-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 6vh;
  padding-top: 4vh;
  border-top: 1px solid var(--sand-12);
}

.tc-gallery-pagination[hidden],
.tc-gallery-load-more[hidden] {
  display: none;
}

.tc-gallery-pagination span {
  color: var(--sand-40);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tc-gallery-photo-grid {
  column-count: 4;
  column-gap: 2rem;
  max-width: 1700px;
  margin: 0 auto;
}

.tc-gallery-photo {
  position: relative;
  break-inside: avoid;
  margin: 0 0 2rem;
  overflow: hidden;
  border: 1px solid var(--sand-12);
  background: #000;
  cursor: zoom-in;
  opacity: 0;
  animation: tcGalleryItemIn 0.8s var(--easing) forwards;
}

.tc-gallery-photo img {
  width: 100%;
  height: auto;
  display: block;
  filter: brightness(0.82) saturate(0.95);
  transition: transform 0.6s var(--easing), filter 0.6s var(--easing);
}

.tc-gallery-photo:hover img {
  transform: scale(1.08);
  filter: brightness(1.08) saturate(1.08);
}

.tc-gallery-photo figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 1.4rem;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.82));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tc-gallery-photo:hover figcaption {
  opacity: 1;
}

.tc-gallery-photo figcaption span,
.tc-gallery-photo figcaption strong {
  display: block;
}

.tc-gallery-photo figcaption span {
  color: var(--sand);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.tc-gallery-photo figcaption strong {
  color: var(--cream);
  font-size: 0.95rem;
  text-transform: uppercase;
}

.tc-gallery-load-more {
  display: flex;
  margin: 5vh auto 0;
}

.tc-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(0,0,0,0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.tc-gallery-lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.tc-gallery-lightbox-content {
  position: relative;
  width: min(1200px, 100%);
  max-height: 92vh;
  border: 1px solid var(--sand-12);
  background: #080808;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tc-gallery-lightbox-close,
.tc-gallery-lightbox-nav {
  position: absolute;
  z-index: 3;
  width: 50px;
  height: 50px;
  border: 1px solid var(--sand-25);
  border-radius: 50%;
  background: rgba(0,0,0,0.56);
  color: var(--sand-40);
  font-size: 1.7rem;
  transition: all 0.25s ease;
}

.tc-gallery-lightbox-close {
  top: 1.4rem;
  right: 1.4rem;
}

.tc-gallery-lightbox-nav {
  top: 45%;
}

.tc-gallery-lightbox-nav.prev {
  left: 1.4rem;
}

.tc-gallery-lightbox-nav.next {
  right: 1.4rem;
}

.tc-gallery-lightbox-close:hover,
.tc-gallery-lightbox-nav:hover {
  color: var(--cream);
  border-color: var(--cream);
}

.tc-gallery-lightbox-image-wrap {
  min-height: 58vh;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tc-gallery-lightbox-image-wrap img {
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
}

.tc-gallery-lightbox-info {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem;
  border-top: 1px solid var(--sand-12);
}

.tc-gallery-lightbox-info p {
  margin: 0 0 0.5rem;
  color: rgba(222,220,208,0.7);
}

.tc-gallery-lightbox-info p:first-child {
  color: var(--sand);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.tc-gallery-lightbox-info h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.tc-gallery-lightbox-actions {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  position: relative;
}

.tc-gallery-actions-toggle[aria-expanded="true"] {
  border-color: var(--cream);
  color: var(--cream);
  background: rgba(222,220,208,0.08);
}

.tc-gallery-actions-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.7rem);
  width: min(230px, 78vw);
  display: grid;
  gap: 0.45rem;
  padding: 0.55rem;
  border: 1px solid var(--sand-25);
  background: rgba(8,8,8,0.98);
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
  z-index: 4;
}

.tc-gallery-actions-menu[hidden] {
  display: none;
}

.tc-gallery-actions-menu [hidden] {
  display: none !important;
}

.tc-gallery-actions-menu button,
.tc-gallery-actions-menu .tc-gallery-download,
.tc-gallery-download-disabled {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

.tc-gallery-download-disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.tc-gallery-actions-feedback {
  min-height: 1.2em;
  color: var(--sand);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.tc-gallery-lock {
  overflow: hidden;
}

@media (max-width: 1100px) {
  .tc-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tc-gallery-photo-grid {
    column-count: 3;
  }
}

@media (max-width: 760px) {
  .tc-gallery-hero,
  .tc-gallery-album-hero {
    min-height: 84vh;
    padding: 12vh 4vw 7vh;
  }

  .tc-gallery-hero-title,
  .tc-gallery-album-title {
    font-size: clamp(2.6rem, 14vw, 5rem);
  }

  .tc-gallery-filter-group,
  .tc-gallery-search-controls,
  .tc-gallery-lightbox-info {
    flex-direction: column;
  }

  .tc-gallery-grid {
    grid-template-columns: 1fr;
    gap: 1.3rem;
  }

  .tc-gallery-photo-grid {
    column-count: 1;
    column-gap: 0;
  }

  .tc-gallery-lightbox {
    padding: 0;
  }

  .tc-gallery-lightbox-content {
    max-height: 100vh;
    height: 100%;
    border: 0;
  }

  .tc-gallery-lightbox-image-wrap {
    min-height: 55vh;
  }

  .tc-gallery-lightbox-nav {
    width: 44px;
    height: 44px;
  }
}
