/**
 * Component: Brands Cards
 * Values extracted from Figma (desktop frame 1920px, container 1520px).
 * All rules are scoped under .tama-brands.
 */

/* --- Section --- */
.tama-brands {
    padding: 74px 0 40px;
}

/* --- Header --- */
.tama-brands__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
}

.tama-brands__title {
    margin: 0;
    font-size: 60px;
    line-height: 0.95 !important; /* overrides .helvetica line-height */
    color: #1C2D00;
}

.tama-brands__text {
    margin: 0;
    font-size: 24px;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: #1C2D00;
}

/* --- Cards List (desktop: one row) --- */
.tama-brands__list {
    display: flex;
    justify-content: center;
    gap: 43px;
    padding: 32px 0;
}

/* --- Card: 350 x 225px --- */
.tama-brands__card {
    position: relative;
    display: flex;
    flex: 0 1 350px;
    flex-direction: column;
    max-width: 350px;
    aspect-ratio: 350 / 225;
    padding: 16px 16px 40px; /* bottom space is reserved for the absolute link */
    background-color: #FFFFFF;
    border-radius: 20px;
}

/* Logo area: centered. Figma Akron logo = 265 x 51.61px inside the 350px card (side margins ~42px) */
.tama-brands__logo {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.tama-brands__logo img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(265px, 100%);
    max-height: 126px;
    object-fit: contain;
}

/* --- "See products" link: 24px from right, 16px from bottom --- */
.tama-brands__link {
    position: absolute;
    right: 24px;
    bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1C2D00;
    text-decoration: none;
}

.tama-brands__link:hover,
.tama-brands__link:focus {
    color: #1C2D00;
}

.tama-brands__link:hover .tama-brands__link-text {
    text-decoration: underline;
}

.tama-brands__link:focus-visible {
    outline: 2px solid #1C2D00;
    outline-offset: 4px;
    border-radius: 4px;
}

.tama-brands__link-text {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.1;
}

.tama-brands__link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    background-color: var(--primary-color, #667F06);
    border-radius: 5px;
}

/* --- Mobile controls: hidden until the slider breakpoint --- */
.tama-brands__controls {
    display: none;
}

/* --- Large laptops: scale down text --- */
@media screen and (max-width: 1440px) {
    .tama-brands__title {
        font-size: 48px;
    }

    .tama-brands__text {
        font-size: 20px;
    }

    .tama-brands__list {
        gap: 24px;
    }
}

/* --- Tablet: 2 cards per row --- */
@media screen and (min-width: 770px) and (max-width: 1199px) {
    .tama-brands__list {
        flex-wrap: wrap;
    }

    .tama-brands__card {
        flex: 0 1 calc(50% - 12px);
    }

    .tama-brands__logo img {
        max-height: 100px;
    }
}

/* --- Mobile: Slick slider (<= 769px, same breakpoint as articles_cards) --- */
@media screen and (max-width: 769px) {
    .tama-brands {
        padding: 48px 0 32px;
    }

    .tama-brands__header {
        gap: 16px;
    }

    .tama-brands__title {
        font-size: 36px;
    }

    .tama-brands__text {
        font-size: 18px;
    }

    .tama-brands__list {
        display: block;
        padding: 24px 0 0;
    }

    /* Before Slick initializes: one row, no stacked jump */
    .tama-brands__list:not(.slick-initialized) {
        display: flex;
        justify-content: flex-start;
        overflow: hidden;
    }

    /* Fixed Figma card size (350 x 225px), shrinks only on narrow phones */
    .tama-brands__list .tama-brands__card {
        flex: none;
        width: min(350px, calc(100vw - 80px));
        max-width: none;
        height: 225px;
        aspect-ratio: auto;
        margin: 0 8px;
    }

    /* Slick 1.5.7 puts .slick-slide on the card itself and forces display:block */
    .tama-brands__list.slick-initialized .tama-brands__card {
        display: flex;
    }

    .tama-brands__logo img {
        max-width: 100%; /* mobile keeps its previous look */
        max-height: 100px;
    }

    .tama-brands__controls {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 16px;
        margin-top: 24px;
    }
}
