/* ============================================================================
 *  styles.css  —  base reset, typography and app shell layout.
 *  All colour comes from theme.css tokens.
 * ==========================================================================*/

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

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: 1.5;
    color: var(--text);
}

body {
    background-color: var(--bg);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.page-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.main-container {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden;
}

.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* The default (empty) workspace navbar block from base.html is replaced by each
   workpage's own <nav class="navbar">; keep it invisible until then. */
.workspace > .workspace-navbar:empty {
    display: none;
}

/* Headings inside placeholder workpages */
.workspace h2 {
    font-size: var(--fs-xl);
    color: var(--text);
    margin: 0 0 var(--space-3);
}

/* ---- Responsive text helpers -------------------------------------------- */
.large-text {
    font-size: var(--font-size-large);
    line-height: 1.4;
}
.medium-text {
    font-size: var(--font-size-medium);
    line-height: 1.5;
    font-weight: 500;
}
.small-text {
    font-size: var(--font-size-small);
    line-height: 1.5;
    letter-spacing: 0.3px;
}
.large-text,
.medium-text,
.small-text {
    color: var(--text);
}

/* Grid tables with text size classes */
.grid-table.large-text,
.grid-table.large-text th,
.grid-table.large-text td {
    font-size: var(--font-size-large);
}
.grid-table.medium-text,
.grid-table.medium-text th,
.grid-table.medium-text td {
    font-size: var(--font-size-medium);
}
.grid-table.small-text,
.grid-table.small-text th,
.grid-table.small-text td {
    font-size: var(--font-size-small);
}

/* ---- Footer ------------------------------------------------------------- */
.footer {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: var(--space-2) var(--space-4);
}
.footer .text-muted {
    color: var(--text-muted);
}

/* ---- Small-screen shell tweaks ------------------------------------------ */
@media (max-width: 400px) {
    .navbar-title {
        font-size: var(--fs-base);
    }
}

@media (max-width: 300px) {
    .main-container {
        flex-direction: column;
    }
    .workspace {
        flex: 1;
    }
}
