/**
 * EIASM Faculty Roster — Widget Styles
 *
 * Design tokens from approved EIASM system:
 *   Primary Teal:    #1587A8
 *   Primary Hover:   #0F6E89
 *   EIASM Dark:      #0B1220
 *   Surface Light:   #F8FAFC
 *   Teal Mist:       #EAF7FA
 *   Text Secondary:  #475569
 *   Accent Lime:     #A8C834
 *   Soft border:     rgba(11, 18, 32, 0.10)
 *   Teal border:     rgba(21, 135, 168, 0.22)
 *   Focus ring:      rgba(21, 135, 168, 0.20)
 *   Teal shadow:     rgba(21, 135, 168, 0.18)
 */

.eiasm-faculty-roster {
    --eiasm-ink: #0B1220;
    --eiasm-teal: #1587A8;
    --eiasm-teal-hover: #0F6E89;
    --eiasm-teal-light: #EAF7FA;
    --eiasm-lime: #A8C834;
    --eiasm-surface: #ffffff;
    --eiasm-surface-light: #F8FAFC;
    --eiasm-border: rgba(11, 18, 32, 0.10);
    --eiasm-border-teal: rgba(21, 135, 168, 0.22);
    --eiasm-muted: #475569;
    --eiasm-muted-light: #98a2b3;
    --eiasm-bg: #f1f5f9;
    --eiasm-radius: 16px;
    --eiasm-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    --eiasm-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.04);
    --eiasm-focus-ring: 0 0 0 3px rgba(21, 135, 168, 0.20);
    --eiasm-teal-shadow: 0 2px 8px rgba(21, 135, 168, 0.18);
    --eiasm-font-heading: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
    --eiasm-font-body: 'Inter', system-ui, -apple-system, sans-serif;

    font-family: var(--eiasm-font-body);
    color: var(--eiasm-ink);
    line-height: 1.5;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════
   TABS — Compact standalone pills, no wrapper background
   Size from padding: 10px 24px + 14px font + 1.42857 line-height ≈ 40px
   ═══════════════════════════════════════════════════════════════════ */

.eiasm-fr-tabs {
    display: inline-flex;
    gap: 8px;
    margin: 0 auto 40px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
}

.eiasm-fr-tab {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.42857 !important;
    padding: 10px 24px !important;
    border-radius: 999px !important;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background-color 0.15s ease,
                border-color 0.15s ease, box-shadow 0.15s ease;

    /* Default / inactive — !important overrides global button styles */
    color: #475569 !important;
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: none !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* Inactive hover */
.eiasm-fr-tab:hover {
    color: #1587A8 !important;
    background: #EAF7FA !important;
    border-color: #1587A8 !important;
    box-shadow: none !important;
}

/* Active / selected */
.eiasm-fr-tab--active,
.eiasm-fr-tab[aria-selected="true"] {
    color: #FFFFFF !important;
    background: #1587A8 !important;
    border-color: #1587A8 !important;
    box-shadow: none !important;
}

/* Active hover */
.eiasm-fr-tab--active:hover,
.eiasm-fr-tab[aria-selected="true"]:hover {
    color: #FFFFFF !important;
    background: #0F6E89 !important;
    border-color: #0F6E89 !important;
    box-shadow: none !important;
}

/* Focus-visible — clean ring that doesn't distort geometry */
.eiasm-fr-tab:focus-visible {
    outline: 2px solid #1587A8 !important;
    outline-offset: 2px !important;
}

/* ═══════════════════════════════════════════════════════════════════
   TAB PANELS
   ═══════════════════════════════════════════════════════════════════ */

.eiasm-fr-panel[hidden] { display: none; }
.eiasm-fr-panel { text-align: center; }

.eiasm-fr-empty-group {
    color: var(--eiasm-muted);
    font-size: 14px;
    text-align: center;
    padding: 40px 20px;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════
   CARD GRID
   ═══════════════════════════════════════════════════════════════════ */

.eiasm-fr-grid {
    display: grid;
    gap: 24px;
    text-align: center;
    transition: opacity 0.15s ease;
}

.eiasm-fr-grid[aria-busy="true"] {
    opacity: 0.5;
    pointer-events: none;
}

.eiasm-fr-cols-1 { grid-template-columns: 1fr; }
.eiasm-fr-cols-2 { grid-template-columns: repeat(2, 1fr); }
.eiasm-fr-cols-3 { grid-template-columns: repeat(3, 1fr); }
.eiasm-fr-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ═══════════════════════════════════════════════════════════════════
   FACULTY CARD — Standard
   ═══════════════════════════════════════════════════════════════════ */

.eiasm-fr-card {
    background: var(--eiasm-surface);
    border: 1px solid var(--eiasm-border);
    border-radius: var(--eiasm-radius);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.2s ease, transform 0.15s ease;
    box-shadow: var(--eiasm-shadow);
    display: flex;
    flex-direction: column;
    text-align: center;
}

.eiasm-fr-card:hover {
    border-color: var(--eiasm-border-teal);
    box-shadow: var(--eiasm-shadow-hover);
    transform: translateY(-2px);
}

.eiasm-fr-card:focus-visible {
    outline: none;
    box-shadow: var(--eiasm-focus-ring);
    border-color: var(--eiasm-teal);
}

/* ─── Circular Portrait ───────────────────────────────────────────── */

.eiasm-fr-card__avatar-area {
    display: flex;
    justify-content: center;
    padding: 28px 20px 0;
}

.eiasm-fr-card__avatar {
    width: 88px;
    height: 88px;
    min-width: 88px;
    max-width: 88px;
    min-height: 88px;
    max-height: 88px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--eiasm-bg);
    flex-shrink: 0;
}

.eiasm-fr-card__avatar-img {
    width: 88px !important;
    height: 88px !important;
    min-width: 88px !important;
    max-width: 88px !important;
    min-height: 88px !important;
    max-height: 88px !important;
    object-fit: cover !important;
    object-position: center top;
    display: block !important;
    border-radius: 50% !important;
    aspect-ratio: auto !important;
}

.eiasm-fr-card__avatar--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8c0cc;
}

