.subpage-cards {
    box-sizing: border-box;
}

.subpage-cards *,
.subpage-cards-carousel * {
    box-sizing: border-box;
}

.subpage-cards-grid {
    display: grid;
    gap: 24px;
}

.subpage-card {
    min-width: 0;
    height: 100%;
}

.subpage-card > a {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
}

.subpage-card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #f2f2f2;
}

.subpage-card-title {
    margin-top: 16px;
}

.subpage-card-desc {
    margin: 8px 0 0;
}

.subpage-cards-carousel {
    position: relative;
    width: 100%;
}

.subpage-carousel-viewport {
    overflow: hidden;
    width: 100%;
}

.subpage-carousel-track {
    display: flex;
    gap: 24px;
    transition: transform 350ms ease;
    will-change: transform;
}

.subpage-carousel-slide {
    flex: 0 0 var(--subpage-slide-width, 100%);
    min-width: 0;
}

.subpage-carousel-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}

.subpage-carousel-prev,
.subpage-carousel-next {
    appearance: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    padding: 8px;
}

.subpage-carousel-prev[disabled],
.subpage-carousel-next[disabled] {
    cursor: default;
    opacity: 0.35;
}

.subpage-carousel-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.subpage-carousel-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.25;
    cursor: pointer;
}

.subpage-carousel-dot.is-active {
    opacity: 1;
}


/* Content-inside-image card style */
.subpage-card--overlay .subpage-card-img {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

.subpage-card--overlay .subpage-card-img::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: none;
    z-index: 0;
}

.subpage-card--overlay .subpage-card-content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 24px;
}

.subpage-card--overlay .subpage-card-title {
    margin-top: 0;
    color: #fff;
}

.subpage-card--overlay .subpage-card-desc {
    color: #fff;
}

.subpage-card--overlay > a {
    padding-bottom: 0;
}
