/* ============================================================
   Walters State Library — Equipment Checkout App
   Site-wide styles: WS brand colors, typography, layout
   ============================================================ */

/* ── Design Tokens ────────────────────────────────────────── */
:root {
    --ws-navy:        #00244d;
    --ws-blue:        #0094ff;   /* decorative only — fails contrast on white */
    --ws-link:        #0066cc;   /* AA-compliant link color (5.56:1 on white) */
    --ws-navy-hover:  #003c80;
    --ws-navy-deep:   #001641;
    --ws-text:        #212529;
    --ws-bg:          #ffffff;
    --ws-muted:       #6c757d;
    --ws-border:      #d0d5dd;

    --font-heading:   'Crimson Text', Georgia, serif;
    --font-body:      'Open Sans', system-ui, -apple-system, sans-serif;

    --navbar-height:  64px;

    /* Bootstrap primary color override */
    --bs-primary:          #0066cc;
    --bs-primary-rgb:      0, 102, 204;
    --bs-link-color:       #0066cc;
    --bs-link-hover-color: #003c80;
}

/* ── Base Reset / Root ────────────────────────────────────── */
html {
    position: relative;
    min-height: 100%;
    scroll-padding-top: var(--navbar-height);
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--ws-text);
    background-color: var(--ws-bg);
    margin: 0;
    padding-top: var(--navbar-height); /* Offset for fixed-top navbar */
}

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-heading);
    color: var(--ws-navy);
    font-weight: 700;
    line-height: 1.2;
}

h1, .h1 { font-size: 2rem; }
h2, .h2 { font-size: 1.65rem; }
h3, .h3 { font-size: 1.35rem; }
h4, .h4 { font-size: 1.15rem; }

.display-1, .display-2, .display-3,
.display-4, .display-5, .display-6 {
    font-family: var(--font-heading);
}

/* ── Links ────────────────────────────────────────────────── */
a {
    color: var(--ws-link);
    text-decoration: none;
}

a:hover {
    color: var(--ws-navy-hover);
    text-decoration: underline;
}

/* ── Navbar / Header ──────────────────────────────────────── */
.ws-navbar,
nav.ws-navbar,
body .ws-navbar,
.k-content .ws-navbar {
    background-color: var(--ws-navy) !important;
    border-bottom: 3px solid var(--ws-blue) !important;
    min-height: var(--navbar-height);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.ws-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-decoration: none !important;
    padding: 6px 0;
}

.ws-brand-institution {
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ws-brand-app {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.01em;
}

.ws-brand:hover .ws-brand-app,
.ws-brand:hover .ws-brand-institution {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

/* Nav menu wrapper — flush right via ms-auto on the element itself */
.ws-nav-menu {
    display: flex;
    align-items: center;
    overflow: visible;
}

/* ── Main Content Area ────────────────────────────────────── */
main {
    min-height: calc(100vh - var(--navbar-height) - 160px);
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* Page title divider */
main > .container > h1:first-child,
main > .container > h2:first-child {
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--ws-border);
}

/* ── Tables ───────────────────────────────────────────────── */
.table > thead {
    background-color: var(--ws-navy);
    color: #fff;
}

.table > thead th {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.03em;
    border-color: var(--ws-navy-hover);
    color: #fff;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(0, 36, 77, 0.035);
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(0, 148, 255, 0.07);
}

/* ── Forms ────────────────────────────────────────────────── */
.form-label {
    font-weight: 500;
    color: var(--ws-navy);
    margin-bottom: 0.25rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ws-blue);
    box-shadow: 0 0 0 0.2rem rgba(0, 148, 255, 0.2);
}

/* ── Kendo Component Overrides ────────────────────────────── */
#configure {
    display: none;
}

.k-panelbar .k-content {
    padding: 20px;
}

.k-panelbar-content > p {
    padding: 1em 2em;
}

p .k-button {
    margin: 0 15px 0 0;
}

.k-state-active .label {
    font-size: 1em;
}

/* Ensure Kendo buttons stay above stacked elements */
.k-button, button, input[type="submit"], a.k-button {
    position: relative;
    z-index: 100;
}

/* Kendo input focus ring */
.k-textbox:focus,
.k-input:focus,
.k-input.k-focus,
.k-textbox.k-focus {
    border-color: var(--ws-blue) !important;
    box-shadow: 0 0 0 2px rgba(0, 148, 255, 0.2) !important;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
    position: relative;
    width: 100%;
    background-color: var(--ws-navy);
    color: rgba(255, 255, 255, 0.87);
    font-family: var(--font-body);
    font-size: 0.82rem;
    margin-top: 0;
    padding: 1.5rem 0;
    border-top: 3px solid var(--ws-blue);
}

.footer hr {
    border-color: rgba(255, 255, 255, 0.15);
    margin: 0.5rem 0 1rem;
}

.footer p, .footer a {
    color: rgba(255, 255, 255, 0.87);
    margin-bottom: 0.25rem;
}

.footer a:hover {
    color: #fff;
}

.footer .text-muted {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge.bg-primary {
    background-color: var(--ws-blue) !important;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 767px) {
    :root {
        --navbar-height: 56px;
    }

    #responsive-panel {
        transition: all linear .2s;
    }

    #configure {
        display: block;
        float: right;
    }

    .k-rpanel {
        width: 100%;
    }

    .k-rpanel-expanded {
        margin-top: 1rem;
    }

    .footer {
        height: auto;
        padding: 1rem 0;
    }

    .k-menu .k-item,
    .k-menu .k-link {
        width: 100%;
    }

    .k-menu .k-link {
        box-sizing: border-box;
    }

    .k-rpanel-expanded ul {
        flex-direction: column;
    }

    main {
        min-height: calc(100vh - 56px - 130px);
    }

    h1, .h1 { font-size: 1.65rem; }
    h2, .h2 { font-size: 1.35rem; }

    .ws-brand-app {
        font-size: 1.05rem;
    }
}
