/**
 * The partner grid on the "Партнёры" page.
 *
 * The carousel on the homepage is deliberately absent from this file: it renders
 * in the theme's own `.ovic-brand > .brand-slide > .brand-item` classes, which
 * the theme's stylesheets already dress, RTL sheet included. Adding rules for it
 * here would be a second opinion about a section that already has one.
 *
 * Two things the logos force. They arrive from the supplier at wildly different
 * shapes — a 1140x636 GIF next to a square PNG next to a wide JPEG — so each one
 * sits in a fixed-height box and is fitted inside it; without that the grid rows
 * are as tall as the tallest logo in each. And several are dark-on-transparent,
 * so the box is white rather than inheriting the page background.
 */

.siggi-partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 30px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* `auto-fill` plus `minmax` means the grid needs no breakpoints of its own, and
   it mirrors under RTL without a single rule — which is why the page needed no
   entry in the theme's RTL sheet. */

.siggi-partners-grid .partner-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 0;
    text-align: center;
    list-style: none;
}

.siggi-partners-grid .partner-item > a {
    display: block;
    width: 100%;
    text-decoration: none;
}

.siggi-partners-grid .partner-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    margin: 0 0 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 3px;
    /* The logos are the content here; the border is only there to give a
       transparent PNG an edge. It lightens on hover rather than moving the
       card, because a grid of fourteen cards that lift on hover is noise. */
    transition: border-color 0.25s ease;
}

.siggi-partners-grid .partner-item > a:hover .partner-thumb,
.siggi-partners-grid .partner-item > a:focus-visible .partner-thumb {
    border-color: #222;
}

.siggi-partners-grid .partner-thumb img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.siggi-partners-grid .partner-name {
    display: block;
    font-size: 14px;
    line-height: 1.4;
    color: #222;
    /* The name is a proper noun in Latin script on a page that may be laid out
       right-to-left. Isolating it keeps a trailing bracket or dot from being
       reordered to the wrong end of it in Hebrew. */
    unicode-bidi: isolate;
}

.siggi-partners-grid .partner-item > a:hover .partner-name,
.siggi-partners-grid .partner-item > a:focus-visible .partner-name {
    color: #000;
}

@media (max-width: 480px) {
    .siggi-partners-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 20px 15px;
    }

    .siggi-partners-grid .partner-thumb {
        height: 90px;
        padding: 8px;
    }
}
