/**
 * Homepage News Slider Section
 * Styles match Figma design exactly
 * Built with design system variables
 *
 * @package Bonusovekody
 * @since 2.0.0
 */

/* ============================================
 * SECTION TITLE
 * ============================================ */

.news-slider__title {
    text-align: center;
    margin-bottom: var(--space-6);
}

/* ============================================
 * SLIDER CONTAINER
 * Desktop (>1024px): Shows 4 cards
 * Tablet (768px-1024px): Shows 2 cards
 * Mobile (<768px): Horizontal scroll, 1 card
 * ============================================ */

#homepage-news-slider .container {
    padding: 0;
    background: transparent;
}

 .news-slider__wrapper {
    margin-bottom: var(--space-6);
    overflow: hidden;
}

@media (min-width: 768px) {
    .news-slider__wrapper {
        position: relative;
    }

    .news-slider__track {
        display: flex;
        gap: var(--space-6);
        transition: transform var(--transition-base) var(--ease-out);
        will-change: transform;
    }

    .news-slider__track .news-card {
        flex: 0 0 calc((100% - (var(--space-6) * 3)) / 4);
        min-width: 0;
    }
}

@media (max-width: 1024px) and (min-width: 768px) {
    .news-slider__track .news-card {
        flex: 0 0 calc((100% - var(--space-6)) / 2);
    }
}

@media (max-width: 767px) {
    #homepage-news-slider .container {
        padding: 0;
    }

    .news-slider__wrapper {
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0 var(--container-padding);
    }

    .news-slider__wrapper::-webkit-scrollbar {
        display: none;
    }

    .news-slider__track {
        display: flex;
        gap: var(--space-4);
    }

    .news-slider__track .news-card {
        flex-shrink: 0;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        width: calc(100vw - var(--container-padding) * 2 - 60px);
        max-width: 340px;
    }

    .news-slider__title {
        padding: 0 var(--container-padding);
    }
}

/* ============================================
 * NEWS CARD
 * White card with image, title, date
 * ============================================ */

.news-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.news-card__link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Card Image */
.news-card__image {
    width: 100%;
    height: 180px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--grey-100);
    position: relative;
}

.news-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Card Content */
.news-card__content {
    padding: var(--space-7);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--space-3);
    flex-grow: 1;
}

/* Card Title */
.news-card__title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-base);
    color: #1A1A1A;
    margin: 0;
}

/* Card Date */
.news-card__date {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-small);
    color: var(--grey-500);
    display: block;
}

/* ============================================
 * FOOTER SECTION
 * CTA button (center) + Navigation arrows (right)
 * ============================================ */

.news-slider__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    position: relative;
}

@media (max-width: 767px) {
    .news-slider__footer {
        display: none;
    }
}

/* CTA Button "Všechny novinky" */
.news-slider__footer .btn-secondary:hover {
    background: #fff;
}

/* Navigation Arrows */
.news-slider__nav {
    display: flex;
    gap: var(--space-3);
    position: absolute;
    right: 0;
}

.news-slider__nav-button {
    width: var(--space-9);
    height: var(--space-9);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grey-600);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
}

.news-slider__nav-button:hover {
    background: var(--black);
    transform: scale(1.05);
}

.news-slider__nav-button img {
    width: var(--space-6);
    height: var(--space-6);
    display: block;
}

/* ============================================
 * PAGINATION DOTS (Mobile Only)
 * ============================================ */

.news-slider__dots {
    display: none;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

@media (max-width: 767px) {
    .news-slider__dots {
        display: flex;
    }

    .news-card__content {
    padding: 20px;
    }
}

.news-slider__dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: #E8E8E8;
    border: none;
    cursor: pointer;
    transition: width 0.3s ease, background-color 0.3s ease;
    padding: 0;
}

.news-slider__dot--active {
    width: 48px;
    height: 8px;
    border-radius: 4px;
    background: #2D7AE9;
}

.news-slider__dot:hover {
    background: #D0D0D0;
}

.news-slider__dot--active:hover {
    background: #2563C7;
}

/* ============================================
 * ACCESSIBILITY
 * ============================================ */

.news-slider__nav-button:focus,
.news-slider__dot:focus {
    outline: var(--space-1) solid var(--blue-500);
    outline-offset: var(--space-1);
}

.news-slider__cta:focus {
    outline: var(--space-1) solid var(--blue-500);
    outline-offset: var(--space-1);
}
