/* ============================================================
   Demos · shared wrapper styles
   Full-bleed Power BI iframe with site chrome + sample-data banner
   ============================================================ */

.demo-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.demo-banner {
  background: linear-gradient(90deg, #fff4ce 0%, #ffe5a8 100%);
  color: #5a3e00;
  border-bottom: 1px solid #e8c878;
  padding: .65rem 1.25rem;
  font-size: .9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}

.demo-banner strong { font-weight: 700; }

.demo-banner a {
  color: #5a3e00;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.demo-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border, #e1e1e1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.demo-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .55rem;
}

.demo-header .demo-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.demo-header-actions {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
}

.demo-frame-wrap {
  flex: 1;
  position: relative;
  background: #0b0b0b;
  min-height: 70vh;
}

.demo-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.demo-foot {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border, #e1e1e1);
  font-size: .85rem;
  color: var(--text-muted, #555);
  text-align: center;
}

.demo-foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 720px) {
  .demo-frame-wrap { min-height: 60vh; }
  .demo-header h1 { font-size: 1.05rem; }
}

/* ============================================================
   Stage: full-width iframe + horizontal related-resources rail above
   The wrap owns the height; the iframe absolute-fills it.
   (Do NOT use `height: auto` on the iframe — cross-origin iframes
   can't size to their content and collapse to ~150px, cropping the
   report. This was the regression in commit 84ddf40.)
   ============================================================ */
.demo-stage-grid {
  display: block;
}
.demo-stage-grid .demo-frame-wrap {
  position: relative;
  background: #0b0b0b;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  height: 78vh;
  min-height: 720px;
}
.demo-stage-grid .demo-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

/* Fullscreen toggle button — top-right overlay on the iframe wrap */
.demo-fs-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(15, 17, 22, .78);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .18);
  font: 500 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .12s ease, border-color .12s ease, transform .08s ease;
}
.demo-fs-toggle:hover { background: rgba(0, 120, 212, .92); border-color: rgba(255,255,255,.35); }
.demo-fs-toggle:active { transform: translateY(1px); }
.demo-fs-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.demo-fs-icon-exit { display: none; }
.demo-stage-grid .demo-frame-wrap:fullscreen,
.demo-stage-grid .demo-frame-wrap:-webkit-full-screen {
  background: #0b0b0b;
  border-radius: 0;
  min-height: 100vh;
  width: 100vw;
  height: 100vh;
  padding: 0;
}
.demo-stage-grid .demo-frame-wrap:fullscreen iframe,
.demo-stage-grid .demo-frame-wrap:-webkit-full-screen iframe {
  width: 100vw;
  height: 100vh;
}
.demo-stage-grid .demo-frame-wrap:fullscreen .demo-fs-icon-enter,
.demo-stage-grid .demo-frame-wrap:-webkit-full-screen .demo-fs-icon-enter { display: none; }
.demo-stage-grid .demo-frame-wrap:fullscreen .demo-fs-icon-exit,
.demo-stage-grid .demo-frame-wrap:-webkit-full-screen .demo-fs-icon-exit { display: inline-block; }

/* Horizontal related-resources strip — sits ABOVE the iframe */
.demo-rail {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e1e1e1);
  border-radius: 12px;
  padding: .65rem .85rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.demo-rail-header {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--border, #ececec);
  padding-right: 1rem;
  margin-right: .25rem;
  min-width: 0;
}
.demo-rail-eyebrow {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted, #666);
  line-height: 1.2;
}
.demo-rail h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text, #222);
  white-space: nowrap;
}
.demo-rail-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: .35rem;
  flex: 1 1 auto;
  min-width: 0;
}
.demo-rail-list li { display: inline-flex; }
.demo-rail-list li a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .38rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--border, #ececec);
  background: var(--bg-alt, #fafafa);
  text-decoration: none;
  color: var(--text, #222);
  font-size: .82rem;
  line-height: 1.2;
  white-space: nowrap;
  transition: background .12s, border-color .12s, transform .08s;
}
.demo-rail-list li a:hover {
  background: color-mix(in srgb, var(--accent, #0078d4) 8%, var(--surface, #fff));
  border-color: color-mix(in srgb, var(--accent, #0078d4) 30%, var(--border, #ececec));
  text-decoration: none;
  transform: translateY(-1px);
}
.demo-rail-list .rail-icon {
  font-size: .95rem;
  flex-shrink: 0;
}
.demo-rail-list .rail-label { }
.demo-rail-list .ext {
  font-size: .72rem;
  opacity: .55;
}
.demo-rail-empty {
  font-size: .85rem;
  color: var(--text-muted, #666);
  padding: .25rem .5rem;
}
.demo-rail-footer {
  flex-shrink: 0;
  border-left: 1px solid var(--border, #ececec);
  padding-left: 1rem;
  margin-left: .25rem;
}
.demo-rail-cta {
  display: inline-block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent, #0078d4);
  text-decoration: none;
  padding: .35rem .6rem;
  border-radius: 6px;
  white-space: nowrap;
}
.demo-rail-cta:hover { background: color-mix(in srgb, var(--accent, #0078d4) 8%, transparent); }

/* Requirements rail: two stacked groups (roles, software) sharing one rail.
   Uses .demo-rail base styles but switches to a vertical layout on the body
   so each group gets its own labeled chip row. */
.demo-rail-reqs { align-items: stretch; }
.demo-rail-reqs .demo-rail-header { justify-content: center; }
.demo-rail-reqs-groups {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  flex: 1 1 auto;
  min-width: 0;
}
.demo-rail-reqs-group {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
  min-width: 0;
}
.demo-rail-reqs-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted, #666);
  flex-shrink: 0;
  min-width: 168px;
}
/* Non-link requirement chips reuse the link-chip look without the hover/click affordance */
.demo-req-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .38rem .7rem;
  border-radius: 999px;
  border: 1px dashed var(--border, #ececec);
  background: var(--bg-alt, #fafafa);
  color: var(--text-soft, #444);
  font-size: .82rem;
  line-height: 1.2;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .demo-rail-reqs-group { flex-direction: column; align-items: flex-start; }
  .demo-rail-reqs-label { min-width: 0; }
}

@media (max-width: 760px) {
  .demo-rail { flex-direction: column; align-items: stretch; }
  .demo-rail-header,
  .demo-rail-footer {
    border: 0;
    padding: 0;
    margin: 0;
  }
  .demo-rail-footer { text-align: center; padding-top: .5rem; border-top: 1px solid var(--border, #ececec); }
  .demo-stage-grid .demo-frame-wrap { min-height: 480px; }
}
