/* Prodávané značky – matches https://csm-vrchlabi.cz/ gallery (grayscale → color on hover) */

.csm-sold-brands {
    padding: 2.5rem 0 3.5rem;
}

.csm-sold-brands .csm-section-heading {
    margin-bottom: 2.5rem;
}

.csm-brand-logos__gallery {
    display: grid;
    grid-gap: 2.5rem;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    align-items: end;
    justify-content: center;
    text-align: center;
}

@media (min-width: 769px) {
    .csm-brand-logos__gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .csm-brand-logos__gallery {
        grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
        grid-row-gap: 4rem;
        grid-column-gap: 6.25rem;
    }
}

.csm-brand-logos__link {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    line-height: 0;
}

/* CWImg wraps logos in an extra div; stretch it to the grid cell so w-full img sizing resolves. */
.csm-brand-logos__link > .csm-brand-logos__img {
    width: 100%;
}

.csm-brand-logos__img,
.csm-brand-logos__link img,
.csm-brand-logos__link picture img {
    display: block;
    max-width: 100%;
    max-height: 4.5rem;
    width: auto;
    height: auto;
    margin: 0 auto;
    filter: grayscale(100%);
    transition: filter 0.4s ease;
}

/* CWImg adds Tailwind w-full; override it so viewBox-only SVGs keep their intrinsic size. */
.csm-brand-logos__link img.w-full {
    width: auto;
}

.csm-brand-logos__link:hover .csm-brand-logos__img,
.csm-brand-logos__link:hover img,
.csm-brand-logos__link:focus-visible .csm-brand-logos__img,
.csm-brand-logos__link:focus-visible img {
    filter: none;
}

.csm-brand-logos__link:focus-visible {
    outline: 2px solid #c8d400;
    outline-offset: 4px;
}

.csm-brand-logos__error {
    text-align: center;
    color: #fff;
    margin: 0;
}

/* Fixed last cell – “A další…” (not editable in CMS) */
.csm-brand-logos__more {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 4.5rem;
    text-align: center;
}

.csm-brand-logos__more-text {
    display: block;
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
    color: #000;
    letter-spacing: 0.02em;
}