/* Legacy portrait classes (AJAX-loaded cards backward compat) */
.eiasm-fr-card__portrait {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px 0;
}

.eiasm-fr-card__portrait .eiasm-fr-card__img {
    width: 88px; height: 88px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.eiasm-fr-card__portrait .eiasm-fr-card__placeholder {
    width: 88px; height: 88px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8c0cc;
    background: var(--eiasm-bg);
}

/* ─── Card Body ───────────────────────────────────────────────────── */

.eiasm-fr-card__body {
    padding: 16px 22px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.eiasm-fr-card__name {
    font-family: var(--eiasm-font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--eiasm-ink);
    margin: 0 0 4px;
    line-height: 1.3;
}

.eiasm-fr-card__role {
    font-size: 13px;
    font-weight: 500;
    color: var(--eiasm-teal);
    margin: 0 0 16px;
    line-height: 1.35;
}

/* ─── Short Card Summary — FULL TEXT, NO CLAMP ────────────────────── */

.eiasm-fr-card__summary {
    font-size: 13px;
    color: var(--eiasm-muted);
    margin: 0 0 16px;
    line-height: 1.6;
    flex: 1;
    border-top: 1px solid rgba(11, 18, 32, 0.06);
    padding-top: 16px;
    width: 100%;
    text-align: left;

    /* NO line-clamp — show the full editorial Short Card Summary.
       The card = full summary; the modal = full biography. */
}

/* ─── Expertise Chip ──────────────────────────────────────────────── */

.eiasm-fr-card__expertise-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    color: var(--eiasm-muted);
    background: var(--eiasm-surface-light);
    padding: 5px 14px;
    border-radius: 8px;
    margin-top: auto;
    align-self: flex-start;
}

.eiasm-fr-card__tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--eiasm-teal);
    background: var(--eiasm-teal-light);
    padding: 3px 10px;
    border-radius: 6px;
    margin-top: 8px;
    align-self: flex-start;
}

