/* Container Grid turned into a Horizontal Swiper Track */
.cpcg-grid {
    display: flex;
    gap: 20px;
    margin: 24px 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px; /* Space so shadows aren't clipped */

    /* Hide scrollbar for Chrome, Safari and Opera */
    scrollbar-width: none; /* Firefox */
}

.cpcg-grid::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

/* Outer Card Frame */
.cpcg-card {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    aspect-ratio: 2 / 3;

    /* CRITICAL: Force cards to maintain sizing horizontally without squeezing */
    flex: 0 0 280px;
    scroll-snap-align: start;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    cursor: grab; /* Shows hand grab utility */
}

.cpcg-card:active {
    cursor: grabbing;
}

/* Background Image & Overlay Controls */
.cpcg-image-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none; /* Prevents image dragging behavior from blocking js swipe */
}

.cpcg-image-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

/* Linear gradient to guarantee text is legible at the bottom */
.cpcg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 40%, rgba(0,0,0,0.75) 90%);
}

/* Card Content Box */
.cpcg-card-body {
    position: relative;
    z-index: 2;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    box-sizing: border-box;
    font-family: 'Sofia Sans', sans-serif;
}

/* Title Styling */
.cpcg-title {
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 28px 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* The Link Anchor (The only clickable area) */
.cpcg-link {
    align-self: flex-start;
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.cpcg-link:hover {
    opacity: 0.85;
    text-decoration: underline;
}

.cpcg-link:hover {
    opacity: 0.85;
    text-decoration: underline;
}

@media (min-width: 992px) {
    .cpcg-card {
        flex: 0 0 calc((100% - 80px) / 4.5);
    }
}