/* ===================== COMPANIES LIST ===================== */
.companies-list {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
    margin-top: 40px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* Smart Justification Overrides (Forces natural wraps based on total items) */
.companies-list[data-count="5"],
.companies-list[data-count="6"] {
    max-width: 600px; /* Forces wrap to max 3 items per row */
}

.companies-list[data-count="7"],
.companies-list[data-count="8"] {
    max-width: 800px; /* Forces wrap to max 4 items per row */
}

.company-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    width: 150px;
}

/* Updated for transparent, borderless logos */
.company-logo-link {
    width: 110px;
    height: 90px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
    z-index: 2;
    transition: transform 0.22s cubic-bezier(.34,1.56,.64,1);
    padding: 18px;
    box-sizing: border-box;
}

.company-logo-link img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.company-name-fallback {
    font-size: 14px;
    font-weight: 700;
    color: #00569d;
    text-align: center;
    word-break: break-word;
}

/* Hover expansion */
.company-item:hover .company-logo-link,
.company-item:focus-within .company-logo-link {
    transform: scale(1.15);
}

.company-name {
    margin-top: 5px;
    font-size: 15px;
    font-weight: 600;
    color: #00569d;
    letter-spacing: 0.5px;
    text-align: center;
}

/* Inherits visual language from .tl-event-badge */
.company-info-badge {
    position: absolute;
    top: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    background: #00569d;
    color: #fff;
    padding: 10px 16px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, top 0.2s ease;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: max-content;
    max-width: 260px;
    text-align: center;
    border-radius: 4px;
}

/* Tooltip Triangle */
.company-info-badge::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #00569d transparent;
}

.company-badge-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.company-badge-desc {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.4;
}

.company-badge-desc p {
    margin: 0;
}

.company-item:hover .company-info-badge,
.company-item:focus-within .company-info-badge {
    opacity: 1;
    top: calc(100% + 20px);
}

/* Inherits mobile unrolling from .tl-mobile-desc */
.company-mobile-desc {
    display: none;
}

@media (max-width: 700px) {
    .companies-list {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
        padding-left: 10px;
        max-width: 100%; /* Resets width constraint for mobile */
    }

    .company-item {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 15px;
    }

    .company-logo-link {
        width: 70px;
        height: 70px;
        padding: 10px;
    }

    .company-item:hover .company-logo-link,
    .company-item:focus-within .company-logo-link {
        transform: scale(1.05);
    }

    .company-name {
        margin-top: 0;
        font-size: 16px;
    }

    .company-info-badge {
        display: none !important;
    }

    .company-mobile-desc {
        display: block;
        width: 100%;
        font-size: 13px;
        color: #555;
        line-height: 1.45;
        margin: 0;
        padding-left: 85px; 
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(.25,0,.2,1), opacity 0.3s ease;
        opacity: 0;
    }

    .company-item:hover .company-mobile-desc,
    .company-item:focus-within .company-mobile-desc {
        opacity: 1;
        max-height: 250px;
        margin-top: -5px;
        margin-bottom: 10px;
    }
}