/* ==========================================================================
   LUMINA STUDIO — Atelier Google Drive Masterpiece Gallery
   Scrapbook Botanical Luxury Archive & Live Cloud Vault Synchronization
   ========================================================================== */

.gallery-page-body {
  min-height: 100vh;
  min-height: 100dvh;
}

.gallery-viewport {
  max-width: 1720px;
}

/* --------------------------------------------------------------------------
   1. NAVIGATION BAR (Gallery Variant)
   -------------------------------------------------------------------------- */
.gallery-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px clamp(16px, 3vw, 36px);
}

.nav-left-action {
  display: flex;
  align-items: center;
}

.nav-back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--color-ink-primary);
  transition: transform 0.25s ease, color 0.25s ease;
}

.nav-back-home:hover {
  transform: translateX(-3px);
  color: var(--color-gold);
}

.back-glyph {
  font-size: 20px;
  line-height: 1;
}

.gallery-nav-links {
  margin: 0;
}

.nav-drive-badge-wrap {
  display: flex;
  align-items: center;
}

.atelier-reserve-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--color-gold);
  padding: 6px 16px;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7d4d23;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(185, 145, 90, 0.2);
  transition: all 0.25s ease;
}

.atelier-reserve-pill:hover {
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(185, 145, 90, 0.35);
  transform: translateY(-1px);
}

.nav-seal-icon {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   2. GALLERY HEADER & LIVE VAULT SYNC BAR
   -------------------------------------------------------------------------- */
.gallery-editorial-header {
  text-align: center;
  max-width: 980px;
  margin: clamp(24px, 3vw, 42px) auto clamp(32px, 4vw, 54px) auto;
  padding: 0 16px;
  position: relative;
  z-index: 10;
}

.gallery-script-title {
  font-family: var(--font-script);
  font-size: clamp(52px, 6.5vw, 92px);
  color: var(--color-ink-primary);
  line-height: 1.08;
  margin-bottom: 14px;
  text-shadow: 0 2px 14px rgba(220, 190, 140, 0.35);
}

.gallery-editorial-desc {
  font-family: var(--font-editorial);
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.6;
  color: var(--color-ink-secondary);
  font-style: italic;
  max-width: 760px;
  margin: 0 auto 26px auto;
}

/* Vault Sync Bar */
.vault-sync-bar {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #fcf8f2;
  border: 1px solid rgba(195, 165, 125, 0.45);
  border-radius: 9999px;
  padding: 8px 22px;
  box-shadow: 0 4px 16px rgba(70, 50, 30, 0.06);
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.vault-status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--color-ink-secondary);
  font-weight: 500;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38a169;
  box-shadow: 0 0 0 0 rgba(56, 161, 105, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 161, 105, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(56, 161, 105, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 161, 105, 0); }
}

.vault-metrics-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vault-count-pill {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  background: rgba(235, 218, 195, 0.6);
  border: 1px solid rgba(190, 160, 130, 0.4);
  padding: 3px 10px;
  border-radius: 9999px;
  color: #7d4d23;
  font-weight: 600;
}

.vault-sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--color-ink-secondary);
  cursor: pointer;
  padding: 2px 6px;
  transition: color 0.25s ease;
}

.vault-sync-btn:hover {
  color: var(--color-gold);
}

.vault-sync-btn.rotating .sync-icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   3. GALLERY SEARCH & FILTER CONTROLS
   -------------------------------------------------------------------------- */
