/*
  HD Admin docs theme ("Blue Glow").
  Deep blue-black with a blue brand, gradient header, soft glows. Every hue
  lives in the --hd-* knobs below, so retinting the whole site (see the blue
  lab in blue-lab.css) means redefining a dozen variables. The docs are pinned
  to the slate scheme in mkdocs.yml; the double attribute selector matches
  Material's own palette selectors' weight, or its deep-purple rules keep
  beating these variables for link colours

  Violet originals, for reverting the blue era entirely:
    accent #9c92ff | links #a89fff | pills #beb6ff | admonition #7066ff
    header gradient #2b1f5e #241a4e #1c1540 | banner gradient #251a52 #1d1440 #16122e
    borders rgba(140,128,255,x) | pill bg rgba(112,102,255,x) | keyword #c792ff
*/

/* Docs patterns, hd-admin only because they lean on the --hd-* knobs.
   nb-path renders a Studio menu trail as one chip with accent arrows
   between segments, authored as
   <span class="nb-path"><b>File</b><b>Security</b></span>.
   nb-tag is the small pill for step labels,
   <span class="nb-tag">Optional</span> */
.md-typeset .nb-path {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.45em;
  padding: 0.1em 0.6em;
  border: 1px solid rgba(var(--hd-tint), 0.25);
  border-radius: 6px;
  background: rgba(var(--hd-tint), 0.08);
  font-size: 0.85em;
}

.md-typeset .nb-path b {
  font-weight: 600;
}

.md-typeset .nb-path b + b::before {
  content: "▸";
  margin-right: 0.45em;
  color: var(--hd-accent);
  font-weight: 400;
}

/* The site's blue, lightened. Brighter fill and a paler text tone than the
   menu trail chips keep it readable as a label rather than a path */
.md-typeset .nb-tag {
  display: inline-block;
  padding: 0.05em 0.45em;
  border: 1px solid rgba(var(--hd-tint), 0.45);
  border-radius: 99px;
  background: rgba(var(--hd-tint), 0.22);
  color: #c3d0ff;
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: 0.12em;
  margin: 0 0.15em;
}

/* Required sits in the same family as Optional, just a touch deeper.
   Produced by [[#Required]] */
.md-typeset .nb-tag--required {
  border-color: rgba(var(--hd-strong-tint), 0.55);
  background: rgba(var(--hd-strong-tint), 0.28);
  color: #d4ddff;
}

/* Each side takes a hue of its own so a field reads without reading the word.
   These are the same three colours as the Task API pills, so a field and the
   member it points at always agree */
.md-typeset .nb-tag--server {
  border-color: rgba(96, 165, 250, 0.3);
  background: rgba(96, 165, 250, 0.12);
  color: #60a5fa;
}

.md-typeset .nb-tag--client {
  border-color: rgba(0, 200, 83, 0.3);
  background: rgba(0, 200, 83, 0.12);
  color: #4ade80;
}

.md-typeset .nb-tag--shared {
  border-color: rgba(192, 132, 252, 0.3);
  background: rgba(192, 132, 252, 0.12);
  color: #c084fc;
}

/* Videos dropped into doc pages fill the content column like images do */
.md-typeset video {
  width: 100%;
  height: auto;
  border-radius: 0.25rem;
}

/* The chip-browsable showcase, built by hooks/patterns.py from
   ::: showcase blocks and driven by javascripts/showcase.js */
.md-typeset .nb-showcase {
  margin: 1em 0;
}

/* Slim enough that all eight fit one desktop row, wrapping when the
   window can't fit them. Nothing hides and nothing scrolls */
.md-typeset .nb-showcase-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em;
  margin-bottom: 0.7em;
}

.md-typeset .nb-showcase-chip {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0.38em 0.78em;
  border: 1px solid rgba(var(--hd-tint), 0.35);
  border-radius: 99px;
  background: rgba(var(--hd-tint), 0.08);
  color: var(--md-default-fg-color);
  font: 600 0.62rem/1 var(--md-text-font-family, sans-serif);
  cursor: pointer;
}

.md-typeset .nb-showcase-chip:hover {
  border-color: var(--hd-accent);
  color: var(--hd-accent);
}

.md-typeset .nb-showcase-chip.is-active {
  background: var(--hd-accent-strong);
  border-color: transparent;
  color: #fff;
}

