/* ── ORC Documentation — Custom Styles ── */

/* ── ORC Dark Theme — matches tool UI color palette ── */

/* Custom primary/accent colors (required for palette: primary: custom) */
:root > * {
  --md-primary-fg-color:        #282828;
  --md-primary-fg-color--light: #2a2a2a;
  --md-primary-fg-color--dark:  #1e1e1e;
  --md-primary-bg-color:        #EEE;
  --md-accent-fg-color:         #0078d4;
  --md-accent-fg-color--transparent: rgba(0,120,212,0.12);
}

/* Slate scheme overrides */
[data-md-color-scheme="slate"] {
  --md-default-bg-color:        #1e1e1e;
  --md-default-bg-color--light: #232323;
  --md-default-bg-color--lighter: #282828;
  --md-default-fg-color:        #EEE;
  --md-default-fg-color--light: #CCC;
  --md-default-fg-color--lighter: #AAA;
  --md-default-fg-color--lightest: #666;
  --md-code-bg-color:           #282828;
  --md-code-fg-color:           #CCC;
  --md-typeset-color:           #EEE;
  --md-typeset-a-color:         #5aacf0;
  --md-footer-bg-color:         #1a1a1a;
  --md-footer-bg-color--dark:   #161616;
}

/* Visited links — keep readable on dark bg */
[data-md-color-scheme="slate"] .md-typeset a:visited {
  color: #9a8fcf;
}

/* Header bar */
.md-header {
  background: #1e1e1e;
  border-bottom: 1px solid #333;
}

/* Tabs bar below header */
.md-tabs {
  background: #232323;
  border-bottom: 1px solid #333;
}

/* ── Sidebar separators ── */
.md-nav__item {
  border-bottom: 1px solid #2a2a2a;
}

.md-nav__item--nested > .md-nav__link {
  border-bottom: 1px solid #333;
}

/* Section labels in sidebar */
.md-nav__item--section > .md-nav__link {
  color: #AAA;
  font-weight: 600;
  border-bottom: 1px solid #444;
  padding-bottom: 4px;
  margin-bottom: 2px;
}

/* Active sidebar link accent */
.md-nav__link--active {
  border-left: 3px solid #0078d4;
  padding-left: 8px;
}

/* TOC sidebar (right) section borders */
.md-sidebar--secondary .md-nav__item {
  border-bottom: 1px solid #282828;
}

/* ── Section headers ── */
.md-content h2 {
  border-bottom: 1px solid #444;
  padding-bottom: 6px;
  margin-top: 2em;
  letter-spacing: -0.01em;
  color: #EEE;
}

.md-content h3 {
  border-bottom: 1px solid #333;
  padding-bottom: 4px;
  margin-top: 1.5em;
  color: #CCC;
}

/* Inline widget mockups — flush with header text */
.orc-widget-inline {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 12px;
}

/* Widget bar: row of inline mockup widgets next to a header */
.orc-widget-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
  margin-left: 14px;
}

/* Full-width UI strip mockup (like the top toolbar) */
.orc-ui-strip {
  background: #282828;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 8px 12px;
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: 'Inter', sans-serif;
}

/* Dark inset container for widget groups */
.orc-ui-inset {
  background: #1e1e1e;
  border-radius: 6px;
  padding: 14px 18px;
  display: inline-block;
  margin: 8px 0;
}

/* ── Annotated image badges ── */
.orc-annotated {
  position: relative;
  display: inline-block;
  margin: 12px 0;
}
.orc-annotated img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid #444;
}
.orc-badge {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0078d4;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  pointer-events: none;
  z-index: 1;
}

/* ── Pricing card icons ── */
.pricing-card .card-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 10px;
  image-rendering: pixelated;
}
.pricing-card .card-emoji-icon {
  font-size: 36px;
  line-height: 48px;
  height: 48px;
  margin-bottom: 10px;
}

/* ── Video tutorial frames ── */
/* Swap-later: replace the inner <div class="video-pending"> with
   <iframe src="https://www.youtube.com/embed/VIDEO_ID" allowfullscreen></iframe>
   and drop the "video-pending" class. The .video-embed wrapper keeps 16:9. */
.video-embed {
  position: relative;
  width: 100%;
  max-width: 760px;
  aspect-ratio: 16 / 9;
  margin: 1.2rem 0 1.8rem;
  border-radius: 8px;
  overflow: hidden;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-pending {
  background: #1a1a1a;
  border: 1px dashed #555;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-pending-inner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #888;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
}
.vp-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #4A9E5C;
  color: #fff;
  font-size: 1rem;
  padding-left: 2px;
}