.gallery-controls-card {
  background: #faf4eb;
  border: 1px solid rgba(185, 155, 120, 0.35);
  border-radius: 12px;
  padding: clamp(16px, 2.5vw, 26px);
  box-shadow: var(--shadow-paper);
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.scrapbook-search-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.search-quill-icon {
  position: absolute;
  left: 18px;
  font-size: 18px;
  color: var(--color-gold);
  pointer-events: none;
}

.scrapbook-search-input {
  width: 100%;
  padding: 14px 44px 14px 48px;
  background: #ffffff;
  border: 1px solid rgba(190, 160, 130, 0.4);
  border-radius: 9999px;
  font-family: var(--font-editorial);
  font-size: 18px;
  color: var(--color-ink-primary);
  outline: none;
  box-shadow: inset 0 2px 4px rgba(60, 45, 30, 0.04);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.scrapbook-search-input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(201, 163, 104, 0.22);
}

.scrapbook-search-input::placeholder {
  color: #9c8976;
  font-style: italic;
}

.clear-search-btn {
  position: absolute;
  right: 18px;
  background: none;
  border: none;
  color: var(--color-ink-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.clear-search-btn:hover {
  color: var(--color-ink-primary);
}

/* Media Type Filter Ribbons (Images & Videos Only) */
.gallery-filter-ribbons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: center;
}

.archive-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(245, 235, 222, 0.65);
  border: 1px solid rgba(190, 160, 130, 0.4);
  border-radius: 9999px;
  padding: 8px 24px;
  font-family: var(--font-editorial);
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--color-ink-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
}

.archive-pill:hover {
  background: #ffffff;
  border-color: var(--color-gold);
  color: var(--color-ink-primary);
  transform: translateY(-1px);
}

.archive-pill.active {
  background: #ffffff;
  border-color: var(--color-gold);
  color: var(--color-ink-primary);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(185, 145, 90, 0.22);
  transform: translateY(-2px);
}

.pill-counter {
  font-family: var(--font-sans);
  font-size: 10.5px;
  background: rgba(230, 215, 195, 0.55);
  border-radius: 9999px;
  padding: 1px 7px;
  color: var(--color-ink-muted);
}

.archive-pill.active .pill-counter {
  background: rgba(240, 220, 180, 0.7);
  color: #7b4e24;
}

/* --------------------------------------------------------------------------
   4. DYNAMIC SCRAPBOOK MASONRY / GRID
   -------------------------------------------------------------------------- */
.gallery-scrapbook-stage {
  width: 100%;
  position: relative;
  min-height: 400px;
  margin-bottom: 60px;
  z-index: 10;
}

/* Loading Placeholder */
.gallery-loading-card {
  text-align: center;
  padding: 80px 20px;
  background: #faf4eb;
  border: 1px dashed rgba(190, 160, 130, 0.4);
  border-radius: 12px;
  max-width: 600px;
  margin: 40px auto;
}

.loading-seal-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px auto;
}

.loading-seal-spin {
  width: 100%;
  height: 100%;
  animation: spin 3s linear infinite;
  filter: drop-shadow(0 4px 12px rgba(80, 45, 20, 0.25));
}

.loading-title {
  font-family: var(--font-editorial);
  font-size: 26px;
  color: var(--color-ink-primary);
  margin-bottom: 8px;
}

.loading-sub {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--color-ink-muted);
  letter-spacing: 0.05em;
}

/* Empty State */
.gallery-empty-card {
  text-align: center;
  padding: 80px 20px;
  background: #faf4eb;
  border: 1px solid rgba(190, 160, 130, 0.35);
  border-radius: 12px;
  max-width: 640px;
  margin: 40px auto;
}

.empty-quill {
  font-size: 42px;
  display: block;
  margin-bottom: 12px;
}

.empty-title {
  font-family: var(--font-editorial);
  font-size: 28px;
  color: var(--color-ink-primary);
  margin-bottom: 10px;
}

.empty-sub {
  font-family: var(--font-editorial);
  font-size: 17px;
  color: var(--color-ink-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* True Scrapbook Masonry Column Container */
.drive-scrapbook-grid {
  display: flex;
  gap: clamp(14px, 2.2vw, 28px);
  width: 100%;
  align-items: flex-start;
  justify-content: center;
}

.gallery-masonry-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2.6vw, 32px);
}

/* Scrapbook Media Card */
.drive-media-card {
  position: relative;
  width: 100%;
  background: #faf5ee;
  border: 1px solid rgba(190, 160, 130, 0.32);
  border-radius: 6px;
  padding: 12px 12px 10px 12px;
  box-shadow: var(--shadow-paper);
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
  cursor: pointer;
  content-visibility: auto;
  contain-intrinsic-size: 320px 480px;
  touch-action: manipulation;
}

