/* ==========================================================================
   Platformscode Core - Documentation styles (DGA identity)
   Single right-side rail (brand · nav · language). No top header.
   Tokens lifted from the DGA source library so this reads as one family.
   Requires ../css/main.css (fonts + theme) loaded first.
   ========================================================================== */

:root {
  /* DGA sa-flag green + gold + neutrals */
  --g:          #1b8354;   /* sa-flag-600 primary */
  --g-strong:   #166a45;   /* 700 hover  */
  --g-active:   #14573a;   /* 800 active */
  --g-500:      #25935f;
  --g-200:      #b8eacb;
  --g-100:      #dff6e7;
  --g-50:       #f3fcf6;
  --gold:       #dba102;

  --ink:        #111927;   /* neutral-900 headings */
  --body:       #384250;   /* neutral-700 body */
  --muted:      #6c727e;   /* neutral-500 */
  --line:       #e5e7eb;   /* neutral-200 border */
  --line-soft:  #eef0f2;
  --soft:       #f9fafb;   /* neutral-50 */
  --soft-2:     #f3f4f6;   /* neutral-100 */
  --white:      #fff;

  /* code block: light, per DGA (#f7f7f7) */
  --code-bg:    #f6f8f7;
  --code-fg:    #1f2a37;
  --code-bar:   #eef1f0;

  --rail-w: 290px;
  --toc-w:  232px;
  --nav-h:  0px;

  /* z-scale */
  --z-rail: 40;
  --z-backdrop: 45;
  --z-rail-open: 50;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

body.docs-body {
  margin: 0;
  background: var(--white);
  color: var(--body);
  font-family: "IBMPlexSansArabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* The shell strips link chrome from its own navigation only. A component's own
   anchors keep whatever the component decided - otherwise the docs page shows
   something different from what the library actually ships. */
.docs-body a:not([class*="pfc-"]) { text-decoration: none; color: inherit; }
/* Link-buttons must keep their own text color, not inherit the docs body color. */
.docs-body a.pfc-btn { color: var(--pfc-btn-color); }
/* Same for the link component: `color: inherit` above outranks `.pfc-link`, so
   every documented link rendered grey instead of its own brand colour. Restore
   the component's own scale, state by state. */
.docs-body a.pfc-link { color: var(--pfc-link-color); }
.docs-body a.pfc-link:hover,
.docs-body a.pfc-link.pfc-state-hover { color: var(--pfc-link-color-hover); }
.docs-body a.pfc-link:active,
.docs-body a.pfc-link.pfc-state-pressed { color: var(--pfc-link-color-active); }
.docs-body a.pfc-link:focus-visible,
.docs-body a.pfc-link.pfc-state-focus { color: var(--pfc-link-color-focus); }
.docs-body a.pfc-link:visited { color: var(--pfc-link-color-visited); }
.docs-body a.pfc-link.pfc-link--disabled { color: var(--pfc-link-color-disabled); }
/* Same story for footer links inside a live example: `color: inherit` outranks
   `.pfc-footer__link`, so the resting sample rendered in the ground colour
   instead of its own. :where() keeps this at the same specificity as that
   rule, so it wins only on order - `.pfc-footer--dark .pfc-footer__link` and
   every `pfc-state-*` pin still outrank it. Scoped to example previews so the
   shell's own footer is untouched. Value mirrors css/main.css
   `.pfc-footer__link`. */
:where(.docs-example__preview) a.pfc-footer__link { color: #384250; }

/* ============================================================ Shell layout */
.docs-shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--toc-w);
  align-items: start;
  min-height: 100vh;
}
.docs-shell--no-toc { grid-template-columns: var(--rail-w) minmax(0, 1fr); }

/* ================================================================== Rail   */
.docs-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
  border-inline-start: 1px solid var(--line);
  z-index: var(--z-rail);
}