.md-typeset .nb-showcase-card {
  position: relative;
  border: 1px solid rgba(var(--hd-tint), 0.25);
  border-radius: 0.4rem;
  background: #0a0e16;
  overflow: hidden;
}

/* The stage takes its height from the active slide, so every clip spans
   the full card width at its own aspect ratio, no letterboxing */
.md-typeset .nb-showcase-stage {
  position: relative;
}

.md-typeset .nb-showcase-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.md-typeset .nb-showcase-slide.is-active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

/* A shimmering placeholder fills the reserved box until the media paints
   over it, then showcase.js flags the slide loaded to stop the animation */
.md-typeset .nb-showcase-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(var(--hd-tint), 0.05) 30%,
    rgba(var(--hd-tint), 0.16) 50%,
    rgba(var(--hd-tint), 0.05) 70%
  );
  background-size: 200% 100%;
  animation: nb-shimmer 1.4s linear infinite;
}

.md-typeset .nb-showcase-slide.is-loaded::before {
  display: none;
}

@keyframes nb-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.md-typeset .nb-showcase-media {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}

/* Videos carry no header dimensions, so reserve a 16:9 box for them */
.md-typeset video.nb-showcase-media {
  aspect-ratio: 16 / 9;
}

/* The slanted corner banner, a nod to the v2 BETA ribbon in the panel */
.md-typeset .nb-showcase-ribbon {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.45em 1.7em 0.45em 1em;
  clip-path: polygon(0 0, 100% 0, calc(100% - 1em) 100%, 0 100%);
  background: linear-gradient(120deg, var(--hd-accent-strong), var(--hd-accent));
  color: #fff;
  font: 700 0.72rem/1 var(--md-text-font-family, sans-serif);
  letter-spacing: 0.03em;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

/* Large edge arrows over the media for stepping through the slides */
.md-typeset .nb-showcase-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.3rem;
  height: 2.3rem;
  border: 1px solid rgba(var(--hd-tint), 0.35);
  border-radius: 50%;
  background: rgba(10, 14, 22, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #e6ecff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.md-typeset .nb-showcase-arrow:hover {
  border-color: var(--hd-accent);
  color: var(--hd-accent);
}

.md-typeset .nb-showcase-arrow.is-hidden {
  display: none;
}

.md-typeset .nb-showcase-arrow--prev {
  left: 0.7rem;
}

.md-typeset .nb-showcase-arrow--next {
  right: 0.7rem;
}

/* The caption floats over the media as a frosted panel on the right, so
   the clip runs the full card width behind it. On phones it drops to a
   solid strip below the media instead */
.md-typeset .nb-showcase-caption {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  max-height: 100%;
  width: 10.5rem;
  margin: 0;
  padding: 1em;
  border-left: 1px solid rgba(var(--hd-tint), 0.18);
  border-bottom: 1px solid rgba(var(--hd-tint), 0.18);
  border-bottom-left-radius: 0.4rem;
  background: rgba(10, 14, 22, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  overflow-y: auto;
  font-size: 0.7rem;
  color: var(--md-default-fg-color--light);
}

.md-typeset .nb-showcase-caption.is-active {
  display: block;
}

/* A slide written with no caption keeps its place in the list, so the chips
   still line up, and just never shows */
.md-typeset .nb-showcase-caption.nb-showcase-caption--none {
  display: none;
}

/* Slides flagged [below] in the showcase block keep the mobile treatment
   on every screen size */
.md-typeset .nb-showcase-caption--below {
  position: static;
  width: auto;
  border-left: 0;
  border-bottom: 0;
  border-top: 1px solid rgba(var(--hd-tint), 0.18);
  background: rgba(var(--hd-tint), 0.05);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@media (max-width: 44.9375em) {
  .md-typeset .nb-showcase-caption {
    position: static;
    width: auto;
    border-left: 0;
    border-top: 1px solid rgba(var(--hd-tint), 0.18);
    background: rgba(var(--hd-tint), 0.05);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Our own admonition type for media that could set off photosensitivity,
   written as `??? flashing "..."` so the clip stays unrendered until the
   reader opts in. Brand blue with Remix Icon's file-gif-fill mark, matching
   how theme.css colours the rest of the types */
:root {
  --md-admonition-icon--flashing: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16 2L20.9997 7L21 20.9925C21 21.5489 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5447 3 21.0082V2.9918C3 2.44405 3.44749 2 3.9985 2H16ZM13 10H12V15H13V10ZM11 10H9C7.89543 10 7 10.8954 7 12V13C7 14.1046 7.89543 15 9 15H10C10.5523 15 11 14.5523 11 14V12H9V13H10V14H9C8.44772 14 8 13.5523 8 13V12C8 11.4477 8.44772 11 9 11H11V10ZM17 10H14V15H15V13H17V12H15V11H17V10Z"/></svg>');
}

.md-typeset .flashing {
  --admonition-color: #5c7cff;
  border-color: #5c7cff;
}

.md-typeset .flashing > .admonition-title::before,
.md-typeset .flashing > summary::before {
  -webkit-mask-image: var(--md-admonition-icon--flashing);
  mask-image: var(--md-admonition-icon--flashing);
}

/* FAQ accordions, generated by hooks/patterns.py on pages with `faq: true`
   in their front matter. The !important pair beats the shared admonition
   glow that theme.css puts on every bare details element */
.md-typeset details.nb-faq {
  border: 1px solid rgba(var(--hd-tint), 0.22) !important;
  border-radius: 0.5rem;
  box-shadow: none !important;
  background: rgba(var(--hd-tint), 0.05) !important;
  padding: 0;
  margin: 0.55em 0;
}

.md-typeset details.nb-faq > summary {
  position: relative;
  cursor: pointer;
  list-style: none;
  margin: 0;
  padding: 0.75em 2.6em 0.75em 1em;
  font-weight: 600;
}

.md-typeset details.nb-faq > summary::-webkit-details-marker {
  display: none;
}

.md-typeset details.nb-faq > summary::before {
  display: none;
}

.md-typeset details.nb-faq > summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 0.9em;
  width: auto;
  height: auto;
  transform: translateY(-50%);
  background: none;
  -webkit-mask: none;
  mask: none;
  color: var(--hd-accent);
  font-size: 1.2em;
  font-weight: 500;
}

.md-typeset details.nb-faq[open] > summary::after {
  content: "−";
}

.md-typeset details.nb-faq > summary:hover {
  background: rgba(var(--hd-tint), 0.08);
}

.md-typeset details.nb-faq > :not(summary) {
  margin: 0 1em 0.9em;
}

/* The commands page. Each command is laid out like an API method, with the
   role it belongs to as the tag, in that role's colour */
.hd-api-tag--owner {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.hd-api-tag--dev {
  background: rgba(192, 132, 252, 0.12);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.3);
}

.hd-api-tag--admin {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.hd-api-tag--mod {
  background: rgba(96, 165, 250, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.hd-api-tag--fun {
  background: rgba(0, 200, 83, 0.12);
  color: #4ade80;
  border: 1px solid rgba(0, 200, 83, 0.3);
}

.hd-api-tag--player {
  background: rgba(161, 161, 170, 0.12);
  color: #a1a1aa;
  border: 1px solid rgba(161, 161, 170, 0.3);
}

/* The aliases and extra undo names under a command's description, one
   muted line of labelled chips */
.md-typeset .hd-cmd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em 1.4em;
  margin-top: 0.6em;
  font-size: 0.72rem;
  color: var(--md-default-fg-color--light);
}

.md-typeset .hd-cmd-meta__row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35em;
}

.md-typeset .hd-cmd-meta__key {
  margin-right: 0.15em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.6rem;
}

.md-typeset .hd-cmd-meta code {
  font-size: 0.68rem;
}

body[data-md-color-scheme="slate"][data-md-color-primary] {
  /* Theme knobs (Roblox Blue, anchored on #335FFF). Tints are r, g, b
     triplets for rgba() use */
  --hd-accent: #5c7cff;
  --hd-accent-strong: #335fff;
  --hd-link: #7d97ff;
  --hd-pill-text: #a5b6ff;
  --hd-tint: 92, 124, 255;
  --hd-strong-tint: 51, 95, 255;
  --hd-grad-1: #22307c;
  --hd-grad-2: #1a2560;
  --hd-grad-3: #131b48;
  --hd-bgrad-1: #192459;
  --hd-bgrad-2: #131b45;
  --hd-bgrad-3: #0d1334;
  --hd-keyword: #7d97ff;
  --hd-function: #66d9ff;
}
