/* ========================================
   Documentation-Specific Styles
   Layout, header, sidebar, ToC, search, article typography, tables, callouts, code blocks, cards.
   Every value reads the App's tokens (app.css), so both themes come from the token layer; the only colour literals on
   this site are the print tokens at the end (I-043 Decision 12). Article typography lives here, not in
   Pages/Doc.razor.css: that file wrote it as top-level `::deep`, which never matched (Decision 13).
   ======================================== */

/* ========================================
   Skip-to-Content Link
   ======================================== */

.skip-to-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 9999;
}

.skip-to-content:focus {
    position: fixed;
    top: 8px;
    left: 8px;
    width: auto;
    height: auto;
    padding: 8px 16px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-xs);
    text-decoration: none;
    z-index: 9999;
    /* Ink ring (--text-primary: white in dark, near-black in light): the on-primary ink alone vanishes against the
       page ground; matches StatusPage */
    outline: 2px solid var(--text-primary);
}

/* ========================================
   Visually Hidden (screen reader only)
   ======================================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   Documentation Layout
   ======================================== */

.docs-layout {
    display: flex;
    min-height: 100vh;
    background: var(--gradient-bg);
}

/* ========================================
   Header
   The App's .main-header (F .hdr): 56px (--docs-header-height), glass surface on tokens (a white wash in light), blur
   20px, 12px between the controls.
   ======================================== */

.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--docs-header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 0 var(--space-md);
    z-index: 1000;
}

.docs-header__logo {
    height: 32px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.docs-header__logo-img {
    height: 32px;
    width: auto;
}

/* Theme image swap (the App's .theme-img--on-light / --on-dark, app.css there): data-theme is set by site-theme.js
   before the first paint. Both copies are in the markup, so the first .docs-header__logo-img is always loaded. */
:root:not([data-theme="light"]) .theme-img--on-light {
    display: none;
}

:root[data-theme="light"] .theme-img--on-dark {
    display: none;
}

.docs-header__logo-text {
    font-family: var(--font-display);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.docs-header__search {
    flex: 1;
    max-width: 400px;
    margin: 0 var(--space-xl);
}

.docs-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

/* Header icon buttons (menu, search): the 44px square the App's header controls use — the same face as the theme toggle
   (THEME TOGGLE block below) */
.docs-header__menu-toggle,
.docs-header__search-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-xl);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.docs-header__menu-toggle:hover,
.docs-header__search-toggle:hover {
    background: var(--color-fg-06);
    color: var(--color-primary-text);
}

.docs-header__menu-toggle:focus-visible,
.docs-header__search-toggle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* The menu toggle holds both icons; aria-expanded (flipped by docs.js, or by DocsLayout when it is interactive) picks one */
.docs-header__menu-toggle .anticon-close,
.docs-header__menu-toggle[aria-expanded="true"] .anticon-menu {
    display: none;
}

.docs-header__menu-toggle[aria-expanded="true"] .anticon-close {
    display: inline-flex;
}

/* ===== THEME TOGGLE — one block, byte-identical in both sites' stylesheets; scripts/check-token-parity.js --check fails on any drift, so edit both copies together ===== */
/* Two-state header button (Components/ThemeToggle.razor, I-043 Decision 10), wired by js/site-theme.js; the icon shows
   the theme in use. Hover ink is --color-primary-text, the contrast-safe primary ink (not --color-primary). */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--color-fg-06);
    color: var(--color-primary-text);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.theme-toggle__icon {
    display: block;
}

.theme-toggle__icon--sun,
:root[data-theme="light"] .theme-toggle__icon--moon {
    display: none;
}

:root[data-theme="light"] .theme-toggle__icon--sun {
    display: block;
}
/* ===== END THEME TOGGLE ===== */

/* ========================================
   Sidebar
   Navigation items as the App's menu: 40px rows, radius 8, the primary tint on the active page.
   ======================================== */

