/* ==========================================================================
   Motomarine v3 · Cards
   .cs-card = bordered white card: __media (photo, zooms on hover), __body
   (h3 + p + optional cs-list + __actions). Modifiers: --framed (padding
   around the photo too, 2-up), --overlay (photo with a navy foot gradient,
   white title and an outlined round arrow that fills red on hover, 4-up),
   --row (photo left, body right, stacked in .cs-cards-stack beside a
   .cs-cards-copy column), --caption (photo + centered title bar), --panel
   (photo under a navy overlay with a title; --panel-hover swaps in a centered
   title + stacked outline links on hover), --dark (dark card
   recipe). On .bg-lighter the border drops for a shadow.
   ========================================================================== */

/* --- Base card --- */
.cs-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--white);
    transition: box-shadow .2s;
}
.cs-card:hover {
    box-shadow: var(--shadow);
}
.cs-card__media {
    display: block;
    overflow: hidden;
}
.cs-card__media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 20 / 13;
    object-fit: cover;
    transition: transform .6s ease;
}
.cs-card:hover .cs-card__media img {
    transform: scale(1.04);
}
.cs-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 28px 30px;
}
.cs-card__body h2,
.cs-card__body h3 {
    margin-bottom: 10px;
}
.cs-card__body h2 a,
.cs-card__body h3 a {
    color: inherit;
    text-decoration: none;
    transition: color .2s;
}
.cs-card__body h2 a:hover,
.cs-card__body h3 a:hover {
    color: var(--primary);
}
.cs-card__body > p {
    margin: 0 0 20px;
}
.cs-card__body .cs-list {
    margin-bottom: 24px;
}
.cs-card__actions {
    margin-top: auto;
}
.cs-cards__more {
    margin-top: 40px;
}
.bg-lighter .cs-card {
    border: 0;
    box-shadow: var(--shadow);
}
.bg-lighter .cs-card:hover {
    box-shadow: var(--shadow-lg);
}
.cs-card--dark {
    border-color: rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
}
.cs-card--dark:hover {
    background: rgba(255, 255, 255, .08);
    box-shadow: none;
}
.cs-card--dark .cs-card__body h3 {
    color: var(--white);
}
.cs-card--dark .cs-card__body > p {
    color: rgba(255, 255, 255, .72);
}

/* --- Framed: padding around the photo too --- */
.cs-card--framed {
    padding: 32px;
}
.cs-card--framed .cs-card__media {
    border-radius: 4px;
}
.cs-card--framed .cs-card__media img {
    aspect-ratio: 30 / 19;
}
.cs-card--framed .cs-card__body {
    padding: 26px 0 0;
}
.cs-card--framed .cs-card__body h3 {
    margin-bottom: 12px;
}

/* --- Overlay: photo, navy foot gradient, white title + round arrow --- */
.cs-card--overlay {
    position: relative;
    display: block;
    border: 0;
    background: var(--heading);
    text-decoration: none;
}
.cs-card--overlay > img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 6;
    object-fit: cover;
    transition: transform .6s ease;
}
.cs-card--overlay > img {
    filter: brightness(.82);
}
.cs-card--overlay:hover > img {
    transform: scale(1.04);
}
.cs-card--overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(0deg, rgba(15, 23, 43, .95) 0%, rgba(15, 23, 43, .6) 35%, rgba(15, 23, 43, .15) 65%, transparent 85%);
}
.cs-card__overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
}
.cs-card__overlay .h5 {
    margin: 0;
    color: var(--white);
}
.cs-card__overlay-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 50%;
    color: var(--white);
    font-size: 13px;
    transition: background .2s, border-color .2s;
}
.cs-card__overlay-arrow i {
    display: flex;
    line-height: 1;
}
.cs-card--overlay:hover .cs-card__overlay-arrow {
    border-color: var(--primary);
    background: var(--primary);
}

/* --- Split heading + stacked cards: copy column beside two horizontal cards --- */
.cs-cards-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.cs-card--row {
    flex-direction: row;
    height: auto;
}
.cs-card--row .cs-card__media {
    position: relative;
    flex: 0 0 200px;
    min-height: 150px;
}
.cs-card--row .cs-card__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}
.cs-card--row .cs-card__body {
    padding: 20px 24px;
}
.cs-card--row .cs-card__body h3 {
    margin-bottom: 6px;
}
.cs-card--row .cs-card__body > p {
    margin-bottom: 12px;
}
.cs-cards-copy .head-label {
    margin-bottom: 7px;
}
.cs-cards-copy h2 {
    margin-bottom: 12px;
}
.cs-cards-copy > p {
    margin: 0 0 12px;
}
.cs-cards-copy > p:last-of-type {
    margin-bottom: 28px;
}

/* --- Photo caption cards: photo with a centered title bar --- */
.cs-card--caption {
    text-decoration: none;
}
.cs-card__caption {
    display: block;
    padding: 20px 20px 22px;
    font-family: var(--font-heading);
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    color: var(--heading);
}
.cs-card--dark .cs-card__caption {
    color: var(--white);
}

