/*
 * Training Pages — RMAI W34
 * Styles for /ai-training/ landing and /ai-training/{slug}/ detail pages.
 * Loaded after style.css via functions.php enqueue.
 *
 * Class names are locked in the Doc 2 class name contract (Section 8.1).
 * Do not add or rename classes without updating the contract.
 */

/* ── Functional UI tokens ──
   Scoped colour pairs for badges, tags, and status indicators.
   Not brand colours — semantic UI colours for training components only. */

:root {
    --training-lilac-bg: #E8DCF2;
    --training-lilac-text: #A77ACD;
    --training-amber-bg: #FDEBD0;
    --training-amber-text: #D97706;
    --training-green-bg: #D4F0E0;
    --training-green-text: #16A34A;
    --training-stone-bg: #EDEBE8;
    --training-stone-text: #8D8D92;
    --training-red: #EF4444;
}

/* ── Breadcrumbs ── */

.rmai-breadcrumbs {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--wp--preset--color--text-muted);
    margin-bottom: 16px;
}

.rmai-breadcrumbs a {
    color: var(--wp--preset--color--text-secondary);
    text-decoration: none;
}

.rmai-breadcrumbs a:hover {
    color: var(--wp--preset--color--black);
    text-decoration: underline;
}

.rmai-breadcrumbs .sep {
    margin: 0 8px;
    color: var(--wp--preset--color--border);
}

/* ── Proof strip ── */

.proof-strip {
    display: flex;
    justify-content: center;
    gap: 48px;
    padding: 36px 40px;
    background: var(--wp--preset--color--black);
    flex-wrap: wrap;
}

.proof-stat {
    text-align: center;
}

.proof-stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--wp--preset--color--white);
    line-height: 1.2;
    margin-bottom: 4px;
}

.proof-stat-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--wp--preset--color--text-faint);
}

/* ── Delivery mode cards ── */

.mode-card {
    background: var(--wp--preset--color--white);
    border-radius: 12px;
    padding: 32px 28px;
    border: 2px solid var(--wp--preset--color--border);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.mode-card:hover {
    box-shadow: var(--wp--custom--shadow--hover);
    border-color: var(--wp--preset--color--plum);
}

.mode-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--wp--preset--color--black);
}

.mode-icon {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.mode-price {
    font-size: 1rem;
    font-weight: 600;
    color: var(--wp--preset--color--plum);
    margin-bottom: 12px;
}

.mode-best-for {
    font-size: 0.875rem;
    color: var(--wp--preset--color--text-secondary);
    line-height: 1.6;
}

/* ── Course cards ── */

/* Catalogue section — dark background, cards pop against it */
.courses-section {
    background: var(--wp--preset--color--black);
    padding: 64px 40px;
}

.courses-section h2 {
    color: var(--wp--preset--color--white);
    text-align: center;
    margin-bottom: 8px;
}

.courses-section .section-sub {
    color: var(--wp--preset--color--text-faint);
    text-align: center;
    font-size: 1rem;
    margin-bottom: 40px;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: var(--wp--style--global--wide-size);
    margin: 0 auto;
}

.course-card {
    background: var(--wp--preset--color--white);
    border-radius: 12px;
    padding: 0;
    border: 1px solid var(--wp--preset--color--border);
    border-top: 4px solid var(--wp--preset--color--border);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.course-card:hover {
    box-shadow: var(--wp--custom--shadow--hover);
}

/* Mode-coloured top border — set by adding a second class to .course-card */
.course-card.mode-open-class { border-top-color: var(--training-lilac-text); }
.course-card.mode-team-training { border-top-color: var(--training-amber-text); }
.course-card.mode-cowork { border-top-color: var(--training-green-text); }

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 0;
}

.course-code {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--wp--preset--color--text-faint);
}

.course-body {
    padding: 12px 24px;
    flex: 1;
}

.course-body h3 {
    font-size: 1.1875rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--wp--preset--color--black);
    line-height: 1.3;
}

.course-hook {
    font-style: italic;
    font-size: 0.875rem;
    color: var(--wp--preset--color--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

.course-desc {
    display: none;
}

.course-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    font-size: 0.8125rem;
    color: var(--wp--preset--color--text-muted);
}

.course-meta-tag {
    font-weight: 500;
}

.course-meta-tag + .course-meta-tag::before {
    content: '·';
    margin-right: 4px;
}

.course-meta-tag + .mode-tag::before {
    content: '';
    margin: 0;
}

.course-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--wp--preset--color--bg);
    margin-top: auto;
}

.course-price {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--wp--preset--color--black);
}

.course-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--wp--preset--color--plum);
    text-decoration: none;
}

.course-link:hover {
    color: var(--wp--preset--color--black);
}

/* ── Badges ── */

/* Badges — prominent, only element with filled background on a card */
.course-badge-popular,
.course-badge-early-access {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.course-badge-popular {
    background: var(--wp--preset--color--plum);
    color: var(--wp--preset--color--white);
}

.course-badge-early-access {
    background: var(--training-stone-bg);
    color: var(--training-stone-text);
}

/* Introductory — text-only label near price, not a pill */
.course-badge-introductory {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--training-green-text);
    margin-left: 8px;
}

/* ── Mode tags ── */

/* Mode tags — dot + text (not a pill) when inside cards */
.mode-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 5px;
}

.mode-tag::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mode-tag-open-class {
    color: var(--training-lilac-text);
}

.mode-tag-open-class::before {
    background: var(--training-lilac-text);
}

.mode-tag-team-training {
    color: var(--training-amber-text);
}

.mode-tag-team-training::before {
    background: var(--training-amber-text);
}

.mode-tag-cowork {
    color: var(--training-green-text);
}

.mode-tag-cowork::before {
    background: var(--training-green-text);
}

