/* =============================================================================
   YURBI GALLERY STYLES
   Layout only — tokens in global.css
   ============================================================================= */


/* =============================================================================
   HERO
   ============================================================================= */
.gallery-hero {
  padding: calc(var(--header-h) + var(--s-16)) var(--s-6) var(--s-14);
  background: linear-gradient(180deg, var(--bg-blue) 0%, var(--bg) 100%);
  text-align: center;
}

.gallery-hero-inner {
  max-width: 700px;
  margin-inline: auto;
}

.gallery-hero .sh-label { justify-content: center; margin-bottom: var(--s-4); }

.gallery-hero h1 {
  font-size: var(--t-hero-page);
  font-weight: var(--w-xbold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--text);
  margin-bottom: var(--s-5);
}

.gallery-hero p {
  font-size: var(--t-lead);
  color: var(--text-sec);
  margin-bottom: var(--s-8);
  max-width: 560px;
  margin-inline: auto;
}

.gallery-hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .gallery-hero h1 { font-size: var(--t-4xl); }
}


/* =============================================================================
   GALLERY STAGE — two-column layout
   ============================================================================= */
.gallery-stage {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-sub);
  border-bottom: 1px solid var(--border-sub);
}

.gallery-stage-inner {
  max-width: 1400px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--s-3);
  padding: var(--s-3);
  align-items: start;
}


/* =============================================================================
   PICKER — left column (natural page flow, no independent scrollbar)
   ============================================================================= */
.gallery-picker {
  background: var(--bg);
  border: 1px solid var(--border-sub);
  border-radius: var(--r-xl);
  overflow: hidden;
}

/* Dashboard featured card */
.picker-dashboard-card {
  margin: var(--s-3);
  padding: var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-sub);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.picker-dashboard-card:hover    { border-color: var(--blue); background: var(--blue-soft); }
.picker-dashboard-card.is-selected { border-color: var(--blue); background: var(--blue-soft); }
.picker-dashboard-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.picker-dashboard-icon {
  width: 36px; height: 36px;
  background: var(--blue-soft2);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--blue);
}
.picker-dashboard-icon svg { width: 18px; height: 18px; }

.picker-dashboard-name {
  font-size: var(--t-sm);
  font-weight: var(--w-bold);
  color: var(--text);
  line-height: 1.3;
}
.picker-dashboard-sub {
  font-size: var(--t-sm);
  color: var(--text-muted);
  margin-top: 2px;
}

/* Category sections */
.viz-category { padding: var(--s-2) var(--s-3) var(--s-3); }

.viz-category-header {
  padding: var(--s-3) var(--s-1) var(--s-2);
}
.viz-category-header h3 {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-label);
  font-weight: var(--w-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-widest);
  color: var(--text-muted);
}
.viz-category-header h3 svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Viz card grid — 2 cols in picker */
.viz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-2);
}

.viz-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-2);
  background: var(--bg);
  border: 1.5px solid var(--border-sub);
  border-radius: var(--r-lg);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.viz-card:hover    { border-color: var(--blue); background: var(--blue-soft); }
.viz-card.is-selected { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(0,95,172,.1); }
.viz-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.viz-card-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--blue);
}
.viz-card-icon svg { width: 20px; height: 20px; }

.viz-card-name {
  font-size: var(--t-sm);
  font-weight: var(--w-bold);
  color: var(--text);
  line-height: 1.3;
}

.viz-card-tag {
  position: absolute;
  top: var(--s-1);
  right: var(--s-1);
  font-size: 9px;
  font-weight: var(--w-bold);
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--blue);
  background: var(--blue-soft);
  padding: 2px 6px;
  border-radius: var(--r-full);
  border: 1px solid var(--blue-soft2);
  white-space: nowrap;
}


/* =============================================================================
   PREVIEW PANEL — right column
   Sticky to viewport so the dashboard stays in view while user scrolls picker.
   Panel is viewport-height; embed fills remaining vertical space (flex: 1).
   ============================================================================= */
