/* Demo app overrides — DRYL design lives in _content/DRYL.Components/dryl.css */

html, body {
    height: 100%;
    background: var(--ground);
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ─── Demo page zwei-Spalten-Layout (Content + ToC) ─── */
.demo-page-wrap {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-6);
    width: 100%;
}

.demo-page-content {
    flex: 1;
    min-width: 0;
}

/* ─── Sticky Table of Contents ─── */
.demo-toc {
    display: none;  /* JS zeigt via .has-content wenn Sections vorhanden */
    flex: 0 0 160px;
    position: sticky;
    top: var(--sp-7);
    align-self: flex-start;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    scrollbar-width: none;
}
.demo-toc::-webkit-scrollbar { display: none; }
.demo-toc.has-content { display: block; }

/* Auf mittelgroßen Bildschirmen ausblenden */
@media (max-width: 1279px) {
    .demo-toc.has-content { display: none; }
}

.demo-toc-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-dim);
    margin: 0 0 var(--sp-2) 0;
    padding-left: var(--sp-3);
}

.demo-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-left: 1px solid var(--line);
}

.demo-toc-link {
    display: block;
    padding: 3px var(--sp-2);
    margin-left: -1px;
    font-size: 12px;
    color: var(--fg-dim);
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 var(--r-xs) var(--r-xs) 0;
    transition: color var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-toc-link:hover {
    color: var(--fg-muted);
}

.demo-toc-link.is-active {
    color: var(--fg);
    border-left-color: var(--accent-b);
}


/* ─── Top bar (website chrome) ─── */
.topbar-brand {
    text-decoration: none;
    color: inherit;
    padding-left: 0;
    margin-right: var(--sp-2);
}
.topbar-nav {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
}
.topbar-link {
    padding: 6px 12px;
    border-radius: var(--r-sm);
    color: var(--fg-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out);
}
.topbar-link:hover { color: var(--fg); background: var(--glass-1); }
.topbar-link.active { color: var(--fg); background: var(--glass-2); }

.topbar-spacer { flex: 1; }

.topbar-search-trigger {
    width: 240px;
    justify-content: space-between;
    gap: var(--sp-2);
    cursor: pointer;
    font-family: var(--font-sans);
    font-feature-settings: "ss01", "cv11";
    white-space: nowrap;
    overflow: hidden;
}
.topbar-search-label {
    flex: 1;
    text-align: left;
    color: var(--fg-dim);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.topbar-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    color: var(--fg-muted);
    border: 1px solid var(--line);
    background: var(--glass-1);
    transition: color var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out);
}
.topbar-icon-link:hover { color: var(--fg); border-color: var(--line-strong); }

@media (max-width: 720px) {
    .topbar-nav { display: none; }
    .topbar-search-trigger { width: auto; }
    .topbar-search-label { display: none; }
}

/* Blazor Enhanced Navigation setzt tabindex="-1" auf h1 und fokussiert es programmatisch.
   :focus:not(:focus-visible) unterdrückt den Ring bei programmatischem Fokus,
   lässt ihn aber bei echter Tastaturnavigation bestehen. */
:focus:not(:focus-visible) { outline: none; }

/* ─── Landing shell ─── */
.landing-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.landing-main {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: var(--sp-8) var(--sp-7) 96px;
}

.hero {
    display: flex;
    flex-direction: column;
    gap: var(--sp-5);
    align-items: flex-start;
    padding: var(--sp-8) 0 var(--sp-7);
    max-width: 860px;
}
.hero h1 {
    font-size: 56px;
    line-height: 1.04;
    letter-spacing: -0.035em;
    font-weight: 700;
    margin: 0;
}
.hero .lead { font-size: 19px; max-width: 60ch; }
.hero-cta { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

.section-head {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    margin-bottom: var(--sp-5);
}

/* ─── Component doc header ─── */
.doc-source-link {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    font-size: 13px;
    color: var(--fg-muted);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--glass-1);
    transition: color var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out);
}
.doc-source-link:hover { color: var(--fg); border-color: var(--line-strong); }

/* ─── DemoExample (live preview + source) ─── */
.demo-example-card {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--glass-1);
    overflow: hidden;
}
.demo-example-card .tabs { padding: 0 var(--sp-4); }
.demo-example-card .tab-panel { padding: 0; }
.demo-example-preview {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    padding: var(--sp-6);
}
.demo-example-code { padding: var(--sp-4); }

/* ─── App Shell demo — frame the nested chrome inside a fixed-height box so the
   live DrylLayout (which is normally 100vh) sits cleanly inside a doc preview. ─── */
.demo-shell {
    height: 320px;
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--bg-2);
}
.demo-shell .app-shell { min-height: 0; height: 100%; }
.demo-shell .sidebar  { height: 100%; position: relative; z-index: 1; }
.demo-shell .topbar   { position: relative; }
.demo-shell .main     { padding: var(--sp-5); max-width: none; overflow: auto; }

/* Sidebar brand text wrapper — stacks name over sub via a class (not inline
   style) so the collapsed icon rail's .sidebar-collapse-hide can hide it. */
.brand-text { display: flex; flex-direction: column; }

/* Blazor reconnect / error UI — keep visible but unobtrusive */
#blazor-error-ui {
    color-scheme: dark;
    background: var(--bg-2);
    color: var(--fg);
    border-top: 1px solid var(--line-strong);
    bottom: 0;
    box-shadow: var(--shadow-lg);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 12px 20px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 13px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 12px;
    top: 8px;
    color: var(--fg-muted);
}

#blazor-error-ui .reload {
    color: var(--accent-b);
    margin-left: 8px;
}
