/* ───────────────────────────────────────────────────────
   VetOS Portal — app shell (header / nav / main / footer).
   Component classes live in nimbus.css; tokens are defined
   there (:root) and consumed here.
─────────────────────────────────────────────────────── */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: var(--color-ink);
    background: var(--color-canvas-parchment);
}

a { color: var(--color-primary); }
a:hover { color: var(--color-ink); }

.portal-root {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Suppress the default focus ring on programmatically-focused page headings.
   Blazor's <FocusOnNavigate Selector="h1" /> sets focus on every navigation;
   keyboard users still get :focus-visible for genuine tab-focus.            */
h1:focus {
    outline: none;
}

.portal-header {
    background: rgba(245, 245, 247, 0.85);
    backdrop-filter: var(--blur-frost);
    -webkit-backdrop-filter: var(--blur-frost);
    border-bottom: 1px solid var(--color-hairline);
    /* No shadow — Nimbus header treatment is parchment frosted, hairline bottom. */
    position: sticky;
    top: 0;
    z-index: 10;
}

.portal-header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.portal-brand {
    font-weight: 700;
    color: var(--color-ink);
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.portal-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.portal-nav a,
.portal-link-button {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    /* Neutral text — Action Blue is reserved for primary CTAs + in-content
       links. Nav items use ink and hover into Action Blue for affordance. */
    color: var(--color-ink);
    border-radius: var(--radius-sm);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    border-bottom: 2px solid transparent;
}

/* Inline wrapper for POST-form nav actions (sign out) so the form doesn't
   break the nav's flex row. */
.portal-inline-form { display: inline; }

.portal-nav a:hover,
.portal-link-button:hover {
    background: transparent;
    color: var(--color-primary);
}

/* Active state — Blazor NavLink writes the `active` class when the current
   route matches. Small underline in Action Blue makes the active nav clear
   without making every item look like a CTA. */
.portal-nav a.active {
    color: var(--color-ink);
    border-bottom-color: var(--color-primary);
}

/* Accessibility: hide content visually but keep it in the a11y tree. Used
   to attach `<label>` to fields where a visible label would clutter the UI
   (search inputs with explicit placeholders, etc.). */
.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;
}

/* Portal footer — small, muted, never competes with body content. */
.portal-footer {
    margin-top: 3rem;
    border-top: 1px solid var(--color-hairline);
    background: var(--color-canvas-parchment);
}
.portal-footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.825rem;
    color: var(--color-ink-muted-56);
}
.portal-footer-nav {
    display: flex;
    gap: 0.25rem;
}
.portal-footer-nav a {
    color: var(--color-ink);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-xs);
    font-weight: 600;
    transition: color 0.15s;
}
.portal-footer-nav a:hover,
.portal-footer-nav a:focus-visible {
    color: var(--color-primary);
}
.portal-footer-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--color-ink-muted-56);
}

.portal-main {
    flex: 1;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

/* ── Mobile (<= 640px) ─────────────────────────────── */
@media (max-width: 640px) {
    .portal-header-inner {
        padding: 0.7rem 0.9rem;
        gap: 0.5rem 0.75rem;
        align-items: flex-start;
    }
    .portal-brand { font-size: 1rem; }
    .portal-nav {
        flex: 1 1 100%;
        justify-content: flex-start;
        gap: 0.1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .portal-nav::-webkit-scrollbar { display: none; }
    .portal-nav a,
    .portal-link-button {
        padding: 0.4rem 0.65rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .portal-main { padding: 1.25rem 0.9rem 2.5rem; }
}
