/*
 * ============================================================
 *  UbuntuPlay — UbuntuPlay Hub
 *  Copyright © 2024-2026 Zipangile. All rights reserved.
 *
 *  Developer : Sobhuza Ziba
 *  Company   : Zipangile
 *  Product   : UbuntuPlay
 *
 *  This software and all its modules, features, algorithms,
 *  protocols, UI designs, and associated files are the
 *  exclusive intellectual property of Zipangile.
 *  Unauthorised copying, modification, distribution, or use
 *  of any part of this system — in whole or in part — is
 *  strictly prohibited without the express written permission
 *  of Zipangile.
 *
 *  For licensing enquiries: legal@zipangile.com
 * ============================================================
 */


@import url('/fonts.css');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

.material-symbols-outlined, .ms-icon {
  font-family: 'Material Symbols Outlined', sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'liga';
  vertical-align: middle;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Palette — Landing System v2 light (token names kept from the wood era).
     DESIGN TOKEN CONTRACT: values must match public/landing.css (canonical) —
     ink #1B1C1A, surface #FAF8F4, forest #2D6A4F, text-safe gold #8A6408.
     Note the inverted names: --cream here is the near-black TEXT color. */
  --soil:     #FAF8F4;   /* page background */
  --bark:     #FFFFFF;   /* panels */
  --wood:     #F1EDE5;   /* elevated panels */
  --plank:    #E7E1D5;   /* highest elevation */
  --amber:    #9A6E08;   /* accent labels */
  --gold:     #8A6408;   /* links */
  --gold-lt:  #B8860B;   /* emphasis */
  --cream:    #1B1C1A;   /* primary text */
  --ivory:    #141512;   /* headings */
  --muted:    rgba(27, 28, 26, 0.62);  /* >= 4.5:1 on --soil (WCAG 1.4.3); was 0.5 (~3.3:1) */
  --muted-lt: rgba(27, 28, 26, 0.72);
  --moss:     #2D6A4F;
  --moss-lt:  #40916C;
  --sky:      #1356A0;
  --red:      #8B2E14;
  --border:   rgba(27, 28, 26, 0.10);
  --border-md:rgba(27, 28, 26, 0.16);
  --border-lt:rgba(27, 28, 26, 0.06);

  /* Typography */
  --serif: var(--font-serif);
  --sans:  var(--font-sans);
  --mono:  var(--font-mono);

  /* Layout */
  --sidebar-w: 272px;
  --toc-w:     220px;
  --content-max: 720px;
  --topbar-h:  56px;
}

/* ── Keyboard focus (WCAG 2.4.7) ── */
:focus-visible {
  outline: 3px solid var(--moss);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Skip link (WCAG 2.4.1) — injected by docs.js ── */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 2000;
  background: var(--cream); color: var(--soil);
  padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px;
  text-decoration: none; transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

html { scroll-behavior: smooth; font-size: 15px; }
body {
  font-family: var(--sans);
  background: var(--soil);
  background-image:
    radial-gradient(at 0% 0%, rgba(45, 106, 79, 0.06) 0px, transparent 52%),
    radial-gradient(at 100% 0%, rgba(212, 160, 23, 0.06) 0px, transparent 52%);
  background-attachment: fixed;
  color: var(--cream);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bark); }
::-webkit-scrollbar-thumb { background: var(--plank); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--amber); }

/* ── Selection ── */
::selection { background: rgba(200,134,10,.25); color: var(--ivory); }

/* ── Top bar ── */
.docs-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 0 rgba(255,255,255,0.55) inset, 0 4px 14px rgba(27,28,26,0.05);
  display: flex; align-items: center; gap: 0;
  padding: 0;
}

.topbar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 0 24px; height: 100%;
  text-decoration: none; white-space: nowrap;
  border-right: 1px solid var(--border);
}
.topbar-logo span { color: var(--amber); }

.topbar-divider {
  width: 1px; height: 20px; background: var(--border-md);
  margin: 0 16px;
}

.topbar-section {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  color: var(--muted); text-transform: uppercase;
}

.topbar-search {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
  padding-right: 24px;
}

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--wood); border: 1px solid var(--border-md);
  border-radius: 8px; padding: 7px 14px;
  cursor: pointer; transition: all .2s;
  width: 220px;
}
.search-box:hover { border-color: rgba(200,134,10,.4); }
.search-box:focus-within { border-color: var(--moss); box-shadow: 0 0 0 3px rgba(45,106,79,0.15); }
.search-box input {
  background: none; border: none; outline: none;
  font-family: var(--sans); font-size: 13px;
  color: var(--cream); width: 100%;
}
.search-box input::placeholder { color: var(--muted); }
.search-kbd {
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  background: var(--plank); padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--border-md); flex-shrink: 0;
}