/* Scroll Sentinel for On-Demand Streaming */
.gallery-scroll-sentinel {
  width: 100%;
  height: 24px;
  margin: 12px 0;
  pointer-events: none;
  visibility: hidden;
}

/* End of Archive Seal */
.gallery-end-seal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 16px 20px 16px;
  color: var(--color-ink-muted);
  font-family: var(--font-editorial);
  font-size: 16px;
  font-style: italic;
  text-align: center;
}

.end-seal-glyph {
  color: var(--color-gold);
  font-size: 14px;
}

/* Organic Rotation Angles */
.drive-media-card.tilt-left {
  transform: rotate(-1.3deg);
}

.drive-media-card.tilt-right {
  transform: rotate(1.4deg);
}

.drive-media-card.tilt-left-sm {
  transform: rotate(-0.8deg);
}

.drive-media-card.tilt-right-sm {
  transform: rotate(1.0deg);
}

.drive-media-card:hover {
  transform: translateY(-8px) rotate(0deg) scale(1.02);
  box-shadow: var(--shadow-card-hover);
  z-index: 5;
}

/* Media Frame (Image & Video) - Dynamic Native Aspect Ratio */
.media-photo-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid rgba(160, 130, 100, 0.25);
  background: #eee4d8;
  margin-bottom: 14px;
  display: block;
  line-height: 0;
}

/* When aspect-ratio style is provided, preserve exact bounds */
.media-photo-frame[style*="aspect-ratio"] .media-thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* When aspect-ratio style is not yet provided, let image natural height flow */
.media-photo-frame:not([style*="aspect-ratio"]) .media-thumbnail-img {
  width: 100%;
  height: auto;
  display: block;
}

.media-thumbnail-img {
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  display: block;
}

.drive-media-card:hover .media-thumbnail-img {
  transform: scale(1.04);
}

/* Video Badge */
.video-motion-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(20, 15, 10, 0.75);
  backdrop-filter: blur(6px);
  color: #f7e6c4;
  padding: 4px 10px;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(220, 185, 120, 0.4);
  z-index: 4;
}

.video-play-glyph {
  font-size: 10px;
}

/* Resolution Tag */
.media-res-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(253, 248, 240, 0.9);
  backdrop-filter: blur(4px);
  color: var(--color-ink-primary);
  padding: 3px 9px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(190, 160, 130, 0.4);
  z-index: 4;
}

/* Card Body & Minimal 1-Line Label (Boutique Gallery Aesthetic) */
.media-card-body {
  margin-top: 10px;
  width: 100%;
}

.media-single-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 2px 2px 0 2px;
}

.media-single-title {
  font-family: var(--font-editorial);
  font-size: 16.5px;
  font-weight: 500;
  color: var(--color-ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  letter-spacing: 0.015em;
  transition: color 0.25s ease;
}

.media-single-arrow {
  font-size: 14px;
  color: var(--color-gold);
  flex-shrink: 0;
  line-height: 1;
  transition: transform 0.25s ease, color 0.25s ease;
}

.drive-media-card:hover .media-single-arrow {
  transform: translateX(3px);
  color: var(--color-ink-primary);
}

.drive-media-card:hover .media-single-title {
  color: var(--color-gold);
}

/* Card Corner Wax Seal */
.card-corner-seal {
  position: absolute;
  bottom: 4px;
  right: -6px;
  width: 30px;
  height: 30px;
  pointer-events: none;
  z-index: 6;
  filter: drop-shadow(0 3px 6px rgba(70, 40, 20, 0.28));
}

/* --------------------------------------------------------------------------
   5. BOTTOM ARCHIVE CALL TO ACTION
   -------------------------------------------------------------------------- */
.gallery-bottom-cta {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto clamp(60px, 8vw, 100px) auto;
  position: relative;
  z-index: 10;
}

.bottom-cta-inner {
  background: #faf4ea;
  border: 1px solid rgba(185, 155, 120, 0.38);
  border-radius: 12px;
  padding: clamp(32px, 5vw, 60px) clamp(20px, 4vw, 48px);
  box-shadow: 0 20px 50px rgba(60, 45, 30, 0.1);
  text-align: center;
  position: relative;
}

.bottom-cta-botanical {
  position: absolute;
  top: -30px;
  right: -18px;
  width: 90px;
  pointer-events: none;
  transform: rotate(20deg);
  filter: drop-shadow(0 6px 12px rgba(60, 45, 30, 0.15));
}

.bottom-subtag {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}

.bottom-script-title {
  font-family: var(--font-script);
  font-size: clamp(40px, 4.5vw, 64px);
  color: var(--color-ink-primary);
  line-height: 1.12;
  margin-bottom: 14px;
}

.bottom-desc {
  font-family: var(--font-editorial);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.6;
  color: var(--color-ink-secondary);
  max-width: 680px;
  margin: 0 auto 28px auto;
}

.bottom-btn-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   6. HIGH-DEFINITION SCRAPBOOK LIGHTBOX MODAL
   -------------------------------------------------------------------------- */
.gallery-lightbox-overlay {
  padding: clamp(12px, 3vw, 36px);
}

.lightbox-frame {
  width: 100%;
  max-width: 1300px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  background: #fbf7f0;
  border: 1px solid rgba(190, 160, 130, 0.4);
  border-radius: 12px;
  box-shadow: 0 28px 70px rgba(30, 20, 10, 0.35);
  overflow: hidden;
  padding: 0;
}

/* Lightbox Top Toolbar */
.lightbox-top-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: #f5eedf;
  border-bottom: 1px solid rgba(190, 160, 130, 0.35);
  z-index: 20;
}

