/* ==========================================================================
   Kishoreganj University — Teachers & Staff  (/employee)

   Scoped under .kiu-employee-page (and .kiu-employee-cards for the shared
   member-card partial reused on this page and on department pages).
   main.css sets `html { font-size: 10px }`, so 1rem = 10px sitewide.
   ========================================================================== */

/* .kiu-profile-page is the single-profile root (employee/show.blade.php). It
   loads this file for exactly these tokens — employee-profile.css references
   them 36 times and defines none of its own, so leaving it off this list left
   every one of those declarations invalid: the breadcrumb band lost its tint
   and its hairline rule, and the muted/ink text colours fell back to the
   theme's defaults. */
.kiu-employee-page,
.kiu-profile-page,
.kiu-employee-cards {

    color: var(--kiu-body);
}

.kiu-employee-page {
    overflow-x: clip;
    width: 100%;
    max-width: 100%;
}

.kiu-employee-page .kiu-section {
    padding-block: 56px;
    background: var(--kiu-surface);
}

@media (max-width: 767px) {
    .kiu-employee-page .kiu-section {
        padding-block: 32px;
    }

    .kiu-employee-page .container {
        padding-inline: 14px;
        max-width: 100%;
        box-sizing: border-box;
    }
}

.kiu-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--kiu-muted);
    font-size: 15px;
}

/* Category nav ------------------------------------------------------------- */

.kiu-employee-nav {
    position: sticky;
    top: 76px;
    z-index: 20;
    border-bottom: 1px solid var(--kiu-border);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
    width: 100%;
    overflow: hidden;
}

.kiu-employee-nav .container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    box-sizing: border-box;
}

.kiu-employee-nav .container::-webkit-scrollbar {
    display: none;
}

@media (min-width: 701px) {
    .kiu-employee-nav {
        margin-top: 40px;
    }
}

.kiu-page-hero + .kiu-employee-nav {
    margin-top: 0;
}

.kiu-employee-nav__list {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    width: max-content;
    white-space: nowrap;
}

.kiu-employee-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 20px 18px;
    border-bottom: 3px solid transparent;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--kiu-body);
}

.kiu-employee-nav__link span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border-radius: var(--kiu-radius-pill);
    background: var(--kiu-surface-alt);
    font-size: 12px;
    font-weight: 700;
    color: var(--kiu-muted);
}

.kiu-employee-nav__link:hover {
    color: var(--kiu-navy);
}

.kiu-employee-nav__link.is-active {
    border-bottom-color: var(--kiu-accent);
    color: var(--kiu-navy);
}

.kiu-employee-nav__link.is-active span {
    background: var(--kiu-navy);
    color: var(--kiu-white);
}

/* Sections & grid ------------------------------------------------------------ */

/* The adjacent-sibling rule only fires for sections inside one
   <x-employee-cards>. Pages that render the component more than once — the
   office pages call it twice, Officers then Staff — produce two separate
   .kiu-employee-cards wrappers, so nothing separated them and the second
   heading sat flush against the grid above it. main.css sets
   `h2 { margin-top: 0; line-height: 1 }`, which left no optical gap at all.
   Both cases now get the same 52px. */
.kiu-employee-section + .kiu-employee-section,
.kiu-employee-cards + .kiu-employee-cards {
    margin-top: 52px;
}

.kiu-employee-section__title {
    font-family: var(--rs-ff-heading, "Kalpurush", serif);
    font-size: 24px;
    font-weight: 700;
    color: var(--kiu-navy);
    margin-bottom: 24px;
    text-align: center;
}

.kiu-employee-section__title span {
    font-weight: 400;
    color: var(--kiu-body);
}

.kiu-employee-section--leave .kiu-employee-section__title span {
    color: var(--kiu-accent);
}

.kiu-employee-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.kiu-employee-grid--single {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
}

.kiu-employee-grid--single .kiu-employee-card {
    width: 100%;
    max-width: 560px;
}

/* Spacing inside these cards is set explicitly, element by element, because
   main.css applies `p { margin-bottom: 30px; line-height: 28px }` to every
   paragraph on the site — which silently added 30px under the designation
   and under each contact line. Every <p> here resets margin and line-height
   first; do not remove those resets. */