.topbar-links {
  display: flex; align-items: center; gap: 4px;
  padding: 0 12px;
  border-left: 1px solid var(--border);
}
.topbar-link {
  padding: 6px 10px; border-radius: 6px;
  font-size: 13px; color: var(--muted-lt);
  text-decoration: none; transition: all .15s;
}
.topbar-link:hover { color: var(--cream); background: rgba(200,134,10,.07); }

/* ── Layout ── */
.docs-layout {
  display: flex;
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
}

/* ── Sidebar ── */
.docs-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  border-right: 1px solid var(--border-lt);
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 24px 0 48px;
}

.sidebar-group { margin-bottom: 8px; }

.sidebar-group-label {
  font-family: var(--mono);
  font-size: 10px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--amber);
  padding: 12px 24px 6px;
  display: flex; align-items: center; gap: 8px;
}
.sidebar-group-label::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(to right, var(--border-md), transparent);
}

.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 24px;
  font-size: 13px; color: var(--muted-lt);
  text-decoration: none;
  transition: all .15s;
  position: relative;
  border-left: 2px solid transparent;
  margin-left: -1px;
}
.sidebar-link:hover {
  color: var(--cream);
  background: rgba(200,134,10,.05);
}
.sidebar-link.active {
  color: var(--gold);
  background: rgba(200,134,10,.08);
  border-left-color: var(--amber);
}
.sidebar-link .link-icon {
  font-size: 14px; width: 18px; text-align: center; flex-shrink: 0;
}
.sidebar-badge {
  margin-left: auto;
  font-family: var(--mono); font-size: 9px; letter-spacing: .06em;
  padding: 2px 6px; border-radius: 10px;
  background: rgba(200,134,10,.15); color: var(--amber);
  text-transform: uppercase;
}

/* ── Main content ── */
.docs-content {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.docs-article {
  width: 100%;
  max-width: calc(var(--content-max) + var(--toc-w) + 48px);
  display: flex;
  gap: 48px;
  padding: 48px 40px;
  align-items: flex-start;
}

.docs-main {
  flex: 1;
  min-width: 0;
  max-width: var(--content-max);
}

/* ── TOC (right rail) ── */
.docs-toc {
  width: var(--toc-w);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--topbar-h) + 48px);
  max-height: calc(100vh - var(--topbar-h) - 96px);
  overflow-y: auto;
}
.toc-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--amber);
  margin-bottom: 12px;
}
.toc-link {
  display: block; padding: 4px 0 4px 12px;
  font-size: 12px; color: var(--muted);
  text-decoration: none;
  border-left: 1px solid var(--border-md);
  transition: all .15s; line-height: 1.4;
}
.toc-link:hover { color: var(--cream); border-left-color: var(--amber); }
.toc-link.active { color: var(--gold); border-left-color: var(--gold); }
.toc-link.toc-h3 { padding-left: 24px; font-size: 11px; }

/* ── Typography ── */
.docs-main h1 {
  font-family: var(--serif);
  font-size: 2.4rem; font-weight: 700;
  line-height: 1.15; color: var(--ivory);
  margin-bottom: 16px;
  letter-spacing: -.02em;
}
.docs-main .doc-lead {
  font-size: 1.05rem; color: var(--muted-lt); line-height: 1.7;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.docs-main h2 {
  font-family: var(--serif);
  font-size: 1.45rem; font-weight: 600;
  color: var(--ivory); line-height: 1.25;
  margin: 48px 0 16px;
  padding-top: 48px;
  border-top: 1px solid var(--border-lt);
  scroll-margin-top: calc(var(--topbar-h) + 24px);
}
.docs-main h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.docs-main h3 {
  font-size: .95rem; font-weight: 600;
  color: var(--cream); margin: 28px 0 10px;
  scroll-margin-top: calc(var(--topbar-h) + 24px);
}
.docs-main h4 {
  font-size: .875rem; font-weight: 600;
  color: var(--muted-lt); text-transform: uppercase;
  letter-spacing: .06em; font-family: var(--mono);
  margin: 20px 0 8px;
}
.docs-main p {
  color: rgba(27,28,26,0.72); margin-bottom: 16px;
  max-width: 66ch; line-height: 1.75;
}
.docs-main a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(232,160,32,.3); transition: border-color .15s; }
.docs-main a:hover { border-bottom-color: var(--gold); }
.docs-main ul, .docs-main ol {
  color: rgba(27,28,26,0.72); padding-left: 20px;
  margin-bottom: 16px; max-width: 64ch;
}
.docs-main li { margin-bottom: 6px; padding-left: 4px; }
.docs-main li::marker { color: var(--amber); }
.docs-main strong { color: var(--ivory); font-weight: 600; }
.docs-main em { color: var(--gold-lt); font-style: italic; }