/* Legacy inline expertise (AJAX compat) */
.eiasm-fr-card__expertise {
    font-size: 13px;
    color: var(--eiasm-muted);
    margin: 0 0 8px;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════════
   COMPACT CARD
   ═══════════════════════════════════════════════════════════════════ */

.eiasm-fr-card--compact {
    flex-direction: row;
    align-items: center;
    padding: 14px 16px;
    gap: 14px;
    text-align: left;
}

.eiasm-fr-card--compact .eiasm-fr-card__avatar-area { padding: 0; }

.eiasm-fr-card--compact .eiasm-fr-card__avatar {
    width: 48px; height: 48px;
    min-width: 48px; max-width: 48px;
    min-height: 48px; max-height: 48px;
}

.eiasm-fr-card--compact .eiasm-fr-card__avatar-img {
    width: 48px !important; height: 48px !important;
    min-width: 48px !important; max-width: 48px !important;
    min-height: 48px !important; max-height: 48px !important;
}

.eiasm-fr-card--compact .eiasm-fr-card__body {
    padding: 0; min-width: 0; text-align: left; align-items: flex-start;
}

.eiasm-fr-card--compact .eiasm-fr-card__name { font-size: 14px; margin-bottom: 2px; }
.eiasm-fr-card--compact .eiasm-fr-card__role { font-size: 13px; margin-bottom: 4px; }
.eiasm-fr-card--compact .eiasm-fr-card__summary { border-top: none; padding-top: 0; margin-bottom: 6px; }
.eiasm-fr-card--compact .eiasm-fr-card__expertise-tag { font-size: 11px; padding: 2px 8px; }
.eiasm-fr-card--compact .eiasm-fr-card__tag { font-size: 10px; padding: 2px 6px; }

/* ═══════════════════════════════════════════════════════════════════
   PAGINATION — Load More
   Same family as tabs: 14px/700, padding-derived height, 999px radius.
   Primary action: solid teal fill.
   ═══════════════════════════════════════════════════════════════════ */

.eiasm-fr-pagination { margin-top: 36px; text-align: center; }

.eiasm-fr-load-more {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.42857 !important;
    padding: 10px 28px !important;
    border-radius: 999px !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease,
                border-color 0.15s ease, box-shadow 0.15s ease;

    /* Default: solid teal */
    color: #FFFFFF !important;
    background: #1587A8 !important;
    border: 1px solid #1587A8 !important;
    box-shadow: none !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.eiasm-fr-load-more:hover {
    color: #FFFFFF !important;
    background: #0F6E89 !important;
    border-color: #0F6E89 !important;
    box-shadow: none !important;
}

.eiasm-fr-load-more:active {
    color: #FFFFFF !important;
    background: #0F6E89 !important;
    border-color: #0F6E89 !important;
    box-shadow: none !important;
}

.eiasm-fr-load-more:focus-visible {
    outline: 2px solid #1587A8 !important;
    outline-offset: 2px !important;
}

.eiasm-fr-load-more:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed;
    box-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PAGINATION — Numbers
   ═══════════════════════════════════════════════════════════════════ */

.eiasm-fr-pagination--numbers {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.eiasm-fr-page-btn {
    font-family: var(--eiasm-font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--eiasm-muted);
    background: var(--eiasm-surface);
    border: 1px solid var(--eiasm-border);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.eiasm-fr-page-btn:hover { border-color: var(--eiasm-teal); color: var(--eiasm-teal); }
.eiasm-fr-page-btn--active,
.eiasm-fr-page-btn[aria-current="page"] { background: var(--eiasm-teal); border-color: var(--eiasm-teal); color: #fff; }
.eiasm-fr-page-btn:focus-visible { outline: 2px solid #1587A8; outline-offset: 2px; }

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .eiasm-fr-grid { gap: 20px; }
    .eiasm-fr-cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .eiasm-fr-tabs {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .eiasm-fr-tab {
        font-size: 13px !important;
        padding: 8px 18px !important;
    }

    .eiasm-fr-load-more {
        font-size: 13px !important;
        padding: 8px 24px !important;
    }

    .eiasm-fr-grid { gap: 16px; }

    .eiasm-fr-cols-3,
    .eiasm-fr-cols-4 { grid-template-columns: repeat(2, 1fr); }

    .eiasm-fr-card__avatar,
    .eiasm-fr-card__avatar-img {
        width: 72px !important; height: 72px !important;
        min-width: 72px !important; max-width: 72px !important;
        min-height: 72px !important; max-height: 72px !important;
    }

    .eiasm-fr-card__body { padding: 12px 16px 18px; }
}

@media (max-width: 480px) {
    .eiasm-fr-cols-2, .eiasm-fr-cols-3, .eiasm-fr-cols-4 { grid-template-columns: 1fr; }

    .eiasm-fr-tab {
        font-size: 12px !important;
        padding: 7px 14px !important;
    }

    .eiasm-fr-load-more {
        font-size: 12px !important;
        padding: 7px 20px !important;
    }

    .eiasm-fr-card__name { font-size: 14px; }
}

/* ═══════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════ */

.eiasm-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .eiasm-faculty-roster, .eiasm-faculty-roster *, .eiasm-faculty-roster *::before, .eiasm-faculty-roster *::after {
        transition-duration: 0.01ms !important; animation-duration: 0.01ms !important;
    }
}