.docs-sidebar {
    position: fixed;
    top: var(--docs-header-height);
    left: 0;
    bottom: 0;
    width: var(--docs-sidebar-width);
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
    padding: var(--space-md);
    z-index: 100;
    transition: transform var(--transition-base);
}

/* The navigation block owns its column: the sections stack in it, each one's own margin keeps the rhythm (CF-099
   F-b20-03 — the root had no rule and stacked by UA block flow) */
.docs-sidebar-nav {
    display: flex;
    flex-direction: column;
}

.docs-sidebar__section {
    margin-bottom: var(--space-lg);
}

/* The App's eyebrow: 0.75rem / 600, uppercase, 0.08em, body font, --text-secondary */
.docs-sidebar__section-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-body);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    padding: 0 var(--space-sm);
}

.docs-sidebar__pages {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.docs-sidebar__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-height: 40px;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.docs-sidebar__link:hover {
    background: var(--color-fg-06);
    color: var(--text-primary);
}

/* UserDocsBrandColourTests.ActiveSidebarLink_ShouldUsePrimary pins this colour at --color-primary. The lighter tint
   (--color-primary-bg-subtle, 7 %): primary on --color-nav-active-bg (18 %) is 4.14:1 in dark, under AA. */
.docs-sidebar__link--active,
.docs-sidebar__link--active:hover {
    background: var(--color-primary-bg-subtle);
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

.docs-sidebar__link--active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--color-primary);
    border-radius: 0 2px 2px 0;
}

/* ========================================
   Main Content
   Padding as the App's page content (--content-padding-*, which shrinks at 640px).
   ======================================== */

.docs-content {
    margin-left: var(--docs-sidebar-width);
    margin-top: var(--docs-header-height);
    flex: 1;
    /* Flex item of .docs-layout: without this it keeps min-width: auto and a wide table widens the page */
    min-width: 0;
    padding: var(--content-padding-block-start) var(--content-padding-inline) var(--content-padding-block-end);
    min-height: calc(100vh - var(--docs-header-height));
}

.docs-content__wrapper {
    max-width: 800px;
    margin: 0 auto;
}

/* With ToC visible */
.docs-content--with-toc {
    margin-right: var(--docs-toc-width);
}

/* ========================================
   Article Meta
   ======================================== */

.article-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    color: var(--text-muted);
    font-size: var(--font-size-xs2);
}

.reading-time {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========================================
   Article
   The App's .glass-card (radius --radius-lg, padding --space-lg, --glass-border, blur 24px). Home and NotFound render
   the same article.docs-article.
   ======================================== */

.docs-article {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    color: var(--text-secondary);
    font-size: var(--font-size-body);
    line-height: var(--line-height-body);
}

/* Type scale (App app.css "Type scale"): page title 1.75rem / 700, then the card / sub-block tiers */
.docs-article h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    letter-spacing: -0.01em;
    line-height: var(--line-height-tight);
}

.docs-article h2 {
    font-family: var(--font-display);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--glass-border);
    line-height: var(--line-height-tight);
}

.docs-article h2:first-of-type {
    margin-top: var(--space-lg);
    padding-top: 0;
    border-top: none;
}

.docs-article h3 {
    font-family: var(--font-display);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
    line-height: var(--line-height-tight);
}

.docs-article h4 {
    font-family: var(--font-display);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-top: var(--space-md);
    margin-bottom: var(--space-sm);
}

.docs-article p {
    color: var(--text-secondary);
    margin: 0 0 var(--space-md);
}

.docs-article img {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: var(--space-lg) 0;
    border: 1px solid var(--glass-border);
}

.docs-article ul,
.docs-article ol {
    color: var(--text-secondary);
    padding-left: var(--space-lg);
    margin: 0 0 var(--space-md);
}

.docs-article li {
    margin-bottom: var(--space-xs);
}

/* Links are underlined: the link ink alone is under 3:1 against the body ink */
.docs-article a {
    color: var(--color-link-text);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(var(--color-primary-rgb), 0.5);
}

