/**
 * Teams Archive Styles
 *
 * Card-based layout for the teams archive page, BB module, and [teams] shortcode.
 * Uses the existing utility class system where possible.
 */

/* ── Grid Layout ───────────────────────────────────────────── */
.teams-archive-grid {
    display: grid;
    gap: 1.5rem;
    max-width: 1440px;
    margin: 0 auto;
}

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

@media (max-width: 60rem) {
    .teams-grid-cols-3,
    .teams-grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 36rem) {
    .teams-archive-grid { grid-template-columns: 1fr; }
}

/* ── Card ──────────────────────────────────────────────────── */
.team-card {
    display: flex;
    flex-direction: column;
    background: var(--base-50, #fafafa);
    border: 1px solid var(--base-200, #e5e5e5);
    border-radius: 0.75rem;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.15s;
}

.team-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Banner (featured image) */
.team-card-banner {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.team-card-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card body */
.team-card-body {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
}

/* ── Avatar Stack ──────────────────────────────────────────── */
.team-card-avatars {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.team-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--base-200, #e5e5e5);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.team-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-avatar-overlap {
    margin-left: -14px;
    position: relative;
    z-index: 1;
}

.team-avatar-initials {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--base-500, #737373);
    user-select: none;
}

.team-avatar-team-initials {
    width: 48px;
    height: 48px;
    background: var(--base-100, #f5f5f5);
}

.team-avatar-team-initials .team-avatar-initials {
    font-size: 1rem;
    color: var(--base-400, #a3a3a3);
}

/* ── Card Info ─────────────────────────────────────────────── */
.team-card-info {
    flex: 1;
    min-width: 0;
}

.team-card-name {
    margin: 0 0 0.125rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--base-900, #171717);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-card-count {
    font-size: 0.8125rem;
    color: var(--base-500, #737373);
}

.team-card-excerpt {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: var(--base-600, #525252);
    line-height: 1.4;
}

/* ── List Layout ───────────────────────────────────────────── */
.teams-archive-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 1440px;
    margin: 0 auto;
}

.team-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: var(--base-50, #fafafa);
    border: 1px solid var(--base-200, #e5e5e5);
    border-radius: 0.75rem;
    text-decoration: none !important;
    color: inherit;
    transition: background-color 0.15s;
}

.team-list-item:hover {
    background: var(--base-100, #f5f5f5);
}

.team-list-item .team-card-info {
    flex: 1;
}

.team-list-item .team-card-name {
    white-space: normal;
}

.team-list-count {
    flex-shrink: 0;
    font-size: 0.8125rem;
    color: var(--base-500, #737373);
    white-space: nowrap;
}

/* ── Mobile List Tweaks ────────────────────────────────────── */
@media (max-width: 36rem) {
    .team-list-item {
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .team-avatar {
        width: 40px;
        height: 40px;
    }

    .team-avatar-overlap {
        margin-left: -12px;
    }

    .team-avatar-team-initials {
        width: 40px;
        height: 40px;
    }
}
