/* ============================================================
   UP CMS — Academic Staff (Public)
   Based on approved design (UP Red Applied)
   ============================================================ */

:root {
    --up-red: #a51c2c;
    --up-red-dark: #7d1422;
    --up-cream: #faf8f3;
    --up-border: #e7e3db;
    --up-border-strong: #e0dbcc;
    --up-gold: #8b7540;
    --up-gold-bg: #faf4e6;
    --up-gold-border: #efe6c8;
    --up-gold-text: #6b5420;
    --up-slate: #5f6674;
    --up-ink: #1a1a1a;
    --up-muted: #6b7280;
    --up-muted-2: #8c93a0;
    --up-success: #1d6e4f;
    --up-divider: #f0ede5;
}

/* ─── Page wrapper ──────────────────────────────────────────── */
.staff-page {
    background: var(--up-cream);
    color: var(--up-ink);
    line-height: 1.55;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.staff-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* ─── Hero ──────────────────────────────────────────────────── */
.staff-hero {
    padding: 40px 32px 28px;
    background: #fff;
    border-bottom: 1px solid var(--up-border);
}

.staff-bc {
    font-size: 12px;
    color: var(--up-muted);
    margin-bottom: 18px;
}

.staff-bc a {
    color: var(--up-muted);
    text-decoration: none;
}

.staff-bc a:hover {
    color: var(--up-ink);
}

.staff-bc .sep {
    margin: 0 8px;
    color: #b5b0a3;
}

.staff-bc .cur {
    color: var(--up-ink);
}

.staff-hero h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 34px;
    font-weight: 400;
    margin: 0 0 8px;
    color: var(--up-ink);
    letter-spacing: -0.3px;
}

.staff-hero h1::after {
    content: "";
    display: block;
    width: 48px;
    height: 2px;
    background: var(--up-red);
    margin-top: 14px;
}

.staff-hero .lead {
    font-size: 14.5px;
    color: var(--up-slate);
    max-width: 640px;
    line-height: 1.65;
    margin: 16px 0 0;
}

/* ─── Filter bar ────────────────────────────────────────────── */
.staff-fbar {
    background: #fff;
    padding: 14px 32px;
    border-bottom: 1px solid var(--up-border);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.staff-search-wrap {
    flex: 1;
    min-width: 220px;
    position: relative;
}

.staff-search-wrap svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--up-muted-2);
    pointer-events: none;
}

.staff-search-wrap input {
    width: 100%;
    background: var(--up-cream);
    border: 1px solid var(--up-border-strong);
    border-radius: 4px;
    padding: 9px 12px 9px 34px;
    font-size: 13px;
    color: var(--up-ink);
    box-sizing: border-box;
    font-family: inherit;
}

.staff-search-wrap input:focus {
    outline: none;
    border-color: var(--up-red);
    background: #fff;
}

.staff-sel {
    background: #fff;
    border: 1px solid var(--up-border-strong);
    border-radius: 4px;
    padding: 9px 30px 9px 12px;
    font-size: 13px;
    color: var(--up-ink);
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M2 4L5 7L8 4' stroke='%238c93a0' fill='none' stroke-width='1.5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    font-family: inherit;
    cursor: pointer;
}

.staff-sel:focus {
    outline: none;
    border-color: var(--up-red);
}

.staff-fbar button[type="submit"] {
    background: var(--up-red);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}

.staff-fbar button[type="submit"]:hover {
    background: var(--up-red-dark);
}

.staff-clear {
    color: var(--up-muted);
    text-decoration: none;
    font-size: 13px;
    padding: 9px 8px;
}

.staff-clear:hover {
    color: var(--up-red);
}

/* ─── Count + view ──────────────────────────────────────────── */
.staff-count {
    padding: 18px 32px 4px;
    font-size: 12.5px;
    color: var(--up-muted);
    background: #fff;
}

.staff-count strong {
    color: var(--up-ink);
    font-weight: 500;
}

/* ─── Grid ──────────────────────────────────────────────────── */
.staff-grid {
    padding: 16px 32px 28px;
    background: #fff;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.staff-card {
    background: #fff;
    border: 1px solid var(--up-border);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .15s, transform .15s;
    text-decoration: none;
    color: inherit;
}

.staff-card:hover {
    border-color: var(--up-red);
    transform: translateY(-1px);
}

.staff-photo {
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #eee;
}

.staff-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.staff-photo .ini {
    font-family: Georgia, serif;
    font-size: 42px;
    font-weight: 400;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.92);
}

