/* ============================================================
   Oganiko Lightbox — og-lightbox
   Canonical component · OS-000 os-005 Lightbox / Modal Dialog
   Source of truth: OS-000-Design-System/packages/og-lightbox.css
   ------------------------------------------------------------
   Provenance: proven on the AIOS Skill-Centre portal (OS-009), used for
   the skill/related-skill/playbook detail views (2026-07-04 onward).
   Self-contained: every token carries an Oganiko fallback, so this file
   works alone. Override the tokens in :root to re-theme.
   DO NOT edit vendored copies — sync from this source.
   version: 1.0.0 (2026-07-11)
   ------------------------------------------------------------
   Markup (two-pane, default):
     <div class="og-lightbox-backdrop">
       <div class="og-lightbox" role="dialog" aria-modal="true" aria-label="…">
         <header class="og-lightbox-header">
           <span class="og-lightbox-badge">kind</span>
           <h3 class="og-lightbox-title">Title <span class="og-lightbox-meta">(name)</span></h3>
           <button class="og-lightbox-close" aria-label="Close">&times;</button>
         </header>
         <div class="og-lightbox-body">
           <section class="og-lightbox-pane"> … primary content … </section>
           <section class="og-lightbox-pane og-lightbox-pane--aside"> … secondary content (e.g. an iframe) … </section>
         </div>
       </div>
     </div>
   Markup (single-pane): add `og-lightbox-body--single` to .og-lightbox-body and omit the
   aside pane.
   Behavior (implement in your project's JS — this file is presentation only):
     - Close on click of .og-lightbox-close, or a click on the backdrop itself
       (not inside .og-lightbox).
     - Close on Escape key, globally, while the backdrop is open.
     - Set `document.body.style.overflow = 'hidden'` while open; restore on close.
     - Only one instance open at a time — closing removes the backdrop from the DOM.
   ============================================================ */

.og-lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 100);
  background: var(--overlay-backdrop, rgba(0, 0, 0, 0.55));
  display: grid;
  place-items: center;
  padding: var(--spacing-6, 1.5rem);
}

.og-lightbox {
  background: var(--color-white, #FFFFFF);
  border-radius: var(--radius-lg, 12px);
  width: min(1100px, 96vw);
  height: min(760px, 92vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.og-lightbox-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-4, 1rem);
  padding: var(--spacing-4, 1rem) var(--spacing-6, 1.5rem);
  border-bottom: 2px solid var(--color-accent, #109200);
}

.og-lightbox-badge {
  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--weight-bold, 700);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps, 0.08em);
  color: var(--color-text-secondary, #333333);
}

.og-lightbox-title {
  font-size: var(--text-xl, 1.5rem);
  margin: 0;
}

.og-lightbox-meta {
  font-size: var(--text-sm, 0.875rem);
  font-weight: var(--weight-regular, 400);
  color: var(--color-text-muted, #777777);
  font-family: ui-monospace, monospace;
}

.og-lightbox-close {
  margin-left: auto;
  appearance: none;
  background: none;
  border: 0;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-secondary, #333333);
}

.og-lightbox-close:hover,
.og-lightbox-close:focus-visible {
  color: var(--color-accent, #109200);
}

.og-lightbox-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
}

.og-lightbox-body--single {
  grid-template-columns: 1fr;
}

.og-lightbox-pane {
  overflow-y: auto;
  padding: var(--spacing-6, 1.5rem);
  border-right: 1px solid var(--color-border, #E0E0E0);
}

.og-lightbox-body--single .og-lightbox-pane {
  border-right: 0;
}

.og-lightbox-pane .lead {
  color: var(--color-black, #000000);
  font-weight: var(--weight-bold, 700);
  font-size: var(--text-lg, 1.125rem);
  line-height: var(--leading-snug, 1.25);
  margin-bottom: var(--spacing-4, 1rem);
}

.og-lightbox-pane h4 {
  margin: var(--spacing-6, 1.5rem) 0 var(--spacing-1, 0.25rem);
}

.og-lightbox-pane p,
.og-lightbox-pane li {
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-secondary, #333333);
  margin-bottom: var(--spacing-1, 0.25rem);
}

.og-lightbox-pane ul {
  padding-left: 1.1rem;
}

.og-lightbox-pane pre {
  background: var(--color-bg-secondary, #F8F8F6);
  border-radius: var(--radius-sm, 4px);
  padding: var(--spacing-4, 1rem);
  font-size: var(--text-xs, 0.75rem);
  overflow-x: auto;
  margin: var(--spacing-2, 0.5rem) 0;
}

.og-lightbox-pane .mono {
  font-family: ui-monospace, monospace;
  font-size: var(--text-xs, 0.75rem);
}

/* Secondary pane — e.g. an embedded preview/iframe, distinct background. */
.og-lightbox-pane--aside {
  display: flex;
  flex-direction: column;
  padding: var(--spacing-6, 1.5rem);
  background: var(--color-bg-secondary, #F8F8F6);
  border-right: 0;
}

.og-lightbox-pane--aside h4 {
  margin-bottom: var(--spacing-4, 1rem);
}

.og-lightbox-pane--aside iframe {
  flex: 1;
  border: 1px solid var(--color-border, #E0E0E0);
  border-radius: var(--radius-md, 8px);
  background: var(--color-white, #FFFFFF);
  width: 100%;
}

@media (max-width: 760px) {
  .og-lightbox-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }
  .og-lightbox-pane {
    border-right: 0;
    border-bottom: 1px solid var(--color-border, #E0E0E0);
  }
  .og-lightbox-pane--aside {
    min-height: 320px;
    border-bottom: 0;
  }
}
