/* ==========================================================
   CDS Journey — Homepage Batches (Phase 3)
   Namespace: .rd-batches* / .rd-batch-card*
   Role: curated discovery — max 3 live cards
         + olive Upcoming Batches panel (Plan Ahead / Stay Ready)
   Breakpoints: <768 mobile | 768–1199 tablet 2-col | >=1200
   Palette: Navy / Olive / Gold / Live — no lavender/purple
   ========================================================== */

.rd-batches {
    position: relative;
    background: var(--rd-color-white, #FFFFFF);
    padding-block: 48px 56px;
}

.rd-batches__inner {
    width: 100%;
}

/* ---- Section header ---- */
.rd-batches__head {
    margin-bottom: 28px;
}

.rd-batches__eyebrow {
    position: relative;
    display: inline-block;
    margin: 0 0 12px;
    padding-bottom: 10px;
    font-family: var(--rd-font-mono, "IBM Plex Mono", monospace);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rd-color-olive, #4B5320);
}

.rd-batches__eyebrow::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background: var(--rd-color-gold, #D4AF37);
}

.rd-batches__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
}

.rd-batches__heading {
    margin: 0;
    max-width: 18ch;
    font-family: var(--rd-font-display, "Fraunces", Georgia, serif);
    font-size: clamp(28px, 4.2vw, 40px);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: var(--rd-color-navy, #1A2B4C);
}

.rd-batches__heading em {
    font-style: italic;
    font-weight: 600;
    color: var(--rd-color-olive, #4B5320);
}

.rd-batches__lead {
    margin: 14px 0 0;
    max-width: 42rem; /* ~600–700px */
    font-family: var(--rd-font-body, "Inter", Arial, sans-serif);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.55;
    color: var(--rd-text-secondary, #6C757D);
}

.rd-batches__all {
    color: var(--rd-color-navy, #1A2B4C);
    font-family: var(--rd-font-body, "Inter", Arial, sans-serif);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.rd-batches__all:link,
.rd-batches__all:visited {
    color: var(--rd-color-navy, #1A2B4C);
}

.rd-batches__all:hover {
    color: var(--rd-color-olive, #4B5320);
    outline: none;
}

.rd-batches__all:hover .rd-cta__arrow {
    transform: translateX(4px);
}

.rd-batches__all:focus {
    outline: none;
}

.rd-batches__all:focus-visible {
    outline: 2px solid var(--rd-color-navy, #1A2B4C);
    outline-offset: 3px;
    border-radius: 2px;
}

.rd-batches__all .rd-cta__arrow {
    display: inline-block;
    transition: transform 180ms ease;
}

.rd-batches__all--desktop {
    display: none;
}

.rd-batches__all--mobile {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
}

/* ---- Layout grid ---- */
.rd-batches__layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: stretch;
}

.rd-batches__empty {
    margin: 20px 0 0;
    padding: 16px 18px;
    border: 1px solid var(--rd-border-subtle, #DDE2E6);
    border-radius: 12px;
    background: var(--rd-surface-default, #F8F9FB);
    font-family: var(--rd-font-body, "Inter", Arial, sans-serif);
    font-size: 14px;
    line-height: 1.5;
    color: var(--rd-text-secondary, #6C757D);
}

.rd-batches__empty a {
    color: var(--rd-color-navy, #1A2B4C);
    font-weight: 600;
    text-decoration: none;
}

.rd-batches__empty a:hover {
    color: var(--rd-color-olive, #4B5320);
}

/* ---- Active batch card ---- */
.rd-batch-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    border: 1px solid var(--rd-border-subtle, #DDE2E6);
    border-radius: 16px;
    background: var(--rd-color-white, #FFFFFF);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(26, 43, 76, 0.04);
    transition:
        transform 200ms ease,
        border-color 200ms ease,
        box-shadow 200ms ease;
}

.rd-batch-card__media {
    position: relative;
    display: block;
    flex: 0 0 auto;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--rd-surface-default, #F8F9FB);
    text-decoration: none;
}

.rd-batch-card__media:focus {
    outline: none;
}

.rd-batch-card__media:focus-visible {
    outline: 2px solid var(--rd-color-navy, #1A2B4C);
    outline-offset: -2px;
}

.rd-batch-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rd-batch-card__media-scrim {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(26, 43, 76, 0.05) 0%,
        rgba(26, 43, 76, 0.18) 45%,
        rgba(26, 43, 76, 0.72) 100%
    );
}

.rd-batch-card__live {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--rd-border-subtle, #DDE2E6);
    background: rgba(255, 255, 255, 0.96);
    font-family: var(--rd-font-body, "Inter", Arial, sans-serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rd-color-live, #A73B2E);
    box-shadow: 0 1px 4px rgba(26, 43, 76, 0.08);
}

.rd-batch-card__live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rd-color-live, #A73B2E);
    flex-shrink: 0;
}

.rd-batch-card__exam-tab {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    margin: 0;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.96);
    font-family: var(--rd-font-body, "Inter", Arial, sans-serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rd-color-navy, #1A2B4C);
    box-shadow: 0 1px 4px rgba(26, 43, 76, 0.1);
}

.rd-batch-card__quote {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 12px;
    z-index: 1;
    margin: 0;
    font-family: var(--rd-font-display, "Fraunces", Georgia, serif);
    font-size: 14px;
    font-weight: 500;
    font-style: italic;
    line-height: 1.3;
    color: var(--rd-color-white, #FFFFFF);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.rd-batch-card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 8px;
    padding: 16px 16px 18px;
}

.rd-batch-card__title {
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-family: var(--rd-font-display, "Fraunces", Georgia, serif);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--rd-color-navy, #1A2B4C);
}

.rd-batch-card__title a {
    color: inherit;
    text-decoration: none;
}

.rd-batch-card__title a:hover {
    color: var(--rd-color-olive, #4B5320);
}

.rd-batch-card__title a:focus {
    outline: none;
}

.rd-batch-card__title a:focus-visible {
    outline: 2px solid var(--rd-color-navy, #1A2B4C);
    outline-offset: 2px;
    border-radius: 2px;
}

.rd-batch-card__desc {
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-family: var(--rd-font-body, "Inter", Arial, sans-serif);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--rd-text-secondary, #6C757D);
}

.rd-batch-card__features {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
}

.rd-batch-card__features li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--rd-font-body, "Inter", Arial, sans-serif);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--rd-text-secondary, #6C757D);
}

.rd-batch-card__features .uil {
    font-size: 14px;
    color: var(--rd-color-olive, #4B5320);
}

.rd-batch-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
}

.rd-batch-card__price {
    margin: 0;
    font-family: var(--rd-font-body, "Inter", Arial, sans-serif);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--rd-color-black, #1D1D1F);
    white-space: nowrap;
}

.rd-batch-card__price--empty {
    min-width: 1px;
}

.rd-batch-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    background: var(--rd-color-gold, #D4AF37);
    color: var(--rd-color-black, #1D1D1F);
    font-family: var(--rd-font-body, "Inter", Arial, sans-serif);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background 180ms ease, box-shadow 180ms ease;
}

.rd-batch-card__cta:link,
.rd-batch-card__cta:visited {
    color: var(--rd-color-black, #1D1D1F);
}

.rd-batch-card__cta span {
    display: inline-block;
    transition: transform 180ms ease;
}

.rd-batch-card__cta:hover {
    background: #C49F28;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.35);
    outline: none;
}

.rd-batch-card__cta:hover span {
    transform: translateX(3px);
}

.rd-batch-card__cta:active {
    background: #B89120;
}

.rd-batch-card__cta:focus {
    outline: none;
}

.rd-batch-card__cta:focus-visible {
    outline: 2px solid var(--rd-color-navy, #1A2B4C);
    outline-offset: 3px;
}

.rd-batch-card:hover {
    transform: translateY(-3px);
    border-color: rgba(26, 43, 76, 0.22);
    box-shadow: 0 8px 20px rgba(26, 43, 76, 0.08);
}

/* ---- Upcoming Batches panel (Plan Ahead / Stay Ready) ---- */
.rd-batches__next {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100%;
    border-radius: 16px;
    overflow: hidden;
    color: var(--rd-color-white, #FFFFFF);
    box-shadow: 0 4px 16px rgba(26, 43, 76, 0.1);
    background: var(--rd-color-olive, #4B5320);
}

.rd-batches__next-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-color: var(--rd-color-olive, #4B5320);
    background-image: url("../../images/upcoming-batch-banner.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 72% center;
}

.rd-batches__next-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(45, 52, 18, 0.55) 0%,
        rgba(45, 52, 18, 0.72) 42%,
        rgba(35, 42, 14, 0.88) 100%
    );
}

.rd-batches__next-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 100%;
    padding: 22px 20px 20px;
}

.rd-batches__next-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-family: var(--rd-font-body, "Inter", Arial, sans-serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rd-color-gold, #D4AF37);
}

.rd-batches__next-eyebrow .uil {
    font-size: 15px;
    line-height: 1;
}

.rd-batches__next-heading {
    margin: 0 0 10px;
    font-family: var(--rd-font-display, "Fraunces", Georgia, serif);
    font-size: 28px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--rd-color-white, #FFFFFF);
}

.rd-batches__next-heading em {
    font-style: italic;
    font-weight: 600;
    color: var(--rd-color-gold, #D4AF37);
}

.rd-batches__next-copy {
    margin: 0 0 16px;
    font-family: var(--rd-font-body, "Inter", Arial, sans-serif);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.86);
}

.rd-batches__next-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.rd-batches__next-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(248, 249, 251, 0.12);
    text-decoration: none;
    color: inherit;
    transition: background 180ms ease, border-color 180ms ease;
}

.rd-batches__next-item:link,
.rd-batches__next-item:visited {
    color: inherit;
}

.rd-batches__next-item:hover {
    background: rgba(248, 249, 251, 0.18);
    border-color: rgba(212, 175, 55, 0.55);
    outline: none;
}

.rd-batches__next-item:focus {
    outline: none;
}

.rd-batches__next-item:focus-visible {
    outline: 2px solid var(--rd-color-gold, #D4AF37);
    outline-offset: 2px;
}

.rd-batches__next-item-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(29, 29, 31, 0.35);
    color: var(--rd-color-gold, #D4AF37);
    font-size: 14px;
}

.rd-batches__next-item-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}

.rd-batches__next-item-name {
    font-family: var(--rd-font-body, "Inter", Arial, sans-serif);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--rd-color-white, #FFFFFF);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
}

.rd-batches__next-item-date {
    font-family: var(--rd-font-body, "Inter", Arial, sans-serif);
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.78);
}

.rd-batches__next-item-go {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--rd-color-gold, #D4AF37);
    transition: transform 180ms ease;
}

.rd-batches__next-item:hover .rd-batches__next-item-go {
    transform: translateX(3px);
}

.rd-batches__next-soon {
    margin: 0 0 18px;
    font-family: var(--rd-font-body, "Inter", Arial, sans-serif);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rd-color-gold, #D4AF37);
}

.rd-batches__next-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 44px;
    margin-top: auto;
    padding: 0 16px;
    border: 1px solid var(--rd-color-gold, #D4AF37);
    border-radius: 8px;
    background: rgba(45, 52, 18, 0.72);
    color: var(--rd-color-white, #FFFFFF);
    font-family: var(--rd-font-body, "Inter", Arial, sans-serif);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.rd-batches__next-cta:link,
.rd-batches__next-cta:visited {
    color: var(--rd-color-white, #FFFFFF);
}

.rd-batches__next-cta span {
    display: inline-block;
    transition: transform 180ms ease;
}

.rd-batches__next-cta:hover {
    background: rgba(75, 83, 32, 0.92);
    border-color: var(--rd-color-gold, #D4AF37);
    color: var(--rd-color-white, #FFFFFF);
    outline: none;
}

.rd-batches__next-cta:hover span {
    transform: translateX(3px);
}

.rd-batches__next-cta:focus {
    outline: none;
}

.rd-batches__next-cta:focus-visible {
    outline: 2px solid var(--rd-color-gold, #D4AF37);
    outline-offset: 3px;
}

/* ---- Empty states ---- */
.rd-batches__empty-cta {
    margin-top: 8px;
    padding: 28px 24px;
    border: 1px solid var(--rd-border-subtle, #DDE2E6);
    border-radius: 14px;
    background: var(--rd-surface-default, #F8F9FB);
    text-align: left;
}

.rd-batches__empty-cta-eyebrow {
    margin: 0 0 8px;
    font-family: var(--rd-font-mono, "IBM Plex Mono", monospace);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rd-color-olive, #4B5320);
}

.rd-batches__empty-cta-copy {
    margin: 0 0 16px;
    max-width: 36rem;
    font-family: var(--rd-font-body, "Inter", Arial, sans-serif);
    font-size: 16px;
    line-height: 1.5;
    color: var(--rd-text-secondary, #6C757D);
}

.rd-batches__empty-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    font-family: var(--rd-font-body, "Inter", Arial, sans-serif);
    font-size: 15px;
    font-weight: 600;
    color: var(--rd-color-navy, #1A2B4C);
    text-decoration: none;
}

.rd-batches__empty-cta-link:link,
.rd-batches__empty-cta-link:visited {
    color: var(--rd-color-navy, #1A2B4C);
}

.rd-batches__empty-cta-link span {
    display: inline-block;
    transition: transform 180ms ease;
}

.rd-batches__empty-cta-link:hover {
    color: var(--rd-color-olive, #4B5320);
}

.rd-batches__empty-cta-link:hover span {
    transform: translateX(4px);
}

.rd-batches__empty-cta-link:focus-visible {
    outline: 2px solid var(--rd-color-navy, #1A2B4C);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ==========================================================
   Mobile image height (~180–220px)
   ========================================================== */
@media (max-width: 767px) {
    .rd-batch-card__media {
        aspect-ratio: auto;
        height: clamp(180px, 48vw, 220px);
    }

    .rd-batch-card__quote {
        font-size: 13px;
    }

    .rd-batch-card__body {
        padding: 16px 16px 18px;
    }

    .rd-batch-card__cta {
        min-height: 44px;
        padding: 0 12px;
        font-size: 13px;
    }

    .rd-batch-card__price {
        font-size: 18px;
    }

    .rd-batches__next {
        min-height: 320px;
    }

    .rd-batches__next-heading {
        font-size: 26px;
    }
}

/* ==========================================================
   Tablet 768–1199 — 2-column
   ========================================================== */
@media (min-width: 768px) {
    .rd-batches {
        padding-block: 56px 64px;
    }

    .rd-batches__head {
        margin-bottom: 32px;
    }

    .rd-batches__all--desktop {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        margin-bottom: 4px;
    }

    .rd-batches__all--mobile {
        display: none;
    }

    .rd-batches__layout {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .rd-batches__next {
        min-height: 100%;
    }

    .rd-batches__next-heading {
        font-size: 26px;
    }
}

/* ==========================================================
   Desktop >=1200
   ========================================================== */
@media (min-width: 1200px) {
    .rd-batches {
        padding-block: 56px 64px;
    }

    .rd-batches__head {
        margin-bottom: 36px;
    }

    .rd-batches__heading {
        max-width: none;
        font-size: 52px;
    }

    .rd-batches__lead {
        font-size: 17px;
        max-width: 42rem;
    }

    .rd-batches__layout {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px;
    }

    .rd-batches__layout--four {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .rd-batches__layout--slot:not(.rd-batches__layout--four) {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }

    .rd-batch-card__body {
        padding: 18px 18px 20px;
        gap: 10px;
    }

    .rd-batch-card__title {
        font-size: 22px;
        min-height: 2.5em;
    }

    .rd-batch-card__price {
        font-size: 22px;
    }

    .rd-batch-card__cta {
        min-height: 42px;
        padding: 0 16px;
        font-size: 15px;
    }

    .rd-batches__next-heading {
        font-size: 30px;
    }

    .rd-batches__next-content {
        padding: 24px 22px 22px;
    }
}

@media (min-width: 1440px) {
    .rd-batches__heading {
        font-size: 56px;
    }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .rd-batch-card,
    .rd-batch-card__cta span,
    .rd-batches__all .rd-cta__arrow,
    .rd-batches__next-cta span,
    .rd-batches__next-item-go,
    .rd-batches__empty-cta-link span {
        transition: none;
    }

    .rd-batch-card:hover {
        transform: none;
    }
}