/* ── Inline code ── */
.docs-main code {
  font-family: var(--mono); font-size: .8em;
  background: rgba(200,134,10,.1);
  border: 1px solid rgba(200,134,10,.2);
  color: var(--gold-lt); padding: 2px 7px;
  border-radius: 5px;
}

/* ── Code blocks (stay dark — code reads best on a dark panel) ── */
.code-block {
  position: relative;
  background: #201A11;
  border: 1px solid rgba(200,134,10,.25);
  border-radius: 14px;
  margin: 20px 0 28px;
  overflow: hidden;
}
.code-block-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.code-lang {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(240,223,192,.55);
}
.copy-btn {
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em;
  text-transform: uppercase; color: rgba(240,223,192,.55);
  background: none; border: 1px solid rgba(240,223,192,.25);
  padding: 3px 10px; border-radius: 99px; cursor: pointer;
  transition: all .15s;
}
.copy-btn:hover { color: #F0DFC0; border-color: #C8860A; }
.copy-btn.copied { color: #8FBC6A; border-color: #8FBC6A; }
.code-block pre {
  padding: 20px; overflow-x: auto;
  font-family: var(--mono); font-size: 12.5px;
  line-height: 1.8; color: #C8B898;
}
.code-block pre .cm { color: #5A7050; }
.code-block pre .kw { color: #E8A020; }
.code-block pre .st { color: #8FBC6A; }
.code-block pre .fn { color: #88C0D0; }
.code-block pre .nm { color: #C8860A; }
.code-block pre .nu { color: #B48EAD; }
.code-block pre .op { color: #81A1C1; }

/* ── Callouts ── */
.callout {
  border-radius: 10px; padding: 16px 20px;
  margin: 24px 0; font-size: 14px; line-height: 1.6;
  display: flex; gap: 12px; align-items: flex-start;
   -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.callout-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.callout-body { flex: 1; }
.callout-body strong { display: block; margin-bottom: 4px; font-size: 13px; }
.callout-info {
  background: rgba(58,104,128,.12);
  border: 1px solid rgba(58,104,128,.3);
  color: #10467F;
}
.callout-warn {
  background: rgba(200,134,10,.08);
  border: 1px solid rgba(200,134,10,.25);
  color: var(--gold);
}
.callout-tip {
  background: rgba(61,92,56,.12);
  border: 1px solid rgba(61,92,56,.35);
  color: #22543D;
}
.callout-danger {
  background: rgba(139,46,20,.1);
  border: 1px solid rgba(139,46,20,.3);
  color: #8B2E14;
}

/* ── Tables ── */
.docs-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; margin: 20px 0 28px;
  border: 1px solid var(--border-md);
  border-radius: 10px; overflow: hidden;
}
.docs-table th {
  background: var(--wood); padding: 10px 16px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--amber);
  text-align: left; border-bottom: 1px solid var(--border-md);
}
.docs-table td {
  padding: 10px 16px; color: rgba(27,28,26,0.72);
  border-bottom: 1px solid var(--border-lt);
}
.docs-table tr:last-child td { border-bottom: none; }
.docs-table tr:hover td { background: rgba(200,134,10,.03); }
.docs-table code { font-size: .85em; }

/* ── Step list ── */
.step-list { list-style: none; padding: 0; counter-reset: steps; }
.step-list li {
  counter-increment: steps;
  display: flex; gap: 16px; margin-bottom: 20px;
  align-items: flex-start;
}
.step-list li::before {
  content: counter(steps);
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex-shrink: 0;
  background: rgba(200,134,10,.15);
  border: 1px solid rgba(200,134,10,.3);
  border-radius: 50%;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--amber); margin-top: 2px;
}
.step-list li p { margin-bottom: 8px; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  color: var(--muted); margin-bottom: 24px;
}
.breadcrumb a { color: var(--muted); text-decoration: none; border: none; }
.breadcrumb a:hover { color: var(--amber); }
.breadcrumb-sep { color: var(--border-md); }
.breadcrumb-current { color: var(--muted-lt); }

/* ── Page nav (prev/next) ── */
.page-nav {
  display: flex; gap: 16px; margin-top: 56px;
  padding-top: 32px; border-top: 1px solid var(--border);
}
.page-nav-item {
  flex: 1; padding: 16px 20px;
  background: var(--bark); border: 1px solid var(--border-md);
  border-radius: 10px; text-decoration: none;
  transition: all .2s; display: flex; flex-direction: column; gap: 4px;
}
.page-nav-item:hover { border-color: rgba(200,134,10,.4); background: var(--wood); }
.page-nav-item.next { align-items: flex-end; }
.page-nav-dir {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.page-nav-title { font-size: 14px; font-weight: 500; color: var(--cream); }

/* ── Doc header badge ── */
.doc-header { margin-bottom: 8px; }
.doc-badges { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.doc-badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 20px;
}
.badge-updated { background: rgba(61,92,56,.12); border: 1px solid rgba(61,92,56,.4); color: #2D6A4F; }
.badge-version { background: rgba(200,134,10,.12); border: 1px solid rgba(200,134,10,.3); color: var(--amber); }
.badge-new { background: rgba(19,86,160,.08); border: 1px solid rgba(19,86,160,.35); color: #10467F; }

/* ── Search overlay ── */
.search-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(27,28,26,.45);
   -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: none; align-items: flex-start;
  justify-content: center; padding-top: 80px;
}
.search-overlay.open { display: flex; }
.search-modal {
  width: min(600px, 92vw);
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-md);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
.search-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.search-input-wrap input {
  flex: 1; background: none; border: none; outline: none;
  font-family: var(--sans); font-size: 16px; color: var(--ivory);
}
.search-input-wrap:focus-within { box-shadow: inset 0 -2px 0 var(--moss); }
.search-results { max-height: 400px; overflow-y: auto; }
.search-result {
  display: block; padding: 14px 20px; border-bottom: 1px solid var(--border-lt);
  text-decoration: none; transition: background .1s;
}
.search-result:hover, .search-result.focused { background: rgba(200,134,10,.07); }
.search-result-title { font-size: 14px; font-weight: 500; color: var(--cream); margin-bottom: 3px; }
.search-result-excerpt { font-size: 12px; color: var(--muted-lt); line-height: 1.5; }
.search-result-section { font-family: var(--mono); font-size: 10px; color: var(--amber); margin-bottom: 4px; letter-spacing: .06em; text-transform: uppercase; }
.search-empty { padding: 32px; text-align: center; color: var(--muted); font-size: 13px; }

/* ── Mobile ── */
.mob-nav-toggle {
  display: none; background: none; border: none;
  color: var(--cream); font-size: 18px; padding: 0 16px; cursor: pointer;
  margin-left: auto;
}
@media (max-width: 1024px) {
  .docs-toc { display: none; }
  .docs-article { padding: 32px 24px; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .docs-sidebar {
    position: fixed; left: -280px; width: 280px;
    transition: left .3s ease; z-index: 50;
  }
  .docs-sidebar.open { left: 0; }
  .mob-nav-toggle { display: block; }
  .docs-article { padding: 24px 16px; }
  .docs-main h1 { font-size: 1.8rem; }
  .page-nav { flex-direction: column; }

  /* Hide nav links and search box on mobile — too cramped */
  .topbar-links { display: none; }
  .topbar-divider { display: none; }
  .topbar-section { display: none; }
  .search-box { width: 140px; }
  .search-kbd { display: none; }
  .topbar-logo { padding: 0 12px; font-size: 15px; }
}

@media (max-width: 480px) {
  .topbar-search { padding-right: 8px; }
  .search-box { width: 120px; }
}

.docs-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.docs-main { animation: fadeUp .4s ease both; }

/* ── Standard Branding ── */
.logo-img { height: 32px; width: auto; display: block; }
.logo-mark-img { height: 32px; width: auto; display: block; }
/* Docs are naturally dark-themed, but handle any future dark/light toggles */
.docs-topbar .logo-img { filter: none; }

/* ── Reduced motion (WCAG 2.3.3) ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
