/*
 * Silver Star — gallery.css
 */

/* =========================================
   GALLERY PAGE
   ========================================= */

/* ---- Hero ---- */
.gallery-hero {
  background: #dddddd;
  padding-top: calc(var(--header-height-mobile) + var(--space-3xl));
  padding-bottom: var(--space-xl);
  text-align: center;
}

.gallery-hero__label {
  font-size: 0.6875rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  display: block;
  margin-bottom: var(--space-sm);
}

.gallery-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: var(--fw-bold);
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
  line-height: 1.15;
}

.gallery-hero__subtitle {
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 420px;
  margin-inline: auto;
  line-height: 1.7;
}

/* ---- Filter tabs ---- */
.gallery-filters {
  background: var(--color-white);
  padding-block: var(--space-xl);
}

.gallery-filters__list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  flex-wrap: wrap;
}

.gallery-filters__list::-webkit-scrollbar { display: none; }

.gallery-filter-btn {
  flex-shrink: 0;
  padding: 8px 22px;
  border-radius: var(--radius-full);
  border: 0.3px solid rgba(56,55,20,0.2);
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: var(--fw-semibold);
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-base),
              color var(--transition-base),
              border-color var(--transition-base);
}

.gallery-filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.gallery-filter-btn.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

/* ---- Coverflow Carousel ---- */
.gallery-stage {
  background: var(--color-white);
  padding-block: var(--space-xl) var(--space-3xl);
  overflow: hidden;
  position: relative;
}

.gallery-carousel {
  position: relative;
  width: 100%;
  height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-card {
  position: absolute;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1),
              opacity 0.5s ease,
              box-shadow 0.5s ease,
              width 0.5s ease,
              height 0.5s ease;
  will-change: transform, opacity;
  user-select: none;
}

/* Active (centre) card */
.gallery-card[data-pos="0"] {
  width: 420px;
  height: 440px;
  transform: translateX(0) scale(1);
  opacity: 1;
  z-index: 5;
  box-shadow: 0 24px 64px rgba(56,55,20,0.22);
}

/* ±1 cards */
.gallery-card[data-pos="1"] {
  width: 300px;
  height: 360px;
  transform: translateX(340px) scale(0.88);
  opacity: 0.7;
  z-index: 4;
}

.gallery-card[data-pos="-1"] {
  width: 300px;
  height: 360px;
  transform: translateX(-340px) scale(0.88);
  opacity: 0.7;
  z-index: 4;
}

/* ±2 cards */
.gallery-card[data-pos="2"] {
  width: 220px;
  height: 280px;
  transform: translateX(580px) scale(0.72);
  opacity: 0.35;
  z-index: 3;
}

.gallery-card[data-pos="-2"] {
  width: 220px;
  height: 280px;
  transform: translateX(-580px) scale(0.72);
  opacity: 0.35;
  z-index: 3;
}

/* Hidden cards */
.gallery-card[data-pos="3"],
.gallery-card[data-pos="-3"],
.gallery-card[data-pos="hidden"] {
  width: 180px;
  height: 220px;
  transform: translateX(760px) scale(0.5);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.gallery-card[data-pos="-3"] {
  transform: translateX(-760px) scale(0.5);
}

.gallery-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
  pointer-events: none;
}

.gallery-card[data-pos="0"]:hover .gallery-card__img {
  transform: scale(1.04);
}

/* Name label — bottom gradient overlay */
.gallery-card__name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 18px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.68), transparent);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.01em;
  pointer-events: none;
}

/* Play badge on video items */
.gallery-card__play {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.gallery-card__play svg {
  width: 16px;
  height: 16px;
  fill: var(--color-primary);
  margin-left: 2px;
}

/* ---- Navigation arrows ---- */
.gallery-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding-top: var(--space-xl);
  background: var(--color-white);
  padding-bottom: var(--space-3xl);
}

.gallery-nav__btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0.3px solid rgba(56,55,20,0.2);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-primary);
  transition: background var(--transition-base),
              border-color var(--transition-base),
              color var(--transition-base),
              transform var(--transition-fast);
}

.gallery-nav__btn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.gallery-nav__btn:active { transform: scale(0.94); }

