/* ==========================================================================
   Staff Gallery — ft_staff_gallery
   ========================================================================== */

/* Section title (shortcode `title` param) */
.ft-staff-gallery__section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid currentColor;
    color: inherit;
}

/* Department group wrapper */
.ft-staff-gallery-section {
    margin-bottom: 3rem;
}

.ft-staff-gallery-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1.25rem;
    padding: 0.4rem 0.75rem;
    border-left: 4px solid currentColor;
    color: inherit;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 0 4px 4px 0;
}

/* Gallery grid */
.ft-staff-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

/* ==========================================================================
   Card
   ========================================================================== */

.ft-staff-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ft-staff-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Photo area
   -------------------------------------------------------------------------- */

.ft-staff-card__photo {
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #f3f4f6;
    flex-shrink: 0;
}

.ft-staff-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.ft-staff-card__fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ft-staff-card__fallback-icon {
    width: 100%;
    height: 100%;
    display: block;
}

/* --------------------------------------------------------------------------
   Info block
   -------------------------------------------------------------------------- */

.ft-staff-card__info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem;
    flex-grow: 1;
}

/* Name */
.ft-staff-card__name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.1rem;
    color: #111827;
}

/* Academic title */
.ft-staff-card__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #4b5563;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* University position */
.ft-staff-card__university-position {
    font-size: 0.8125rem;
    font-style: italic;
    color: #6b7280;
    line-height: 1.4;
}

/* Divider between identity fields and contact fields */
.ft-staff-card__info .ft-staff-card__contacts,
.ft-staff-card__info .ft-staff-card__office {
    margin-top: 0.5rem;
}

/* Office */
.ft-staff-card__office {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 0.8125rem;
    color: #374151;
    line-height: 1.4;
}

.ft-staff-card__office::before {
    content: "🏢";
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Contacts
   -------------------------------------------------------------------------- */

.ft-staff-card__contacts {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
    margin-top: auto; /* push contacts toward bottom when card heights vary */
}

.ft-staff-card__contact-item {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    min-width: 0; /* allow text truncation */
}

/* Shared link styles */
.ft-staff-card__email,
.ft-staff-card__personal-email,
.ft-staff-card__phone,
.ft-staff-card__personal-phone {
    color: #2563eb;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    transition: color 0.15s ease;
}

.ft-staff-card__email:hover,
.ft-staff-card__personal-email:hover,
.ft-staff-card__phone:hover,
.ft-staff-card__personal-phone:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Icon prefixes */
.ft-staff-card__contact-item:has(.ft-staff-card__email)::before,
.ft-staff-card__contact-item:has(.ft-staff-card__personal-email)::before {
    content: "✉";
    font-size: 0.7rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.ft-staff-card__contact-item:has(.ft-staff-card__phone)::before,
.ft-staff-card__contact-item:has(.ft-staff-card__personal-phone)::before {
    content: "☎";
    font-size: 0.7rem;
    color: #9ca3af;
    flex-shrink: 0;
}

/* Personal contacts rendered slightly muted to visually differentiate */
.ft-staff-card__personal-email,
.ft-staff-card__personal-phone {
    color: #4b8ef1;
    font-size: 0.75rem;
}

.ft-staff-card__personal-email:hover,
.ft-staff-card__personal-phone:hover {
    color: #1d4ed8;
}

/* --------------------------------------------------------------------------
   CV download
   -------------------------------------------------------------------------- */

.ft-staff-card__cv {
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid #f3f4f6;
}

.ft-staff-card__cv-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #ffffff;
    background: #2563eb;
    border-radius: 4px;
    padding: 0.35rem 0.7rem;
    text-decoration: none;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.ft-staff-card__cv-link::before {
    content: "↓";
    font-size: 0.875rem;
    line-height: 1;
}

.ft-staff-card__cv-link:hover {
    background: #1d4ed8;
    text-decoration: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
    .ft-staff-gallery {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .ft-staff-card__info {
        padding: 0.75rem;
    }

    .ft-staff-card__name {
        font-size: 0.9375rem;
    }

    .ft-staff-gallery__section-title {
        font-size: 1.375rem;
    }
}

@media (max-width: 400px) {
    .ft-staff-gallery {
        grid-template-columns: 1fr 1fr;
    }
}