.docs-rail__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.docs-rail__authority-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: 40px;
  flex: 0 1 auto;
  min-width: 0;
}
.docs-rail__version {
  flex: 0 0 auto;
  font-size: .68rem;
  font-weight: 700;
  color: var(--g-strong);
  background: var(--g-50);
  border: 1px solid var(--g-200);
  padding: 2px 7px;
  border-radius: 999px;
}

.docs-rail__nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 20px;
  scrollbar-width: thin;
}
.docs-rail__nav::-webkit-scrollbar { width: 8px; }
.docs-rail__nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

.docs-rail__links { list-style: none; margin: 0 0 6px; padding: 0; }
.docs-rail__links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--body);
  font-size: .93rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.docs-rail__links a i { font-size: 1.15rem; color: var(--muted); }
.docs-rail__links a:hover { background: var(--soft-2); color: var(--ink); }

.docs-rail__sep { height: 1px; background: var(--line); margin: 10px 8px 6px; }

/* nav groups */
.docs-nav__group { margin-bottom: 2px; }
.docs-nav__head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: var(--ink);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .15s;
}
.docs-nav__head:hover { background: var(--soft-2); }
.docs-nav__head > i:first-child { font-size: 1.15rem; color: var(--g); }
.docs-nav__chevron { margin-inline-start: auto; font-size: .9rem; color: var(--muted); transition: transform .2s var(--ease); }
.docs-nav__group.is-collapsed .docs-nav__chevron { transform: rotate(90deg); }
[dir="ltr"] .docs-nav__group.is-collapsed .docs-nav__chevron { transform: rotate(-90deg); }

/* The rail nests one level: scope → group → page. A nested group steps in and
   drops a weight so the scope above it stays the heading the eye lands on. */
.docs-nav__group--level-1 {
  margin-inline-start: 10px;
  margin-bottom: 0;
}
.docs-nav__group--level-1 > .docs-nav__head {
  padding-block: 8px;
  font-size: .79rem;
  font-weight: 600;
  color: var(--body);
}
.docs-nav__group--level-1 > .docs-nav__head > i:first-child {
  font-size: 1rem;
  color: var(--muted);
}
.docs-nav__group--level-1 > .docs-nav__list {
  margin-bottom: 4px;
  padding-inline-start: 14px;
}

.docs-nav__list {
  list-style: none;
  margin: 2px 0 8px;
  padding: 0;
  padding-inline-start: 20px;
}
.docs-nav__group.is-collapsed .docs-nav__list { display: none; }

.docs-nav__list a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
  transition: background .15s, color .15s;
}
.docs-nav__list a:hover { background: var(--soft-2); color: var(--g-strong); }
.docs-nav__list a.is-active {
  background: var(--g-50);
  color: var(--g-strong);
  font-weight: 600;
}

/* A single link at scope level (the enablers catalogue): the weight of a
   scope head so it reads as a peer of the scopes around it, but no chevron -
   there is nothing under it to open. */
.docs-nav__solo-wrap { margin-bottom: 2px; }
.docs-body a.docs-nav__solo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .01em;
  transition: background .15s, color .15s;
}
.docs-nav__solo > i { font-size: 1.15rem; color: var(--g); }
.docs-body a.docs-nav__solo:hover { background: var(--soft-2); }
.docs-body a.docs-nav__solo.is-active { background: var(--g-50); color: var(--g-strong); }
.docs-nav__solo:focus-visible { outline: 2px solid var(--g); outline-offset: 2px; }

