/**
 * Post Query Carousel
 *
 * Targets any element whose class contains "my-post-carousel" — covers
 * `my-post-carousel`, `my-post-carousel--green`, `my-post-carousel-insights`, etc.
 *
 * Colour tokens (set on the container, override per-variant below):
 *   --post-carousel-accent       button bg & active bullet
 *   --post-carousel-accent-hover button hover bg
 */

/* ── Tokens ─────────────────────────────────────────────────────────── */

[class*="my-post-carousel"] {
    --post-carousel-accent:       #1c4da1;
    --post-carousel-accent-hover: var(--wp--preset--color--secondary);
}

.my-post-carousel--green {
    --post-carousel-accent:       #00AE42;
}

/* ── Container ──────────────────────────────────────────────────────── */

[class*="my-post-carousel"] {
    overflow: hidden !important;
    position: relative;
    padding-bottom: 20px;
}

[class*="my-post-carousel"] .swiper-wrapper {
    display: flex !important;
}

/* ── Controls footer ────────────────────────────────────────────────── */

.swiper-controls-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
}

/* ── Navigation buttons ─────────────────────────────────────────────── */

[class*="my-post-carousel"] .swiper-button-next,
[class*="my-post-carousel"] .swiper-button-prev {
    position: static !important;
    background: transparent;
    border: 1.5px solid color-mix(in srgb, var(--post-carousel-accent) 50%, transparent);
    width: 35px !important;
    height: 35px !important;
    border-radius: 50%;
    margin: 0 !important;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

[class*="my-post-carousel"] .swiper-button-next:after,
[class*="my-post-carousel"] .swiper-button-prev:after {
    color: var(--post-carousel-accent);
    font-size: 14px !important;
    font-weight: bold;
}

[class*="my-post-carousel"] .swiper-button-next:hover,
[class*="my-post-carousel"] .swiper-button-prev:hover {
    background: color-mix(in srgb, var(--post-carousel-accent) 12%, transparent);
    border-color: var(--post-carousel-accent);
    transform: scale(1.05);
}

[class*="my-post-carousel"] .swiper-button-next:focus-visible,
[class*="my-post-carousel"] .swiper-button-prev:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--post-carousel-accent) 80%, transparent);
    outline-offset: 2px;
}

/* ── Pagination bullets ─────────────────────────────────────────────── */

[class*="my-post-carousel"] .swiper-pagination {
    position: static !important;
    width: auto !important;
}

[class*="my-post-carousel"] .swiper-pagination-bullet {
    width: 6px;
    height: 6px;
    padding: 0;
    border: none;
    border-radius: 3px;
    background: color-mix(in srgb, var(--post-carousel-accent) 30%, transparent);
    opacity: 1;
    transition: background 0.2s ease, width 0.25s ease;
}

[class*="my-post-carousel"] .swiper-pagination-bullet-active {
    width: 18px;
    background: var(--post-carousel-accent) !important;
}

[class*="my-post-carousel"] .swiper-pagination-bullet:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--post-carousel-accent) 80%, transparent);
    outline-offset: 2px;
}

/* ── Mobile ─────────────────────────────────────────────────────────── */

@media screen and (max-width: 600px) {
    .swiper-controls-wrapper {
        justify-content: flex-start;
        align-items: flex-start;
        margin-top: 30px;
    }
}