.g1 { background: linear-gradient(135deg, #2c4764 0%, #4d6b8a 100%); }
.g2 { background: linear-gradient(135deg, #6e5a36 0%, #9a8257 100%); }
.g3 { background: linear-gradient(135deg, #2c4a3f 0%, #4d6d5f 100%); }
.g4 { background: linear-gradient(135deg, #4c3f5a 0%, #6d5f7e 100%); }
.g5 { background: linear-gradient(135deg, #3a4452 0%, #5f6674 100%); }
.g6 { background: linear-gradient(135deg, #344a66 0%, #55708c 100%); }

.staff-body {
    padding: 14px 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.staff-rank {
    font-size: 10.5px;
    color: var(--up-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.staff-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    font-weight: 400;
    color: var(--up-ink);
    line-height: 1.25;
    margin: 0;
}

.staff-dept {
    font-size: 12px;
    color: var(--up-muted);
    margin-top: 2px;
}

.staff-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-top: 1px solid var(--up-divider);
    font-size: 12px;
}

.staff-foot .em {
    color: var(--up-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.staff-foot .pf {
    color: var(--up-red);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
    flex: none;
}

.staff-foot .pf::after {
    content: "→";
    margin-left: 2px;
}

/* ─── Empty state ───────────────────────────────────────────── */
.staff-empty {
    padding: 60px 32px;
    text-align: center;
    color: var(--up-muted);
    background: #fff;
}

.staff-empty h3 {
    font-family: Georgia, serif;
    font-weight: 400;
    color: var(--up-ink);
    margin: 0 0 8px;
}

/* ─── Pagination ────────────────────────────────────────────── */
.staff-pag {
    padding: 6px 32px 32px;
    background: #fff;
    display: flex;
    justify-content: center;
    gap: 6px;
    border-bottom: 1px solid var(--up-border);
}

.staff-pag a, .staff-pag span {
    min-width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--up-border-strong);
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
    color: var(--up-slate);
    text-decoration: none;
    padding: 0 10px;
}

.staff-pag a:hover {
    border-color: var(--up-red);
    color: var(--up-red);
}

.staff-pag .active {
    background: var(--up-red);
    color: #fff;
    border-color: var(--up-red);
}

.staff-pag .disabled {
    color: #c9c3b0;
    cursor: not-allowed;
}

/* ─── Sync banner ───────────────────────────────────────────── */
.staff-synced {
    font-size: 11.5px;
    color: var(--up-muted-2);
    padding: 14px 32px;
    background: var(--up-cream);
    border-top: 1px solid var(--up-divider);
    display: flex;
    align-items: center;
    gap: 8px;
    font-style: italic;
}

.staff-synced svg {
    color: var(--up-red);
}

/* ============================================================
   PROFILE PAGE
   ============================================================ */

.staff-profile-hero {
    background: #fff;
    border-bottom: 1px solid var(--up-border);
}

.staff-profile-bc {
    font-size: 12px;
    color: var(--up-muted);
    padding: 22px 32px 0;
}

.staff-profile-bc .sep {
    margin: 0 8px;
    color: #b5b0a3;
}

.staff-profile-bc .cur {
    color: var(--up-ink);
}

.staff-profile-bc a {
    color: var(--up-muted);
    text-decoration: none;
}

.staff-profile-bc a:hover {
    color: var(--up-red);
}

.staff-profile-herobody {
    padding: 24px 32px 36px;
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.staff-profile-photo {
    width: 220px;
    flex: none;
    aspect-ratio: 4 / 5;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Georgia, serif;
    color: rgba(255,255,255,0.92);
    font-size: 68px;
    letter-spacing: 2px;
}

.staff-profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.staff-profile-ident {
    flex: 1;
    padding-top: 4px;
    min-width: 0;
}

.staff-profile-rank {
    font-size: 11px;
    color: var(--up-gold);
    text-transform: uppercase;
    letter-spacing: 1.4px;
    font-weight: 500;
    margin-bottom: 10px;
}

.staff-profile-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 40px;
    font-weight: 400;
    margin: 0 0 4px;
    color: var(--up-ink);
    letter-spacing: -0.4px;
    line-height: 1.15;
}

.staff-profile-pos {
    font-size: 16px;
    color: #2a3340;
    margin: 0 0 8px;
    font-weight: 400;
}

.staff-profile-dept {
    font-size: 14px;
    color: var(--up-muted);
    margin: 0 0 24px;
}

.staff-profile-dept a {
    color: var(--up-ink);
    text-decoration: underline;
    text-decoration-color: var(--up-red);
    text-underline-offset: 3px;
}

.staff-quickstats {
    display: flex;
    gap: 28px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--up-divider);
    flex-wrap: wrap;
}

.staff-qs {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.staff-qs .lbl {
    font-size: 10.5px;
    color: var(--up-muted-2);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 500;
}

.staff-qs .val {
    font-size: 13px;
    color: var(--up-ink);
    display: flex;
    align-items: center;
    gap: 6px;
}

.staff-qs .val svg {
    color: var(--up-gold);
    flex: none;
}

.staff-qs .val a {
    color: var(--up-ink);
    text-decoration: none;
}

.staff-qs .val a:hover {
    color: var(--up-red);
}

/* ─── Body grid ─────────────────────────────────────────────── */
.staff-profile-body {
    padding: 40px 32px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 44px;
    background: var(--up-cream);
}

.staff-profile-section {
    margin-bottom: 36px;
}

.staff-profile-section:last-child {
    margin-bottom: 0;
}

.staff-h2 {
    font-family: Georgia, serif;
    font-size: 20px;
    font-weight: 400;
    color: var(--up-ink);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--up-border);
    position: relative;
}

.staff-h2::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 42px;
    height: 2px;
    background: var(--up-red);
}

.staff-prose {
    font-size: 14.5px;
    color: #2a3340;
    line-height: 1.75;
    max-width: 64ch;
}

.staff-prose p { margin: 0 0 14px; }
.staff-prose h1, .staff-prose h2, .staff-prose h3, .staff-prose h4 {
    font-family: Georgia, serif;
    font-weight: 500;
    margin: 18px 0 10px;
}
.staff-prose ul, .staff-prose ol { margin: 0 0 14px 20px; }

/* ─── Work / Education timeline ─────────────────────────────── */
.staff-tl {
    display: flex;
    flex-direction: column;
}

.staff-tl-item {
    display: flex;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--up-divider);
}

.staff-tl-item:first-child { padding-top: 0; }
.staff-tl-item:last-child { border-bottom: none; padding-bottom: 0; }

.staff-tl-yr {
    font-family: Georgia, serif;
    font-size: 13px;
    color: var(--up-red);
    min-width: 100px;
    padding-top: 1px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.staff-tl-body { flex: 1; min-width: 0; }
.staff-tl-title {
    font-size: 14px;
    color: var(--up-ink);
    font-weight: 500;
    margin: 0 0 3px;
    line-height: 1.4;
}
.staff-tl-org {
    font-size: 12.5px;
    color: var(--up-muted);
    line-height: 1.55;
    font-style: italic;
}
.staff-tl-detail {
    font-size: 13px;
    color: #2a3340;
    margin-top: 6px;
    line-height: 1.6;
}

/* ─── Publications ─────────────────────────────────────────── */
.staff-pub {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--up-divider);
}

.staff-pub:first-of-type { padding-top: 0; }
.staff-pub:last-of-type { border-bottom: none; padding-bottom: 0; }

.staff-pub-yr {
    font-family: Georgia, serif;
    font-size: 15px;
    color: var(--up-red);
    min-width: 48px;
    padding-top: 1px;
    font-weight: 500;
}

.staff-pub-body { flex: 1; min-width: 0; }

.staff-pub-title {
    font-size: 14px;
    color: var(--up-ink);
    font-weight: 500;
    margin: 0 0 3px;
    line-height: 1.4;
}

.staff-pub-link {
    font-size: 12.5px;
    color: var(--up-red);
    text-decoration: none;
    margin-top: 6px;
    display: inline-block;
}

.staff-pub-link:hover { text-decoration: underline; }

/* ─── Sidebar ───────────────────────────────────────────────── */
.staff-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.staff-sbox {
    background: #fff;
    border: 1px solid var(--up-border);
    border-radius: 6px;
    padding: 18px 20px;
}

.staff-slbl {
    font-size: 10.5px;
    color: var(--up-gold);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 500;
    margin-bottom: 12px;
}

.staff-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.staff-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 13px;
    color: var(--up-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--up-divider);
}

.staff-links a:last-child { border-bottom: none; }

.staff-links a .lg {
    font-family: Georgia, serif;
    font-weight: 500;
    color: var(--up-red);
    min-width: 26px;
    font-size: 13px;
}

.staff-links a .sub {
    color: var(--up-muted);
    font-size: 11.5px;
    margin-left: auto;
}

.staff-langs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.staff-langtag {
    font-size: 12px;
    background: var(--up-gold-bg);
    color: var(--up-gold-text);
    padding: 5px 11px;
    border-radius: 3px;
    border: 1px solid var(--up-gold-border);
}

/* ─── Fallback (minimal data) ──────────────────────────────── */
.staff-fallback {
    padding: 32px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    background: var(--up-cream);
}

.staff-fallback-notice {
    max-width: 480px;
    font-size: 13.5px;
    color: var(--up-slate);
    line-height: 1.6;
}

.staff-fallback-notice strong {
    color: var(--up-ink);
    font-weight: 500;
    display: block;
    margin-bottom: 6px;
    font-family: Georgia, serif;
    font-size: 16px;
}

/* ============================================================
   MOBILE — < 900px
   ============================================================ */

@media (max-width: 900px) {
    .staff-hero { padding: 28px 18px 22px; }
    .staff-hero h1 { font-size: 26px; }
    .staff-fbar { padding: 12px 18px; }
    .staff-grid {
        padding: 14px 18px 22px;
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .staff-card {
        flex-direction: row;
        align-items: stretch;
    }
    .staff-photo {
        aspect-ratio: 1 / 1;
        width: 80px;
        flex: none;
    }
    .staff-photo .ini { font-size: 22px; }
    .staff-foot { display: none; }
    .staff-pag { padding: 6px 18px 24px; }
    .staff-synced { padding: 14px 18px; }
    .staff-count { padding: 14px 18px 4px; }

    .staff-profile-bc { padding: 16px 18px 0; }
    .staff-profile-herobody {
        padding: 16px 18px 22px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 18px;
    }
    .staff-profile-photo { width: 140px; font-size: 44px; }
    .staff-profile-name { font-size: 26px; }
    .staff-profile-body {
        padding: 28px 18px;
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .staff-quickstats { gap: 16px 24px; justify-content: center; }
    .staff-tl-yr { min-width: 80px; }
}

@media (max-width: 600px) {
    .staff-grid { padding: 10px 14px 20px; }
    .staff-fbar { gap: 8px; }
    .staff-search-wrap { width: 100%; }
    .staff-sel { flex: 1; min-width: 110px; }
}


/* === make-collapsible.py: collapsible sections (Phase 2/3) === */
/* v2.1 -- chevron via ::before with inline SVG mask-image (no font dependency).
 * Brand-bar ::after preserved untouched.
 * Hover/open shifts title + chevron to UP red. Body fades in on expand.
 * Pure CSS; no Razor changes required.
 */

.staff-profile-section.staff-collapsible > summary.staff-h2 {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    user-select: none;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.staff-profile-section.staff-collapsible > summary.staff-h2::-webkit-details-marker { display: none; }
.staff-profile-section.staff-collapsible > summary.staff-h2::marker { content: ""; }

/* Title color shift on hover + open. Brand-bar ::after stays UP red regardless. */
.staff-profile-section.staff-collapsible > summary.staff-h2:hover,
.staff-profile-section.staff-collapsible[open] > summary.staff-h2 {
    color: var(--up-red);
}

/* Chevron via ::before with SVG mask. background-color is the visible color
 * and transitions smoothly. order: 2 places it AFTER the text node -> right side.
 */
.staff-profile-section.staff-collapsible > summary.staff-h2::before {
    content: "";
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    order: 2;
    margin-left: 1rem;
    background-color: var(--up-muted-2);
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    transform-origin: center;
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
                background-color 0.2s ease;
}

.staff-profile-section.staff-collapsible > summary.staff-h2:hover::before,
.staff-profile-section.staff-collapsible[open] > summary.staff-h2::before {
    background-color: var(--up-red);
}

.staff-profile-section.staff-collapsible[open] > summary.staff-h2::before {
    transform: rotate(-180deg);
}

/* Keyboard focus */
.staff-profile-section.staff-collapsible > summary.staff-h2:focus-visible {
    outline: 2px solid var(--up-red);
    outline-offset: 4px;
    border-radius: 2px;
}

/* Body content reveals with fade + small slide on open. */
.staff-profile-section.staff-collapsible[open] > *:not(summary) {
    animation: staff-collapsible-reveal 0.35s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.staff-profile-section.staff-collapsible[open] > *:not(summary):first-of-type {
    margin-top: 0.85rem;
}

@keyframes staff-collapsible-reveal {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Respect user motion preferences. */
@media (prefers-reduced-motion: reduce) {
    .staff-profile-section.staff-collapsible *,
    .staff-profile-section.staff-collapsible *::before,
    .staff-profile-section.staff-collapsible *::after {
        transition-duration: 0.01ms !important;
        animation: none !important;
    }
}

/* Mobile: slightly smaller chevron, tighter spacing. */
@media (max-width: 768px) {
    .staff-profile-section.staff-collapsible > summary.staff-h2::before {
        width: 0.95rem;
        height: 0.95rem;
        margin-left: 0.75rem;
    }
}
/* === end make-collapsible.py === */
