/* OutaStory Theme System — base CSS
 *
 * Two parts:
 *
 * 1. THEME-SCOPED PALETTE — every per-theme palette lives in its own
 *    file under /themes/{themeId}.css. This file imports the default
 *    palette (the v0.x baseline) so every page that links theme.css
 *    still gets the full token set even when no other theme stylesheet
 *    has loaded yet. Per-theme files are appended at runtime by
 *    theme.js when the user picks a non-default theme.
 *
 * 2. THEME-AGNOSTIC BASE — resets, typography, .os-page shell, .os-btn
 *    / .os-input / .os-card utilities, scrollbar styling, page-enter
 *    animations, .skip-link. These read --os-* tokens but don't define
 *    them, so a theme swap re-paints everything for free.
 *
 * Brand reference (default theme): blue-to-purple gradient
 * (#052767 → #3a0647), primary #1b6ec2.
 */

@import url('themes/default.css');

@font-face {
    font-family: 'OpenDyslexic';
    src: url('/_content/OutaStory.App.Shared/fonts/OpenDyslexic-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenDyslexic';
    src: url('/_content/OutaStory.App.Shared/fonts/OpenDyslexic-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Theme-agnostic tokens — sizing, typography, layout, transitions.
   Themes override the colour palette but inherit these so component
   layouts stay stable across theme swaps. */
:root {
    /* Spacing (base: 4px) */
    --os-space-xs: 4px;
    --os-space-sm: 8px;
    --os-space-md: 16px;
    --os-space-lg: 24px;
    --os-space-xl: 32px;
    --os-space-2xl: 48px;

    /* Border radius */
    --os-radius-sm: 8px;
    --os-radius-md: 12px;
    --os-radius-lg: 16px;
    --os-radius-xl: 24px;
    --os-radius-full: 9999px;

    /* Typography */
    --os-font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --os-font-size-xs: 0.75rem;
    --os-font-size-sm: 0.875rem;
    --os-font-size-md: 1rem;
    --os-font-size-lg: 1.25rem;
    --os-font-size-xl: 1.5rem;
    --os-font-size-2xl: 2rem;
    --os-font-weight-normal: 400;
    --os-font-weight-medium: 500;
    --os-font-weight-semibold: 600;
    --os-font-weight-bold: 700;

    /* Layout */
    --os-header-height: 56px;
    --os-bottom-nav-height: 64px;
    --os-sidebar-width: 260px;

    /* Transitions */
    --os-transition-fast: 150ms ease;
    --os-transition-normal: 250ms ease;
    --os-transition-slow: 350ms ease;
}

/* ============================================================
   Global Reset & Base Styles
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--os-font-family);
    font-size: var(--os-font-size-md);
    color: var(--os-text-primary);
    background-color: var(--os-background);
    transition: background-color var(--os-transition-normal), color var(--os-transition-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--os-primary);
    text-decoration: none;
}

a:hover {
    color: var(--os-primary-hover);
    text-decoration: underline;
}

/* ============================================================
   Shared content-page shell (.os-page BEM block)

   Single source of truth for the "nice boxes" pattern used by
   /about/version, /developer/* (push-test, auth0-claims,
   api-claims, system-info) and intended as the migration target
   for /legal/* and /about/*. Defined in theme.css (NOT scoped)
   so every page that uses .os-page-* gets the same look without
   per-page CSS duplication. Page-specific styles (forms, tables,
   diagnostic blocks) stay in each page's scoped .razor.css.
   ============================================================ */

.os-page {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--os-space-xl);
    padding-bottom: var(--os-space-2xl);
}

.os-page__header {
    display: flex;
    align-items: center;
    gap: var(--os-space-md);
    padding-top: var(--os-space-md);
}

.os-page__back-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--os-text-primary);
    padding: var(--os-space-xs);
    border-radius: var(--os-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--os-transition-fast);
    flex-shrink: 0;
}

.os-page__back-btn:hover {
    background: var(--os-surface-variant);
}

.os-page__back-btn:focus-visible {
    outline: 2px solid var(--os-primary);
    outline-offset: 2px;
}

.os-page__header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.os-page__title {
    font-size: var(--os-font-size-xl);
    font-weight: var(--os-font-weight-bold);
    color: var(--os-text-primary);
    margin: 0;
}

.os-page__subtitle {
    font-size: var(--os-font-size-sm);
    color: var(--os-text-secondary);
    margin: 0;
}

.os-page__content {
    display: flex;
    flex-direction: column;
    gap: var(--os-space-2xl);
}

.os-page__section {
    display: flex;
    flex-direction: column;
    gap: var(--os-space-md);
    padding: var(--os-space-xl);
    background: var(--os-surface);
    border: 1px solid var(--os-border);
    border-radius: var(--os-radius-lg);
}

.os-page__section-heading {
    font-size: var(--os-font-size-lg);
    font-weight: var(--os-font-weight-bold);
    color: var(--os-text-primary);
    margin: 0;
    padding-bottom: var(--os-space-sm);
    border-bottom: 2px solid var(--os-primary);
    display: inline-block;
    align-self: flex-start;
}