.docs-article a:hover {
    color: var(--color-primary-text);
    text-decoration-color: currentColor;
}

.docs-article strong {
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
}

/* A plain blockquote is a quiet quote; the coloured callouts are .markdown-alert below */
.docs-article blockquote {
    background: var(--color-fg-03);
    border-left: 3px solid var(--glass-border-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-md) 0;
    color: var(--text-secondary);
}

.docs-article blockquote p:last-child {
    margin-bottom: 0;
}

.docs-article hr {
    border: none;
    border-top: 1px solid var(--glass-border);
    margin: var(--space-xl) 0;
}

/* ========================================
   Tables
   MarkdownService wraps every table: a wide table scrolls inside the article, never the page. The look is the App's
   table: header row on --color-fg-03 at 0.78125rem / 600, 0.875rem body cells, the App's
   12px 8px cell padding (#data-display .ant-table-cell; was 16px, I-043 TASK_07), hover wash.
   ======================================== */

.docs-article .docs-table-scroll {
    overflow-x: auto;
    max-width: 100%;
    margin: var(--space-md) 0;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

.docs-article .docs-table-scroll > table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.docs-article th,
.docs-article td {
    padding: 12px 8px;
    text-align: left;
}

.docs-article th {
    background: var(--color-fg-03);
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: var(--font-size-caption);
    font-weight: var(--font-weight-semibold);
}

.docs-article td {
    border-bottom: 1px solid var(--color-fg-04);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.docs-article tbody tr:last-child td {
    border-bottom: none;
}

.docs-article tbody tr:hover td {
    background: var(--color-fg-05);
}

.docs-article .docs-table-scroll:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ========================================
   Callouts: GitHub alerts (> [!NOTE] …) as the App's Alert
   One recipe, one hue per kind: border at 60 % (light 75 %) and tint at 10 % of the hue (warning 50 / 11 dark), radius 12, padding
   14 16, bold --text-primary title. The sanitizer strips Markdig's inline SVG, so the 20px icon is a CSS mask in
   the hue. Note = info, tip = success, important = primary, warning, caution = error.
   ======================================== */

.markdown-alert {
    --alert-hue: var(--color-info);
    --alert-border: 60%;
    --alert-tint: 10%;
    --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm1 15h-2v-6h2v6Zm0-8h-2V7h2v2Z'/%3E%3C/svg%3E");
    background: color-mix(in srgb, var(--alert-hue) var(--alert-tint), transparent);
    border: 1px solid color-mix(in srgb, var(--alert-hue) var(--alert-border), transparent);
    border-radius: 12px;
    padding: 14px 16px;
    margin: var(--space-md) 0;
}

/* Border mix raised for the 3:1 the callout boundary needs (I-043 TASK_07): at 45 % it measured 2.65 – 4.24 : 1 dark
   (caution and important under 3) and 2.22 : 1 light; 60 % dark gives 3.48+, 75 % light 3.76+ */
:root[data-theme="light"] .markdown-alert {
    --alert-border: 75%;
}

.markdown-alert-tip {
    --alert-hue: var(--color-success-hover);
    --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm-1.2 14.4-3.6-3.6 1.4-1.4 2.2 2.2 4.6-4.6 1.4 1.4-6 6Z'/%3E%3C/svg%3E");
}

.markdown-alert-important {
    --alert-hue: var(--color-primary-text);
}

.markdown-alert-warning {
    --alert-hue: var(--color-warning-light);
    --alert-border: 50%;
    --alert-tint: 11%;
    --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 1 21h22L12 2Zm1 15h-2v-2h2v2Zm0-4h-2V9h2v4Z'/%3E%3C/svg%3E");
}

.markdown-alert-caution {
    --alert-hue: var(--color-error-light);
    --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm5 13.6L15.6 17 12 13.4 8.4 17 7 15.6 10.6 12 7 8.4 8.4 7l3.6 3.6L15.6 7 17 8.4 13.4 12l3.6 3.6Z'/%3E%3C/svg%3E");
}

.markdown-alert .markdown-alert-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 var(--space-xs);
    color: var(--text-primary);
    font-weight: var(--font-weight-bold);
}

.markdown-alert .markdown-alert-title::before {
    content: '';
    flex: none;
    width: 20px;
    height: 20px;
    background: var(--alert-hue);
    -webkit-mask: var(--alert-icon) center / contain no-repeat;
    mask: var(--alert-icon) center / contain no-repeat;
}

.markdown-alert > :last-child {
    margin-bottom: 0;
}

/* ========================================
   Code Blocks (Prism.js overrides + copy button)
   Token colours are in js/prism/prism.css (tokens, both themes, no re-highlight on toggle).
   ======================================== */

.docs-article pre[class*="language-"],
.docs-article pre:has(> code[class*="language-"]) {
    background: var(--surface-code);
    border: 1px solid var(--glass-border-light);
    border-radius: var(--radius-md);
    margin: var(--space-md) 0;
}

.docs-article code[class*="language-"],
.docs-article pre[class*="language-"] {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
}

.docs-article pre {
    position: relative;
}

/* The copy button: the App's control recipe on the code surface */
.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: var(--font-size-xs);
    font-family: var(--font-body);
    background: var(--control-bg);
    border: 1px solid var(--control-border);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    z-index: 1;
    line-height: 1;
}