.docs-rail__foot { padding: 12px; border-top: 1px solid var(--line); }
.docs-lang {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--soft-2);
  border-radius: 11px;
}
.docs-lang button {
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.docs-lang button.is-active {
  background: var(--white);
  color: var(--g-strong);
  box-shadow: 0 1px 2px rgba(16, 25, 39, .08);
}

/* mobile toggle + backdrop (created by JS) */
.docs-rail__toggle {
  display: none;
  position: fixed;
  inset-block-start: 14px;
  inset-inline-end: 14px;
  z-index: var(--z-rail-open);
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  color: var(--g-strong);
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(16, 25, 39, .1);
}
.docs-rail__backdrop { display: none; }

/* ================================================================== Main   */
.docs-main {
  min-width: 0;
  padding: 46px 60px 110px;
  max-width: 1040px;
}

.docs-main > header { margin-bottom: 8px; }
.docs-main h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 14px;
  line-height: 1.18;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.docs-lead {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 68ch;
  margin: 0;
  line-height: 1.75;
}

/* ======================================================= Branded footer   */
.docs-site-footer {
  width: 100%;
  margin: 0;
  border-top: 1px solid var(--line);
}
.docs-site-footer .pfc-footer__content {
  max-width: 100%;
}

/* breadcrumb - the shell uses the library component itself (pfc-breadcrumb),
   so states, colours and the RTL arrow flip all come from css/main.css.
   Nothing here may override them: spacing only. */
.docs-crumb { margin-bottom: 18px; }

/* ------------------------------------------------- Template live frames    */
.docs-frame {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  margin: 18px 0 10px;
}
.docs-frame iframe {
  display: block;
  width: 100%;
  height: 460px;
  border: 0;
}
.docs-frame--tall iframe { height: 640px; }
.docs-frame__actions { display: flex; gap: 10px; margin: 0 0 6px; }

/* sections */
.docs-section { scroll-margin-top: 24px; padding-top: 48px; }
.docs-section > h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.docs-section > h3 { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin: 30px 0 8px; }
/* Prose only. A bare `.docs-section p` also matched paragraphs belonging to a
   demonstrated component and quietly repainted them - which is how the digital
   stamp's label ended up grey instead of #222222. Excluding the component's own
   paragraphs leaves the component to style itself. */
/* The shell styles its own prose. A paragraph that lives INSIDE a component
   belongs to that component - the class guard alone missed those, so a hero
   slide's text was repainted the shell's grey on its green ground. :where()
   carries no specificity, so this only narrows what the rule matches. */
.docs-section p:not([class*="pfc-"]):not(:where([class*="pfc-"]) p) { color: var(--body); max-width: 70ch; line-height: 1.8; }

.docs-section :not(pre):not(.pfc-code-snippet__display) > code,
.docs-lead code {
  font-family: var(--bs-font-monospace, "Roboto Mono", monospace);
  font-size: .86em;
  background: var(--soft-2);
  color: var(--g-strong);
  padding: .14em .44em;
  border-radius: 6px;
  direction: ltr;
  unicode-bidi: embed;
  display: inline-block;
}

/* ===================================================== Example (tabbed)    */
.docs-example {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin: 18px 0 8px;
  background: var(--white);
}
.docs-example__tabs {
  display: flex;
  gap: 4px;
  padding: 8px 10px 0;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}
.docs-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  padding: 9px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.docs-tab i { font-size: 1.05rem; }
.docs-tab:hover { color: var(--ink); }
.docs-tab.is-active { color: var(--g-strong); border-bottom-color: var(--g); }

.docs-panel[hidden] { display: none; }

.docs-example__preview {
  padding: 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  background:
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 22px 22px,
    var(--white);
}
.docs-example__preview--plain { background: var(--white); }
/* A demo that opens a floating panel needs the room to show it, and must
   not be clipped by the example box. */
.docs-example__preview--roomy { overflow: visible; }
/* A demo wider than the column scrolls inside its own box - the page itself
   must never scroll sideways. Opt-in, because a scroll container would clip
   the popups that most previews rely on. */
.docs-example__preview--scroll-x { overflow-x: auto; }
.docs-example__preview--dark { background: var(--g); }
/* «على خلفية داكنة (On-Color)» - an on-color demo needs a dark ground, and it
   has to be declared here: a ground set on the component side loses to the
   preview's own background, which is declared later in this file. */
.docs-example__preview--on-color { background: #101828; }
.docs-example__preview--stack { flex-direction: column; align-items: stretch; }
.docs-example__preview--datepicker {
  min-height: 440px;
  align-items: flex-start;
  overflow: visible;
}

@media (max-width: 520px) {
  .docs-example__preview--datepicker { min-height: 420px; padding: 22px 16px; }
}

/* code block (light) - used inside example tab OR standalone (.docs-codeblock) */
.docs-codeblock {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin: 18px 0;
}
.docs-code { background: var(--code-bg); }
.docs-code__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--code-bar);
  border-bottom: 1px solid var(--line);
}
.docs-code__lang { font-size: .72rem; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.docs-code__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--body);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.docs-code__copy:hover { background: var(--soft-2); color: var(--ink); }
.docs-code__copy.is-copied { background: var(--g); border-color: var(--g); color: #fff; }
.docs-code pre { margin: 0; padding: 16px 18px; overflow-x: auto; direction: ltr; text-align: left; }
.docs-code pre code {
  font-family: var(--bs-font-monospace, "Roboto Mono", monospace);
  font-size: .84rem;
  line-height: 1.7;
  color: var(--code-fg);
  white-space: pre;
}

/* ============================================================= Callout     */
.docs-callout {
  display: flex;
  gap: 12px;
  border: 1px solid var(--g-200);
  background: var(--g-50);
  border-radius: 12px;
  padding: 15px 17px;
  margin: 20px 0;
}
.docs-callout__icon { flex: none; font-size: 1.25rem; color: var(--g); margin-top: 1px; }
.docs-callout p { margin: 0; color: var(--body); max-width: none; }
.docs-callout strong { color: var(--g-strong); }

/* ============================================================= Cards       */
.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.docs-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  background: var(--white);
}
.docs-card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--g-50);
  color: var(--g);
  font-size: 1.3rem;
  margin-bottom: 14px;
}
.docs-card h3 { font-size: 1.02rem; font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.docs-card p { font-size: .92rem; color: var(--muted); margin: 0; line-height: 1.6; max-width: none; }

/* ============================================================= Swatches    */
.docs-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.docs-swatch {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
}
.docs-swatch__chip { height: 76px; }
.docs-swatch__meta { padding: 10px 12px; }
.docs-swatch__name { font-size: .85rem; font-weight: 600; color: var(--ink); }
.docs-swatch__hex {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-family: var(--bs-font-monospace, monospace);
  font-size: .78rem;
  color: var(--muted);
  cursor: copy;
  direction: ltr;
}
.docs-swatch__hex:hover { color: var(--g-strong); }
.docs-swatch__hex.is-copied { color: var(--g); }
.docs-swatch__hex i { font-size: .85rem; opacity: .55; }

/* full-bleed color ramp row */
.docs-ramp { display: flex; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); margin: 14px 0; }
.docs-ramp__step { flex: 1; height: 64px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 5px; font-size: .66rem; font-family: var(--bs-font-monospace, monospace); }

