/* Post scroller - styled to match the category scroller */
.post-scroller {
    --post-scroller-arrow-space: 3.75rem; /* 60px each side for the arrows */
    --post-scroller-inset: 0.625rem; /* 10px around the row of cards */
    box-sizing: border-box; /* Keep padding inside 100% width so the right arrow stays on screen */
    width: 100%;
    padding: 0.625rem 0; /* 10px */
    border-radius: 8px;
}

/* Title lines up with the left edge of the first card */
.post-scroller-title {
    font-size: 2em; /* Same as H1s (browser default - the theme doesn't set one) */
    margin: 0;
    padding: 0 calc(var(--post-scroller-arrow-space) + var(--post-scroller-inset));
}

/* Holds the arrows and cards, so the arrows centre on the cards, not the title */
.post-scroller-track {
    position: relative;
    padding: 0 var(--post-scroller-arrow-space);
}

/* Cards in a row */
.post-scroller-inner {
    display: flex;
    gap: 0.9375rem; /* 15px */
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: var(--post-scroller-inset);
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none; /* Hide scrollbar in IE/Edge */
    scrollbar-width: none; /* Hide scrollbar in Firefox */
}

.post-scroller-inner::-webkit-scrollbar {
    display: none;
}

.post-scroller-item {
    flex: 0 0 auto;
    width: 25rem; /* 400px */
    max-width: 85vw;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    padding: 0.9375rem; /* 15px */
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
    overflow: hidden;
    scroll-snap-align: start;
}

.post-scroller-thumbnail {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 2.17; /* Same ratio as category thumbnails */
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.625rem;
}

.post-scroller-thumbnail.no-thumbnail {
    background: #eeeeee;
}

.post-scroller-item h3 {
    margin: 0.625rem 0 0;
}

.post-scroller-item h3 a {
    color: inherit;
    text-decoration: none;
}

.post-scroller-item p {
    font-size: 0.875rem; /* 14px */
    color: #555;
    line-height: 1.5;
    margin: 0.625rem 0;
    overflow: hidden;
    word-wrap: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3; /* Limits to 3 lines */
    max-height: 4.5em;
}

.post-scroller-read-more {
    display: block;
    margin-top: auto; /* Line buttons up along the bottom of the cards */
    padding-top: 0.625rem;
    color: #0073aa;
    text-decoration: none;
    font-weight: bold;
}

.post-scroller-read-more:hover {
    text-decoration: underline;
}

/* Left & right scroll arrows */
.post-scroller-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0px;
    transition: opacity 0.2s ease;
}

.post-scroller-arrow.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.post-scroller-left {
    left: 0;
}

.post-scroller-right {
    right: 0;
}

.post-scroller-arrow img {
    width: 3.125rem; /* 50px */
    height: auto;
    transition: filter 0.1s ease-in-out;
}

/* Change from black (#000000) to red (#e10f14) on hover */
.post-scroller-arrow:hover img {
    filter: invert(13%) sepia(92%) saturate(5805%) hue-rotate(357deg) brightness(90%) contrast(120%);
}

/* Page dots under the cards - sized like the page slideshow's, black like the arrows */
.post-scroller-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 0.625rem;
}

.post-scroller-dots[hidden] {
    display: none;
}

.post-scroller-dot {
    width: 0.75rem; /* 12px */
    height: 0.75rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #000000;
    opacity: 0.25;
    cursor: pointer;
    transition: opacity 0.2s, background 0.2s;
}

.post-scroller-dot.active {
    opacity: 1;
}

.post-scroller-dot:hover {
    background: #e10f14; /* Red, like the arrows on hover */
    opacity: 1;
}

@media screen and (max-width: 768px) {
    .post-scroller-dot {
        width: 0.9375rem; /* 15px - easier to tap */
        height: 0.9375rem;
    }

    .post-scroller-arrow {
        display: none;
    }

    .post-scroller {
        --post-scroller-arrow-space: 0px;
        --post-scroller-inset: 0px;
        padding: 0px;
    }

    .post-scroller-title {
        font-size: 2rem; /* Same as H1s on mobile (style.css) */
        padding-bottom: 1rem; /* Matches the 1rem (Small) top padding on the group above it */
    }

    .post-scroller-inner {
        padding: 0 0 0.625rem;
    }
}
