/* Organization sections continue the Team page typography and spacing. */

.organization-section {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    scroll-margin-top: 7rem;
    text-align: left;
}

.organization-section h2 {
    margin-bottom: 1.25rem;
}

.organization-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem 1.75rem;
    margin: 0;
    padding: 0.25rem 0 0.5rem;
    list-style: none;
}

.organization-grid li {
    min-width: 0;
}

.site-page-body .organization-grid .organization-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 76px;
    height: 100%;
    padding: 0.5rem;
    background-image: none;
    border-radius: 3px;
}

.organization-logo img {
    display: block;
    width: 100%;
    max-width: 162px;
    height: 60px;
    object-fit: contain;
    filter: grayscale(1);
    opacity: 0.78;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.organization-mit img { max-width: 83px; height: 44px; }
.organization-cmu img { max-width: 100px; height: 64px; }
.organization-cornell img { max-width: 65px; height: 65px; }
.organization-hec img { max-width: 59px; height: 59px; }
.organization-usc img { max-width: 128px; height: 48px; }
.organization-nus img { max-width: 170px; height: 70px; }
.organization-michigan img { filter: brightness(0); }

.organization-grid-support {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.75rem;
}

body.dark-mode .organization-section {
    border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .organization-section h2 {
    color: #e0e0e0;
}

body.dark-mode .organization-logo img {
    filter: grayscale(1) invert(1);
    opacity: 0.85;
}

body.dark-mode .organization-michigan img {
    filter: brightness(0) invert(1);
}

@media (hover: hover) and (pointer: fine) {
    body:not(.dark-mode) .organization-logo:hover img {
        filter: none;
        opacity: 1;
    }

    body.dark-mode .organization-logo:hover img {
        opacity: 1;
    }
}

@media (max-width: 1200px) {
    .organization-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1000px) {
    .organization-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .organization-logo img { transition: none; }
}

/* Blend the official Tsinghua asset's white background into each theme. */
.organization-tsinghua {
    overflow: hidden;
}

.organization-tsinghua img {
    object-fit: contain;
    transform: scale(1.5);
    mix-blend-mode: multiply;
}

body.dark-mode .organization-tsinghua img {
    mix-blend-mode: screen;
}

.organization-smu img {
    height: 86px;
}