/* --- Photo panels with links: navy overlay, title, stacked outline links --- */
.cs-card--panel {
    position: relative;
    display: block;
    height: auto;
    border: 0;
    background: var(--heading);
    text-decoration: none;
}
.cs-card--panel > img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .6s ease;
}
.cs-card--panel:hover > img {
    transform: scale(1.04);
}
.cs-card--panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(15, 23, 43, .55);
    transition: background .3s;
}
.cs-card--panel:hover::before {
    background: rgba(15, 23, 43, .7);
}
.cs-card__panel-body {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 32px;
    color: var(--white);
}
.cs-card__panel-body .h3 {
    margin: 0;
    color: var(--white);
}
.cs-card__panel-body--center {
    align-items: center;
    justify-content: center;
    text-align: center;
}
.cs-card--panel-hover .cs-card__panel-body,
.cs-card--panel-hover .cs-card__panel-body--center {
    transition: opacity .3s ease, transform .3s ease;
}
.cs-card--panel-hover .cs-card__panel-body--center {
    opacity: 0;
    transform: translateY(12px);
}
.cs-card--panel-hover:hover .cs-card__panel-body {
    opacity: 0;
}
.cs-card--panel-hover:hover .cs-card__panel-body--center {
    opacity: 1;
    transform: none;
}
.cs-card--panel-hover:hover::before {
    background: rgba(15, 23, 43, .78);
}
.cs-card__panel-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    margin-top: 22px;
}
.cs-card__panel-link {
    display: block;
    padding: 12px 18px;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 0;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--white);
    text-decoration: none;
    transition: background .2s, border-color .2s, color .2s;
}
.cs-card__panel-link:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
}
.cs-card__panel-more {
    margin-top: 24px;
}

/* --- Responsive --- */
/* --- Wide split cards: stacked full width cards, photo or logo panel left, copy right --- */
.cs-cards-wide {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 1040px;
    margin: 0 auto;
}
.cs-card--wide {
    height: auto;
    border: 0;
    box-shadow: rgba(0, 0, 0, .1) 0 0 5px 0, rgba(0, 0, 0, .1) 0 0 1px 0;
}
.cs-card--wide .row > [class*="col-"] {
    display: flex;
}
.cs-card--wide .cs-card__media {
    flex: 1 1 auto;
    width: 100%;
    min-height: 300px;
}
.cs-card--wide .cs-card__media--fill {
    position: relative;
}
.cs-card--wide .cs-card__media--fill img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    filter: brightness(.9);
}
.cs-card--wide .cs-card__body {
    align-self: center;
    width: 100%;
    padding: 44px 56px;
}
.cs-card--wide .cs-card__body h3 {
    margin-bottom: 6px;
}
.cs-card__sub {
    display: block;
    margin-bottom: 14px;
    font-size: 17px;
    font-weight: 500;
    color: var(--heading);
}
.cs-card--wide .cs-card__body > p {
    margin-bottom: 22px;
}
.cs-cards-wide__note {
    max-width: 900px;
    margin: 40px auto 0;
    font-size: 14px;
    text-align: center;
    color: var(--muted);
}
.cs-card--wide.cs-card--dark {
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, .12);
}
.cs-card--wide.cs-card--dark .cs-card__sub {
    color: var(--white);
}
.bg-dark .cs-cards-wide__note {
    color: rgba(255, 255, 255, .6);
}