/* ============================================================= Table       */
.docs-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .92rem; }
.docs-table th, .docs-table td { text-align: start; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.docs-table th { background: var(--soft); color: var(--ink); font-weight: 700; white-space: nowrap; }
.docs-table td { color: var(--body); }
.docs-table td code {
  background: var(--soft-2);
  color: var(--g-strong);
  padding: .1em .42em;
  border-radius: 5px;
  font-size: .85em;
  font-family: var(--bs-font-monospace, monospace);
  direction: ltr;
  display: inline-block;
}

/* ============================================================= Home hero   */
.docs-home { padding: 0; max-width: none; }
.docs-home__hero {
  padding: 56px 60px 48px;
  background:
    radial-gradient(900px 380px at 15% 100%, var(--g-100), transparent 70%),
    linear-gradient(180deg, var(--g-50), var(--white));
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.docs-home__hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, .9fr);
  align-items: center;
  gap: 40px;
  max-width: 1180px;
}
.docs-home__hero-art img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 700px;
  margin-inline-start: auto;
}
@media (min-width: 1500px) {
  .docs-home__hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr); }
}
.docs-home__kicker {
  color: var(--g);
  font-weight: 700;
  font-size: .95rem;
  margin: 0 0 12px;
}
.docs-home__hero h1 { font-size: 2rem; max-width: none; white-space: nowrap; }
.docs-home__hero .docs-lead { max-width: 52ch; }
.docs-home__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.docs-home__body { padding: 44px 60px 110px; max-width: 1040px; }