.lightbox-counter-badge {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink-secondary);
  letter-spacing: 0.08em;
  background: rgba(230, 215, 195, 0.6);
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(180, 150, 120, 0.3);
}

.lightbox-tool-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lightbox-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border: 1px solid rgba(190, 160, 130, 0.45);
  border-radius: 9999px;
  padding: 5px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--color-ink-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.lightbox-tool-btn:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
  box-shadow: 0 2px 8px rgba(185, 145, 90, 0.22);
  transform: translateY(-1px);
}

.lightbox-tool-actions .modal-close-btn {
  position: static;
  width: 32px;
  height: 32px;
  font-size: 15px;
}

/* Floating Back to Top Button */
.floating-scroll-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 235, 220, 0.85);
  border: 1px solid rgba(190, 160, 130, 0.45);
  border-radius: 9999px;
  padding: 5px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-ink-primary);
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  touch-action: manipulation;
}

.floating-scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.floating-scroll-top-btn:hover {
  background: #ffffff;
  border-color: var(--color-gold);
  color: var(--color-gold);
  box-shadow: 0 2px 8px rgba(185, 145, 90, 0.25);
  transform: translateY(-1px);
}

.floating-scroll-top-btn .arrow-glyph {
  font-size: 13px;
  font-weight: bold;
}

/* Lumina Atelier Notification Toast */
.lumina-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #2b221a;
  color: #f7eedb;
  border: 1px solid var(--color-gold);
  border-radius: 9999px;
  padding: 10px 22px;
  font-family: var(--font-editorial);
  font-size: 16px;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 30px rgba(40, 25, 10, 0.4);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lumina-toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.lightbox-stage-container {
  position: relative;
  width: 100%;
  background: #18130e;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  max-height: 70vh;
  overflow: hidden;
}

.lightbox-image-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox-main-img {
  max-width: 100%;
  max-height: 66vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease;
}

.lightbox-video-wrap {
  width: 100%;
  height: 66vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-video-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Chevrons */
.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 10;
}

.lightbox-nav-btn:hover {
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-ink-primary);
  transform: translateY(-50%) scale(1.08);
}

.lightbox-nav-btn.nav-prev {
  left: 20px;
}

.lightbox-nav-btn.nav-next {
  right: 20px;
}

/* Lightbox Details Footer */
.lightbox-details-footer {
  padding: 22px 28px;
  background: #faf4eb;
  border-top: 1px solid rgba(190, 160, 130, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.lightbox-meta-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lightbox-subtag {
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-gold);
  font-weight: 600;
}

.lightbox-script-title {
  font-family: var(--font-editorial);
  font-size: 24px;
  font-weight: 600;
  color: var(--color-ink-primary);
}

.lightbox-meta-specs {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--color-ink-muted);
}

