/* ═══════════════════════════════════════════
   gallery.css — Immersive Timeline Gallery
   3D cards, scroll reveals, polaroid frames
   ═══════════════════════════════════════════ */

/* ── Gallery Header ── */
.gallery-header {
  text-align: center; padding: 32px 0 20px;
}
.gallery-header h1 { font-size: 28px; margin-bottom: 4px; }
.gallery-header .gallery-sub {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
}

/* ── Gallery Song Bar ── */
.gallery-song-bar {
  margin-bottom: 24px;
}
.gallery-song-inner {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(255,107,138,0.1), rgba(255,77,109,0.05));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
}
.gallery-song-vinyl {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #2d1b32, #4a1942);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.gallery-song-vinyl.spinning { animation: vinylSpin 2s linear infinite; }
.gallery-song-info {
  display: flex; flex-direction: column; flex: 1;
}

/* ── Day Tabs ── */
.gallery-day-tabs {
  display: flex; border-radius: var(--radius-btn);
  background: rgba(255,255,255,0.5); border: 1px solid var(--border-subtle);
  overflow: hidden; margin-bottom: 16px;
}
.gallery-day-tab {
  flex: 1; padding: 10px; text-align: center; border: none; background: none;
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  transition: all 0.2s ease;
}
.gallery-day-tab.active {
  background: var(--accent-gradient); color: #fff;
}

/* ── Filter Chips ── */
.filter-chips {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px;
  padding: 0 4px;
}
.filter-chip {
  padding: 7px 16px; border-radius: var(--radius-btn);
  background: rgba(255,255,255,0.5); border: 1px solid var(--border-subtle);
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.filter-chip.active {
  background: var(--accent-soft); color: #fff; border-color: var(--pink-500);
}

/* ── Timeline ── */
.timeline {
  position: relative;
  padding: 20px 0 40px;
}
.timeline-line {
  position: absolute; left: 50%; top: 0; bottom: 0;
  width: 3px; transform: translateX(-50%);
  background: linear-gradient(180deg, var(--pink-400), var(--rose-light), var(--pink-500));
  border-radius: 2px;
  transform-origin: top center;
}

/* ── Timeline Node ── */
.timeline-node {
  position: relative;
  display: flex; align-items: flex-start;
  margin-bottom: 40px;
  perspective: 1000px;
}
.timeline-left { justify-content: flex-start; padding-right: 55%; }
.timeline-right { justify-content: flex-end; padding-left: 55%; }

/* ── Timeline Dot ── */
.timeline-dot {
  position: absolute; left: 50%; top: 20px;
  transform: translateX(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--pink-400);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; z-index: 2;
  box-shadow: 0 4px 16px rgba(255,107,138,0.2);
}

/* ── Timeline Card ── */
.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--glow-card);
  width: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  transform-style: preserve-3d;
}
.timeline-card:hover {
  box-shadow: 0 12px 40px rgba(255,107,138,0.15);
}
.timeline-card-header { margin-bottom: 14px; }
.timeline-badge {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--pink-500); letter-spacing: 0.06em;
  display: block; margin-bottom: 4px;
}
.timeline-card-title {
  font-size: 17px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 4px;
}
.timeline-card-time {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-dim);
}

/* ── Timeline Polaroid Grid ── */
.timeline-photo-grid {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 12px;
}
.timeline-polaroid {
  background: #fff;
  padding: 8px 8px 6px;
  border-radius: 3px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: rotate(var(--rot, -1deg));
  cursor: pointer; flex: 1; min-width: 100px;
  transition: transform 0.4s var(--ease), box-shadow 0.3s ease;
}
.timeline-polaroid:hover {
  transform: rotate(0deg) scale(1.05) translateY(-4px);
  box-shadow: 0 12px 32px rgba(255,107,138,0.2);
}
.timeline-polaroid-img {
  overflow: hidden; border-radius: 2px;
  background: var(--bg-surface);
}
.timeline-polaroid-img img {
  width: 100%; display: block;
  aspect-ratio: 1; object-fit: cover;
  transition: transform 0.4s ease;
}
.timeline-polaroid:hover .timeline-polaroid-img img {
  transform: scale(1.08);
}
.timeline-polaroid-caption {
  text-align: center; padding: 6px 2px 2px;
}
.timeline-polaroid-caption .text-cursive {
  font-size: 1rem; color: #5a1832;
}

/* ── Timeline Video ── */
.timeline-video {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  margin-bottom: 12px; cursor: pointer;
  aspect-ratio: 16/9; background: rgba(255,107,138,0.04);
}
.timeline-video video { width: 100%; height: 100%; object-fit: cover; }
.timeline-video-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.15);
  transition: background 0.2s ease;
}
.timeline-video-play:hover { background: rgba(0,0,0,0.25); }
.timeline-video-play span {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.9); color: var(--pink-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* ── Timeline Audio ── */
.timeline-audio {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 8px;
  background: rgba(255,255,255,0.5);
  border-radius: var(--radius-btn); border: 1px solid var(--border-subtle);
}
.timeline-audio-author {
  font-size: 12px; color: var(--text-dim); flex-shrink: 0;
}

/* ── Timeline Answers ── */
.timeline-answers { margin-top: 10px; }
.timeline-answer {
  padding: 10px 14px; margin-bottom: 8px;
  background: rgba(255,107,138,0.04);
  border-left: 3px solid var(--pink-400);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.timeline-answer-author {
  font-family: var(--font-mono); font-size: 11px; color: var(--pink-500);
  display: block; margin-bottom: 4px;
}
.timeline-answer-text {
  font-size: 14px; color: var(--text-body); line-height: 1.6;
  font-style: italic;
}
.slider-result {
  font-family: var(--font-display); font-size: 20px; font-weight: 700;
  color: var(--pink-600);
}

/* ── Popup Viewer ── */
.popup-viewer {
  display: flex; flex-direction: column; align-items: center;
  max-width: 90vw;
}
.popup-polaroid {
  background: #fff; padding: 14px 14px 10px;
  border-radius: 4px; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.popup-polaroid-img {
  overflow: hidden; border-radius: 2px;
}
.popup-polaroid-img img {
  width: 100%; max-height: 65vh;
  object-fit: contain; display: block;
}
.popup-polaroid-bottom {
  padding: 12px 4px 4px;
  display: flex; flex-direction: column; align-items: center;
}

/* ── Empty State ── */
.gallery-empty {
  text-align: center; padding: 60px 20px;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.gallery-empty h3 { font-size: 18px; margin-bottom: 8px; }
.gallery-empty p { font-size: 14px; color: var(--text-muted); }

/* ── Responsive: Mobile Timeline ── */
@media (max-width: 600px) {
  .timeline-line {
    left: 20px;
  }
  .timeline-node {
    padding-left: 52px !important;
    padding-right: 0 !important;
    justify-content: flex-start !important;
  }
  .timeline-dot {
    left: 20px;
    width: 32px; height: 32px; font-size: 14px;
  }
  .timeline-card { padding: 16px; }
  .timeline-card-title { font-size: 15px; }
  .timeline-polaroid { min-width: 80px; }
  .timeline-polaroid-caption .text-cursive { font-size: 0.85rem; }
  .popup-polaroid { max-width: 95vw; padding: 10px 10px 8px; }
}
