/* Section wrapper -- full bleed dark bg */
.resource-carousel-block {
    background-color: var(--wp--preset--color--main);
    padding: var(--wp--preset--spacing--x-large) 0;
    overflow: hidden; /* clip peek on right edge of viewport */
}

/* Container -- left-aligned to wide width, extends full-width to the right */
.resource-carousel-block__container {
    max-width: calc((100% - 1248px) / 2 + 1248px);
    margin-left: auto;
    margin-right: 0;
    padding: 0;
}

/* Swiper -- overflow visible so peeking card extends into clipped area */
.resource-carousel-block__swiper {
    overflow: visible;
}

/* Slide height consistency */
.resource-carousel-block__swiper .swiper-wrapper {
    align-items: stretch;
}

.resource-carousel-block__swiper .swiper-slide {
    height: auto;
}

/* Individual card slide */
.resource-carousel-block__card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* Image area -- 8:5 aspect ratio */
.resource-carousel-block__image-wrap {
    position: relative;
    aspect-ratio: 8 / 5;
    overflow: hidden;
    margin: 0;
}

.resource-carousel-block__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resource-carousel-block__gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 58%, rgba(0, 0, 0, 0.2));
}

/* Card body -- white bg, fills remaining height for consistent card sizes */
.resource-carousel-block__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    background-color: var(--wp--preset--color--base);
    padding: 1.4375rem 1rem;
    gap: var(--wp--preset--spacing--small);
    min-height: 0;
}

/* Meta row -- category badge + brand icon */
.resource-carousel-block__meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.resource-carousel-block__badge {
    color: var(--wp--preset--color--main);
    font-family: var(--wp--preset--font-family--roboto-flex);
    font-size: 0.875rem;
    line-height: 1.2;
    max-width: 55%;
}

/* Brand icon — colored cube, no background */
.resource-carousel-block__brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.resource-carousel-block__brand-icon svg {
    width: 1.4375rem;
    height: auto;
}

.resource-carousel-block__brand-icon--americase svg path {
    fill: var(--wp--preset--color--primary);
}

.resource-carousel-block__brand-icon--hazmat-safety-consulting svg path {
    fill: var(--wp--preset--color--hazmat-orange);
}

.resource-carousel-block__brand-icon--fulcrum-testing svg path {
    fill: var(--wp--preset--color--fulcrum-green);
}

/* Title */
.resource-carousel-block__title {
    font-family: var(--wp--preset--font-family--neue-haas-display);
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.069rem;
    color: var(--wp--preset--color--main);
    margin: 0;
    flex: 1;
}

/* View Resource CTA in card */
.resource-carousel-block__cta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: auto;
}

.resource-carousel-block__cta-text {
    font-family: var(--wp--preset--font-family--roboto-flex);
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    color: var(--wp--preset--color--main);
}

.resource-carousel-block__cta-arrow {
    display: flex;
    color: var(--wp--preset--color--main);
}

/* Footer -- nav + CTA */
.resource-carousel-block__footer {
    max-width: 1248px;
    margin: 0 auto;
    padding-top: var(--wp--preset--spacing--medium);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Navigation arrows */
.resource-carousel-block__nav {
    display: flex;
    gap: 0.8125rem;
}

.resource-carousel-block__nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--wp--preset--color--base);
    cursor: pointer;
    padding: 0;
    transition: opacity 0.3s ease;
}

.resource-carousel-block__nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.resource-carousel-block__nav-btn svg {
    width: 2.5rem;
    height: 2.5rem;
}

.resource-carousel-block__nav-btn--prev svg {
    transform: rotate(180deg);
}

/* CTA outline button */
.resource-carousel-block__view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--wp--preset--color--primary-light);
    background: transparent;
    color: var(--wp--preset--color--base);
    padding: 0.875rem 1.125rem;
    font-family: var(--wp--preset--font-family--roboto-flex);
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    text-decoration: none;
    transition: all 0.3s ease-in-out;
}

.resource-carousel-block__view-all:hover {
    background-color: var(--wp--preset--color--primary-dark);
    color: var(--wp--preset--color--base);
}

/* Responsive */
@media (max-width: 80rem) {
    .resource-carousel-block__container {
        padding-left: var(--wp--preset--spacing--x-large);
    }

    .resource-carousel-block__footer {
        padding-left: var(--wp--preset--spacing--x-large);
        padding-right: var(--wp--preset--spacing--x-large);
    }
}

@media (max-width: 37.5rem) {
    .resource-carousel-block__container {
        padding-right: var(--wp--preset--spacing--x-large);
    }

    .resource-carousel-block__footer {
        flex-direction: column;
        gap: var(--wp--preset--spacing--medium);
        align-items: center;
    }

    .resource-carousel-block__view-all {
        align-self: stretch;
        text-align: center;
        justify-content: center;
    }
}

/* Preview mode */
.resource-carousel-block--preview {
    padding: var(--wp--preset--spacing--large);
}

.resource-carousel-block__placeholder {
    color: var(--wp--preset--color--border-light);
    text-align: center;
    font-style: italic;
}