/* Mode tags as pills — in session table and standalone contexts */
.sessions-table .mode-tag,
.test-section > div > .mode-tag {
    padding: 3px 10px;
    border-radius: 4px;
    gap: 0;
}

.sessions-table .mode-tag::before,
.test-section > div > .mode-tag::before {
    display: none;
}

.sessions-table .mode-tag-open-class,
.test-section > div > .mode-tag-open-class {
    background: var(--training-lilac-bg);
}

.sessions-table .mode-tag-team-training,
.test-section > div > .mode-tag-team-training {
    background: var(--training-amber-bg);
}

.sessions-table .mode-tag-cowork,
.test-section > div > .mode-tag-cowork {
    background: var(--training-green-bg);
}

/* ── Pricing block (detail pages) ── */

.pricing-block {
    background: var(--wp--preset--color--white);
    border-radius: 12px;
    padding: 32px 28px;
    border: 2px solid var(--wp--preset--color--border);
}

.pricing-current {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--wp--preset--color--black);
    margin-bottom: 4px;
}

.pricing-was {
    font-size: 1rem;
    color: var(--wp--preset--color--text-muted);
    text-decoration: line-through;
    margin-bottom: 4px;
}

.pricing-savings {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--training-green-text);
    margin-bottom: 8px;
}

.pricing-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--wp--preset--color--text-secondary);
    margin-bottom: 8px;
}

.pricing-note {
    font-size: 0.8125rem;
    color: var(--wp--preset--color--text-muted);
    font-style: italic;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--wp--preset--color--border);
}

/* Pricing table (multi-mode courses) */
.pricing-block table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.pricing-block th {
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--wp--preset--color--text-muted);
    padding: 8px 12px;
    background: var(--wp--preset--color--bg);
    border-bottom: 1px solid var(--wp--preset--color--border);
}

.pricing-block td {
    font-size: 0.9375rem;
    padding: 10px 12px;
    border-bottom: 1px solid var(--wp--preset--color--border);
    color: var(--wp--preset--color--black);
}

/* ── Session table ── */

.sessions-table {
    max-width: var(--wp--style--global--wide-size);
    margin: 0 auto;
    overflow-x: auto;
}

.sessions-table table {
    width: 100%;
    border-collapse: collapse;
}

.sessions-table thead th {
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--wp--preset--color--text-muted);
    padding: 10px 16px;
    background: var(--wp--preset--color--bg);
    border-bottom: 2px solid var(--wp--preset--color--border);
}

.sessions-table tbody td {
    font-size: 0.9375rem;
    padding: 14px 16px;
    border-bottom: 1px solid var(--wp--preset--color--border);
    color: var(--wp--preset--color--black);
    vertical-align: middle;
}

.sessions-table tbody tr:hover {
    background: var(--wp--preset--color--bg);
}

.sessions-table a {
    color: var(--wp--preset--color--plum);
    text-decoration: none;
    font-weight: 500;
}

.sessions-table a:hover {
    color: var(--wp--preset--color--black);
}

.session-cta {
    display: inline-block;
    padding: 8px 20px;
    border-radius: var(--wp--custom--radius--button);
    font-size: 0.8125rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

/* ── Status indicators ── */

.session-status {
    display: inline-flex;
    align-items: center;
    font-size: 0.8125rem;
    font-weight: 600;
    gap: 6px;
    white-space: nowrap;
}

.session-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-available {
    color: var(--training-green-text);
}

.status-available::before {
    background: #22C55E;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
    animation: rmai-pulse 2s infinite;
}

.status-coming-soon {
    color: var(--training-stone-text);
}

.status-coming-soon::before {
    background: var(--training-stone-text);
}

.status-full {
    color: var(--training-red);
}

.status-full::before {
    background: var(--training-red);
}

.status-booked {
    color: var(--training-amber-text);
}

.status-booked::before {
    background: var(--training-amber-text);
}

/* ── Responsive: tablet ── */

@media (max-width: 782px) {
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .proof-strip {
        gap: 24px 36px;
        padding: 28px 24px;
    }
}

/* ── Responsive: mobile ── */

@media (max-width: 600px) {
    /* Course grid — single column */
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Proof strip — compact */
    .proof-strip {
        gap: 12px 24px;
        padding: 20px 16px;
    }

    .proof-stat-number {
        font-size: 1.5rem;
    }

    .proof-stat-label {
        font-size: 0.75rem;
    }

    /* Mode cards — stack */
    .mode-card {
        padding: 20px 16px;
    }

    /* Courses section — compact */
    .courses-section {
        padding: 40px 16px;
    }

    /* Course cards — compact */
    .course-header {
        padding: 16px 16px 0;
    }

    .course-body {
        padding: 10px 16px;
    }

    .course-footer {
        padding: 12px 16px;
    }

    /* Pricing block — compact */
    .pricing-block {
        padding: 20px 16px;
    }

    .pricing-current {
        font-size: 1.375rem;
    }

    /* Session table — card reflow */
    .sessions-table {
        overflow-x: visible;
    }

    .sessions-table thead {
        display: none;
    }

    .sessions-table tbody tr {
        display: block;
        background: var(--wp--preset--color--white);
        border: 1px solid var(--wp--preset--color--border);
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 12px;
    }

    .sessions-table tbody tr:hover {
        background: var(--wp--preset--color--white);
    }

    .sessions-table tbody td {
        display: block;
        padding: 4px 0;
        border-bottom: none;
    }

    .sessions-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: var(--wp--preset--color--text-muted);
        display: block;
        margin-bottom: 2px;
    }

    .sessions-table tbody td:last-child {
        margin-top: 8px;
    }

    /* Breadcrumbs — smaller */
    .rmai-breadcrumbs {
        font-size: 0.8125rem;
    }
}
