/* gallery.css — public gallery pages
   Uses the same CSS variables as the rest of the site. */

/* ══════════════════════════════════════════════════
   GALLERY INDEX  /gallery
══════════════════════════════════════════════════ */

.gallery-index {
  padding: 96px 40px 80px;
  max-width: 1280px;
  margin: 0 auto;
}

.gallery-index__heading {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
  color: var(--text);
}

.gallery-index__sub {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-muted);
  margin: 0 0 3rem;
}

.gallery-index__empty {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 300;
}

/* ── Project tiles grid ──────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.gallery-tile {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
  display: block;
  aspect-ratio: 16 / 10;
}

.gallery-tile:hover {
  border-color: var(--nav-accent);
  transform: translateY(-3px);
}

.gallery-tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-tile:hover .gallery-tile__img {
  transform: scale(1.04);
}

.gallery-tile__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.1) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  opacity: 0;
  transition: opacity 0.25s;
}

.gallery-tile:hover .gallery-tile__overlay {
  opacity: 1;
}

.gallery-tile__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 4px;
}

.gallery-tile__count {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  font-weight: 300;
}

.gallery-tile__badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  color: rgba(255,255,255,0.75);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
}

/* ══════════════════════════════════════════════════
   GALLERY PROJECT  /gallery/{id}
══════════════════════════════════════════════════ */

.gallery-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top nav strip (replaces main navbar on this page) ───── */
.gallery-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 56px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.gallery-nav__back,
.gallery-nav__examples {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

.gallery-nav__back:hover,
.gallery-nav__examples:hover {
  color: var(--text);
}

/* .gallery-nav__title { */
/*   font-size: 0.9rem; */
/*   font-weight: 500; */
/*   color: var(--text); */
/*   letter-spacing: -0.01em; */
/* } */

.gallery-nav__links {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ── Parallax hero band ──────────────────────────── */
.gallery-hero {
  height: 190px;
  position: relative;
  overflow: hidden;
  margin-top: 56px; /* height of gallery-nav only — main navbar is suppressed */
}

.gallery-hero__bg {
  position: absolute;
  inset: -30px;
  background-size: cover;
  background-position: center;
  filter: blur(3px) brightness(0.35);
  transform: translateY(0);
  will-change: transform;
}

.gallery-hero__content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}

.gallery-hero__title {
  font-size: clamp(1.1rem, 4vw, 2.1rem);
  font-weight: 600;
  /* letter-spacing: -0.02em; */
  color: #fff;
  /* margin: 0 0 6px; */
}

.gallery-hero__desc {
  font-size: 0.95rem;
  font-weight: 300;
  color: rgba(255,255,255,0.55);
  max-width: 520px;
  line-height: 1.6;
  margin: 0;
}

/* ── 3D Circular Carousel ────────────────────────── */
.carousel-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 92px 24px 72px;
  min-height: 560px;
  perspective: 1400px;
  user-select: none;
  overflow: hidden; /* prevents side-cards from creating horizontal scroll */
  position: relative;
}

.carousel-hint {
  position: absolute;
  top: 48px;
  left: 24px;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
  display: flex;
  align-items: center;
  gap: 6px;
}

.carousel-hint svg {
  opacity: 0.7;
}

.carousel-stage {
  position: relative;
  width: min(544px, 88vw);
  height: min(352px, 57vw);   /* keeps 544:352 ≈ 16:10.4 ratio */
  transform-style: preserve-3d;
  cursor: grab;
  outline: none;
}

.carousel-stage:active {
  cursor: grabbing;
}

.carousel-item {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 24px 80px rgba(0,0,0,0.55);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: box-shadow 0.3s;
  background: rgba(0,0,0,0.90);
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.carousel-item.is-front {
  box-shadow: 0 32px 100px rgba(0,0,0,0.85), 0 0 0 1px rgba(255,255,255,0.2);
}

/* ── Caption strip ───────────────────────────────── */
.carousel-caption {
  margin-top: 28px;
  min-height: 28px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  transition: opacity 0.3s;
}

/* ── Dot nav ─────────────────────────────────────── */
.carousel-dots {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.3;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  border: none;
  padding: 0;
}

.carousel-dot.is-active {
  opacity: 1;
  transform: scale(1.4);
  background: var(--nav-accent);
}

/* ── Arrow controls ──────────────────────────────── */
.carousel-arrows {
  display: flex;
  gap: 14px;
  margin-top: 24px;
}

.carousel-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.carousel-arrow:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text);
  border-color: rgba(255,255,255,0.25);
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 700px) {
  .gallery-index {
    padding: 80px 16px 60px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .gallery-nav {
    padding: 0 16px;
  }

  .gallery-hero {
    height: 180px;
  }

  .carousel-section {
    padding: 32px 0 48px;
    min-height: unset;
  }
}
