/**
 * cg/partner-grid — directory of the `partners` CPT.
 *
 * The grid column count comes from the inline --cg-pg-cols custom property set by
 * render.php (the block's "Columns" field; default 4), dropping to 2 then 1 on
 * smaller screens.
 *
 * @package cg-2026
 */

.cg-partner-grid {
    display: grid;
    grid-template-columns: repeat(var(--cg-pg-cols, 4), minmax(0, 1fr));
    gap: 2.5rem 2rem;
}

@media (max-width: 1024px) {
    .cg-partner-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .cg-partner-grid {
        grid-template-columns: 1fr;
    }
}

.cg-partner-grid__card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Partner logos are almost all reversed (white) artwork meant for dark grounds —
   a theme-900 "chip" keeps them legible on the light page, and a fixed chip
   height + object-fit:contain lands wildly different source ratios on one tidy
   baseline. */
.cg-partner-grid__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 128px;
    padding: 1.25rem;
    border-radius: 8px;
    background: var(--color-theme-900, #0c2c3e);
}

.cg-partner-grid__img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.cg-partner-grid__name {
    margin-top: 1rem;
    text-align: center;
    font-family: var(--wp--preset--font-family--sans, sans-serif);
    font-size: 0.95rem;
    line-height: 1.3;
    color: inherit;
    text-decoration: none;
}

.cg-partner-grid__name:hover {
    text-decoration: underline;
}
