/* CIT Case Management - Custom CSS overrides beyond Tailwind */
/* For third-party component styling and edge cases only. */
/* All layout and component styles live in Tailwind utility classes. */

/* Alpine.js cloak: hide elements until Alpine initializes */
[x-cloak] {
    display: none !important;
}

/* Print styles */
@media print {
    aside,
    header,
    .btn-primary,
    .btn-secondary,
    .btn-danger,
    [data-no-print],
    #sessionTimeoutModal {
        display: none !important;
    }

    main {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
        break-inside: avoid;
    }
}

/* htmx loading indicator */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Chart.js tooltip overrides (if needed) */

/* ---------------------------------------------------------------------------
   Sidebar: compact mode at short viewport heights.
   Default sidebar chrome (~172px) + 10 nav items + admin divider (~448px) needs
   ~620px viewport to avoid an inner scrollbar. These rules tighten paddings on
   short screens so all items stay visible without scrolling.
   --------------------------------------------------------------------------- */
@media (max-height: 760px) {
    aside.bg-cit-navy > div:first-child {
        /* Logo block: was py-5 (1.25rem), shrink to py-2.5 */
        padding-top: 0.625rem;
        padding-bottom: 0.625rem;
    }
    aside.bg-cit-navy nav a {
        /* Nav items: was py-2 (0.5rem), shrink to py-1 */
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }
    aside.bg-cit-navy nav > div.pt-4 {
        /* "Administration" section divider: was pt-4 pb-2 */
        padding-top: 0.5rem;
        padding-bottom: 0.125rem;
    }
    aside.bg-cit-navy > div.border-t.border-white\/10 {
        /* User footer: was py-3 */
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    aside.bg-cit-navy > button {
        /* Collapse toggle: was py-2 */
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }
}

@media (max-height: 580px) {
    aside.bg-cit-navy nav a {
        padding-top: 0.125rem;
        padding-bottom: 0.125rem;
    }
    aside.bg-cit-navy nav > * + * {
        /* Tighten space-y-1 between items */
        margin-top: 0.0625rem;
    }
    aside.bg-cit-navy > div:first-child {
        padding-top: 0.375rem;
        padding-bottom: 0.375rem;
    }
}
