/* m252 (BP-273 round 10): Portfolio page, the Carousels group. Same card look as m203 (radius, shadow, caption). */

.pf-grid.m252-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.m252-car {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* the card's height comes from its pages: one page is 86% of the card wide, the next one peeks in */
.pf-card__media.m252-car__media {
    aspect-ratio: auto;
}

.m252-car__track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.m252-car__track::-webkit-scrollbar {
    display: none;
}

.m252-car__page {
    flex: 0 0 86%;
    display: block;
    aspect-ratio: 4 / 5;
    scroll-snap-align: start;
    background: var(--bp-lime-50, #f4fbe4);
}

.m252-car__page:last-child {
    scroll-snap-align: end;
}

.m252-car__page img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.m252-car__btn {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgb(28 40 0 / 0.82);
    color: var(--bp-lime, #c2f542);
    cursor: pointer;
    translate: 0 -50%;
    transition: opacity 0.2s, background-color 0.2s, color 0.2s;
}

.m252-car__btn svg {
    width: 22px;
    height: 22px;
}

.m252-car__prev { left: 10px; }
.m252-car__next { right: 10px; }
.m252-car__next svg { transform: scaleX(-1); }

.m252-car__btn[disabled] {
    opacity: 0;
    pointer-events: none;
}

.m252-car__btn:focus-visible {
    outline: 3px solid var(--bp-lime, #c2f542);
    outline-offset: 2px;
}

/* arrows on a desktop pointer; on a phone the card is swiped */
@media (hover: none), (pointer: coarse) {
    .m252-car__btn { display: none; }
}

@media (hover: hover) {
    .m252-car__btn:hover { background: var(--bp-lime, #c2f542); color: var(--bp-green-950, #1c2800); }
    .m252-car:hover .pf-card__media {
        transform: translateY(-4px);
        box-shadow: 0 26px 50px -24px rgb(28 40 0 / 0.55), 0 0 0 2px var(--bp-lime, #c2f542);
    }
}

/* the page count is in the caption ("page 3 of 10"), so nothing covers the design */
.m252-car__n b {
    color: var(--bp-green, #5c7900);
    font-variant-numeric: tabular-nums;
}

.m252-car__page:focus-visible {
    outline: 3px solid var(--bp-green, #5c7900);
    outline-offset: -3px;
}

@media (max-width: 719px) {
    .pf-grid.m252-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    .m252-car__btn { transition: none; }
}