@media (max-width: 991px) {
    .cs-card--wide .cs-card__body {
        padding: 32px 36px;
    }
    .cs-card--wide .cs-card__media {
        min-height: 260px;
    }
    .cs-card--framed {
        padding: 24px;
    }
}
@media (max-width: 767px) {
    .cs-card--wide .cs-card__media {
        min-height: 0;
        aspect-ratio: 16 / 10;
    }
    .cs-card--wide .cs-card__body {
        padding: 28px 24px 30px;
    }
    .cs-cards-wide {
        gap: 24px;
    }
}
@media (max-width: 575px) {
    .cs-card__body {
        padding: 22px 20px 24px;
    }
    .cs-card--framed {
        padding: 16px;
    }
    .cs-card--framed .cs-card__body {
        padding: 22px 4px 8px;
    }
    .cs-card__overlay {
        padding: 16px;
    }
    .cs-card__caption {
        padding: 14px 10px 16px;
        font-size: .9375rem;
    }
    .cs-card__panel-body {
        padding: 20px;
    }
    .cs-card__panel-links {
        margin-top: 14px;
        gap: 8px;
    }
    .cs-card__panel-link {
        padding: 10px 14px;
        font-size: 14px;
    }
    .cs-card--row {
        flex-direction: column;
    }
    .cs-card--row .cs-card__media {
        flex-basis: auto;
        min-height: 0;
    }
    .cs-card--row .cs-card__media img {
        position: static;
        aspect-ratio: 20 / 11;
    }
    .cs-card--row .cs-card__body {
        padding: 20px 20px 22px;
    }
    .cs-card__overlay .h5 {
        font-size: .9375rem;
    }
    .cs-card__overlay-arrow {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}

/* --- Card rows swipe sideways on phones instead of stacking --- */
@media (max-width: 991px) {
    .row:has(> [class*="col-"] > .cs-card) {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .row:has(> [class*="col-"] > .cs-card)::-webkit-scrollbar {
        display: none;
    }
    .row:has(> [class*="col-"] > .cs-card) > [class*="col-"] {
        flex: 0 0 84%;
        max-width: 84%;
        scroll-snap-align: start;
    }
    /* Tablets see two cards at a time, phones one */
    @media (min-width: 576px) {
        .row:has(> [class*="col-"] > .cs-card) > [class*="col-"] {
            flex: 0 0 48%;
            max-width: 48%;
        }
    }
    .row:has(> [class*="col-"] > .cs-card) > [class*="col-"] .cs-card {
        height: 100%;
    }
    .row:has(> [class*="col-"] > .cs-card--panel),
    .row:has(> [class*="col-"] > .cs-card--caption),
    .row:has(> [class*="col-"] > .cs-card--overlay) {
        flex-wrap: wrap;
        overflow-x: visible;
    }
    .row:has(> [class*="col-"] > .cs-card--panel) > [class*="col-"],
    .row:has(> [class*="col-"] > .cs-card--caption) > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
    /* Overlay cards keep a grid rather than a swipe row: four up from tablet, two up on phones */
    .row:has(> [class*="col-"] > .cs-card--overlay) > [class*="col-"] {
        flex: 0 0 25%;
        max-width: 25%;
    }
    .cs-card--overlay .cs-card__overlay {
        padding: 12px;
    }
}

/* Paging dots under a swipe row (phones only) */
.cs-swipe-dots {
    display: none;
}
/* Loop clones only exist inside the phone carousel */
[data-cs-clone] {
    display: none;
}
@media (max-width: 991px) {
    .row:has(> [class*="col-"] > .cs-card) > [data-cs-clone] {
        display: block;
    }
}
@media (max-width: 991px) {
    .cs-swipe-dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 20px;
    }
    .cs-swipe-dots button {
        width: 8px;
        height: 8px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: var(--border-strong);
        cursor: pointer;
        transition: var(--transition);
    }
    .cs-swipe-dots button.is-active {
        width: 22px;
        border-radius: 4px;
        background: var(--primary);
    }
    .bg-dark .cs-swipe-dots button {
        background: rgba(255, 255, 255, .3);
    }
    .bg-dark .cs-swipe-dots button.is-active {
        background: var(--primary);
    }
}

/* Rows marked data-swipe-dots only swipe on phones, so their dots stay hidden above that */
@media (min-width: 768px) {
    [data-swipe-dots] + .cs-swipe-dots {
        display: none;
    }
}

/* Overlay cards on phones: two up with a tighter gutter */
@media (max-width: 575px) {
    .row:has(> [class*="col-"] > .cs-card--overlay) {
        --bs-gutter-x: 12px;
        --bs-gutter-y: 12px;
    }
    .row:has(> [class*="col-"] > .cs-card--overlay) > [class*="col-"] {
        flex: 0 0 50%;
        max-width: 50%;
    }
    .cs-card--overlay .cs-card__overlay {
        padding: 12px;
    }
}


/* ==========================================================================
   v5 · Modern cards
   .cs-cards--modern sits on the row or stack that holds the cards, so card
   use elsewhere keeps its old look. Photos stay clean: they only zoom
   inside their frame. Cards lift on hover, overlay cards slide their
   title up and turn the arrow red.
   ========================================================================== */
.cs-cards--modern .cs-card:not(.cs-card--overlay):not(.cs-card--panel) {
    position: relative;
    transition: transform .3s var(--ease-out), box-shadow .3s ease, border-color .3s ease;
}
.cs-cards--modern .cs-card__media img,
.cs-cards--modern .cs-card--overlay > img {
    transition: transform 1s var(--ease-out);
}

/* --- Overlay cards: title slides up, arrow fills red --- */
.cs-cards--modern .cs-card--overlay:hover > img {
    transform: scale(1.08);
}
.cs-cards--modern .cs-card__overlay {
    transition: transform .4s var(--ease-out);
}
.cs-cards--modern .cs-card--overlay:hover .cs-card__overlay {
    transform: translateY(-6px);
}
.cs-cards--modern .cs-card__overlay-arrow {
    transition: background .3s ease, border-color .3s ease, transform .3s var(--ease-out);
}
.cs-cards--modern .cs-card--overlay:hover .cs-card__overlay-arrow {
    border-color: var(--primary);
    background: var(--primary);
    transform: rotate(-45deg);
}

/* --- Photo panels: the photo zooms under the panel --- */
.cs-cards--modern .cs-card--panel > img {
    transition: transform 1s var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
    .cs-cards--modern .cs-card,
    .cs-cards--modern .cs-card img,
    .cs-cards--modern .cs-card__overlay {
        transition: none;
    }
}
