/* =============================================================================
   BLACK SIGNAL // components/gloss.css  jargon explainer (bs_gloss.js)
   Written for people new to tech, so the card favours readability over
   density: larger body text, generous line height, plain section labels,
   high contrast, and every term inside an explanation is itself a link.
   A marked term in running text: a dotted accent underline. Inside buttons,
   links, crumbs and title bands the underline stays hidden (bs-gl--quiet) so
   tiles and keys keep their clean look; hovering still opens the card there.
   ============================================================================= */
@layer components {
  abbr.bs-gl {
    text-decoration: none;
    border-bottom: 1.5px dotted color-mix(in srgb, var(--orange) 80%, transparent);
    cursor: help;
    font: inherit;
    color: inherit;
  }
  abbr.bs-gl:hover, abbr.bs-gl.is-open { border-bottom-style: solid; border-bottom-color: var(--orange); }
  abbr.bs-gl:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 1px; }
  abbr.bs-gl.bs-gl--quiet { border-bottom: 0; cursor: inherit; }

  .bs-gl-pop {
    position: fixed; z-index: 2147483000;
    box-sizing: border-box; max-width: calc(100vw - 16px);
    overflow-y: auto; overscroll-behavior: contain;
    background: var(--sig-black);
    color: var(--sig-ink);
    border: 1px solid var(--orange);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
    font-family: var(--font-body, inherit);
    text-transform: none; letter-spacing: normal; text-align: left; white-space: normal;
    pointer-events: auto;
    animation: bsGlIn 0.14s var(--ease-sharp, ease-out);
  }
  .bs-gl-pop[hidden] { display: none; }
  .bs-gl-pop:focus { outline: none; }
  .bs-gl-pop:focus-visible { outline: 2px solid var(--sig-ink); outline-offset: 2px; }

  .bs-gl-head {
    position: relative;
    display: flex; flex-direction: column; gap: 6px;
    padding: 14px 52px 13px 18px;
    background: var(--orange); color: var(--accent-on-accent);
  }
  .bs-gl-term { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: 0.02em; }
  .bs-gl-exp { font-size: 16px; font-weight: 600; line-height: 1.35; }
  .bs-gl-sublbl {
    display: block; margin-bottom: 2px;
    font-family: var(--sig-mono); font-weight: 500; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
    opacity: 0.85;
  }
  .bs-gl-x {
    position: absolute; top: 8px; right: 8px;
    width: 40px; height: 40px; display: grid; place-items: center;
    background: transparent; border: 0; cursor: pointer;
    color: var(--accent-on-accent); font-size: 18px; font-weight: 700; line-height: 1;
  }
  .bs-gl-x:hover { background: color-mix(in srgb, var(--accent-on-accent) 14%, transparent); }
  .bs-gl-x:focus-visible { outline: 2px solid var(--accent-on-accent); outline-offset: -4px; }

  .bs-gl-body { padding: 14px 18px 16px; }
  .bs-gl-lbl {
    margin: 14px 0 4px;
    font-family: var(--sig-mono); font-weight: 600; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--orange);
  }
  .bs-gl-lbl:first-child { margin-top: 0; }
  .bs-gl-txt { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--sig-ink); }
  .bs-gl-lead { font-size: 16.5px; }
  .bs-gl-from { color: var(--sig-ink-dim); font-size: 14.5px; }

  /* Jargon inside the explanation: a real button styled as an underlined word. */
  .bs-gl-in {
    display: inline; padding: 0; margin: 0; border: 0; background: none;
    font: inherit; color: inherit; cursor: pointer;
    text-decoration: underline; text-decoration-style: dotted; text-decoration-color: var(--orange);
    text-decoration-thickness: 1.5px; text-underline-offset: 3px;
  }
  .bs-gl-in:hover { text-decoration-style: solid; color: var(--orange); }
  .bs-gl-in:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

  .bs-gl-foot {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 18px 14px; border-top: 1px solid var(--sig-rule);
  }
  .bs-gl-key {
    min-height: 40px; padding: 0 16px;
    background: transparent; border: 1px solid var(--orange); color: var(--orange); cursor: pointer;
    font-family: var(--sig-mono); font-weight: 600; font-size: 12px; letter-spacing: 0.14em;
  }
  .bs-gl-key:hover { background: var(--orange); color: var(--accent-on-accent); }
  .bs-gl-key:focus-visible { outline: 2px solid var(--sig-ink); outline-offset: 2px; }
  .bs-gl-hint { font-size: 13px; color: var(--sig-ink-dim); line-height: 1.4; }

  @keyframes bsGlIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
  @media (prefers-reduced-motion: reduce) { .bs-gl-pop { animation: none; } }
  @media (forced-colors: active) {
    .bs-gl-pop { border: 2px solid CanvasText; }
    .bs-gl-head { border-bottom: 2px solid CanvasText; }
    abbr.bs-gl { border-bottom-color: CanvasText; }
  }
  @media (max-width: 599px) {
    .bs-gl-term { font-size: 24px; }
    .bs-gl-txt { font-size: 16px; }
    .bs-gl-lead { font-size: 17px; }
  }
}
