/* Úvodní stránka – nové články */
body.type-index .homepage-blog-wrapper {
    display: block;
    margin: 48px 0;
    padding: 0;
}

body.type-index .homepage-blog-wrapper .homepage-group-title {
    margin: 0 0 28px;
    padding: 0;
    color: #24242e;
    font-size: clamp(26px, 2.5vw, 34px);
    font-weight: 800;
    line-height: 1.3;
    text-align: left;
}

/* Tři karty na desktopu */
body.type-index .sl-home-blog-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    min-width: 0;
}

body.type-index .homepage-blog-wrapper .news-item {
    display: flex;
    float: none;
    width: auto !important;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 1px solid #dfe5eb;
    border-radius: 0;
    background: #fff;
    transition: border-color .2s;
}

body.type-index .homepage-blog-wrapper .news-item:hover {
    border-color: #245ba5;
}

/* Celá karta je jeden odkaz */
body.type-index .homepage-blog-wrapper .news-item > a:not(.cely-clanek) {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    color: inherit;
    text-decoration: none !important;
}

body.type-index .homepage-blog-wrapper .news-item .image {
    float: none;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #f3f6fa;
}

body.type-index .homepage-blog-wrapper .news-item .image img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    border-radius: 0;
    transition: transform .3s;
}

body.type-index .homepage-blog-wrapper .news-item:hover .image img {
    transform: scale(1.025);
}

body.type-index .homepage-blog-wrapper .news-item .text {
    display: flex;
    flex: 1;
    flex-direction: column;
    float: none;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 24px;
    box-sizing: border-box;
}

body.type-index .homepage-blog-wrapper .news-item .title {
    display: block;
    margin: 0 0 14px;
    color: #24242e;
    font-size: clamp(20px, 1.6vw, 24px);
    font-weight: 800;
    line-height: 1.4;
    text-decoration: none !important;
}

body.type-index .homepage-blog-wrapper .news-item:hover .title {
    color: #245ba5;
}

body.type-index .homepage-blog-wrapper .news-item .description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    margin: 0 0 24px;
    color: #626b76;
    font-size: 15px;
    line-height: 1.75;
}

body.type-index .homepage-blog-wrapper .news-item .read-article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #dfe5eb;
    background: transparent;
    color: #245ba5;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
    text-decoration: none !important;
}

body.type-index .homepage-blog-wrapper .read-article::before {
    content: none;
}

body.type-index .homepage-blog-wrapper .read-article::after {
    content: "→";
    position: static;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-family: Arial, sans-serif;
    font-size: 22px;
    line-height: 1;
    text-decoration: none;
    transform: none;
}

/* Skript šablony sem přidává ještě druhý, nepotřebný odkaz */
body.type-index .homepage-blog-wrapper .news-item > .cely-clanek {
    display: none !important;
}

body.type-index .sl-home-blog-controls {
    display: none;
}

body.type-index .homepage-blog-wrapper a:focus-visible,
body.type-index .sl-home-blog-controls button:focus-visible {
    outline: 3px solid #245ba5;
    outline-offset: 3px;
}

/* Tablet – dvě karty a část další */
@media (max-width: 1199px) {
    body.type-index .sl-home-blog-track {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 46%;
        gap: 20px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scrollbar-width: thin;
        scrollbar-color: #245ba5 #edf1f6;
        padding-bottom: 16px;
    }

    body.type-index .sl-home-blog-track > .news-item {
        scroll-snap-align: start;
    }

    body.type-index .sl-home-blog-controls {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin-top: 16px;
    }

    body.type-index .sl-home-blog-hint {
        color: #626b76;
        font-size: 14px;
    }

    body.type-index .sl-home-blog-buttons {
        display: flex;
        gap: 8px;
    }

    body.type-index .sl-home-blog-controls button {
        appearance: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 46px;
        height: 46px;
        margin: 0;
        padding: 0;
        border: 1px solid #dfe5eb;
        border-radius: 0;
        background: #fff;
        color: #245ba5;
        font-family: Arial, sans-serif;
        font-size: 24px;
        line-height: 1;
        cursor: pointer;
    }

    body.type-index .sl-home-blog-controls button:hover:not(:disabled) {
        border-color: #245ba5;
        background: #245ba5;
        color: #fff;
    }

    body.type-index .sl-home-blog-controls button:disabled {
        opacity: .35;
        cursor: default;
    }
}

/* Mobil – jedna karta a viditelný začátek další */
@media (max-width: 767px) {
    body.type-index .homepage-blog-wrapper {
        margin: 36px 0;
    }

    body.type-index .sl-home-blog-track {
        grid-auto-columns: 86%;
        gap: 16px;
    }

    body.type-index .homepage-blog-wrapper .news-item .text {
        padding: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.type-index .homepage-blog-wrapper .news-item,
    body.type-index .homepage-blog-wrapper .news-item .image img {
        transition: none;
        transform: none;
    }
}
/* Carousel – jedna karta a boční šipky */
@media (max-width: 1199px) {
    body.type-index .homepage-blog-wrapper {
        position: relative;
        padding: 0 32px;
        box-sizing: border-box;
    }

    body.type-index .homepage-blog-wrapper .homepage-group-title {
        margin-bottom: 24px;
    }

    body.type-index .sl-home-blog-track {
        grid-auto-columns: 100%;
        gap: 20px;
        padding-bottom: 0;
        scrollbar-width: none;
    }

    body.type-index .sl-home-blog-track::-webkit-scrollbar {
        display: none;
    }

    /* Pryč se spodní nápovědou */
    body.type-index .sl-home-blog-hint {
        display: none;
    }

    /* Ovládání přesunout na boky carouselu */
    body.type-index .sl-home-blog-controls {
        display: block;
        position: absolute;
        inset: 60px 0 0;
        margin: 0;
        padding: 0;
        pointer-events: none;
    }

    body.type-index .sl-home-blog-buttons {
        display: contents;
    }

    body.type-index .sl-home-blog-controls button {
        position: absolute;
        top: 50%;
        z-index: 2;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 52px;
        padding: 0;
        border: 1px solid #dfe5eb;
        border-radius: 0;
        background: #fff;
        color: #245ba5;
        font-size: 25px;
        line-height: 1;
        box-shadow: 0 3px 12px rgba(20, 40, 65, .1);
        transform: translateY(-50%);
        pointer-events: auto;
    }

    body.type-index .sl-home-blog-controls button:first-child {
        left: 6px;
    }

    body.type-index .sl-home-blog-controls button:last-child {
        right: 6px;
    }

    body.type-index .sl-home-blog-controls button:disabled {
        visibility: hidden;
        pointer-events: none;
    }

    body.type-index .sl-home-blog-controls[hidden] {
        display: none;
    }
}

@media (max-width: 767px) {
    body.type-index .homepage-blog-wrapper {
        padding: 0 28px;
    }

    body.type-index .sl-home-blog-controls button {
        width: 40px;
        height: 48px;
    }

    body.type-index .sl-home-blog-controls button:first-child {
        left: 2px;
    }

    body.type-index .sl-home-blog-controls button:last-child {
        right: 2px;
    }
}