pre:hover .copy-btn,
.copy-btn:focus-visible {
    opacity: 1;
}

/* A touch screen has no hover: the button stays visible */
@media (hover: none) {
    .copy-btn {
        opacity: 1;
    }
}

.copy-btn:hover {
    border-color: var(--color-primary-light);
    color: var(--color-primary-text);
}

.copy-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-color: var(--color-primary-light);
}

.copy-btn.copied {
    color: var(--color-success-light);
    border-color: var(--color-success-light);
}

/* ========================================
   Table of Contents
   ======================================== */

.docs-toc-container {
    position: fixed;
    top: var(--docs-header-height);
    right: 0;
    bottom: 0;
    width: var(--docs-toc-width);
    padding: var(--space-lg);
    overflow-y: auto;
}

/* An outline with no headings (the not-found face) drew an orphan "On this page" title (I-043 TASK_07); hidden, not
   removed, so the content column keeps the width it has on doc pages */
.docs-toc-container:not(:has(.docs-toc__item)) {
    visibility: hidden;
}

/* The outline block owns its column: the title over the list (CF-099 F-b20-03, as .docs-sidebar-nav) */
.docs-toc {
    display: flex;
    flex-direction: column;
}

.docs-toc__title {
    font-family: var(--font-body);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.docs-toc__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-toc__item {
    margin-bottom: var(--space-xs);
}

.docs-toc__link {
    display: block;
    width: 100%;
    padding: var(--space-xs) 0 var(--space-xs) var(--space-sm);
    color: var(--text-muted);
    font-size: var(--font-size-xs2);
    text-decoration: none;
    text-align: left;
    background: none;
    border: none;
    border-left: 2px solid transparent;
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.docs-toc__link:hover {
    color: var(--text-primary);
}

.docs-toc__link--active {
    color: var(--color-primary-text);
    border-left-color: var(--color-primary);
}

.docs-toc__link--level-3 {
    padding-left: var(--space-lg);
}

.docs-toc__link--level-4 {
    padding-left: calc(var(--space-lg) + var(--space-sm));
}

/* ========================================
   Search
   Input on the App's control recipe: 38px, radius 12, --control-bg, --control-border (3:1; --glass-border-light was
   2.03 / 1.55, I-043 TASK_07), the one 2px primary-glow ring with the primary-light border on focus.
   ======================================== */

.docs-search {
    position: relative;
}

.docs-search__input {
    width: 100%;
    height: 38px;
    padding: 0 var(--space-md) 0 36px;
    background: var(--control-bg);
    border: 1px solid var(--control-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.docs-search__input:hover {
    border-color: var(--color-primary-light);
}

.docs-search__input:focus {
    outline: none;
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.docs-search__input::placeholder {
    color: var(--text-muted);
}

.docs-search__icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Results panel: the App's dropdown panel (elevated surface, --glass-border-light, radius 12, --shadow-panel) */
.docs-search__results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg-elevated);
    border: 1px solid var(--glass-border-light);
    border-radius: 12px;
    padding: 4px;
    margin-top: var(--space-xs);
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow-panel);
    z-index: 1001;
}

.docs-search__result {
    padding: var(--space-sm) 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.docs-search__result:hover,
.docs-search__result--selected {
    background: var(--color-fg-06);
}

.docs-search__result-title {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.docs-search__result-section {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.docs-search__result-snippet {
    font-size: var(--font-size-xs2);
    color: var(--text-secondary);
}

.docs-search__result-snippet mark {
    background: var(--color-primary-bg);
    color: var(--text-primary);
    padding: 0 2px;
    border-radius: 2px;
}

.docs-search__empty {
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* ========================================
   Footer
   ======================================== */

.docs-footer {
    margin-top: var(--space-2xl);
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-xs2);
}

/* ========================================
   Not-Translated Banner
   (global, not NotTranslatedBanner.razor.css: the component is only an AntDesign <Alert>, so no element carries its
   CSS scope attribute and scoped rules cannot match). The 0.1 / 0.3 primary tint (pinned by UserDocsBrandColourTests)
   out-weighs overrides.css's .ant-alert-info by specificity: (0,2,0) against (0,1,0).
   ======================================== */

.ant-alert.not-translated-banner {
    margin-bottom: var(--space-lg);
    background: rgba(var(--color-primary-rgb), 0.1) !important;
    border-color: rgba(var(--color-primary-rgb), 0.3) !important;
}

.not-translated-banner .ant-alert-message {
    color: var(--color-primary-light) !important;
}

.not-translated-banner .anticon {
    color: var(--color-primary) !important;
}

/* Light: --color-primary-light on the 10 % tint is 4.4:1, under AA; the dark ink of the primary family is 5.6:1.
   The pinned dark value is untouched (UserDocsBrandColourTests runs on dark). */
:root[data-theme="light"] .not-translated-banner .ant-alert-message {
    color: var(--color-primary) !important;
}

/* ========================================
   NotFound (static SSR article.docs-article.docs-not-found)
   The App's not-found / empty typography: a centred title, a muted line, the back link as a default button.
   ======================================== */

.docs-not-found {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
}

.docs-not-found h1 {
    margin-bottom: var(--space-sm);
}

.docs-not-found p {
    max-width: 480px;
    margin: 0 auto var(--space-lg);
    color: var(--text-secondary);
}

.docs-not-found__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    background: var(--glass-bg);
    border: 1px solid var(--control-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.docs-article .docs-not-found__back {
    color: var(--text-primary);
    text-decoration: none;
}

.docs-not-found__back:hover,
.docs-article .docs-not-found__back:hover {
    border-color: var(--color-primary-light);
    color: var(--color-primary-text);
}

.docs-not-found__back:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ========================================
   Mobile Menu Backdrop
   Always in the markup; docs.js adds --open (DocsLayout does when it is interactive). The App's --overlay-mask.
   ======================================== */

.docs-mobile-backdrop {
    display: none;
    position: fixed;
    top: var(--docs-header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-mask);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99;
    animation: fadeIn 0.3s ease;
}

/* ========================================
   Responsive - Large Tablet (1200px)
   Hide ToC, expand content
   ======================================== */

@media (max-width: 1200px) {
    .docs-toc-container {
        display: none;
    }

    .docs-content,
    .docs-content--with-toc {
        margin-right: 0;
    }
}

/* ========================================
   Responsive - Tablet (768px)
   Hide sidebar, show hamburger menu; the article card pads as the page content does on a phone
   ======================================== */

@media (max-width: 768px) {
    .docs-header__menu-toggle {
        display: flex;
    }

    .docs-header__search {
        display: none;
    }

    .docs-header__search-toggle {
        display: flex;
    }

    /* The search toggle (docs.js) opens the one SearchBox as a full-width row under the header */
    .docs-header--search-open .docs-header__search {
        display: block;
        position: fixed;
        top: var(--docs-header-height);
        left: 0;
        right: 0;
        max-width: none;
        margin: 0;
        padding: var(--space-md);
        background: var(--color-bg-elevated);
        border-bottom: 1px solid var(--glass-border);
        z-index: 1001;
    }

    .docs-sidebar {
        transform: translateX(-100%);
    }

    .docs-sidebar--open {
        transform: translateX(0);
    }

    .docs-mobile-backdrop--open {
        display: block;
    }

    .docs-content {
        margin-left: 0;
    }

    .docs-article {
        padding: var(--content-padding-inline);
    }

    /* Touch target sizing for sidebar links */
    .docs-sidebar__link {
        min-height: 44px;
        padding: var(--space-sm) var(--space-md);
    }

    /* Touch target sizing for ToC links */
    .docs-toc__link {
        min-height: 40px;
        display: flex;
        align-items: center;
    }
}

/* ========================================
   Responsive - Mobile (480px)
   Compact layout
   ======================================== */

@media (max-width: 480px) {
    /* Menu + logo (154px) + search + theme + language picker must fit 390px: tighter padding and gaps (they were
       12px / 16px and overflowed by 52px) */
    .docs-header {
        gap: var(--space-xs);
        padding: 0 var(--space-sm);
    }

    .docs-header__actions {
        gap: var(--space-xs);
    }

    .docs-header__logo,
    .docs-header__logo-img {
        height: 28px;
    }

    .docs-header__logo-text {
        display: none;
    }

    .docs-article h1 {
        font-size: var(--font-size-xl);
    }

    .docs-article h2 {
        font-size: var(--font-size-lg);
    }
}

/* The Cyrillic picker label ("Српски (ћирилица)", 159px) still pushed the picker 60px past a 390px header (I-043
   TASK_07): below 461px the logo shows its mark only — the square at the left of the wordmark, cropped by the box */
@media (max-width: 460px) {
    .docs-header__logo-img {
        width: 28px;
        object-fit: cover;
        object-position: left center;
    }
}

/* ========================================
   Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .docs-mobile-backdrop {
        animation: none;
    }

    .docs-sidebar {
        transition: none;
    }

    .docs-sidebar__link,
    .docs-search__input,
    .docs-search__result,
    .docs-header__menu-toggle,
    .docs-toc__link,
    .copy-btn {
        transition: none;
    }
}

/* ========================================
   Print
   Print ink is theme-independent: paper white and ink black whichever theme is on screen. These tokens exist only
   here (a :root token block, the one place a colour literal may sit).
   ======================================== */

@media print {
    :root {
        --print-paper: #fff;
        --print-ink: #000;
        --print-body: #333;
    }

    .docs-header,
    .docs-sidebar,
    .docs-toc-container,
    .docs-mobile-backdrop,
    .feedback-widget,
    .article-navigation,
    .related-articles,
    .docs-footer,
    .copy-btn {
        display: none !important;
    }

    .docs-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .docs-article {
        background: var(--print-paper) !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .docs-article h1,
    .docs-article h2,
    .docs-article h3,
    .docs-article h4 {
        color: var(--print-ink) !important;
    }

    .docs-article p,
    .docs-article li {
        color: var(--print-body) !important;
    }

    a {
        color: var(--print-ink) !important;
        text-decoration: underline !important;
    }
}