.gallery-nav__btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ---- Dot indicators ---- */
.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-bottom: var(--space-2xl);
  background: var(--color-white);
}

.gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(56,55,20,0.15);
  cursor: pointer;
  transition: background var(--transition-base),
              width var(--transition-base),
              border-radius var(--transition-base);
}

.gallery-dot.is-active {
  width: 24px;
  border-radius: 4px;
  background: var(--color-accent);
}

/* ---- Lightbox ---- */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.gallery-lightbox__img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}

.gallery-lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 0.3px solid rgba(255,255,255,0.2);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.gallery-lightbox__close:hover { background: rgba(255,255,255,0.22); }
.gallery-lightbox__close svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ========================================
   RESPONSIVE
   ======================================== */

/* Default (< 375px): very small phones */
.gallery-carousel { height: 300px; }

.gallery-card[data-pos="0"]  { width: 240px; height: 260px; }
.gallery-card[data-pos="1"]  { width: 170px; height: 200px; transform: translateX(190px) scale(0.82); }
.gallery-card[data-pos="-1"] { width: 170px; height: 200px; transform: translateX(-190px) scale(0.82); }
.gallery-card[data-pos="2"],
.gallery-card[data-pos="-2"],
.gallery-card[data-pos="3"],
.gallery-card[data-pos="-3"] { opacity: 0; pointer-events: none; }

/* 375px – small mobile */
@media (min-width: 375px) {
  .gallery-carousel { height: 340px; }

  .gallery-card[data-pos="0"]  { width: 280px; height: 300px; }
  .gallery-card[data-pos="1"]  { width: 200px; height: 240px; transform: translateX(220px) scale(0.85); }
  .gallery-card[data-pos="-1"] { width: 200px; height: 240px; transform: translateX(-220px) scale(0.85); }
}

/* 641px – between mobile and tablet */
@media (min-width: 641px) {
  .gallery-carousel { height: 400px; }

  .gallery-card[data-pos="0"]  { width: 340px; height: 360px; }
  .gallery-card[data-pos="1"]  { width: 240px; height: 290px; transform: translateX(270px) scale(0.87); opacity: 0.7; }
  .gallery-card[data-pos="-1"] { width: 240px; height: 290px; transform: translateX(-270px) scale(0.87); opacity: 0.7; }
  .gallery-card[data-pos="2"]  { width: 180px; height: 220px; transform: translateX(480px) scale(0.68); opacity: 0.3; pointer-events: none; }
  .gallery-card[data-pos="-2"] { width: 180px; height: 220px; transform: translateX(-480px) scale(0.68); opacity: 0.3; pointer-events: none; }
}

/* 768px – iPad Mini */
@media (min-width: 768px) {
  .gallery-hero { padding-top: calc(var(--header-height) + var(--space-3xl)); }

  .gallery-carousel { height: 440px; }

  .gallery-card[data-pos="0"]  { width: 380px; height: 400px; }
  .gallery-card[data-pos="1"]  { width: 270px; height: 320px; transform: translateX(300px) scale(0.88); opacity: 0.7; }
  .gallery-card[data-pos="-1"] { width: 270px; height: 320px; transform: translateX(-300px) scale(0.88); opacity: 0.7; }
  .gallery-card[data-pos="2"]  { width: 200px; height: 250px; transform: translateX(520px) scale(0.7); opacity: 0.35; pointer-events: none; }
  .gallery-card[data-pos="-2"] { width: 200px; height: 250px; transform: translateX(-520px) scale(0.7); opacity: 0.35; pointer-events: none; }
}

/* 853px – ZenBook Fold */
@media (min-width: 853px) {
  .gallery-carousel { height: 460px; }

  .gallery-card[data-pos="0"]  { width: 400px; height: 420px; }
  .gallery-card[data-pos="1"]  { width: 285px; height: 340px; transform: translateX(318px) scale(0.88); }
  .gallery-card[data-pos="-1"] { width: 285px; height: 340px; transform: translateX(-318px) scale(0.88); }
  .gallery-card[data-pos="2"]  { width: 210px; height: 265px; transform: translateX(545px) scale(0.71); }
  .gallery-card[data-pos="-2"] { width: 210px; height: 265px; transform: translateX(-545px) scale(0.71); }
}

