/* Public gallery — clean photography-style grid + lightbox */

.trc-gallery-page {
  --trc-gallery-primary: #74131d;
  --trc-gallery-ink: #0f172a;
  --trc-gallery-muted: #475569;
  --trc-gallery-radius: 14px;
  overflow-x: hidden;
}

.trc-gallery-page .trc-gallery-main {
  background: linear-gradient(180deg, #fbf9f9 0%, #ffffff 12%, #ffffff 90%, #f6f4f4 100%);
}

.trc-gallery-page .trc-gallery-section {
  padding: 2.5rem 0 5rem;
}

.trc-gallery-page .trc-gallery-header {
  max-width: 40rem;
  margin: 0 0 2.5rem;
}

.trc-gallery-page .trc-gallery-title {
  margin: 0;
  font-family: var(--trc-font-display, "Clash Display", system-ui, sans-serif);
  font-size: clamp(1.85rem, 3.6vw, 2.85rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--trc-gallery-primary);
}

.trc-gallery-page .trc-gallery-intro {
  margin: 0.75rem 0 0;
  color: var(--trc-gallery-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.trc-gallery-page .trc-gallery-empty {
  text-align: center;
  padding: 4rem 1.25rem;
  border: 1px dashed rgba(15, 23, 42, 0.12);
  border-radius: var(--trc-gallery-radius);
  background: rgba(255, 255, 255, 0.7);
}

.trc-gallery-page .trc-gallery-empty i {
  font-size: 2.4rem;
  color: rgba(116, 19, 29, 0.45);
  margin-bottom: 0.75rem;
  display: block;
}

.trc-gallery-page .trc-gallery-empty__title {
  margin: 0 0 0.4rem;
  font-family: var(--trc-font-display, "Clash Display", system-ui, sans-serif);
  font-size: 1.45rem;
  color: var(--trc-gallery-ink);
}

.trc-gallery-page .trc-gallery-empty__text {
  margin: 0;
  color: var(--trc-gallery-muted);
}

/* Larger tiles — 1200 × 800 aspect, fewer columns */
.trc-gallery-page .trc-gallery-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.35rem;
}

@media (min-width: 640px) {
  .trc-gallery-page .trc-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media (min-width: 1100px) {
  .trc-gallery-page .trc-gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.75rem;
  }
}

.trc-gallery-page .trc-gallery-item {
  margin: 0;
}

.trc-gallery-page .trc-gallery-trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 16px;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 14px 36px -18px rgba(15, 23, 42, 0.4);
}

.trc-gallery-page .trc-gallery-trigger:focus-visible {
  outline: 2px solid var(--trc-gallery-primary);
  outline-offset: 3px;
}

.trc-gallery-page .trc-gallery-frame {
  display: block;
  overflow: hidden;
  background: #eef1f4;
  aspect-ratio: 1200 / 800;
  min-height: 220px;
}

@media (min-width: 640px) {
  .trc-gallery-page .trc-gallery-frame {
    min-height: 260px;
  }
}

@media (min-width: 1100px) {
  .trc-gallery-page .trc-gallery-frame {
    min-height: 300px;
  }
}

.trc-gallery-page .trc-gallery-trigger img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.trc-gallery-page .trc-gallery-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1.25rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.55) 100%);
  color: #fff;
  font-size: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  text-align: center;
}

.trc-gallery-page .trc-gallery-overlay__title {
  display: block;
  max-width: 90%;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.trc-gallery-page .trc-gallery-trigger:hover img,
.trc-gallery-page .trc-gallery-trigger:focus-visible img {
  transform: scale(1.04);
}

.trc-gallery-page .trc-gallery-trigger:hover .trc-gallery-overlay,
.trc-gallery-page .trc-gallery-trigger:focus-visible .trc-gallery-overlay {
  opacity: 1;
}

.trc-gallery-page .trc-gallery-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
}

.trc-gallery-page .trc-gallery-load-more {
  appearance: none;
  border: 1px solid rgba(116, 19, 29, 0.28);
  background: #fff;
  color: var(--trc-gallery-primary);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.trc-gallery-page .trc-gallery-load-more:hover,
.trc-gallery-page .trc-gallery-load-more:focus-visible {
  background: var(--trc-gallery-primary);
  color: #fff;
  border-color: var(--trc-gallery-primary);
  box-shadow: 0 10px 24px -14px rgba(116, 19, 29, 0.55);
}

.trc-gallery-page .trc-gallery-load-more:disabled {
  opacity: 0.65;
  cursor: wait;
  box-shadow: none;
}

/* Lightbox */
.trc-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.trc-gallery-lightbox[hidden] {
  display: none !important;
}

.trc-gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 16, 0.88);
  backdrop-filter: blur(2px);
}

.trc-gallery-lightbox__dialog {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1400px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.trc-gallery-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 4.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  user-select: none;
  -webkit-user-drag: none;
}

.trc-gallery-lightbox__counter {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.trc-gallery-lightbox__title {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  max-width: 40rem;
  line-height: 1.35;
}

.trc-gallery-lightbox__close,
.trc-gallery-lightbox__prev,
.trc-gallery-lightbox__next {
  position: absolute;
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.trc-gallery-lightbox__close:hover,
.trc-gallery-lightbox__close:focus-visible,
.trc-gallery-lightbox__prev:hover,
.trc-gallery-lightbox__prev:focus-visible,
.trc-gallery-lightbox__next:hover,
.trc-gallery-lightbox__next:focus-visible {
  background: rgba(255, 255, 255, 0.22);
}

.trc-gallery-lightbox__close {
  top: 1rem;
  right: 1rem;
}

.trc-gallery-lightbox__prev {
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
}

.trc-gallery-lightbox__next {
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 575.98px) {
  .trc-gallery-lightbox__prev {
    left: 0.35rem;
  }
  .trc-gallery-lightbox__next {
    right: 0.35rem;
  }
  .trc-gallery-lightbox__close {
    top: 0.65rem;
    right: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trc-gallery-page .trc-gallery-trigger img,
  .trc-gallery-page .trc-gallery-overlay {
    transition: none;
  }
  .trc-gallery-page .trc-gallery-trigger:hover img,
  .trc-gallery-page .trc-gallery-trigger:focus-visible img {
    transform: none;
  }
}