/* Tutorials index grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  margin: 28px 0;
}
.video-card .video-embed { margin: 0 0 10px; max-width: none; }
.video-card h3 {
  border: none !important;
  margin: 0 0 2px !important;
  padding: 0 !important;
  font-size: 1rem;
  color: #EEE;
}
.video-card p {
  margin: 0;
  color: #999;
  font-size: 0.85rem;
}

/* ── Plain screenshot frame (house style) ────────────────────────────
   Use on any un-annotated screenshot:  ![Alt](path.png){ .orc-shot }
   Annotated shots use the inline <svg> pattern instead, whose viewBox
   must carry a >=34px margin so numbered badges never clip.          */
img.orc-shot {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px 0;
  border: 1px solid #444;
  border-radius: 4px;
  background: #151515;
}
.orc-figure { margin: 14px 0 18px; display: inline-block; max-width: 100%; }
.orc-figure img { margin: 0; }
.orc-figure figcaption {
  color: #8a8a8a;
  font-size: 0.76rem;
  font-family: 'Inter', sans-serif;
  margin-top: 6px;
}
/* Side-by-side screenshot row */
.orc-shot-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }

/* ── UI glyphs (the real outliner role balls / type glyphs) ───────────── */
.orc-g {
  width: 17px; height: 17px;
  vertical-align: -4px;
  color: #cccccc;
  margin-right: 4px;
}
.orc-g.is-warn { color: #d9a648; }
.orc-g.is-ok   { color: #8fff8f; }
.orc-g.is-bad  { color: #e05c4a; }
td .orc-g:last-child { margin-right: 0; }

/* ── Live widget demos ────────────────────────────────────────────────── */
.orc-live {
  background: #1c1c1c;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 14px 16px 12px;
  margin: 16px 0 20px;
  display: inline-block;
  max-width: 100%;
}
.orc-live-svg {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 3px;
  touch-action: none;
  cursor: crosshair;
  user-select: none;
}
.orc-live-grab { cursor: default; }
.orc-live .orc-grip { cursor: pointer; }
.orc-live-readout {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.74rem;
  color: #cfcfcf;
  margin-top: 9px;
  line-height: 1.6;
}
.orc-live-readout b { color: #64c878; font-weight: 600; }
.orc-live-readout span { color: #8a8a8a; }
.orc-live-hint {
  font-size: 0.76rem;
  color: #9a9a9a;
  margin-top: 8px;
  max-width: 460px;
  line-height: 1.55;
}
.orc-live-hint b { color: #cfcfcf; font-weight: 600; }
.orc-live-hint kbd {
  background: #2a2a2a; border: 1px solid #4a4a4a; border-radius: 3px;
  padding: 1px 5px; font-size: 0.72rem; color: #ddd;
}
.orc-live-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 10px 0 4px;
  font-size: 0.76rem; color: #b5b5b5;
}
.orc-live-bar label { display: inline-flex; align-items: center; gap: 7px; }
.orc-live-bar input[type=range] { width: 130px; accent-color: #0078d4; }
.orc-live-bar input[type=checkbox] { accent-color: #0078d4; }
.orc-live-toggle {
  background: #2b2b2b; border: 1px solid #4a4a4a; color: #c8c8c8;
  border-radius: 3px; padding: 4px 12px; font-size: 0.75rem; cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.orc-live-toggle:hover { background: #343434; }
.orc-live-toggle.is-on { background: #0078d4; border-color: #2a90e8; color: #fff; }


/* Material measures nav labels without our tracking, so .md-ellipsis was
   clipping the last glyph ("Legal" -> "Lega"). Give it room and stop the
   ellipsis from eating a label that actually fits. */
.md-nav__link .md-ellipsis,
.md-tabs__link .md-ellipsis {
  overflow: visible;
  text-overflow: clip;
  padding-right: 2px;
}

/* ── ORC-style checkbox (matches the app's blue check) ────────────────── */
.orc-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  outline: none;
}
.orc-check-box {
  width: 16px; height: 16px;
  border-radius: 3px;
  border: 1px solid #8a8a8a;
  background: #2b2b2b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: background .12s ease, border-color .12s ease;
}
.orc-check-box svg { width: 13px; height: 13px; opacity: 0; transition: opacity .12s ease; }
.orc-check.is-on .orc-check-box { background: #0078d4; border-color: #0078d4; }
.orc-check.is-on .orc-check-box svg { opacity: 1; }
.orc-check:hover .orc-check-box { border-color: #b5b5b5; }
.orc-check:focus-visible .orc-check-box { box-shadow: 0 0 0 2px rgba(0,120,212,.45); }
.orc-check-label { font-size: 0.78rem; color: #c8c8c8; }

/* The readout must never widen the card (it re-wraps the row). */
.orc-live { box-sizing: border-box; }
.orc-live-readout, .orc-live-hint, .orc-live-bar { max-width: 100%; }

/* ── Glyph chip ───────────────────────────────────────────────────────
   A UI glyph shown inline as "this is that thing's icon", in a quiet
   container so it doesn't read as a bullet marker.                    */
.orc-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: #232323;
  border: 1px solid #3f3f3f;
  border-radius: 4px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  margin-right: 9px;
  flex: 0 0 auto;
}
.orc-chip .orc-g { width: 17px; height: 17px; margin: 0; vertical-align: 0; }
/* inside a table cell: tighter, and centred with the label */
td .orc-chip { width: 24px; height: 24px; margin-right: 7px; }

/* A glyph chip and its label, always on one line. */
.orc-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}
.orc-item .orc-chip { margin-right: 7px; }



/* ── OSA: the tool's own PNG icons, shown in the same chip as ORC's SVGs ──
   OSA draws its icons as PNGs (script-icons/), so the chip carries an <img>
   instead of a <use>. Same 26px chip, same 17px glyph box.                */
.orc-chip img.osa-i { width: 17px; height: 17px; display: block; }
td .orc-chip img.osa-i { width: 16px; height: 16px; }
/* A row of chips (an icon family shown together). */
.osa-chips { display: inline-flex; gap: 6px; align-items: center; }
/* A wider chip for the composite node glyphs (peg+group+read+comp), which are
   deliberately not square. */
.orc-chip.is-wide { width: 40px; }
.orc-chip.is-wide img.osa-i { width: 30px; height: 17px; object-fit: contain; }

/* ── OSA: the live tag decoder ────────────────────────────────────────
   Type a name, see the nodes it builds. The rules mirror core/parser.py:
   the same tag vocabulary, the same right-to-left reading.            */
.osa-decoder { max-width: 640px; }
.osa-decoder input[type="text"] {
  width: 100%; box-sizing: border-box;
  background: #262626; color: #eee;
  border: 1px solid #4a4a4a; border-radius: 3px;
  padding: 9px 11px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.95rem;
}
.osa-decoder input[type="text"]:focus { outline: none; border-color: #0078d4; }
.osa-try { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 4px; }
.osa-try button {
  background: #333; color: #ccc; border: 1px solid #444; border-radius: 3px;
  padding: 4px 10px; font-size: 0.74rem; cursor: pointer;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.osa-try button:hover { border-color: #666; color: #fff; }
.osa-out { margin-top: 14px; }
.osa-out-name { font-size: 0.78rem; color: #8a8a8a; margin-bottom: 8px; }
.osa-out-name b {
  color: #eee; font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 600;
}
.osa-node {
  display: flex; align-items: center; gap: 10px;
  background: #262626; border: 1px solid #3a3a3a; border-radius: 3px;
  padding: 7px 10px; margin-bottom: 5px;
}
.osa-node .osa-bar { width: 5px; height: 15px; border-radius: 2px; flex: 0 0 auto; }
.osa-node .osa-kind { color: #ddd; font-size: 0.8rem; min-width: 120px; }
.osa-node .osa-nm {
  color: #7fb3e8; font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8rem;
}
.osa-node.is-note { background: transparent; border-style: dashed; }
.osa-node.is-note .osa-kind { color: #9a9a9a; }
.osa-chain {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem; color: #cfcfcf; margin-top: 10px;
}
.osa-chain span { color: #8a8a8a; }

/* The decoder's node glyph — the same drawing the tree paints. */
.osa-preview {
  display: flex; align-items: center; justify-content: center;
  background: #1a1a1a; border: 1px solid #3a3a3a; border-radius: 4px;
  padding: 18px 14px; margin: 14px 0 12px; min-height: 120px;
}
.osa-glyph { max-width: 100%; height: auto; }
.osa-stackhead, .osa-stackfoot {
  font-size: 0.68rem; color: #7a7a7a; letter-spacing: 0.06em;
  text-transform: uppercase; margin: 6px 0 4px;
}
.osa-stackfoot { margin: 2px 0 8px; }
/* Stack rows: the tree's own icon on the left, small. */
.osa-node .osa-rowicon {
  width: 24px; height: 16px; object-fit: contain;
  flex: 0 0 auto; display: block;
}
/* Backdrop has no glyph — it is the plate. A swatch of the plate colour. */
 /* Backdrop has no glyph — it IS the plate, and the plate is square. */
.osa-node .osa-rowbd {
  width: 17px; height: 17px; flex: 0 0 auto; border-radius: 3px;
  background: #3d1520; position: relative;
}
.osa-node .osa-rowbd::after {
  content: ""; position: absolute; left: 1px; right: 1px; bottom: 1px; top: 4px;
  background: #6E2639; border-radius: 2px;
}
/* The effect badge: a VERTICAL cyan bar, living in the icon column and
   pushed to its right edge — not after the name. */
.osa-node .osa-fxslot {
  width: 24px; flex: 0 0 auto; display: flex; justify-content: flex-end;
}
.osa-node .osa-fxbar {
  width: 4px; height: 16px; border-radius: 2px; background: #22D3EE;
}

/* The backdrop has no PNG — it IS the plate, drawn. A chip-sized copy of it,
   with the same proportions as IconFactory: 6% sides, 22% header. */
.osa-bd-chip {
  display: inline-block; width: 17px; height: 17px;
  border-radius: 3px; background: #3d1520; position: relative;
  vertical-align: -3px;
}
.osa-bd-chip::after {
  content: ""; position: absolute; left: 1px; right: 1px; bottom: 1px; top: 4px;
  background: #6E2639; border-radius: 2px;
}

/* O chip do EFEITO no corpo do texto: a mesma barra ciano vertical que a
   arvore desenha na coluna do icone, do tamanho dos chips de art layer. Um
   unico chip para os dez efeitos, porque na arvore eles tambem tem uma marca
   so — o que distingue e o nome escrito ao lado, nao a forma. */
.osa-fx-chip {
  display: inline-flex; width: 17px; height: 17px; vertical-align: -3px;
  align-items: center; justify-content: flex-end;
}
.osa-fx-chip-bar {
  width: 4px; height: 14px; border-radius: 2px; background: #22D3EE;
}

/* O DESENHO DA PILHA (art-layers.md): a ordem de empilhamento vista de uma
   vez. Ele nao e decorativo — a regra tem tres partes que se compoem (o frame
   por cima de tudo, o container por cima dos filhos, ordem de arvore entre
   irmaos) e em texto corrido as tres se perdem. */
.osa-stackdemo {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 4px; overflow: hidden; margin: 1em 0;
  font-size: .78rem;
}
.osa-stackdemo .osa-sd-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}
.osa-stackdemo .osa-sd-row:last-child { border-bottom: 0; }
.osa-stackdemo .osa-sd-tag {
  flex: 0 0 18px; text-align: center; opacity: .6; font-weight: 700;
}
/* DOIS GLIFOS por linha, como na arvore: a art layer a que a trilha pertence
   e o TIPO do dado. Um icone so nao respondia "por que esta trilha caiu?" —
   e essa e a pergunta que a figura existe para responder.
   O tamanho e explicito porque `.osa-i` so encolhe dentro de `.orc-chip`:
   sem isto os PNG saem em tamanho natural (50 px) e a figura vira um mural. */
.osa-stackdemo .osa-sd-ic {
  flex: 0 0 40px; display: flex; justify-content: flex-start; gap: 3px;
}
.osa-stackdemo img.osa-sd-g {
  width: 15px; height: 15px; display: block; flex: 0 0 auto;
}
/* A trilha que NAO entra: apagada e riscada, com a nota dizendo por que.
   Ambar, e nao vermelho — nada quebrou, e ela continua na sua arvore. */
.osa-stackdemo .osa-sd-row.is-dropped { opacity: .55; }
.osa-stackdemo .osa-sd-row.is-dropped .osa-sd-nm { text-decoration: line-through; }
.osa-stackdemo .osa-sd-row.is-dropped .osa-sd-note { color: #d9a441; font-style: normal; }
.osa-stackdemo .osa-sd-nm { flex: 1 1 auto; }
.osa-stackdemo .osa-sd-note { opacity: .55; font-style: italic; }
/* O recuo diz "eu sou filho", a mesma leitura da arvore. */
.osa-stackdemo .osa-sd-row.is-track .osa-sd-nm { padding-left: 18px; }
.osa-stackdemo .osa-sd-row.is-top { background: rgba(34, 211, 238, .10); }
.osa-stackdemo .osa-sd-row.is-result { background: rgba(34, 211, 238, .06); }
.osa-stackdemo .osa-sd-out {
  text-align: center; padding: 5px; opacity: .6;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}