.gallery-panel {
  position: sticky;
  top: calc(var(--header-h) + var(--s-3));
  height: calc(100vh - var(--header-h) - var(--s-6));
  display: flex;
  flex-direction: column;
  padding: var(--s-3);
  gap: var(--s-3);
  background: var(--bg);
  border: 1px solid var(--border-sub);
  border-radius: var(--r-xl);
  transition: opacity .15s;
}
.gallery-panel.is-transitioning {
  opacity: .6;
}
.gallery-panel.is-transitioning .gallery-preview-title,
.gallery-panel.is-transitioning .gallery-preview-description {
  opacity: .3;
}

.gallery-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-6);
}

.gallery-preview-label {
  font-size: var(--t-label);
  font-weight: var(--w-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-widest);
  color: var(--blue);
  margin-bottom: var(--s-2);
}

.gallery-preview-title {
  font-size: var(--t-2xl);
  font-weight: var(--w-xbold);
  color: var(--text);
  line-height: var(--lh-snug);
  margin-bottom: var(--s-2);
}

.gallery-preview-description {
  font-size: var(--t-base);
  color: var(--text-sec);
  line-height: var(--lh-relaxed);
  max-width: 480px;
  margin: 0;
}

.gallery-panel-actions { flex-shrink: 0; }

/* Embed area — fills remaining panel height */
.gallery-panel-embed {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--bg);
  border: 1px solid var(--border-sub);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
}
.gallery-panel-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  transition: opacity .2s;
}
.gallery-panel-embed.is-loading iframe { opacity: .15; }

/* Loader overlay */
.gallery-preview-loader {
  display: none;
  position: absolute;
  inset: 0;
  background: var(--bg);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--s-3);
  z-index: 2;
  font-size: var(--t-sm);
  color: var(--text-muted);
  font-weight: var(--w-semibold);
}
.gallery-panel-embed.is-loading .gallery-preview-loader { display: flex; }

.gallery-preview-spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border-sub);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: gallery-spin .7s linear infinite;
}
@keyframes gallery-spin {
  to { transform: rotate(360deg); }
}

/* Hint pills */
.gallery-preview-hints {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  flex-wrap: wrap;
}

.gallery-preview-hint {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-sm);
  font-weight: var(--w-semibold);
  color: var(--text-muted);
}
.gallery-preview-hint svg { width: 14px; height: 14px; color: var(--green); flex-shrink: 0; }


/* =============================================================================
   FEATURES GRID
   ============================================================================= */
.gallery-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
}

@media (max-width: 1024px) { .gallery-features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .gallery-features-grid { grid-template-columns: 1fr; } }


/* =============================================================================
   RESPONSIVE — Stage
   Dashboard requires 1000px × 530px embed minimum.
   At 1400px stage max-width with 240px picker + 12px gap + 12px paddings,
   embed is ~1100px wide. Below 1320px viewport, switch to single-column
   so the panel can use full width and clear the 1000px requirement.
   ============================================================================= */
@media (max-width: 1320px) {
  .gallery-stage-inner {
    grid-template-columns: 1fr;
  }

  /* In single-column layout, panel can't be sticky — revert to fixed height */
  .gallery-panel {
    position: static;
    height: auto;
    min-height: 700px;
  }
}

@media (max-width: 768px) {
  .gallery-panel-header {
    flex-direction: column;
    gap: var(--s-3);
  }

  .gallery-panel {
    min-height: 560px;
  }

  .gallery-preview-hints {
    gap: var(--s-3);
  }
}


/* =============================================================================
   REDUCED MOTION
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
  .gallery-panel,
  .gallery-panel-embed iframe,
  .gallery-preview-title,
  .gallery-preview-description,
  .viz-card,
  .picker-dashboard-card {
    transition: none !important;
  }
  .gallery-preview-spinner {
    animation: none;
  }
}
