/* ─── T20 Gallery ──────────────────────────────────────────────────────────── */
.t20-gallery-wrap {
  --t20-cols: 3;
  --t20-gap: 12px;
  --t20-overlay-bg: rgba(0, 0, 0, 0.52);
  --t20-overlay-text: #fff;
  --t20-accent: #b8975a;   /* warm gold — swap to your brand color */
  --t20-radius: 4px;
  --t20-zoom-scale: 1.07;
  --t20-transition: 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.t20-gallery-wrap {
  font-family: inherit;
  width: 100%;
}

/* ── Filter tabs ─────────────────────────────────────────────────────────── */
.t20-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.t20-filter-btn {
  background: transparent;
  border: 1.5px solid #ccc;
  border-radius: 2px;
  color: #555;
  cursor: pointer;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding: 7px 18px;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.t20-filter-btn:hover,
.t20-filter-btn.active {
  background: var(--t20-accent);
  border-color: var(--t20-accent);
  color: #fff;
}

/* ── Grid ────────────────────────────────────────────────────────────────── */
.t20-gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--t20-cols, 3), 1fr);
  gap: var(--t20-gap);
}

/* Column count from data-columns attribute (JS also sets the CSS var) */
.t20-gallery-grid[data-columns="1"] { --t20-cols: 1; }
.t20-gallery-grid[data-columns="2"] { --t20-cols: 2; }
.t20-gallery-grid[data-columns="3"] { --t20-cols: 3; }
.t20-gallery-grid[data-columns="4"] { --t20-cols: 4; }
.t20-gallery-grid[data-columns="5"] { --t20-cols: 5; }
.t20-gallery-grid[data-columns="6"] { --t20-cols: 6; }

/* ── Individual item ─────────────────────────────────────────────────────── */
.t20-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--t20-radius);
}

.t20-item.hidden { display: none; }

/* Anchor reset */
.t20-lightbox-trigger {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* ── Image wrapper + zoom ────────────────────────────────────────────────── */
.t20-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;   /* keeps grid uniform; remove for natural heights */
  border-radius: var(--t20-radius);
}

.t20-img-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transform-origin: center center;
  transition: transform var(--t20-transition);
  will-change: transform;
}

/* ── Hover: zoom image ───────────────────────────────────────────────────── */
.t20-item:hover .t20-img-wrap img {
  transform: scale(var(--t20-zoom-scale));
}

/* ── Dark overlay ────────────────────────────────────────────────────────── */
.t20-overlay {
  position: absolute;
  inset: 0;
  background: var(--t20-overlay-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 16px 14px;
  opacity: 0;
  transition: opacity var(--t20-transition);
}

.t20-item:hover .t20-overlay {
  opacity: 1;
}

/* ── Overlay text ────────────────────────────────────────────────────────── */
.t20-overlay-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
  transform: translateY(8px);
  transition: transform var(--t20-transition);
}

.t20-item:hover .t20-overlay-text {
  transform: translateY(0);
}

.t20-door-style,
.t20-finish,
.t20-designer {
  display: block;
  color: var(--t20-overlay-text);
  line-height: 1.3;
}

.t20-door-style {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.t20-finish {
  font-size: 0.78rem;
  opacity: 0.88;
}

.t20-designer {
  font-size: 0.72rem;
  opacity: 0.7;
  margin-top: 2px;
}

/* ── Zoom icon ───────────────────────────────────────────────────────────── */
.t20-zoom-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  color: #fff;
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity var(--t20-transition);
}

.t20-item:hover .t20-zoom-icon {
  opacity: 0.8;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.t20-empty {
  color: #888;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════════════════════════════════ */
.t20-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.t20-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.t20-lb-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.t20-lb-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
  transition: opacity 0.25s ease;
}

.t20-lb-img.loading { opacity: 0; }

.t20-lb-caption {
  margin-top: 14px;
  text-align: center;
  color: #ddd;
}

.t20-lb-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 4px;
  color: #fff;
}

.t20-lb-meta {
  font-size: 0.8rem;
  margin: 0;
  opacity: 0.65;
}

/* Buttons */
.t20-lb-close,
.t20-lb-prev,
.t20-lb-next {
  position: fixed;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 10px 16px;
  transition: background 0.2s ease;
  border-radius: 3px;
}

.t20-lb-close:hover,
.t20-lb-prev:hover,
.t20-lb-next:hover {
  background: rgba(255,255,255,0.22);
}

.t20-lb-close { top: 16px; right: 16px; font-size: 1.8rem; }
.t20-lb-prev  { left: 16px; top: 50%; transform: translateY(-50%); font-size: 2rem; }
.t20-lb-next  { right: 16px; top: 50%; transform: translateY(-50%); font-size: 2rem; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .t20-gallery-grid { --t20-cols: 2 !important; }
}
@media (max-width: 600px) {
  .t20-gallery-grid { --t20-cols: 1 !important; }
  .t20-lb-prev { left: 6px; }
  .t20-lb-next { right: 6px; }
}
