/* =============================================================================
   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: var(--max-w);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 680px;
}


/* =============================================================================
   PICKER — left column
   ============================================================================= */
.gallery-picker {
  border-right: 1px solid var(--border-sub);
  overflow-y: auto;
  max-height: 88vh;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* 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-caption);
  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-caption);
  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
   ============================================================================= */
.gallery-panel {
  display: flex;
  flex-direction: column;
  padding: var(--s-6);
  gap: var(--s-5);
  background: var(--bg-subtle);
  transition: opacity .15s;
}
.gallery-panel.is-transitioning { opacity: .5; }

.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 */
.gallery-panel-embed {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border-sub);
  border-radius: var(--r-xl);
  overflow: hidden;
  flex: 1;
  min-height: 440px;
  box-shadow: var(--sh-md);
}

/* Screenshot mode: show image, hide iframe */
.gallery-panel-embed.is-screenshot .gallery-panel-screenshot { display: block; }
.gallery-panel-embed.is-screenshot #preview-iframe           { display: none; }
.gallery-panel-embed:not(.is-screenshot) .gallery-panel-screenshot { display: none; }
.gallery-panel-embed:not(.is-screenshot) #preview-iframe           { display: block; }

.gallery-panel-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 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
   ============================================================================= */
@media (max-width: 1024px) {
  .gallery-stage-inner {
    grid-template-columns: 1fr;
  }

  .gallery-picker {
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border-sub);
    overflow-y: visible;
  }

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

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

  .gallery-panel-embed {
    min-height: 320px;
  }

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