.os-page__subsection-heading {
    font-size: var(--os-font-size-md);
    font-weight: var(--os-font-weight-semibold);
    color: var(--os-text-primary);
    margin: var(--os-space-sm) 0 0;
}

.os-page__body-text {
    font-size: var(--os-font-size-sm);
    color: var(--os-text-secondary);
    line-height: 1.7;
    margin: 0;
}

.os-page__list {
    margin: 0;
    padding-left: var(--os-space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--os-space-xs);
}

.os-page__list li {
    font-size: var(--os-font-size-sm);
    color: var(--os-text-secondary);
    line-height: 1.7;
}

.os-page__list li strong {
    color: var(--os-text-primary);
    font-weight: var(--os-font-weight-semibold);
}

.os-page__link {
    color: var(--os-primary);
    text-decoration: underline;
    font-weight: var(--os-font-weight-medium);
}

.os-page__link:hover {
    opacity: 0.8;
}

/* ============================================================
   Utility Classes
   ============================================================ */

.os-card {
    background: var(--os-surface);
    border-radius: var(--os-radius-md);
    box-shadow: var(--os-shadow-sm);
    transition: background-color var(--os-transition-normal), box-shadow var(--os-transition-normal);
}

.os-card:hover {
    box-shadow: var(--os-shadow-md);
}

.os-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--os-space-sm);
    padding: 12px 24px;
    border: none;
    border-radius: var(--os-radius-sm);
    font-family: var(--os-font-family);
    font-size: var(--os-font-size-md);
    font-weight: var(--os-font-weight-semibold);
    cursor: pointer;
    transition: all var(--os-transition-fast);
    text-decoration: none;
    line-height: 1.4;
}

.os-btn-primary {
    background-color: var(--os-primary);
    color: var(--os-text-on-primary);
}

.os-btn-primary:hover {
    background-color: var(--os-primary-hover);
    text-decoration: none;
    color: var(--os-text-on-primary);
}

.os-btn-dark {
    background-color: var(--os-text-primary);
    color: var(--os-surface);
}

.os-btn-dark:hover {
    opacity: 0.9;
    text-decoration: none;
    color: var(--os-surface);
}

.os-btn-outline {
    background: transparent;
    border: 1.5px solid var(--os-border);
    color: var(--os-text-primary);
}

.os-btn-outline:hover {
    border-color: var(--os-primary);
    color: var(--os-primary);
    text-decoration: none;
}

.os-btn-ghost {
    background: transparent;
    color: var(--os-text-primary);
}

.os-btn-ghost:hover {
    background: var(--os-surface-variant);
    text-decoration: none;
}

.os-btn-block {
    width: 100%;
}

.os-btn-lg {
    padding: 14px 28px;
    font-size: var(--os-font-size-lg);
    border-radius: var(--os-radius-md);
}

.os-btn-sm {
    padding: 8px 16px;
    font-size: var(--os-font-size-sm);
}

.os-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--os-border);
    border-radius: var(--os-radius-sm);
    background: var(--os-surface);
    color: var(--os-text-primary);
    font-family: var(--os-font-family);
    font-size: var(--os-font-size-md);
    transition: border-color var(--os-transition-fast), box-shadow var(--os-transition-fast);
    outline: none;
}

.os-input:focus {
    border-color: var(--os-border-focus);
    box-shadow: 0 0 0 3px rgba(37, 140, 251, 0.15);
}

.os-input::placeholder {
    color: var(--os-text-tertiary);
}

.os-label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--os-font-size-sm);
    font-weight: var(--os-font-weight-medium);
    color: var(--os-text-secondary);
}

.os-divider {
    height: 1px;
    background: var(--os-border);
    border: none;
    margin: var(--os-space-md) 0;
}

.os-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--os-radius-full);
    font-size: var(--os-font-size-xs);
    font-weight: var(--os-font-weight-semibold);
}

.os-badge-success {
    background: var(--os-success-light);
    color: var(--os-success);
}

.os-badge-error {
    background: var(--os-error-light);
    color: var(--os-error);
}

.os-badge-warning {
    background: var(--os-warning-light);
    color: var(--os-warning);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--os-border);
    border-radius: var(--os-radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--os-text-tertiary);
}

/* Page transition */
.os-page-enter {
    animation: osPageIn var(--os-transition-normal) forwards;
}

@keyframes osPageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skip-link — invisible until focused. Keyboard users tab past the side
   nav + top header to reach page content; screen readers announce the
   landmark link. Positioned off-screen by default; focus reveals it in
   the top-left corner above everything else. */
.skip-link {
    position: absolute;
    top: -48px;
    left: var(--os-space-sm);
    padding: var(--os-space-xs) var(--os-space-sm);
    background-color: var(--os-primary);
    color: #ffffff;
    text-decoration: none;
    font-weight: var(--os-font-weight-semibold);
    border-radius: var(--os-radius-sm);
    z-index: 9999;
    transition: top var(--os-transition-fast);
}

.skip-link:focus {
    top: var(--os-space-sm);
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

