/* ============================================================
   Department Theme — Shared Layout
   Each department page sets its own colour variables.
   ============================================================ */

:root {
    /* Layout defaults — pages override these */
    --dept-primary: #005f73;
    --dept-secondary: #0a9396;
    --dept-accent: #94d2bd;
    --dept-dark: #003b4a;
    --dept-light: #e0fbfc;
    --dept-text: #0f172a;
    --dept-text-inverse: #ffffff;

    /* Shared layout offsets */
    --dept-header-h: 74px;
    --dept-newsbar-h: 38px;
    --dept-titlebar-h: 84px;
}

* { box-sizing: border-box; }

body {
    background-color: var(--dept-light);
    color: var(--dept-text);
    margin: 0;
    padding-top: calc(var(--dept-header-h) + var(--dept-newsbar-h) + var(--dept-titlebar-h));
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ─── Fixed Top Stack: News Bar + Title Bar ─── */
.dept-top-stack {
    position: fixed;
    top: var(--dept-header-h);
    left: 0;
    right: 0;
    z-index: 1020;
}

/* ─── News Bar ─── */
.dept-news-bar {
    background: linear-gradient(90deg, var(--dept-primary) 0%, var(--dept-secondary) 60%, var(--dept-accent) 100%);
    color: var(--dept-text-inverse);
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.dept-news-marquee {
    display: inline-block;
    padding-left: 100%;
    white-space: nowrap;
    animation: deptScrollLeft 25s linear infinite;
    font-weight: 500;
    font-size: 0.9rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
}

.dept-news-bar:hover .dept-news-marquee { animation-play-state: paused; }

@keyframes deptScrollLeft {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ─── Title Bar ─── */
.dept-titlebar {
    background: linear-gradient(135deg, var(--dept-primary) 0%, var(--dept-secondary) 100%);
    color: var(--dept-text-inverse);
    padding: 16px 20px;
    text-align: center;
    border-top: 2px solid rgba(255, 255, 255, 0.5);
    border-bottom: 4px solid rgba(0, 0, 0, 0.45);
    box-shadow:
        inset 0 1px 3px rgba(255, 255, 255, 0.4),
        inset 0 -2px 6px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.3);
    text-shadow:
        1px 1px 0 rgba(0, 0, 0, 0.45),
        -1px -1px 0 rgba(255, 255, 255, 0.15);
}

.dept-titlebar h1 {
    margin: 0;
    font-size: clamp(1.2rem, 2.4vw, 1.6rem);
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    line-height: 1.25;
}

.dept-titlebar p {
    margin: 4px 0 0;
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.95;
}

/* ─── Container ─── */
.dept-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 3rem;
}

/* ─── Tabs ─── */
.dept-tabs.nav-tabs {
    border-bottom: 2px solid var(--dept-secondary);
    gap: 6px;
}

.dept-tabs.nav-tabs .nav-link {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    color: var(--dept-primary);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.85rem 1.5rem;
    border: 1px solid var(--dept-accent);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 1px 3px rgba(0, 0, 0, 0.06);
}

.dept-tabs.nav-tabs .nav-link:hover {
    background: linear-gradient(180deg, #ffffff 0%, var(--dept-light) 100%);
    color: var(--dept-dark);
    border-color: var(--dept-secondary);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 3px 8px rgba(0, 0, 0, 0.10);
}

.dept-tabs.nav-tabs .nav-link.active {
    background: linear-gradient(180deg, var(--dept-secondary) 0%, var(--dept-primary) 100%);
    color: var(--dept-text-inverse);
    border-color: var(--dept-primary);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.35);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3),
        0 -2px 10px rgba(0, 0, 0, 0.15);
}

/* ─── Tab Content Card ─── */
.dept-tab-content.tab-content {
    background: #ffffff;
    border: 1px solid var(--dept-accent);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 1.75rem;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 1px 2px rgba(0, 0, 0, 0.05),
        0 8px 22px -6px rgba(0, 0, 0, 0.12);
}

