/* ==========================================================================
   Solution Bento Gallery — BEM block: solution-gallery
   Scoped styles for the 6-card bento grid in case study Solution sections.
   Loaded after case-study.css; uses the same design-system tokens.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Grid Container — explicit 3-col layout with named areas
   -------------------------------------------------------------------------- */

.solution-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto auto auto;
  gap: var(--spacing-4);
}

@media (max-width: 767px) {
  .solution-gallery {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   1b. 6-column grid modifier — flexible card sizing
   Available sizes (grid-column spans out of 6):
     --span-1  = 1/6
     --span-2  = 2/6 (1/3)
     --span-3  = 3/6 (1/2)
     --span-4  = 4/6 (2/3)
     --span-5  = 5/6
     --span-6  = 6/6 (full width)
   -------------------------------------------------------------------------- */

.solution-gallery--6col {
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: auto;
}

.solution-gallery--6col .solution-gallery__card {
  aspect-ratio: auto;
  min-height: 220px;
  height: 100%;
}

.solution-gallery--6col .solution-gallery__card--span-1 { grid-column: span 1; }
.solution-gallery--6col .solution-gallery__card--span-2 { grid-column: span 2; }
.solution-gallery--6col .solution-gallery__card--span-3 { grid-column: span 3; }
.solution-gallery--6col .solution-gallery__card--span-4 { grid-column: span 4; }
.solution-gallery--6col .solution-gallery__card--span-5 { grid-column: span 5; }
.solution-gallery--6col .solution-gallery__card--span-6 { grid-column: span 6; }

@media (max-width: 767px) {
  .solution-gallery--6col {
    grid-template-columns: 1fr;
  }
  .solution-gallery--6col .solution-gallery__card {
    grid-column: span 1 !important;
    min-height: 180px;
  }
}

/* --------------------------------------------------------------------------
   2. Gallery Card (button reset + glass-card pattern)
   -------------------------------------------------------------------------- */

.solution-gallery__card {
  /* Button reset */
  appearance: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;

  /* Glass-card tokens */
  position: relative;
  overflow: hidden;
  background-color: var(--color-surface-elevated, #FFFFFF);
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
  border-radius: var(--radius-xl, 12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

  /* Consistent card sizing — default */
  aspect-ratio: 4 / 3;
  width: 100%;

  /* GPU-accelerated transition on base state for smooth enter + exit */
  transition:
    transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.28s ease;
}

/* ---- Card size variants ---- */

/* Wide: spans 2 columns, no fixed aspect-ratio so row height is content-driven */
.solution-gallery__card--wide {
  grid-column: span 2;
  aspect-ratio: auto;
  min-height: 200px;
}

/* Row 2 stacked pair: two cards share the left 1/3 column */
.solution-gallery__card--stack-top {
  grid-column: 1;
  aspect-ratio: 4 / 3;
}

.solution-gallery__card--stack-bottom {
  grid-column: 1;
  aspect-ratio: 4 / 3;
}

/* Row 2 tall card: spans 3 rows on the right 2/3 */
.solution-gallery__card--tall-wide {
  grid-column: 2 / 4;
  grid-row: span 3;
  aspect-ratio: auto;
  min-height: 500px;
}

/* Match row height: removes aspect-ratio, stretches to fill row */
.solution-gallery__card--match-row {
  aspect-ratio: auto;
  height: 100%;
}

@media (max-width: 767px) {
  .solution-gallery__card--wide,
  .solution-gallery__card--tall-wide {
    grid-column: span 1;
    grid-row: span 1;
    aspect-ratio: 4 / 3;
    min-height: 0;
  }
  .solution-gallery__card--stack-top,
  .solution-gallery__card--stack-bottom {
    grid-column: span 1;
  }
}

/* --------------------------------------------------------------------------
   3. Card Hover — subtle lift + shadow deepening
   -------------------------------------------------------------------------- */

.solution-gallery__card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.12);
}

/* --------------------------------------------------------------------------
   4. Focus-visible — keyboard accessibility
   -------------------------------------------------------------------------- */

.solution-gallery__card:focus-visible {
  outline: 2px solid var(--color-accent, #4F46E5);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   5. Reduced Motion — replace transforms with opacity/outline feedback
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .solution-gallery__card {
    transition:
      opacity 0.15s ease,
      box-shadow 0.15s ease,
      outline-color 0.15s ease;
  }

  .solution-gallery__card:hover {
    transform: none;
    box-shadow: 0 0 0 2px var(--color-accent, #4F46E5);
    opacity: 0.92;
  }
}

/* --------------------------------------------------------------------------
   6. Card Content Area — fills the entire card
   -------------------------------------------------------------------------- */

.solution-gallery__content {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

/* --------------------------------------------------------------------------
   7. Card Overlay — bottom-anchored metadata with gradient scrim
   -------------------------------------------------------------------------- */

.solution-gallery__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-1, 4px);
  padding: var(--spacing-3, 12px) var(--spacing-4, 16px);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 0 0 var(--radius-xl, 12px) var(--radius-xl, 12px);
}

/* Remove the dark gradient scrim — no longer needed */
.solution-gallery__overlay::before {
  display: none;
}

/* --------------------------------------------------------------------------
   8. Overlay — Tag pill
   -------------------------------------------------------------------------- */

.solution-gallery__tag {
  display: inline-block;
  align-self: flex-start;
  font-size: var(--font-size-xs, 12px);
  font-weight: var(--font-weight-semibold, 600);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent, #4F46E5);
  background: rgba(79, 70, 229, 0.08);
  padding: var(--spacing-1, 4px) var(--spacing-2, 8px);
  border-radius: var(--radius-profile, 46px);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   9. Overlay — Title
   -------------------------------------------------------------------------- */

.solution-gallery__title {
  font-size: var(--font-size-base, 16px);
  font-weight: var(--font-weight-bold, 700);
  color: var(--color-text-primary, #0F172A);
  margin: 0;
  line-height: 1.2;
}

/* --------------------------------------------------------------------------
   10. Overlay — Description
   -------------------------------------------------------------------------- */

.solution-gallery__description {
  font-size: var(--font-size-xs, 12px);
  color: var(--color-text-secondary, #475569);
  margin: 0;
  line-height: 1.4;
}


/* ==========================================================================
   11. Flow Diagram — Editorial "Digital Architect" Style
   Inspired by the stitch design system: bento card nodes, tonal layering,
   subtle connectors, dot-grid background, no hard borders.
   ========================================================================== */

/* 11a. Flow container — dot-grid background, vertical layout */
.solution-gallery__flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: var(--spacing-4, 16px);
  gap: 0;
  position: relative;
  background-color: #f7f9fb;
  background-image: radial-gradient(#757684 0.5px, transparent 0.5px);
  background-size: 20px 20px;
}

/* 11b. Flow node — bento card style */
.solution-gallery__flow-node {
  display: flex;
  align-items: center;
  gap: var(--spacing-2, 8px);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #191c1e;
  line-height: 1.3;
  padding: var(--spacing-2, 8px) var(--spacing-3, 12px);
  min-width: 0;
  max-width: 90%;
  word-break: break-word;
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-radius: var(--radius-lg, 10px);
  box-shadow: 0 1px 4px rgba(25, 28, 30, 0.06);
  border: 1px solid rgba(196, 197, 213, 0.15);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 11c. Node icon container */
.solution-gallery__flow-node .material-symbols-outlined {
  font-size: 18px;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md, 8px);
}

/* 11d. Start/End node — accent tint icon */
.solution-gallery__flow-node--start {
  background: #ffffff;
}

.solution-gallery__flow-node--start .material-symbols-outlined {
  background: rgba(0, 40, 142, 0.1);
  color: #00288e;
}

/* 11e. Action node — subtle surface */
.solution-gallery__flow-node--action {
  background: #f2f4f6;
}

.solution-gallery__flow-node--action .material-symbols-outlined {
  background: rgba(0, 40, 142, 0.08);
  color: #00288e;
}

/* 11f. Decision node — diamond with icon */
.solution-gallery__flow-node--decision {
  background: #e0e3e5;
  width: 64px;
  height: 64px;
  min-height: 64px;
  min-width: 64px;
  padding: 0;
  transform: rotate(45deg);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 4px 12px rgba(25, 28, 30, 0.08);
  border: 1px solid rgba(0, 40, 142, 0.15);
  justify-content: center;
  gap: 0;
}

.solution-gallery__flow-node--decision > * {
  transform: rotate(-45deg);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.solution-gallery__flow-node--decision .material-symbols-outlined {
  background: none;
  color: #00288e;
  font-size: 16px;
  width: auto;
  height: auto;
}

/* 12. Flow Connector — subtle line, no arrowhead */
.solution-gallery__flow-connector {
  width: 1px;
  height: 16px;
  background: rgba(196, 197, 213, 0.4);
  position: relative;
  flex-shrink: 0;
  transition: opacity 0.3s ease;
}

.solution-gallery__flow-connector::after {
  display: none;
}

/* 13. Flow Branch — yes/no paths */
.solution-gallery__flow-branch {
  display: flex;
  gap: var(--spacing-4, 16px);
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}

.solution-gallery__flow-path {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}

/* Branch labels — pill badges */
.solution-gallery__flow-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-sm, 4px);
  margin-bottom: var(--spacing-1, 4px);
  background: #ffffff;
  border: 1px solid rgba(196, 197, 213, 0.3);
}

.solution-gallery__flow-path--yes .solution-gallery__flow-label {
  color: #00288e;
  border-color: rgba(0, 40, 142, 0.2);
}

.solution-gallery__flow-path--no .solution-gallery__flow-label {
  color: #ba1a1a;
  border-color: rgba(186, 26, 26, 0.2);
}


/* ==========================================================================
   14. Flow Step Highlight Animation
   ========================================================================== */

@keyframes solution-gallery-step-highlight {
  0% { opacity: 0.3; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1.02); }
}

@keyframes solution-gallery-step-highlight-diamond {
  0% { opacity: 0.3; transform: rotate(45deg) scale(1); }
  40% { opacity: 1; transform: rotate(45deg) scale(1.04); }
  100% { opacity: 1; transform: rotate(45deg) scale(1.02); }
}

.solution-gallery__card:hover .solution-gallery__flow-node {
  opacity: 0.3;
}

.solution-gallery__card:hover .solution-gallery__flow-node[data-step] {
  animation: solution-gallery-step-highlight 0.5s ease forwards;
}

.solution-gallery__card:hover .solution-gallery__flow-node--decision[data-step] {
  animation-name: solution-gallery-step-highlight-diamond;
}

.solution-gallery__card:hover .solution-gallery__flow-node[data-step="1"] { animation-delay: 0.4s; }
.solution-gallery__card:hover .solution-gallery__flow-node[data-step="2"] { animation-delay: 0.8s; }
.solution-gallery__card:hover .solution-gallery__flow-node[data-step="3"] { animation-delay: 1.2s; }
.solution-gallery__card:hover .solution-gallery__flow-node[data-step="4"] { animation-delay: 1.6s; }
.solution-gallery__card:hover .solution-gallery__flow-node[data-step="5"] { animation-delay: 2.0s; }
.solution-gallery__card:hover .solution-gallery__flow-node[data-step="6"] { animation-delay: 2.4s; }

.solution-gallery__card:hover .solution-gallery__flow-connector {
  opacity: 0.3;
}

@media (prefers-reduced-motion: reduce) {
  .solution-gallery__card:hover .solution-gallery__flow-node {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .solution-gallery__card:hover .solution-gallery__flow-node--decision {
    transform: rotate(45deg);
  }
  .solution-gallery__card:hover .solution-gallery__flow-connector {
    opacity: 1;
  }
}


/* ==========================================================================
   15. Image Card Content
   Requirements: 6.1, 6.3
   ========================================================================== */

/* --------------------------------------------------------------------------
   15a. Image container — fills the card content area
   -------------------------------------------------------------------------- */

.solution-gallery__image {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.solution-gallery__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --------------------------------------------------------------------------
   15b. Image error state — placeholder with broken_image icon
   -------------------------------------------------------------------------- */

.solution-gallery__image--error {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-subtle, #F4F4F5);
}

.solution-gallery__image--error img {
  display: none;
}

.solution-gallery__image--error::after {
  content: 'broken_image';
  font-family: 'Material Symbols Outlined';
  font-size: 48px;
  color: var(--color-text-tertiary, #94A3B8);
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}


/* ==========================================================================
   16. Code Block Card Content
   Requirements: 7.1, 7.2, 7.3
   ========================================================================== */

/* --------------------------------------------------------------------------
   16a. Code container — monospace font, fills card
   -------------------------------------------------------------------------- */

.solution-gallery__code {
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: var(--spacing-4, 16px);
  display: flex;
  align-items: flex-start;
  background: var(--color-surface-subtle, #F4F4F5);
}

.solution-gallery__code pre {
  margin: 0;
  width: 100%;
  overflow-x: auto;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: var(--font-size-xs, 12px);
  line-height: 1.6;
  color: var(--color-text-primary, #0F172A);
  tab-size: 2;
}

.solution-gallery__code code {
  font-family: inherit;
  font-size: inherit;
  white-space: pre;
}

/* --------------------------------------------------------------------------
   16b. Subtle scrollbar styling (webkit)
   -------------------------------------------------------------------------- */

.solution-gallery__code pre::-webkit-scrollbar {
  height: 4px;
}

.solution-gallery__code pre::-webkit-scrollbar-track {
  background: transparent;
}

.solution-gallery__code pre::-webkit-scrollbar-thumb {
  background: var(--color-text-tertiary, #94A3B8);
  border-radius: var(--radius-sm, 4px);
}

/* --------------------------------------------------------------------------
   16c. CSS-only syntax highlighting classes
   -------------------------------------------------------------------------- */

.solution-gallery__code-keyword {
  color: var(--color-accent, #4F46E5);
  font-weight: var(--font-weight-semibold, 600);
}

.solution-gallery__code-string {
  color: #16A34A;
}

.solution-gallery__code-comment {
  color: var(--color-text-tertiary, #94A3B8);
  font-style: italic;
}

.solution-gallery__code-number {
  color: #EA580C;
}

.solution-gallery__code-punctuation {
  color: var(--color-text-secondary, #475569);
}


/* ==========================================================================
   17. Prototype Card Placeholder
   Requirements: 8.1, 8.2, 8.3
   ========================================================================== */

.solution-gallery__prototype-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2, 8px);
  background: var(--color-surface-subtle, #F4F4F5);
  border: 2px dashed var(--color-border, rgba(0, 0, 0, 0.08));
  border-radius: inherit;
}

.solution-gallery__prototype-placeholder .material-symbols-outlined {
  font-size: 48px;
  color: var(--color-text-tertiary, #94A3B8);
}

.solution-gallery__prototype-placeholder p {
  margin: 0;
  font-size: var(--font-size-sm, 14px);
  color: var(--color-text-secondary, #475569);
  font-weight: var(--font-weight-medium, 500);
}


/* ==========================================================================
   18. Expanded Card View — inline expansion (no overlay)
   ========================================================================== */

.solution-gallery__expanded {
  grid-column: 1 / -1;
  background: var(--color-surface-elevated, #FFFFFF);
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
  border-radius: var(--radius-xl, 12px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: solution-gallery-expand-in 0.3s cubic-bezier(0, 0, 0.2, 1) forwards;
}

@keyframes solution-gallery-expand-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Header — nav group left, close right */
.solution-gallery__expanded-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-3, 12px) var(--spacing-4, 16px);
  border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
}

/* Left-side arrow pair */
.solution-gallery__expanded-nav-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-2, 8px);
}

/* Nav and close buttons */
.solution-gallery__expanded-nav,
.solution-gallery__expanded-close {
  appearance: none;
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
  background: var(--color-surface-subtle, #F4F4F5);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-secondary, #475569);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.solution-gallery__expanded-nav:hover,
.solution-gallery__expanded-close:hover {
  background: var(--color-accent, #4F46E5);
  color: #fff;
  border-color: var(--color-accent, #4F46E5);
}

.solution-gallery__expanded-nav:focus-visible,
.solution-gallery__expanded-close:focus-visible {
  outline: 2px solid var(--color-accent, #4F46E5);
  outline-offset: 2px;
}

.solution-gallery__expanded-nav .material-symbols-outlined,
.solution-gallery__expanded-close .material-symbols-outlined {
  font-size: 20px;
}

/* Body — content area (full-bleed) */
.solution-gallery__expanded-body {
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background-color: #f7f9fb;
  background-image: radial-gradient(#757684 0.5px, transparent 0.5px);
  background-size: 20px 20px;
}

/* Expanded image — full-bleed, no border-radius */
.solution-gallery__expanded-img {
  width: 100%;
  height: 100%;
  max-height: 90vh;
  object-fit: cover;
  display: block;
}

/* Zoomable image in expanded view */
.solution-gallery__expanded-img--zoomable {
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.15s ease;
  cursor: zoom-in;
}

.solution-gallery__expanded-img--zoomable.is-zoomed {
  cursor: grab;
}

.solution-gallery__expanded-img--zoomable.is-dragging {
  cursor: grabbing;
}

.solution-gallery__image-zoom-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  min-height: 600px;
}

/* Expanded flow diagram — fills body, no extra background */
.solution-gallery__flow--expanded {
  width: 100%;
  min-height: 600px;
  padding: var(--spacing-8, 32px);
  background: transparent;
  background-image: none;
}

/* Expanded code block */
.solution-gallery__code--expanded {
  max-width: 800px;
  height: auto;
  max-height: 100%;
  overflow: auto;
  font-size: var(--font-size-base, 16px);
  border-radius: var(--radius-md, 8px);
}

/* Meta — tag, title, description */
.solution-gallery__expanded-meta {
  padding: var(--spacing-4, 16px) var(--spacing-6, 24px);
  border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
}

.solution-gallery__expanded-tag {
  display: inline-block;
  font-size: var(--font-size-xs, 12px);
  font-weight: var(--font-weight-semibold, 600);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent, #4F46E5);
  background: rgba(79, 70, 229, 0.08);
  padding: var(--spacing-1, 4px) var(--spacing-2, 8px);
  border-radius: var(--radius-profile, 46px);
  margin-bottom: var(--spacing-1, 4px);
}

.solution-gallery__expanded-title {
  font-size: var(--font-size-2xl, 24px);
  font-weight: var(--font-weight-bold, 700);
  color: var(--color-text-primary, #0F172A);
  margin: 0 0 var(--spacing-1, 4px) 0;
  line-height: 1.2;
}

.solution-gallery__expanded-desc {
  font-size: var(--font-size-sm, 14px);
  color: var(--color-text-secondary, #475569);
  margin: 0;
  line-height: 1.5;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .solution-gallery__expanded {
    animation: none;
  }
  .solution-gallery__flow--expanded {
    transform: none;
  }
}


/* ==========================================================================
   19. Cytoscape Flow Containers & Detail Panel
   Requirements: 4.1, 4.2, 4.3, 7.5, 12.3
   ========================================================================== */

/* Cytoscape flow container — thumbnail inside bento card */
.solution-gallery__flow-cy-container {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  background-color: #f7f9fb;
  background-image: radial-gradient(#757684 0.5px, transparent 0.5px);
  background-size: 20px 20px;
  border-radius: inherit;
}

/* Cytoscape flow container — expanded view */
.solution-gallery__flow-container {
  width: 100%;
  height: 100%;
  min-height: 600px;
  position: relative;
  background-color: #f7f9fb;
  background-image: radial-gradient(#757684 0.5px, transparent 0.5px);
  background-size: 20px 20px;
}

/* Detail panel — right-edge sidebar with slide-in animation */
.flow-detail-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 40%;
  background: #ffffff;
  border-left: 1px solid rgba(196, 197, 213, 0.15);
  box-shadow: -8px 0 32px rgba(25, 28, 30, 0.06);
  padding: 20px;
  font-family: 'Inter', sans-serif;
  z-index: 100;
  overflow-y: scroll;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  animation: flow-panel-slide-in 0.3s cubic-bezier(0, 0, 0.2, 1) forwards;
}

.flow-detail-panel::-webkit-scrollbar {
  width: 4px;
}

.flow-detail-panel::-webkit-scrollbar-track {
  background: transparent;
}

.flow-detail-panel::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
}

.flow-detail-panel:hover {
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.flow-detail-panel:hover::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

@keyframes flow-panel-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.flow-detail-panel__close {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  position: absolute;
  top: 8px;
  right: 8px;
  color: #444653;
  padding: 4px;
}

.flow-detail-panel__close:hover {
  color: #191c1e;
}

.flow-detail-panel__title {
  font-size: 16px;
  font-weight: 700;
  color: #191c1e;
  margin: 0 0 8px 0;
}

.flow-detail-panel__description {
  font-size: 13px;
  color: #444653;
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.flow-detail-panel__screenshot {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  margin-top: 8px;
}

/* Visually hidden utility for accessibility summaries */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ==========================================================================
   20. Dagre + HTML Nodes + SVG Edges — Flow Renderer v2
   Replaces Cytoscape.js canvas rendering with HTML divs for nodes,
   SVG paths for edges, and CSS transform for zoom/pan.
   ========================================================================== */

/* Flow canvas — contains all nodes and SVG edges */
.flow-canvas {
  position: relative;
  transform-origin: 0 0;
}

/* Flow node — editorial bento card */
.flow-node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(25, 28, 30, 0.06);
  border: 1px solid rgba(196, 197, 213, 0.15);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  font-family: 'Inter', sans-serif;
  z-index: 2;
}

.flow-node:hover {
  box-shadow: 0 8px 24px rgba(25, 28, 30, 0.1);
  transform: translateY(-2px);
}

/* Node icon container */
.flow-node__icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.flow-node__icon .material-symbols-outlined {
  font-size: 20px;
}

/* Node content */
.flow-node__content {
  min-width: 0;
}

.flow-node__category {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #00288e;
  margin-bottom: 2px;
}

.flow-node__title {
  font-size: 13px;
  font-weight: 700;
  color: #191c1e;
  margin: 0;
  line-height: 1.3;
}

/* Start/End node */
.flow-node--start .flow-node__icon,
.flow-node--end .flow-node__icon {
  background: rgba(0, 40, 142, 0.1);
  color: #00288e;
}

/* Action node */
.flow-node--action {
  background: #f2f4f6;
}
.flow-node--action .flow-node__icon {
  background: rgba(0, 40, 142, 0.08);
  color: #00288e;
}

/* Decision node — diamond shape with icon inside, text below */
.flow-node--decision {
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  width: auto !important;
}

.flow-node--decision .flow-node__icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  transform: rotate(45deg);
  background: #e0e3e5;
  border: 1px solid rgba(0, 40, 142, 0.15);
  box-shadow: 0 4px 12px rgba(25, 28, 30, 0.08);
}

.flow-node--decision .flow-node__icon .material-symbols-outlined {
  transform: rotate(-45deg);
  font-size: 22px;
  color: #00288e;
}

.flow-node--decision .flow-node__content {
  margin-top: 8px;
  text-align: center;
}

.flow-node--decision .flow-node__category {
  display: block;
}

.flow-node--decision .flow-node__title {
  font-size: 11px;
  white-space: nowrap;
}

.flow-node--decision:hover {
  box-shadow: none;
  transform: none;
}

.flow-node--decision .flow-node__icon:hover {
  box-shadow: 0 8px 24px rgba(25, 28, 30, 0.12);
}

/* SVG edges */
.flow-edges {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.flow-edge {
  fill: none;
  stroke: rgba(196, 197, 213, 0.4);
  stroke-width: 1.5;
}

.flow-edge-arrow {
  fill: rgba(196, 197, 213, 0.4);
}

/* Edge label pill */
.flow-edge-label {
  position: absolute;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid rgba(196, 197, 213, 0.3);
  z-index: 3;
  pointer-events: none;
  font-family: 'Inter', sans-serif;
}

.flow-edge-label--yes {
  color: #00288e;
  border-color: rgba(0, 40, 142, 0.2);
}

.flow-edge-label--no {
  color: #ba1a1a;
  border-color: rgba(186, 26, 26, 0.2);
}

/* Edge flow animation */
.flow-edge--animated {
  stroke-dasharray: 8 4;
  animation: flow-edge-pulse 1.5s linear infinite;
}

@keyframes flow-edge-pulse {
  from { stroke-dashoffset: 12; }
  to { stroke-dashoffset: 0; }
}

/* Zoom controls */
.flow-zoom-controls {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  gap: 4px;
  z-index: 10;
}

.flow-zoom-btn {
  appearance: none;
  border: 1px solid rgba(196, 197, 213, 0.3);
  background: #ffffff;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #444653;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease;
}

.flow-zoom-btn:hover {
  background: #00288e;
  color: #ffffff;
  border-color: #00288e;
}

/* Thumbnail mode — no hover effects */
.flow-node--thumbnail {
  cursor: default;
  pointer-events: none;
}
.flow-node--thumbnail:hover {
  box-shadow: 0 1px 4px rgba(25, 28, 30, 0.06);
  transform: none;
}

/* Active node state — clicked node with gradient border */
.flow-node--active {
  border: 2px solid rgba(10, 132, 255, 0.6);
  background: linear-gradient(90deg, rgba(10, 132, 255, 0.00) -18.24%, rgba(10, 132, 255, 0.08) 100%), #ffffff;
  box-shadow: 0 4px 16px rgba(10, 132, 255, 0.15);
}

.flow-node--active.flow-node--action {
  background: linear-gradient(90deg, rgba(10, 132, 255, 0.00) -18.24%, rgba(10, 132, 255, 0.08) 100%), #f2f4f6;
}

.flow-node--active.flow-node--decision .flow-node__icon {
  border: 2px solid rgba(10, 132, 255, 0.6);
  box-shadow: 0 4px 16px rgba(10, 132, 255, 0.15);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .flow-node {
    transition: none;
  }
  .flow-node:hover {
    transform: none;
  }
  .flow-edge--animated {
    animation: none;
  }
}


/* ==========================================================================
   21. Detail Panel Slideshow
   ========================================================================== */

.flow-detail-slideshow {
  position: relative;
  width: 100%;
  margin-top: 8px;
  /* border-radius: 8px; */
  /* overflow: hidden; */
  /* background: #f2f4f6; */
  /* aspect-ratio: 9 / 16; */
  height: 470px;
}

.flow-detail-slideshow__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s ease;
  border-radius: 8px;
}

.flow-detail-slideshow__slide--active {
  opacity: 1;
}

.flow-detail-slideshow__dots {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

.flow-detail-slideshow__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background 0.2s ease;
}

.flow-detail-slideshow__dot--active {
  background: #ffffff;
}

.flow-detail-slideshow__dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* Play/pause button */
.flow-detail-slideshow__play {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  padding: 0;
  margin-left: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.flow-detail-slideshow__play:hover {
  color: #ffffff;
}

.flow-detail-slideshow__play .material-symbols-outlined {
  font-size: 16px;
}


/* Equal row heights modifier */
.solution-gallery--equal-rows {
  grid-template-rows: auto auto;
  height: 100%;
}

.solution-gallery--equal-rows .solution-gallery__card {
  aspect-ratio: auto;
  height: 100%;
  min-height: 250px;
}
