/* ────────────────────────────────────────────────────────────────
   Modern course cards (shared across course listings).

   Used on:
   - course.html          (related-courses section)
   - latest-courses.html
   - course/training-format.html
   - course/courses-by-venue.html
   - course/course-finder.html   (SSR fallback)

   Keep selectors unscoped so a single stylesheet powers every page.
   The legacy .card.card-product classes remain wrappers for backwards
   compatibility but no longer contribute visuals.
   ──────────────────────────────────────────────────────────────── */

:root {
    --rc-card-radius: 14px;
    --rc-card-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    --rc-card-shadow-hover: 0 14px 30px rgba(15, 23, 42, 0.09);
    --rc-card-border: #e6ebf0;
    --rc-primary: #0b7269;
    --rc-primary-dark: #095c55;
    --rc-secondary: #0a4772;
    --rc-text: #334155;
    --rc-muted: #64748b;
}

.rc-card {
    display: flex; flex-direction: column; height: 100%;
    position: relative;
    background: #fff;
    border: 1px solid var(--rc-card-border);
    border-radius: var(--rc-card-radius);
    box-shadow: var(--rc-card-shadow);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}

.rc-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--rc-card-shadow-hover);
    border-color: #c9e2df;
}

.rc-card__link {
    display: flex; flex-direction: column; height: 100%;
    color: inherit; text-decoration: none;
}
.rc-card__link:hover,
.rc-card__link:focus { color: inherit; text-decoration: none; }

.rc-card__image {
    position: relative; overflow: hidden;
    aspect-ratio: 400 / 137;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
    background: #eef2f7;
}
.rc-card__image img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.55s ease;
}
.rc-card:hover .rc-card__image img { transform: scale(1.03); }

.rc-card__body {
    /* the footer row went with the repeated call to action — the card is
       one anchor already — so the body carries its own bottom padding */
    padding: 0.9rem 1.05rem 1rem;
    flex: 1 1 auto;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.rc-card__title {
    font-size: 0.95rem; font-weight: 700;
    color: var(--rc-secondary);
    margin: 0; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}
.rc-card:hover .rc-card__title { color: var(--rc-primary); }

/* One value, not two. 93.4% of the catalogue is "5 Days", and a random
   six cards from a category show the same duration more than half the
   time, so two chips side by side invited a comparison that was usually
   between identical things. Level varies — intermediate 67%, foundation
   26%, advanced 8% — so it leads; duration follows as quiet text.
   (2026-09-26) */
.rc-card__meta {
    display: flex; flex-wrap: wrap; align-items: baseline;
    gap: 0.4rem 0.6rem;
    margin: 0;
    font-size: 0.72rem; color: var(--rc-muted); font-weight: 500;
}
.rc-card__level {
    font-size: 0.62rem; font-weight: 700;
    letter-spacing: 0.07em; text-transform: uppercase;
    color: var(--rc-primary);
    background: rgba(11, 114, 105, 0.08);
    border-radius: 3px;
    padding: 0.14rem 0.4rem;
}
.rc-card__dur { color: var(--rc-muted); }

/* Three bullets and a repeated "Key skills you'll learn" label became
   one line. The bullets were truncated at 52 characters, which cut
   mid-word on half of them. */
.rc-card__covers {
    margin: 0;
    font-size: 0.76rem; line-height: 1.5; color: var(--rc-muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}

.rc-card__note {
    margin: 0.15rem 0 0; padding: 0.45rem 0.6rem;
    background: #f8fafc; border-radius: 8px;
    font-size: 0.72rem; color: var(--rc-muted); line-height: 1.4;
    display: flex; align-items: flex-start; gap: 0.4rem;
}
.rc-card__note i { color: var(--rc-primary); margin-top: 0.15rem; }

/* Compact variant (no banner image) — used on SSR course-finder fallback. */
.rc-card--compact .rc-card__body { padding-top: 1.1rem; }

/* Category pill sitting at the top of the body — optional. */
.rc-card__pill {
    display: inline-flex; align-items: center; align-self: flex-start;
    padding: 0.2rem 0.55rem;
    background: #f0faf9; color: var(--rc-primary);
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.05em;
    text-transform: uppercase; border-radius: 999px;
}

/* "See more" pill used below card grids. */
.rc-see-more-wrap { display: flex; justify-content: center; margin-top: 1.25rem; }
.rc-see-more {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.82rem; font-weight: 700;
    color: var(--rc-primary);
    background: #fff;
    border: 1.5px solid var(--rc-primary);
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.rc-see-more:hover {
    background: var(--rc-primary); color: #fff;
    box-shadow: 0 8px 20px rgba(11, 114, 105, 0.2);
    transform: translateY(-1px);
}
.rc-see-more svg {
    width: 16px; height: 16px;
    stroke: currentColor; stroke-width: 2;
    fill: none; stroke-linecap: round; stroke-linejoin: round;
    transition: transform 0.2s ease;
}
.rc-see-more:hover svg { transform: translateX(3px); }

/* ============================================
   Phone: rows, not posters (2026-09-26).
   Six stacked cards ran 2,724px — 15.9% of the
   page, more than three screens, for the block
   that matters least to a reader who has got
   this far. Same markup and the same single
   anchor, laid out as a row: thumbnail, title,
   one muted line. The banner survives because
   3,780 of 3,782 active courses have their own.
   ============================================ */
@media (max-width: 767.98px) {
    .rc-card { flex-direction: row; }
    .rc-card__link { flex-direction: row; align-items: center; gap: 0.8rem; width: 100%; }

    .rc-card__image {
        flex: 0 0 96px;
        width: 96px;
        aspect-ratio: 1 / 1;
        border-radius: var(--rc-card-radius) 0 0 var(--rc-card-radius);
    }

    .rc-card__body {
        padding: 0.7rem 0.9rem 0.7rem 0;
        gap: 0.3rem;
        justify-content: center;
    }

    .rc-card__title { font-size: 0.88rem; }

    /* one muted line: level and duration read as a single fact rather
       than two competing chips */
    .rc-card__meta { gap: 0.35rem; font-size: 0.7rem; }
    .rc-card__level {
        background: none; padding: 0;
        letter-spacing: 0.05em;
    }
    .rc-card__level::after { content: ' ·'; color: var(--rc-muted); }

    /* the syllabus line is the first thing to go at this width */
    .rc-card__covers { display: none; }
}

/* Card footer CTA.
   Restored 2026-09-26. These three rules were dropped by 2992823a, which
   rewrote this file for the course page's related-courses cards. Four
   other pages render `.rc-card__cta` — the course finder and both
   listing pages through customHits in course-search.js, and the SSR
   fallback through _listing_ssr_cards.html — and none of them defines it
   anywhere else, so the arrow lost its sizing and rendered as a 348px
   black triangle inside every card. Production is unaffected: 2992823a
   is on develop and has not been released. Copied verbatim from
   origin/main so the peer's new card work is untouched. */
.rc-card__cta {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.5rem;
    padding: 0.8rem 1.1rem 1rem;
    margin-top: auto;
    font-size: 0.8rem; font-weight: 700; color: var(--rc-primary);
    border-top: 1px solid #eef2f7;
}
.rc-card__cta svg {
    width: 16px; height: 16px;
    stroke: currentColor; stroke-width: 2;
    fill: none; stroke-linecap: round; stroke-linejoin: round;
    transition: transform 0.2s ease;
}
.rc-card:hover .rc-card__cta svg { transform: translateX(3px); }