.lightbox-action-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   7. RESPONSIVE DESIGN FOR GALLERY
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .drive-scrapbook-grid {
    gap: 16px;
  }

  .gallery-masonry-col {
    gap: 20px;
  }

  .gallery-nav-links {
    display: none;
  }
}

@media (max-width: 768px) {
  .gallery-editorial-header {
    margin-top: 18px;
    margin-bottom: 24px;
    padding: 0 10px;
  }

  .gallery-script-title {
    font-size: clamp(40px, 10vw, 56px);
  }

  .gallery-editorial-desc {
    font-size: 16px;
    margin-bottom: 18px;
  }

  .vault-sync-bar {
    width: 100%;
    border-radius: 12px;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 14px;
    gap: 10px;
    margin-bottom: 20px;
  }

  .vault-metrics-row {
    width: 100%;
    justify-content: space-between;
  }

  .scrapbook-search-input {
    font-size: 16px; /* Prevents auto-zoom on iOS Safari */
    padding: 12px 42px 12px 42px;
  }

  .clear-search-btn {
    width: 44px;
    height: 44px;
    right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Centered Dual Filter Bar (Images & Videos) */
  .gallery-filter-ribbons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 4px 0 8px 0;
    gap: 12px;
    width: 100%;
  }

  .archive-pill {
    flex: 1 1 130px;
    max-width: 170px;
    justify-content: center;
    white-space: nowrap;
    padding: 10px 18px;
    font-size: 15px;
    min-height: 44px;
    border-radius: 9999px;
  }

  .drive-scrapbook-grid {
    gap: 12px;
    width: 100%;
  }

  .gallery-masonry-col {
    gap: 14px;
  }

  .drive-media-card {
    padding: 10px 10px 8px 10px;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(60, 45, 30, 0.06);
    touch-action: manipulation;
  }

  .drive-media-card:hover {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(60, 45, 30, 0.08);
  }

  .drive-media-card:hover .media-thumbnail-img {
    transform: none !important;
  }

  .archive-pill,
  .lumina-btn,
  .lightbox-nav-btn,
  .modal-close-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .media-card-body {
    margin-top: 7px;
  }

  .media-single-title {
    font-size: 14.5px;
  }

  .media-single-arrow {
    font-size: 12.5px;
  }

  .card-corner-seal {
    width: 24px;
    height: 24px;
    bottom: 2px;
    right: -4px;
  }

  /* Lightbox Responsive Enhancements */
  .gallery-lightbox-overlay {
    padding: 8px;
  }

  .lightbox-frame {
    max-height: 94dvh;
    max-height: 94vh;
    border-radius: 8px;
  }

  .lightbox-stage-container {
    min-height: 240px;
    max-height: 56dvh;
    max-height: 56vh;
  }

  .lightbox-main-img {
    max-height: 52dvh;
    max-height: 52vh;
  }

  .lightbox-video-wrap {
    height: 54dvh;
  }

  .lightbox-details-footer {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .lightbox-script-title {
    font-size: 20px;
  }

  .lightbox-action-buttons {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .lightbox-action-buttons .lumina-btn {
    width: 100%;
    min-width: 0;
    padding: 10px 18px;
    font-size: 15px;
    text-align: center;
  }

  .lightbox-nav-btn {
    width: 46px;
    height: 46px;
    font-size: 28px;
    background: rgba(30, 24, 18, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
  }

  .lightbox-nav-btn.nav-prev {
    left: 8px;
  }

  .lightbox-nav-btn.nav-next {
    right: 8px;
  }

  .modal-close-btn {
    top: 10px;
    right: 12px;
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .gallery-script-title {
    font-size: 42px;
  }

  .gallery-editorial-desc {
    font-size: 15px;
  }

  .bottom-script-title {
    font-size: 38px;
  }

  .bottom-btn-row {
    flex-direction: column;
    width: 100%;
  }

  .bottom-btn-row .lumina-btn {
    width: 100%;
    text-align: center;
  }
}