/* audience cards (designers / developers) */
.docs-home__audiences {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.docs-audience {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  padding: 28px;
}
.docs-audience__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--g);
  color: #fff;
  font-size: 1.5rem;
  margin-bottom: 16px;
}
.docs-audience h2 { font-size: 1.35rem; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.docs-audience p { margin: 0 0 16px; color: var(--body); line-height: 1.75; }
.docs-audience__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--g-strong);
  font-weight: 700;
  font-size: .95rem;
}
.docs-audience__link:hover { color: var(--g-active); }
[dir="ltr"] .docs-audience__link i { transform: scaleX(-1); }

/* ================================================================== TOC    */
.docs-toc {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 48px 22px;
  border-inline-end: 1px solid var(--line);
}
.docs-toc__title { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.docs-toc__list { list-style: none; margin: 0; padding: 0; }
.docs-toc__list a {
  display: block;
  padding: 6px 12px;
  border-radius: 7px;
  color: var(--muted);
  font-size: .87rem;
  line-height: 1.45;
  transition: color .15s, background .15s;
}
.docs-toc__list a:hover { color: var(--g-strong); background: var(--soft-2); }
.docs-toc__list a.is-active { color: var(--g-strong); background: var(--g-50); font-weight: 600; }

/* ============================================================= Responsive  */
@media (max-width: 1180px) {
  .docs-shell { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .docs-toc { display: none; }
}

@media (max-width: 1280px) {
  .docs-home__hero-grid { grid-template-columns: minmax(0, 1fr); }
  .docs-home__hero-art { display: none; }
  .docs-home__hero h1 { white-space: normal; }
}

@media (max-width: 860px) {
  .docs-shell, .docs-shell--no-toc { grid-template-columns: minmax(0, 1fr); }
  .docs-rail__toggle { display: grid; place-items: center; }
  .docs-main { min-width: 0; padding: 30px 20px 80px; }
  .docs-table { display: block; max-width: 100%; overflow-x: auto; }
  .docs-code, .docs-codeblock, .docs-code pre { max-width: 100%; }
  .docs-home__hero { padding: 56px 20px 44px; }
  .docs-home__hero h1 { font-size: 2.1rem; }
  .docs-home__body { padding: 36px 20px 80px; }
  .docs-site-footer { margin: 0; }

  .docs-rail {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(320px, 86vw);
    transform: translateX(-110%);
    transition: transform .28s var(--ease);
    z-index: var(--z-rail-open);
    border-inline-start: 0;
    box-shadow: 0 10px 40px rgba(16, 25, 39, .2);
  }
  [dir="rtl"] .docs-rail { transform: translateX(110%); }
  .docs-rail.is-open { transform: translateX(0); }
  .docs-rail__backdrop.is-open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(16, 25, 39, .42);
    z-index: var(--z-backdrop);
  }
}

/* AI banner on the home hero - the success/colored alert variant supplies
   the approved light-green information state; this block only handles placement. */
.docs-home__ai-banner {
  max-width: 1180px;
  margin-top: 40px;
}
.docs-home__ai-banner .pfc-alert__header { align-items: center; }
.docs-home__ai-banner .pfc-alert__title { text-wrap: balance; }
.docs-home__ai-banner .pfc-alert__content { text-wrap: pretty; }
.docs-home__ai-banner-cta { flex: 0 0 auto; margin-inline-start: auto; white-space: nowrap; }
@media (max-width: 700px) {
  .docs-home__ai-banner-cta { width: 100%; justify-content: center; margin-inline-start: 0; }
}

/* AI prompt copy button (every docs page) */
.docs-ai-prompt {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 22px;
}
.docs-ai-prompt__hint {
  color: var(--pfc-text-paragraph);
  font-size: .85rem;
  max-width: 46ch;
  line-height: 1.6;
}

/* Najran University initiative branding (home page) */
.docs-home__initiative-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(16, 25, 39, .05);
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink);
}
.docs-home__initiative-badge img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.docs-home__hero-art--logo {
  display: flex;
  align-items: center;
  justify-content: center;
}
.docs-home__hero-art--logo img {
  width: auto;
  max-width: 340px;
  max-height: 300px;
}
.docs-home__initiative-note {
  color: #4b5563;
  font-size: 1rem;
  line-height: 1.7;
  max-width: 54ch;
  margin: 14px 0 0;
}
.docs-home__hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.docs-initiative__logo {
  flex: 0 0 auto;
}
.docs-initiative__logo img {
  display: block;
  width: 190px;
  height: auto;
}
.docs-initiative__copy h2 { margin-top: 0; }
.docs-initiative__copy p { max-width: 62ch; }
.docs-initiative__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.docs-initiative__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--g-50);
  color: var(--g);
  font-size: .85rem;
  font-weight: 700;
}
.docs-initiative__chip i { font-size: 15px; }
@media (max-width: 700px) {
  .docs-initiative { flex-direction: column; align-items: flex-start; gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------------------------------------------- Source coverage map */
.docs-map th:first-child, .docs-map td:first-child { width: 26%; }
.docs-map td { vertical-align: top; }
.docs-map__tag { color: var(--pfc-text-tertiary); font-size: 12px; line-height: 1.7; }
.docs-map__tag code { font-size: 11px; }
.docs-map__sep { opacity: .5; }
.docs-map__hook { color: var(--pfc-text-tertiary); font-size: 11px; }
.docs-map__none { color: var(--pfc-text-tertiary); font-size: 12px; font-style: italic; }

/* ---------------------------------------------- React comparison */
.docs-cmp {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.docs-cmp__side {
  border: 1px solid var(--pfc-border-neutral);
  border-radius: 8px;
  overflow: hidden;
  min-width: 0;
}
.docs-cmp__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-block-end: 1px solid var(--pfc-border-neutral);
  background: var(--pfc-bg-disabled);
  font-size: 12px;
}
.docs-cmp__head code { font-size: 12px; }
.docs-cmp__badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  flex-shrink: 0;
}
.docs-cmp__badge--react { background: #61698c; }
.docs-cmp__badge--pfc { background: var(--bs-primary); }
/* Code is always LTR, even on an RTL page. */
.docs-cmp__side pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 14px 16px;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
}
.docs-cmp__side pre code { font-size: 12px; line-height: 1.65; }
.docs-cmp__tag {
  font-size: 13px;
  font-weight: 400;
  color: var(--pfc-text-tertiary);
  margin-inline-start: 8px;
}
.docs-cmp__note {
  margin-block-start: 12px;
  font-size: 14px;
  color: var(--pfc-text-paragraph);
}
@media (max-width: 900px) {
  .docs-cmp { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------- React API section */
.docs-react-tag {
  font-family: ui-monospace, Consolas, monospace;
  font-size: .72em;
  font-weight: 400;
  color: var(--pfc-text-paragraph-secondary, #6c737f);
  background: var(--docs-code-bg, #f3f4f6);
  border-radius: 4px;
  padding: 2px 8px;
  margin-inline-start: 8px;
  vertical-align: middle;
}
.docs-react-events { margin-block-start: 8px; }
/* JSX is authored left-to-right whatever the page language */
.docs-code--react pre { direction: ltr; text-align: left; }
.docs-affix-variant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 20px;
  align-items: start;
}

.docs-affix-variant {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.docs-affix-variant small {
  color: #6c737f;
}

.docs-textarea-state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  align-items: start;
}

.docs-textarea-state-grid .pfc-form-control {
  min-width: 0;
}

.docs-textarea-state-grid .pfc-textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* Tooltip documentation: keep each 240px specimen in its own measured stage.
   The production tooltip remains absolutely positioned; only these always-open
   reference specimens are laid out in normal flow to avoid visual collisions. */
.docs-body[data-docs-page="tooltip"] .docs-tooltip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 24px;
  align-items: stretch;
}

.docs-body[data-docs-page="tooltip"] .docs-tooltip-demo {
  min-width: 0;
  padding: 20px;
  border: 1px solid #d2d6db;
  border-radius: 12px;
  background: #f9fafb;
}

.docs-body[data-docs-page="tooltip"] .docs-tooltip-demo__label {
  display: block;
  margin-block-end: 20px;
  color: #384250;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}

.docs-body[data-docs-page="tooltip"] .docs-tooltip-demo__stage {
  display: flex;
  min-height: 132px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  direction: ltr;
}

.docs-body[data-docs-page="tooltip"] .docs-tooltip-demo .pfc-tooltip {
  position: relative;
  inset: auto;
  display: block;
  flex: 0 1 auto;
  width: min(240px, 100%);
  min-width: 0;
  transform: none;
  direction: rtl;
}

html[dir="ltr"] .docs-body[data-docs-page="tooltip"] .docs-tooltip-demo .pfc-tooltip {
  direction: ltr;
}

.docs-body[data-docs-page="tooltip"] .docs-tooltip-demo__trigger {
  display: grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #384250;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.docs-body[data-docs-page="tooltip"] .docs-tooltip-demo--top .docs-tooltip-demo__stage {
  flex-direction: column;
}

.docs-body[data-docs-page="tooltip"] .docs-tooltip-demo--bottom .docs-tooltip-demo__stage {
  flex-direction: column;
}

.docs-body[data-docs-page="tooltip"] .docs-tooltip-demo--inverted {
  grid-column: 1 / -1;
}

.docs-body[data-docs-page="tooltip"] .docs-tooltip-demo--inverted .docs-tooltip-demo__stage {
  max-width: 320px;
  margin-inline: auto;
}

.docs-body[data-docs-page="tooltip"] .docs-tooltip-grid--alignment .docs-tooltip-demo__stage {
  width: min(100%, 272px);
  margin-inline: auto;
}

.docs-body[data-docs-page="tooltip"] .docs-tooltip-demo--align-start .docs-tooltip-demo__trigger {
  align-self: flex-end;
  margin-inline-end: 14px;
}

.docs-body[data-docs-page="tooltip"] .docs-tooltip-demo--align-end .docs-tooltip-demo__trigger {
  align-self: flex-start;
  margin-inline-start: 14px;
}

html[dir="ltr"] .docs-body[data-docs-page="tooltip"] .docs-tooltip-demo--align-start .docs-tooltip-demo__trigger {
  align-self: flex-start;
}

html[dir="ltr"] .docs-body[data-docs-page="tooltip"] .docs-tooltip-demo--align-end .docs-tooltip-demo__trigger {
  align-self: flex-end;
}

@media (max-width: 520px) {
  .docs-body[data-docs-page="tooltip"] .docs-tooltip-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .docs-body[data-docs-page="tooltip"] .docs-tooltip-demo {
    padding: 16px;
  }

  .docs-body[data-docs-page="tooltip"] .docs-tooltip-demo--right .docs-tooltip-demo__stage,
  .docs-body[data-docs-page="tooltip"] .docs-tooltip-demo--left .docs-tooltip-demo__stage {
    min-height: 148px;
  }
}

@media (max-width: 760px) {
  .docs-affix-variant-grid {
    grid-template-columns: 1fr;
  }
}
