/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

h1:focus { outline: none; }

/* Sidebar NavLink active state — Blazor's NavLink adds class="active" on the
   matching anchor. Tailwind arbitrary variants weren't firing because the
   pre-compiled bundle doesn't scan for [&_a.active]:*, so we write the rule
   directly with a selector specificity that beats the base muted-foreground. */
.lumeo-sidebar-nav a.active {
    background-color: var(--color-accent);
    color: var(--color-foreground);
    font-weight: 500;
}

/* Code block styling */
.code-block {
    background: hsl(220 13% 10%);
    color: hsl(220 13% 85%);
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: 'Cascadia Code', 'Fira Code', ui-monospace, monospace;
    font-size: 0.825rem;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre;
    tab-size: 4;
}

.code-block .kw { color: hsl(280 70% 70%); }
.code-block .str { color: hsl(90 60% 60%); }
.code-block .cm { color: hsl(220 10% 50%); }
.code-block .tag { color: hsl(200 80% 65%); }
.code-block .attr { color: hsl(40 80% 65%); }
.code-block .type { color: hsl(170 60% 60%); }

/* Loading spinner */
.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: hsl(14 70% 50%);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* Blazor error UI */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* Thin subtle scrollbar for the On-This-Page aside */
.lumeo-otp-scroll::-webkit-scrollbar {
  width: 4px;
}
.lumeo-otp-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.lumeo-otp-scroll::-webkit-scrollbar-thumb {
  background-color: color-mix(in oklab, var(--color-foreground) 15%, transparent);
  border-radius: 2px;
}
.lumeo-otp-scroll::-webkit-scrollbar-thumb:hover {
  background-color: color-mix(in oklab, var(--color-foreground) 25%, transparent);
}

/* Hide the floating navbar when a DataGrid (or other Lumeo fullscreen
   overlay) claims the viewport. The Lumeo library toggles
   html.lumeo-fullscreen-active while the overlay is open. */
html.lumeo-fullscreen-active header {
  display: none !important;
}