/* ─── Headings inside tabs ─── */
.dept-tab-content h2,
.dept-tab-content h3 {
    color: var(--dept-primary);
    font-weight: 800;
    letter-spacing: -0.01em;
    border-bottom: 2px dashed var(--dept-accent);
    padding-bottom: 0.55rem;
    margin-bottom: 1rem;
}

/* ─── Accordion ─── */
.dept-accordion .accordion-item {
    border: 1px solid var(--dept-accent);
    border-radius: 8px;
    margin-bottom: 0.6rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dept-accordion .accordion-button {
    background: linear-gradient(180deg, var(--dept-secondary) 0%, var(--dept-primary) 100%);
    color: var(--dept-text-inverse);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.9rem 1.15rem;
    text-align: left;
    border: none;
    border-radius: 0;
    letter-spacing: 0.3px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.dept-accordion .accordion-button:not(.collapsed) {
    background: linear-gradient(180deg, var(--dept-primary) 0%, var(--dept-dark) 100%);
    color: var(--dept-text-inverse);
}

.dept-accordion .accordion-button:hover {
    background: linear-gradient(180deg, var(--dept-primary) 0%, var(--dept-secondary) 100%);
}

.dept-accordion .accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.dept-accordion .accordion-body {
    background: #ffffff;
    padding: 1rem 1.25rem;
    font-size: 0.92rem;
    line-height: 1.7;
    color: #334155;
}

/* ─── Tables ─── */
.dept-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    border: 1px solid var(--dept-accent);
    border-radius: 8px;
    overflow: hidden;
}

.dept-table th {
    background: var(--dept-primary);
    color: var(--dept-text-inverse);
    font-weight: 700;
    padding: 10px 12px;
    text-align: left;
    letter-spacing: 0.3px;
}

.dept-table td {
    padding: 10px 12px;
    border-top: 1px solid #e2e8f0;
    vertical-align: top;
    background: #ffffff;
}

.dept-table tbody tr:nth-child(even) td { background: var(--dept-light); }

/* ─── Staff cards ─── */
.dept-staff-card {
    background: #ffffff;
    border: 1px solid var(--dept-accent);
    border-left: 4px solid var(--dept-secondary);
    border-radius: 12px;
    padding: 1.15rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    height: 100%;
    transition: all 0.25s ease;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 2px 6px rgba(0, 0, 0, 0.06);
}

.dept-staff-card:hover {
    transform: translateY(-3px);
    border-left-color: var(--dept-accent);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 6px 16px -4px rgba(0, 0, 0, 0.15);
}

.dept-staff-avatar {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dept-secondary) 0%, var(--dept-primary) 100%);
    color: var(--dept-text-inverse);
    font-weight: 800;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.35),
        inset 0 -2px 0 rgba(0, 0, 0, 0.25),
        0 2px 6px rgba(0, 0, 0, 0.15);
}

.dept-staff-info { flex: 1; min-width: 0; }

.dept-staff-name {
    margin: 0 0 3px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--dept-dark);
}

.dept-staff-role {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dept-text-inverse);
    background: var(--dept-secondary);
    padding: 0.22rem 0.6rem;
    border-radius: 6px;
    margin-bottom: 0.45rem;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.dept-staff-detail {
    margin: 0 0 3px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #475569;
    word-break: break-word;
}

.dept-staff-detail strong { color: var(--dept-dark); font-weight: 700; }

/* ─── Responsive ─── */
@media (max-width: 991.98px) {
    .dept-container { padding: 1.5rem 1.15rem 2.5rem; }
}

@media (max-width: 575.98px) {
    .dept-titlebar { padding: 12px 16px; }
    .dept-titlebar h1 { font-size: 1.05rem; letter-spacing: 1px; }
    .dept-titlebar p { font-size: 0.75rem; }
    .dept-tabs.nav-tabs .nav-link { padding: 0.65rem 1rem; font-size: 0.82rem; }
    .dept-tab-content.tab-content { padding: 1.15rem; }
    .dept-container { padding: 1.15rem 1rem 2rem; }
    .dept-staff-card { flex-direction: column; align-items: flex-start; }
}