.kiu-employee-card {
    display: flex;
    flex-direction: row;
    gap: 18px;
    background: var(--kiu-white);
    border: 1px solid var(--kiu-border);
    border-radius: var(--kiu-radius);
    padding: 18px;
    box-shadow: var(--kiu-shadow);
    transition: box-shadow var(--kiu-dur) var(--kiu-ease-out), transform var(--kiu-dur) var(--kiu-ease-out);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.kiu-employee-card:hover {
    box-shadow: var(--kiu-shadow-hover);
    transform: translateY(var(--kiu-lift));
}

.kiu-employee-card--leave {
    opacity: .92;
}

/* Roughly the 768x850 aspect of the uploaded portraits, so object-fit has
   little to crop. Kept close to the text block's natural height to avoid
   dead space under the card body. */
.kiu-employee-card__photo {
    width: 116px;
    height: 130px;
    border-radius: var(--kiu-radius-sm);
    object-fit: cover;
    object-position: top center;
    background: var(--kiu-surface-alt);
    flex-shrink: 0;
}

.kiu-employee-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1 1 0%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

/* Neutralise the global `p { margin-bottom: 30px; line-height: 28px }`. */
.kiu-employee-card__body p {
    margin: 0;
    line-height: 1.5;
}

/* Only /additional-duty passes a duty label — there the duty, not the
   substantive post, is the reason the card is on the page, so it leads.
   Selector must stay as specific as the `.kiu-employee-card__body p` reset
   above, or that reset's `margin: 0` wins and the label collides with the
   name below it. */
.kiu-employee-card__body p.kiu-employee-card__duty {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--kiu-accent);
    margin-bottom: 10px;
}

.kiu-employee-card__name {
    font-size: 16.5px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--kiu-navy);
    margin-bottom: 3px;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.kiu-employee-card__designation {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--kiu-ink);
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.kiu-employee-card__contact {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.kiu-employee-card__meta {
    font-size: 12.5px;
    color: var(--kiu-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kiu-employee-card__meta i {
    color: var(--kiu-navy);
    flex-shrink: 0;
}

/* Sits in normal flow, directly under whatever precedes it, so a card with
   no phone/email pulls "View Profile" up rather than stranding it at the
   bottom of a stretched card. */
.kiu-employee-card__link {
    margin-top: 12px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--kiu-navy);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    white-space: nowrap;
}

@media (max-width: 991px) {
    .kiu-employee-grid {
        gap: 16px;
    }

    .kiu-employee-card {
        padding: 16px 14px;
        gap: 14px;
    }

    .kiu-employee-card__photo {
        width: 100px;
        height: 115px;
    }

    .kiu-employee-card__name {
        font-size: 15px;
    }

    .kiu-employee-card__designation {
        font-size: 12.5px;
    }
}

@media (max-width: 767px) {
    .kiu-employee-section + .kiu-employee-section,
    .kiu-employee-cards + .kiu-employee-cards {
        margin-top: 36px;
    }

    .kiu-employee-section__title {
        text-align: center;
        font-size: 20px;
        margin-bottom: 20px;
    }

    /* One card per row, capped so the card doesn't sprawl on large phones. */
    .kiu-employee-grid {
        grid-template-columns: minmax(0, 360px);
        justify-content: center;
        gap: 16px;
    }

    .kiu-employee-grid--single .kiu-employee-card {
        max-width: 360px;
    }

    /* Phones get a vertical profile card — photo on top, details stacked
       and centred underneath. Side-by-side cards left the text column
       too narrow, so names shrank to 11px and emails were cut off. */
    .kiu-employee-card {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 18px 16px 20px;
        border-radius: var(--kiu-radius-sm);
        text-align: center;
    }

    .kiu-employee-card__photo {
        width: 100%;
        max-width: 200px;
        height: auto;
        aspect-ratio: 768 / 850;
    }

    .kiu-employee-card__body {
        align-items: center;
        width: 100%;
    }

    .kiu-employee-card__name {
        font-size: 17.5px;
        line-height: 1.3;
        margin-bottom: 4px;
    }

    .kiu-employee-card__designation {
        font-size: 14px;
        line-height: 1.35;
    }

    .kiu-employee-card__contact {
        margin-top: 10px;
        gap: 6px;
        align-items: center;
    }

    /* Wrap rather than truncate, so the full phone number and email
       are always readable. */
    .kiu-employee-card__meta {
        font-size: 14px;
        line-height: 1.4;
        align-items: flex-start;
        justify-content: center;
        gap: 4px;
        white-space: normal;
        overflow-wrap: anywhere;
        text-overflow: clip;
    }

    .kiu-employee-card__meta i {
        margin-top: 2px;
    }

    .kiu-employee-card__link {
        margin-top: auto;
        padding-top: 14px;
        font-size: 14px;
    }
}

/* Faculty Members page ------------------------------------------------------ */

.kiu-employee-intro {
    margin-bottom: 28px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--kiu-body);
}

.kiu-employee-intro a {
    color: var(--kiu-navy);
    font-weight: 600;
}

@media (max-width: 767px) {
    .kiu-employee-nav__list > li {
        flex: 0 0 auto;
    }

    .kiu-employee-nav__link {
        padding: 14px 12px;
        font-size: 13.5px;
        white-space: nowrap;
    }
}
