/* tta-workspace.css — tap targets + drawer visuals for the shell topbar
 * (Student/partials/_workspace-topbar.blade.php: #ttaShellMenu, .tta-shell-action,
 * .tta-workspace-home) and the mobile sidebar drawer
 * (Student/partials/_sidebar.blade.php: .student-sidebar, .sb-nav-item,
 * #ttaShellClose) + backdrop (#ttaShellBackdrop). Behavior lives in
 * public/js/tta-workspace.js. Loaded only when this file exists — see the
 * file_exists() guard at resources/views/Web/layout.blade.php:1580.
 *
 * Selectors are scoped with "body.tta-workspace" (set at
 * resources/views/Web/layout.blade.php:1800 for every shell page) so these
 * rules win over the unscoped inline styles in _sidebar.blade.php without !important,
 * and never leak onto non-workspace pages that happen to reuse a class name
 * (e.g. .tta-shell-action in resources/views/auth/partials/terms.blade.php).
 */

/* ── Topbar controls: ≥40x40 tap targets ──
 * .student-topbar-hamburger is intentionally NOT given a `display` here: its
 * show/hide (display:none on desktop, display:flex under the existing
 * max-width:768px query) is owned by resources/views/Web/layout.blade.php:1446
 * and :1469. Setting `display` on it in this unconditional rule would win over
 * that desktop `display:none` (equal-or-higher specificity, loaded later) and
 * make the hamburger permanently visible above the mobile breakpoint — caught
 * via tools/fixture/vp-check.mjs while verifying this fix (matchMedia
 * '(max-width:768px)' reported false at 1024 yet computed display was "flex"
 * before this rule was narrowed). */
body.tta-workspace .student-topbar-hamburger {
    min-width: 40px;
    min-height: 40px;
    box-sizing: border-box;
    padding: 8px 12px;
    border-radius: 8px;
}
body.tta-workspace .tta-shell-action,
body.tta-workspace .tta-workspace-home {
    min-width: 40px;
    min-height: 40px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
}

body.tta-workspace .tta-shell-action {
    background: transparent;
    border: 1px solid var(--border, #E2E8F0);
    color: var(--navy, #0A2342);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
body.tta-workspace .tta-shell-action:hover {
    background: rgba(10, 35, 66, 0.06);
}

body.tta-workspace .tta-workspace-home {
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    color: var(--navy, #0A2342);
    white-space: nowrap;
    padding-left: 4px;
    padding-right: 4px;
}

/* Keyboard focus visibility on every shell control */
body.tta-workspace .student-topbar-hamburger:focus-visible,
body.tta-workspace .tta-shell-action:focus-visible,
body.tta-workspace .tta-workspace-home:focus-visible,
body.tta-workspace .tta-shell-close:focus-visible {
    outline: 2px solid var(--gold, #D4AF37);
    outline-offset: 2px;
}

/* Dark theme (html[data-theme="dark"], same attribute _sidebar.blade.php already keys off) */
[data-theme="dark"] body.tta-workspace .tta-shell-action {
    border-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}
[data-theme="dark"] body.tta-workspace .tta-shell-action:hover {
    background: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] body.tta-workspace .tta-workspace-home {
    color: #ffffff;
}
[data-theme="dark"] body.tta-workspace .student-topbar-hamburger {
    color: #ffffff;
}

/* ── Sidebar drawer backdrop (mobile) ── */
body.tta-workspace .tta-shell-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998; /* below .student-sidebar's z-index:9999, above .student-main */
    background: rgba(4, 21, 41, 0.45);
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    animation: ttaShellBackdropIn 0.2s ease;
}
body.tta-workspace .tta-shell-backdrop[hidden] {
    display: none;
}
@keyframes ttaShellBackdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Close (×) button inside the sidebar header, shown only on the enhanced shell sidebar */
body.tta-workspace .tta-shell-close {
    min-width: 40px;
    min-height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    position: absolute;
    top: 8px;
    right: 8px;
}
body.tta-workspace .tta-shell-close:hover {
    color: #ffffff;
}

/* ── Sidebar nav rows: ≥40px row height ── */
body.tta-workspace .student-sidebar .sb-nav-item {
    min-height: 40px;
    box-sizing: border-box;
}
body.tta-workspace .student-sidebar .sb-footer a {
    min-height: 40px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

@media (max-width: 768px) {
    body.tta-workspace .tta-shell-close {
        display: flex;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.tta-workspace .tta-shell-backdrop {
        animation: none;
    }
}
