/* Full-bleed 100vw sections include the vertical scrollbar width. Clip their
 * overhang at the page container, not at the narrower content column.
 * Unlike hidden, clip does not create a scrolling container for sticky content.
 * The mobile card list keeps its own horizontal scrolling below. */
#primary:has(.ac-news-grid) {
    overflow-x: clip;
}

.ac-news-grid {
    position: relative;
    width: 100vw;
    max-width: none;
    margin-inline: calc(50% - 50vw);
    overflow: hidden;
    color: #fff;
    background: #13293d;
    font-family: var(--tamc-font, "Noto Sans Hebrew", "Noto Sans Display", Arial, sans-serif);
}

.ac-news-grid::before,
.ac-news-grid::after {
    content: "";
    position: absolute;
    inset: 0;
}

.ac-news-grid::before {
    z-index: 0;
    background: url("https://tamc.co.il/wp-content/uploads/2026/08/hospital-hallway-with-motion-effect-2.webp") center / cover no-repeat;
}

.ac-news-grid::after {
    z-index: 1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(11, 26, 41, 0.9) 100%);
}

.ac-news-grid__inner {
    position: relative;
    z-index: 2;
    max-width: 1240px;
    margin: 0 auto;
    padding: 40px;
}

.ac-news-grid .ac-news-grid__title {
    margin: 0 0 22px;
    color: #fff !important;
    font-size: 48px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
}

.ac-news-grid__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    gap: 28px;
}

.ac-news-grid__card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 3px solid #fbfbfb;
    border-radius: 22px;
    background: transparent;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.ac-news-grid__card:hover {
    opacity: 0.98;
    transform: translateY(-2px);
}

.ac-news-grid__card-link {
    position: relative;
    display: block;
    min-height: 300px;
    color: inherit;
    text-decoration: none;
}

.ac-news-grid__media {
    position: absolute;
    inset: 0;
    display: block;
    background-image: linear-gradient(359.59deg, rgba(19, 19, 19, 0.44) 7.09%, rgba(24, 114, 205, 0.44) 114.91%), var(--ac-news-bg);
    background-position: center;
    background-size: cover;
    transition: filter 0.12s ease;
}

.ac-news-grid__card:hover .ac-news-grid__media {
    filter: brightness(1.15);
}

.ac-news-grid__badge {
    position: absolute;
    z-index: 2;
    top: 14px;
    inset-inline-end: 18px;
    display: inline-flex;
    align-items: center;
    width: auto;
    padding: 8px 14px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(180deg, rgba(53, 128, 203, 0.4) 0%, rgba(26, 64, 101, 0.9) 100%);
    box-shadow: inset 5px 5px 4px rgba(255, 255, 255, 0.08), inset -5px -5px 4px rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    font-weight: 700;
}

.ac-news-grid__description {
    position: absolute;
    z-index: 2;
    inset-inline: 0;
    bottom: 0;
    display: flex;
    min-height: 95px;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-top: 3px solid #aeccea;
    border-radius: 0 0 17px 17px;
    background: linear-gradient(to bottom, rgba(53, 128, 203, 0.31), rgba(26, 64, 101, 0.8));
    box-shadow: inset 5px 5px 4px rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
}

.ac-news-grid__card-title {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ac-news-grid__empty {
    grid-column: 1 / -1;
    margin: 20px 0;
    text-align: center;
}

.ac-news-grid__more {
    display: flex;
    justify-content: center;
    margin-top: 26px;
}

.ac-news-grid__button {
    display: inline-flex;
    width: 300px;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    padding: 0 28px;
    border-radius: 4px;
    color: #fff;
    background: #246fae;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.ac-news-grid__button:hover,
.ac-news-grid__button:focus {
    color: #fff;
    opacity: 0.95;
    transform: translateY(-1px);
}

@media (max-width: 1024px) {
    .ac-news-grid__list {
        grid-template-columns: repeat(2, minmax(260px, 1fr));
    }
}

@media (max-width: 640px) {
    .ac-news-grid__inner {
        padding: 40px 0;
    }

    .ac-news-grid__title {
        padding: 0 20px;
        font-size: 24px;
    }

    .ac-news-grid__list {
        display: flex;
        gap: 20px;
        overflow-x: auto;
        padding: 0 40px 8px;
        scroll-padding-inline: 40px;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .ac-news-grid__list::-webkit-scrollbar {
        display: none;
    }

    .ac-news-grid__card {
        flex: 0 0 min(78vw, 340px);
        scroll-snap-align: center;
    }

    .ac-news-grid__card-link {
        min-height: 260px;
    }

    .ac-news-grid__description {
        min-height: 80px;
        padding: 10px;
    }

    .ac-news-grid__card-title {
        font-size: 20px;
        -webkit-line-clamp: 3;
    }

    .ac-news-grid__button {
        width: calc(100% - 40px);
        font-size: 16px;
    }
}