/* 1024px – iPad Pro / desktop (original default) */
@media (min-width: 1024px) {
  .gallery-carousel { height: 480px; }

  .gallery-card[data-pos="0"]  { width: 420px; height: 440px; }
  .gallery-card[data-pos="1"]  { width: 300px; height: 360px; transform: translateX(340px) scale(0.88); opacity: 0.7; }
  .gallery-card[data-pos="-1"] { width: 300px; height: 360px; transform: translateX(-340px) scale(0.88); opacity: 0.7; }
  .gallery-card[data-pos="2"]  { width: 220px; height: 280px; transform: translateX(580px) scale(0.72); opacity: 0.35; pointer-events: none; }
  .gallery-card[data-pos="-2"] { width: 220px; height: 280px; transform: translateX(-580px) scale(0.72); opacity: 0.35; pointer-events: none; }
  .gallery-card[data-pos="3"],
  .gallery-card[data-pos="-3"],
  .gallery-card[data-pos="hidden"] { opacity: 0; pointer-events: none; }
  .gallery-card[data-pos="-3"] { transform: translateX(-760px) scale(0.5); }
}

/* 1280px – Desktop */
@media (min-width: 1280px) {
  .gallery-carousel { height: 520px; }

  .gallery-card[data-pos="0"]  { width: 460px; height: 480px; }
  .gallery-card[data-pos="1"]  { width: 325px; height: 390px; transform: translateX(370px) scale(0.88); }
  .gallery-card[data-pos="-1"] { width: 325px; height: 390px; transform: translateX(-370px) scale(0.88); }
  .gallery-card[data-pos="2"]  { width: 240px; height: 300px; transform: translateX(625px) scale(0.72); }
  .gallery-card[data-pos="-2"] { width: 240px; height: 300px; transform: translateX(-625px) scale(0.72); }
}

/* 1440px – Wide */
@media (min-width: 1440px) {
  .gallery-carousel { height: 560px; }

  .gallery-card[data-pos="0"]  { width: 500px; height: 520px; }
  .gallery-card[data-pos="1"]  { width: 355px; height: 425px; transform: translateX(400px) scale(0.88); }
  .gallery-card[data-pos="-1"] { width: 355px; height: 425px; transform: translateX(-400px) scale(0.88); }
  .gallery-card[data-pos="2"]  { width: 260px; height: 325px; transform: translateX(670px) scale(0.72); }
  .gallery-card[data-pos="-2"] { width: 260px; height: 325px; transform: translateX(-670px) scale(0.72); }
}

/* Nest Hub */
@media (min-width: 1024px) and (max-height: 650px) {
  .gallery-carousel { height: 360px; }

  .gallery-card[data-pos="0"]  { width: 320px; height: 340px; }
  .gallery-card[data-pos="1"]  { width: 230px; height: 270px; transform: translateX(260px) scale(0.87); }
  .gallery-card[data-pos="-1"] { width: 230px; height: 270px; transform: translateX(-260px) scale(0.87); }
}

/* Phone landscape */
@media (orientation: landscape) and (max-height: 500px) {
  .gallery-hero {
    padding-top: calc(var(--header-height-mobile) + var(--space-xl));
    padding-bottom: var(--space-md);
  }

  .gallery-stage { padding-block: var(--space-md) var(--space-xl); }

  .gallery-carousel { height: 260px; }

  .gallery-card[data-pos="0"]  { width: 220px; height: 240px; }
  .gallery-card[data-pos="1"]  { width: 160px; height: 185px; transform: translateX(185px) scale(0.85); opacity: 0.7; }
  .gallery-card[data-pos="-1"] { width: 160px; height: 185px; transform: translateX(-185px) scale(0.85); opacity: 0.7; }
  .gallery-card[data-pos="2"],
  .gallery-card[data-pos="-2"] { opacity: 0; pointer-events: none; }

  .gallery-nav { padding-top: var(--space-md); padding-bottom: var(--space-xl); }
  .gallery-dots { padding-bottom: var(--space-lg); }
}
