/**
 * Governance directory page — University of Sierra Leone
 */

.usl-governance-page .hidden,
.usl-governance-page .gov-card.hidden {
    display: none !important;
}

.usl-governance-page {
    --gov-navy: #002147;
    --gov-blue: #003366;
    --gov-gold: #c9a227;
    --gov-surface: #f1f5f9;
    --gov-muted: #64748b;
    --gov-border: rgba(0, 33, 71, 0.1);
    color: #0f172a;
}

/* Sticky toolbar */
.gov-toolbar {
    position: sticky;
    top: 0;
    z-index: 24;
    background: rgba(248, 250, 252, 0.96);
    border-bottom: 1px solid var(--gov-border);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 18px rgba(0, 33, 71, 0.04);
}

.gov-toolbar__inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.gov-toolbar__form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.gov-search {
    position: relative;
    flex: 1 1 14rem;
    min-width: 0;
}

.gov-search i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.85rem;
    pointer-events: none;
}

.gov-search input {
    width: 100%;
    padding: 0.62rem 0.9rem 0.62rem 2.35rem;
    font-size: 0.88rem;
    color: #334155;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gov-search input:focus {
    outline: none;
    border-color: var(--gov-blue);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.12);
}

.gov-select-wrap {
    position: relative;
    flex: 0 1 auto;
    min-width: 10rem;
}

.gov-select {
    appearance: none;
    width: 100%;
    padding: 0.62rem 2rem 0.62rem 0.85rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    cursor: pointer;
}

.gov-select-wrap::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.62rem;
    color: #94a3b8;
    pointer-events: none;
}

.gov-toolbar__submit {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.62rem 1.1rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--gov-navy), var(--gov-blue));
    border: none;
    border-radius: 0.65rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gov-toolbar__submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 33, 71, 0.2);
}

/* Hero view toggle */
.gov-hero-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.28rem;
    margin-bottom: 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0.7rem;
}

.gov-hero-toggle a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: 0.55rem;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.gov-hero-toggle a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.gov-hero-toggle a.is-active {
    color: #0f172a;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 4px 14px rgba(251, 191, 36, 0.35);
}

/* Main content */
.gov-main {
    padding: 2.5rem 0 4rem;
    background: linear-gradient(180deg, var(--gov-surface) 0%, #fff 45%, #f8fafc 100%);
}

.gov-container {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.gov-results {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.84rem;
    color: var(--gov-muted);
}

.gov-results strong {
    color: var(--gov-navy);
}

.gov-empty {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 1rem;
}

.gov-empty i {
    display: block;
    font-size: 2.5rem;
    color: #cbd5e1;
    margin-bottom: 0.75rem;
}

.gov-empty h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    color: #334155;
}

.gov-empty p {
    margin: 0;
    color: var(--gov-muted);
    font-size: 0.9rem;
}

/* Governance structure overview */
.gov-structure {
    margin-top: 3.5rem;
    padding: 2rem;
    background: #fff;
    border: 1px solid var(--gov-border);
    border-radius: 1.15rem;
    box-shadow: 0 12px 32px rgba(0, 33, 71, 0.06);
}

.gov-structure__title {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--gov-navy);
}

.gov-structure__lead {
    margin: 0 0 1.75rem;
    font-size: 0.92rem;
    color: var(--gov-muted);
    max-width: 40rem;
}

.gov-structure__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.gov-structure-card {
    display: flex;
    flex-direction: column;
    padding: 1.35rem;
    border-radius: 0.9rem;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gov-structure-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 33, 71, 0.08);
}

.gov-structure-card--council {
    background: linear-gradient(160deg, #eff6ff 0%, #dbeafe 100%);
    border-color: rgba(0, 33, 71, 0.08);
}

.gov-structure-card--senate {
    background: linear-gradient(160deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: rgba(15, 118, 110, 0.1);
}

.gov-structure-card--committee {
    background: linear-gradient(160deg, #f5f3ff 0%, #ede9fe 100%);
    border-color: rgba(109, 40, 217, 0.1);
}

.gov-structure-card__icon {
    font-size: 1.75rem;
    margin-bottom: 0.85rem;
}

.gov-structure-card--council .gov-structure-card__icon { color: var(--gov-navy); }
.gov-structure-card--senate .gov-structure-card__icon { color: #0f766e; }
.gov-structure-card--committee .gov-structure-card__icon { color: #6d28d9; }

.gov-structure-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.gov-structure-card p {
    margin: 0 0 1rem;
    flex: 1;
    font-size: 0.84rem;
    line-height: 1.55;
    color: #475569;
}

.gov-structure-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.gov-structure-card--council .gov-structure-card__link { color: var(--gov-navy); }
.gov-structure-card--senate .gov-structure-card__link { color: #0f766e; }
.gov-structure-card--committee .gov-structure-card__link { color: #6d28d9; }

/* Member modal */
.gov-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(0, 33, 71, 0.55);
    backdrop-filter: blur(4px);
}

.gov-modal.is-open {
    display: flex;
}

.gov-modal__dialog {
    width: 100%;
    max-width: 48rem;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 24px 48px rgba(0, 33, 71, 0.22);
    animation: govModalIn 0.22s ease;
}

@keyframes govModalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gov-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc, #fff);
}

.gov-modal__header h3 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--gov-navy);
    line-height: 1.3;
}

.gov-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 0.5rem;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.gov-modal__close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.gov-modal__body {
    padding: 1.35rem;
}

.gov-modal__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .gov-modal__layout {
        grid-template-columns: 11rem minmax(0, 1fr);
    }
}

.gov-modal__photo {
    aspect-ratio: 4 / 5;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #f1f5f9;
    box-shadow: 0 8px 20px rgba(0, 33, 71, 0.1);
}

.gov-modal__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gov-modal__position {
    margin: 0.85rem 0 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gov-blue);
}

.gov-modal__meta {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: var(--gov-muted);
}

.gov-modal__meta a {
    color: #1e40af;
    text-decoration: none;
}

.gov-modal__meta a:hover {
    text-decoration: underline;
}

.gov-modal__panel {
    padding: 1rem;
    border-radius: 0.65rem;
    margin-bottom: 0.75rem;
    font-size: 0.84rem;
}

.gov-modal__panel--term {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.gov-modal__panel--contact {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.gov-modal__panel h4 {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gov-modal__bio {
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    font-size: 0.9rem;
    line-height: 1.65;
    color: #475569;
}

.gov-modal__bio h4 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gov-navy);
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

@media (max-width: 900px) {
    .gov-structure__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .gov-toolbar__form {
        flex-direction: column;
        align-items: stretch;
    }

    .gov-select-wrap {
        min-width: 0;
        width: 100%;
    }

    .gov-toolbar__submit {
        justify-content: center;
        width: 100%;
    }

    .gov-hero-toggle {
        flex-direction: column;
        width: 100%;
        max-width: 18rem;
        margin-left: auto;
        margin-right: auto;
    }

    .gov-hero-toggle a {
        justify-content: center;
        width: 100%;
    }
}

@media print {
    .gov-toolbar,
    .evt-hero,
    .gov-structure,
    .gov-show-more {
        display: none !important;
    }

    .gov-main {
        padding: 0;
        background: #fff;
    }
}
