/**
 * OnlySecurity single-course page kit (light variant, `.os-c` namespace).
 *
 * Used by themes/ksec-training/tutor[-v4]/single-course.php to replace
 * the Elementor template at post 9966 ("KSEC TT - Single Course Template").
 *
 * Tokens shared with the dashboard kit (--os-d-*). All values exposed
 * as CSS vars so the v4 dark toggle is a one-selector swap on :root.
 */

.os-c {
    --os-c-bg: #f7f8fb;
    --os-c-panel: #ffffff;
    --os-c-border: #e5e7eb;
    --os-c-text: #1e293b;
    --os-c-muted: #64748b;
    --os-c-subtle: #94a3b8;
    --os-c-primary: #2F62AF;
    --os-c-primary-soft: rgba(47, 98, 175, 0.10);
    --os-c-gold: #fcb900;
    --os-c-gold-soft: rgba(252, 185, 0, 0.14);
    --os-c-up: #22c55e;
    /* Text on white: stars and the Free price need 3:1 and 4.5:1 (OT-H2). The gold and green above stay for fills. */
    --os-c-star: #d97706;
    --os-c-free: #15803d;
    --os-c-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    --os-c-shadow-lg: 0 4px 16px rgba(15, 23, 42, 0.10);

    color: var(--os-c-text);
    font-family: inherit;
}
.os-c a { color: var(--os-c-primary); text-decoration: none; }
.os-c a:hover { text-decoration: underline; }

/*
 * Full-width page surface with internal padding. Matches the rest of
 * the site's wide container (~1500px). Was 1190px which felt cramped
 * on wide monitors.
 */
.os-c-page { padding: 24px 24px 80px; max-width: 1500px; margin: 0 auto; }

/* ───────────── Hero ───────────── */
.os-c-hero { margin-bottom: 24px; }
.os-c-crumb { font-size: 13px; color: var(--os-c-muted); margin-bottom: 10px; }
.os-c-crumb a { color: var(--os-c-muted); }
.os-c-hero h1 {
    font-size: 36px;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
    line-height: 1.15;
    color: var(--os-c-text);
}
.os-c-meta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 14px;
    color: var(--os-c-muted);
    margin-bottom: 12px;
}
.os-c-meta b { color: var(--os-c-text); }
.os-c-meta .star { color: var(--os-c-star); font-size: 16px; line-height: 1; }
/* Star row filled to the average: faint outline row, gold row clipped on top. */
.os-c-stars { position: relative; display: inline-block; white-space: nowrap; vertical-align: -1px; }
.os-c-stars::before { content: "\2605\2605\2605\2605\2605"; color: var(--os-c-subtle); opacity: 0.35; }
.os-c-stars-fill { position: absolute; top: 0; left: 0; bottom: 0; overflow: hidden; }
.os-c-stars-fill::before { content: "\2605\2605\2605\2605\2605"; color: var(--os-c-star); }
.os-c-meta .dot { color: var(--os-c-subtle); }
.os-c-pill {
    display: inline-block;
    padding: 4px 10px;
    background: var(--os-c-primary-soft);
    color: var(--os-c-primary);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.os-c-cats { display: flex; gap: 6px; flex-wrap: wrap; }

/* ───────────── Body grid ───────────── */
.os-c-body {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 32px;
    align-items: start;
}
.os-c-main { min-width: 0; }

/*
 * Desktop: the sidebar starts level with the course title, not below the
 * full-width hero (DEV-631). The template puts the hero inside .os-c-body,
 * so the hero and main column share the left track and the sidebar spans
 * both rows. The sidebar stays inside .os-c-body, which is what stops its
 * sticky travel at the end of the main column: a grid on .os-c-page with
 * .os-c-body as display: contents let it ride down over the related
 * courses. Rules key off the hero being a sibling, so the old template
 * (hero outside the body) keeps the old layout. Phone (880px and below)
 * keeps the stacked layout, where the sidebar is hidden anyway.
 */
@media (min-width: 881px) {
    .os-c-body:has(> .os-c-hero) {
        /* 1fr row: a sidebar taller than hero plus main must not open a
           gap under the title by growing the hero row too. */
        grid-template-rows: auto 1fr;
        row-gap: 0;
    }
    .os-c-body > .os-c-hero               { grid-column: 1; grid-row: 1; min-width: 0; }
    .os-c-body > .os-c-hero ~ .os-c-main  { grid-column: 1; grid-row: 2; }
    .os-c-body > .os-c-hero ~ .os-c-side  { grid-column: 2; grid-row: 1 / span 2; }
}
/* Phone: the body grid's 16px gap already separates hero and main. */
@media (max-width: 880px) {
    .os-c-body > .os-c-hero { margin-bottom: 8px; min-width: 0; }
}

/*
 * Featured image / intro video container.
 *
 * Aspect ratio is set per-render via inline `--os-c-thumb-ratio` so
 * the container matches the actual image. The template reads the
 * attachment's width/height and writes:
 *   <div class="os-c-thumb" style="--os-c-thumb-ratio: 1600/900;">
 * Square images get a square container, 16:9 stays 16:9, portrait
 * gets a 3:4 cap (we don't want a vertical image dominating the
 * whole page). Falls back to 16:9 if no inline var is set (e.g.
 * intro video without a poster).
 *
 * `object-fit: cover` fills the container so we never letterbox.
 * Background gradient only shows for the rare case of a missing
 * featured image.
 */
.os-c-thumb {
    aspect-ratio: var(--os-c-thumb-ratio, 16 / 9);
    max-height: 540px;
    background: linear-gradient(135deg, var(--os-c-primary), #1e3a6f);
    border-radius: 14px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: var(--os-c-shadow);
    position: relative;
}
.os-c-thumb img,
.os-c-thumb video,
.os-c-thumb iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    border: 0;
}
/*
 * An uploaded (html5) intro video renders inside the player's own wrappers,
 * .tutor-video-player > .plyr > .plyr__video-wrapper > video. The rule above
 * takes the video out of flow, so without this those wrappers collapse to
 * zero height and only the gradient above shows. Pin them to the box too.
 * The player's own fake fullscreen (iPhone Safari) is position: fixed on
 * .plyr--fullscreen-fallback at lower specificity, so it is excluded here.
 */
.os-c-thumb .tutor-video-player,
.os-c-thumb .plyr:not(.plyr--fullscreen-fallback),
.os-c-thumb .plyr:not(.plyr--fullscreen-fallback) .plyr__video-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
/* In fullscreen, show the whole video instead of cropping it to the screen. */
.os-c-thumb .plyr--fullscreen-active video,
.os-c-thumb .plyr--fullscreen-fallback video {
    object-fit: contain !important;
}
/* Subtle hover zoom on the static image (no effect on videos/iframes). */
.os-c-thumb img { transition: transform 0.4s ease; }
.os-c-thumb:hover img { transform: scale(1.04); }

/* ───────────── Tabs (Overview / Reviews / Community + Curriculum anchor) ───────────── */
.os-c-tabs-radio { position: absolute; opacity: 0; pointer-events: none; }
.os-c-tabs-nav {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--os-c-border);
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: none;
}
.os-c-tabs-nav::-webkit-scrollbar { display: none; }
.os-c-tab-label {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--os-c-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    user-select: none;
}
.os-c-tab-label:hover { color: var(--os-c-text); }
.os-c-tab-link {
    /* Anchor-style "tab", clicks scroll to #os-c-curriculum, no active state. */
    color: var(--os-c-muted);
    text-decoration: none;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}
.os-c-tab-link:hover { color: var(--os-c-text); text-decoration: none; }

.os-c-tab-panel { display: none; }
/* Up to 5 tabs: Overview, Reviews, Community, Q&A (enrolled), Announcements (enrolled). */
.os-c-tabs-radio:nth-of-type(1):checked ~ .os-c-tabs-nav .os-c-tab-label:nth-of-type(1),
.os-c-tabs-radio:nth-of-type(2):checked ~ .os-c-tabs-nav .os-c-tab-label:nth-of-type(2),
.os-c-tabs-radio:nth-of-type(3):checked ~ .os-c-tabs-nav .os-c-tab-label:nth-of-type(3),
.os-c-tabs-radio:nth-of-type(4):checked ~ .os-c-tabs-nav .os-c-tab-label:nth-of-type(4),
.os-c-tabs-radio:nth-of-type(5):checked ~ .os-c-tabs-nav .os-c-tab-label:nth-of-type(5) {
    color: var(--os-c-text);
    border-bottom-color: var(--os-c-primary);
}
.os-c-tabs-radio:nth-of-type(1):checked ~ .os-c-tab-panels .os-c-tab-panel:nth-of-type(1),
.os-c-tabs-radio:nth-of-type(2):checked ~ .os-c-tab-panels .os-c-tab-panel:nth-of-type(2),
.os-c-tabs-radio:nth-of-type(3):checked ~ .os-c-tab-panels .os-c-tab-panel:nth-of-type(3),
.os-c-tabs-radio:nth-of-type(4):checked ~ .os-c-tab-panels .os-c-tab-panel:nth-of-type(4),
.os-c-tabs-radio:nth-of-type(5):checked ~ .os-c-tab-panels .os-c-tab-panel:nth-of-type(5) {
    display: block;
}

/* ───────────── Sections ───────────── */
.os-c-section {
    background: var(--os-c-panel);
    border: 1px solid var(--os-c-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--os-c-shadow);
}
.os-c-section h2 { font-size: 18px; margin: 0 0 12px; color: var(--os-c-text); }
.os-c-section p {
    color: var(--os-c-text);
    line-height: 1.65;
    font-size: 15px;
    margin: 0 0 12px;
}
.os-c-section ul {
    margin: 0;
    padding-left: 20px;
    color: var(--os-c-text);
    line-height: 1.7;
    font-size: 15px;
}
.os-c-section ul li { margin-bottom: 6px; }

/* What you'll learn, 2-col bullet grid with green ticks */
.os-c-learn-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 24px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.os-c-learn-grid li {
    list-style: none;
    position: relative;
    padding-left: 28px;
}
.os-c-learn-grid li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--os-c-up);
    font-weight: 700;
}

/* Section heading outside tabs (curriculum, certificate, related) */
.os-c-sec-head { margin: 28px 0 14px; }
.os-c-sec-head h2 {
    font-size: 22px;
    letter-spacing: -0.01em;
    margin: 0 0 4px;
    color: var(--os-c-text);
}
.os-c-sec-head p {
    color: var(--os-c-muted);
    font-size: 14px;
    margin: 0;
}

/* Instructor inline card */
.os-c-instr {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: #fafbfd;
    border: 1px solid var(--os-c-border);
    border-radius: 10px;
}
.os-c-instr img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.os-c-instr .name { font-weight: 700; font-size: 18px; display: block; }
.os-c-instr .role { color: var(--os-c-muted); font-size: 13px; display: block; }
.os-c-instr + .os-c-instr { margin-top: 10px; }
/* Hero style band, after the profile's .os-p-hero: dark panel, the trainer's cover photo
 * behind it when they have one, light text. Self contained: the profile stylesheet is not
 * loaded on course pages. */
.os-c-instr {
    display: block;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 20px;
    background: #16243d;
    color: #fff;
    border: 0;
    border-radius: 14px;
}
.os-c-instr.has-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--cover-url);
    background-size: cover;
    background-position: center;
    opacity: 0.30;
    z-index: -1;
}
.os-c-instr::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13,27,46,0.85), rgba(30,58,111,0.55));
    z-index: -1;
}
.os-c-instr .role { color: rgba(255,255,255,0.8); }
.os-c-instr img { width: 72px; height: 72px; border: 3px solid rgba(255,255,255,0.25); }
.os-c-instr__top {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.os-c-instr__who {
    display: flex;
    gap: 16px;
    align-items: center;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}
.os-c-instr__tier {
    display: inline-block;
    padding: 3px 9px;
    margin: 0 6px 4px 0;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.os-c-instr__tier--educational { background: rgba(150,189,242,0.22); color: #fff; }
.os-c-instr__tier--standard { background: rgba(203,213,225,0.30); color: #f1f5f9; }
.os-c-instr__tier--pro { background: rgba(252,185,0,0.30); color: #fff5d0; }
.os-c-instr__tier--enterprise { background: linear-gradient(135deg, #f4f6fa, #cfd6e2 55%, #eef1f6); color: #1e293b; }
.os-c-instr img.os-c-instr__ava--educational { border-color: #2F62AF; }
.os-c-instr img.os-c-instr__ava--standard { border-color: #94a3b8; }
.os-c-instr img.os-c-instr__ava--pro { border-color: #fcb900; }
.os-c-instr img.os-c-instr__ava--enterprise { border-color: #e4e9f1; }
.os-c-instr__rating { margin-left: 10px; color: rgba(255,255,255,0.85); }
.os-c-instr__rating b { color: #fff; }
.os-c-instr__msg {
    flex-shrink: 0;
    padding: 9px 16px;
    border: 1px solid rgba(255,255,255,0.45);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: rgba(255,255,255,0.12);
}
.os-c-instr__msg:hover,
.os-c-instr__msg:focus-visible { background: rgba(255,255,255,0.22); border-color: #fff; }
.os-c-instr__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 14px;
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.18);
}
.os-c-instr__stats div { text-align: center; }
.os-c-instr__stats dd { margin: 0; font-size: 24px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; order: -1; }
.os-c-instr__stats dt { margin-top: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: rgba(255,255,255,0.75); }
.os-c-instr__stats div { display: flex; flex-direction: column; }
.os-c-body .os-c-instr a,
.os-c-body .os-c-instr a:hover,
.os-c-body .os-c-instr a:focus-visible { color: #fff; text-decoration: none; }
.os-c-instr-wrap { margin: 16px 0; }

/* ───────────── Curriculum ───────────── */
.os-c-curriculum details {
    border: 1px solid var(--os-c-border);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
    background: var(--os-c-panel);
}
.os-c-curriculum summary {
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    color: var(--os-c-text);
}
.os-c-curriculum summary::-webkit-details-marker { display: none; }
.os-c-curriculum summary::after {
    content: "+";
    color: var(--os-c-muted);
    font-size: 20px;
    line-height: 1;
}
.os-c-curriculum details[open] summary::after { content: "−"; }
.os-c-curriculum .lessons { list-style: none; margin: 0; padding: 0 0 8px; }
.os-c-curriculum .lessons li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-top: 1px solid var(--os-c-border);
    font-size: 14px;
    color: var(--os-c-text);
}
.os-c-curriculum .lessons .ico { color: var(--os-c-subtle); font-size: 14px; }
.os-c-curriculum .lessons .lmeta {
    font-size: 12px;
    color: var(--os-c-muted);
    margin-left: auto;
}
.os-c-curriculum summary .lc {
    font-weight: 500;
    color: var(--os-c-muted);
    font-size: 13px;
    margin-left: 12px;
}

/*
 * Theme Tutor v3.9's curriculum output. The actual emitted structure
 * is `.tutor-accordion` > `.tutor-accordion-item` > `.tutor-accordion-
 * item-header` + `.tutor-accordion-item-body` > `.tutor-course-
 * content-list` > `.tutor-course-content-list-item` (NOT the older
 * `tutor-course-topic-*` classes, discovered via the live page).
 */
.os-c-curriculum .tutor-accordion {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.os-c-curriculum .tutor-accordion-item {
    border: 1px solid var(--os-c-border) !important;
    border-radius: 10px !important;
    overflow: hidden;
    background: var(--os-c-panel) !important;
    box-shadow: none !important;
}
.os-c-curriculum .tutor-accordion-item-header {
    padding: 14px 18px !important;
    background: transparent !important;
    border: 0 !important;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--os-c-text) !important;
}
.os-c-curriculum .tutor-accordion-item-header.is-active {
    background: #fafbfd !important;
    border-bottom: 1px solid var(--os-c-border) !important;
}
.os-c-curriculum .tutor-accordion-item-body {
    background: var(--os-c-panel) !important;
    padding: 0 !important;
    border: 0 !important;
}
.os-c-curriculum .tutor-accordion-item-body-content {
    padding: 0 !important;
}
.os-c-curriculum .tutor-course-content-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.os-c-curriculum .tutor-course-content-list-item {
    padding: 12px 18px !important;
    border-top: 1px solid var(--os-c-border);
    font-size: 14px;
    color: var(--os-c-text);
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent !important;
}
.os-c-curriculum .tutor-course-content-list-item:first-child { border-top: 0; }
.os-c-curriculum .tutor-course-content-list-item-icon {
    color: var(--os-c-subtle) !important;
    font-size: 14px;
    margin-right: 8px !important;
}
.os-c-curriculum .tutor-course-content-list-item-title {
    color: var(--os-c-text);
    text-decoration: none;
    flex: 1;
    min-width: 0;
}
.os-c-curriculum .tutor-course-content-list-item-title:hover { color: var(--os-c-primary); }
.os-c-curriculum .tutor-course-content-list-item-duration {
    font-size: 12px !important;
    color: var(--os-c-muted) !important;
    margin-left: auto !important;
}
.os-c-curriculum .tutor-course-content-list-item-status {
    color: var(--os-c-subtle) !important;
    font-size: 14px;
    margin-left: 8px !important;
}

/* Tutor's entry box has no rows on course pages (G6, filter in
 * onlysecurity-course-sidebar-meta.php); drop its empty footer and border. */
.os-c .tutor-sidebar-card > .tutor-card-footer { display: none; }

/* ───────────── Certificate render ───────────── */
.os-c-cert {
    background: linear-gradient(135deg, #1e3a6f, #2F62AF);
    border-radius: 14px;
    padding: 32px;
    color: #fff;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 28px;
    align-items: center;
    box-shadow: var(--os-c-shadow-lg);
}
.os-c-cert h3 {
    margin: 0 0 12px;
    font-size: 26px;
    letter-spacing: -0.01em;
    color: #fff;
}
.os-c-cert p {
    margin: 0 0 16px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
}
.os-c-cert .pts {
    display: inline-block;
    padding: 6px 12px;
    background: var(--os-c-gold);
    color: #1a1300;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
}

.os-c-cert__preview {
    background: #fff;
    border-radius: 8px;
    padding: 0;
    color: var(--os-c-text);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    transform: rotate(-1.5deg);
    aspect-ratio: 1.4 / 1;
    overflow: hidden;
    position: relative;
}
.os-c-cert__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Overlay "Your Name" + course title on top of the cert template image */
.os-c-cert__preview .name-line {
    position: absolute;
    bottom: 32%;
    left: 10%;
    right: 10%;
    text-align: center;
    font-family: 'Georgia', serif;
    font-style: italic;
    font-size: 18px;
    color: var(--os-c-text);
    pointer-events: none;
}
.os-c-cert__preview .course-line {
    position: absolute;
    bottom: 20%;
    left: 10%;
    right: 10%;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    color: var(--os-c-muted);
    pointer-events: none;
}
/* Fallback mock (when no cert template assigned) */
.os-c-cert__preview.mock {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.os-c-cert__preview.mock .seal {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--os-c-gold);
}
.os-c-cert__preview.mock .h4 {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--os-c-muted);
    margin: 0 0 4px;
}
.os-c-cert__preview.mock .name-line {
    position: static;
    border-bottom: 1px solid var(--os-c-border);
    padding-bottom: 6px;
    margin-bottom: 6px;
    font-size: 22px;
}
.os-c-cert__preview.mock .course-line {
    position: static;
    font-size: 13px;
    color: var(--os-c-text);
    text-align: left;
    font-weight: 600;
}
.os-c-cert__preview.mock .foot {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--os-c-muted);
    margin-top: auto;
}

/* ───────────── Reviews tab ───────────── */
.os-c-review { padding: 16px 0; border-top: 1px solid var(--os-c-border); }
.os-c-review:first-of-type { border-top: 0; padding-top: 0; }
.os-c-review .head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.os-c-review .head img { width: 36px; height: 36px; border-radius: 50%; }
.os-c-review .who { font-weight: 600; font-size: 14px; }
.os-c-review .when { color: var(--os-c-muted); font-size: 12px; }
.os-c-review .stars { color: var(--os-c-star); }
.os-c-review .body { color: var(--os-c-text); font-size: 14px; line-height: 1.55; }

/* Review labels (os-training-snippets onlysecurity-review-verification.php), sit after the name. */
.os-rv-badge { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; vertical-align: 1px; white-space: nowrap; }
.os-rv-badge--completed { background: #e7f6ec; color: #166534; }
.os-rv-badge--enrolled { background: #eef2f7; color: #374151; }
.os-rv-badge--trainer, .os-rv-badge--team { background: #fff4dc; color: #7a4b00; }

/* ───────────── Community tab, Discourse embed wrapper ───────────── */
.os-c-discourse {
    background: #fafbfd;
    border: 1px dashed var(--os-c-border);
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    color: var(--os-c-muted);
    margin: 12px 0;
    font-size: 14px;
}
.os-c-discourse b { color: var(--os-c-text); }
/*
 * Bump specificity so .os-c a { color: var(--os-c-primary) } above
 * doesn't override the button text colour and leave white-on-white.
 * Same trick applies elsewhere: any `<a>` styled as a button needs to
 * out-specificity the generic link rule.
 */
.os-c .os-c-btn,
.os-c a.os-c-btn {
    display: inline-block;
    background: var(--os-c-primary);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 12px 22px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}
.os-c .os-c-btn:hover,
.os-c a.os-c-btn:hover { background: #3b78d0; color: #fff; text-decoration: none; }

/* ───────────── Sidebar ───────────── */
/*
 * Sticky on desktop. `align-self: start` prevents the grid item from
 * stretching to match the main column height, which would defeat
 * sticky entirely. `overflow-y: auto` was breaking sticky on Safari
 * (which treats it as a new scroll container and pins the element);
 * dropped that, sidebar just scrolls with the page if its content is
 * taller than the viewport, which is the right behaviour for the
 * lengths we have here.
 */
.os-c-side {
    position: sticky;
    /* Clear the site's sticky main menu (~80px tall) plus a 20px gap.
       A sidebar taller than the window gets a negative top from
       onlysecurity-course-sticky.js, so it scrolls until its last card is
       in view and only then pins (DEV-631). */
    top: 100px;
    align-self: start;
}

/*
 * `position: sticky` breaks the moment any ancestor sets overflow to
 * `hidden`, `auto` or `scroll`. The actual ancestor chain wrapping
 * .os-c-side on this site (verified by walking the rendered DOM on
 * 2026-05-13) is:
 *   body > #page > #content > .shoptimizer-archive > .col-full > .os-c
 * Force each of those to `overflow: visible` only on course post-type
 * pages so other surfaces are unaffected.
 */
body.single-courses #page,
body.single-courses #content,
body.single-courses .shoptimizer-archive,
body.single-courses .col-full {
    overflow: visible !important;
}

.os-c-enrol {
    background: var(--os-c-panel);
    border: 1px solid var(--os-c-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--os-c-shadow-lg);
    margin-bottom: 14px;
}
.os-c-enrol .price-row {
    padding: 20px;
    border-bottom: 1px solid var(--os-c-border);
}
.os-c-enrol .price {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.os-c-enrol .price.free { color: var(--os-c-free); }
.os-c-enrol .price-orig {
    color: var(--os-c-muted);
    text-decoration: line-through;
    margin-left: 8px;
    font-size: 16px;
}
.os-c .os-c-enrol__btn,
.os-c a.os-c-enrol__btn {
    display: block;
    width: 100%;
    background: var(--os-c-primary);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 14px;
    font-weight: 700;
    font-size: 15px;
    margin-top: 14px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}
.os-c .os-c-enrol__btn:hover,
.os-c a.os-c-enrol__btn:hover { background: #3b78d0; color: #fff; text-decoration: none; }
.os-c-enrol__actions { display: flex; gap: 8px; margin-top: 10px; }
.os-c-enrol__actions button,
.os-c-enrol__actions a {
    flex: 1;
    background: transparent;
    border: 1px solid var(--os-c-border);
    color: var(--os-c-muted);
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}
.os-c-enrol__actions a:hover { color: var(--os-c-text); }

.os-c-enrol__stats { padding: 16px 20px; }
.os-c-enrol__stats .row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-top: 1px solid var(--os-c-border);
    font-size: 14px;
}
.os-c-enrol__stats .row:first-child { border-top: 0; }
.os-c-enrol__stats .label { color: var(--os-c-muted); }
.os-c-enrol__stats .val { font-weight: 600; }

/* Legacy rules kept for cached course HTML from before the G6 template.
 * Remove one release after the theme ships the new single-course template. */
.os-c-enrol .tutor-course-details-widget,
.os-c-enrol .tutor-course-details-widget-title { display: none !important; }
.os-c-enrol .price-row li.tutor-d-flex { display: none !important; }
.os-c-cert-badge {
    margin: 12px 20px 20px;
    background: var(--os-c-gold-soft);
    border: 1px solid rgba(252, 185, 0, 0.4);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 13px;
}
.os-c-cert-badge .ico {
    width: 28px;
    height: 28px;
    background: var(--os-c-gold);
    color: #1a1300;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    flex-shrink: 0;
}
.os-c-cert-badge b { color: var(--os-c-text); }
.os-c-cert-badge p { margin: 0; color: var(--os-c-muted); font-size: 12px; }

.os-c-side-card {
    background: var(--os-c-panel);
    border: 1px solid var(--os-c-border);
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: var(--os-c-shadow);
    margin-bottom: 14px;
}
.os-c-side-card h3 {
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--os-c-muted);
    margin: 0 0 10px;
}
.os-c-side-card ul {
    margin: 0;
    padding-left: 18px;
    color: var(--os-c-text);
    font-size: 14px;
    line-height: 1.55;
}
.os-c-side-card ul li { margin-bottom: 6px; }

.os-c-sb-review { padding: 10px 0; border-top: 1px solid var(--os-c-border); }
.os-c-sb-review:first-of-type { border-top: 0; padding-top: 0; }
.os-c-sb-review .head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.os-c-sb-review .head img { width: 26px; height: 26px; border-radius: 50%; }
.os-c-sb-review .who { font-weight: 600; font-size: 14px; }
.os-c-sb-review .body { font-size: 13px; color: var(--os-c-muted); line-height: 1.5; margin-top: 4px; }
.os-c-sb-review .stars { color: var(--os-c-star); font-size: 13px; }
.os-c-side-card .all {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
}

/* ───────────── Mobile sticky enrol bar + inline panel ───────────── */
/*
 * Mobile sticky bar lives at the end of <body>, OUTSIDE the .os-c
 * wrapper, so the brand-token CSS variables don't reach it. Hardcode
 * the absolute colours we want here rather than relying on var().
 */
.os-c-mobile-enrol {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 12px 16px;
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.08);
    z-index: 100;
    gap: 14px;
    align-items: center;
}
.os-c-mobile-enrol .p {
    font-size: 20px;
    font-weight: 700;
    color: #15803d; /* 5.02:1 on white; outside .os-c so the token does not reach it (OT-H2) */
}
.os-c-mobile-enrol .b {
    margin-left: auto;
    background: #2F62AF;
    color: #fff;
    border: 0;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}
.os-c-mobile-enrol .b:hover { background: #3b78d0; color: #fff; text-decoration: none; }
/* A real price (paid or partner course) reads in body text colour; green is
   reserved for "Free". Partner labels such as "From £1,999 + VAT" are long,
   so the size steps down to keep them beside the button at 390px. */
.os-c-mobile-enrol .p.is-price { color: #0f172a; font-size: 17px; line-height: 1.2; font-variant-numeric: tabular-nums; }
/* DEV-485: the regular price struck after a sale price (os_course_price_shows_regular, the Ultimates).
   #64748b is 4.76:1 on the bar's white. The theme's .screen-reader-text hides from screen readers too, so the bar has its own. */
.os-c-mobile-enrol .p.is-sale { white-space: nowrap; }
.os-c-mobile-enrol .p .was { margin-left: 6px; font-size: 13px; font-weight: 500; color: #64748b; text-decoration-thickness: 1.5px; }
.os-c-mobile-enrol .os-c-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Price bar with JS (G3): hidden until the inline purchase box has scrolled
 * up out of view. visibility also takes it out of the tab order. The hidden
 * state keys off html.os-js-io, set by an inline script in wp_head, so the
 * bar never flashes before the deferred script runs. */
html.os-js-io .os-c-mobile-enrol {
    transform: translateY(110%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0s linear 0.2s;
}
html.os-js-io .os-c-mobile-enrol.is-shown {
    transform: none;
    visibility: visible;
    transition: transform 0.2s ease;
}
@media (prefers-reduced-motion: reduce) {
    html.os-js-io .os-c-mobile-enrol,
    html.os-js-io .os-c-mobile-enrol.is-shown { transition: none; }
}

/* One floating layer (G3): no Rewards pill on course pages. */
body.single-courses #mycred-loyalty-widget-root { display: none !important; }

.os-c-mobile-inline { display: none; margin-bottom: 16px; }
/* Legacy: cached course HTML only; remove one release after the theme ships the new template. */
.os-c-mobile-prereqs { display: none; }
/* Phone: the facts list and Requirements card sit under the inline box. */
.os-c-mobile-inline .os-c-enrol__stats {
    background: var(--os-c-panel);
    border: 1px solid var(--os-c-border);
    border-radius: 12px;
    margin-top: 12px;
}
.os-c-mobile-inline .os-c-side-card { margin-top: 12px; margin-bottom: 0; }

/* ───────────── Related courses ───────────── */
.os-c-related { margin-top: 40px; }
.os-c-related h2 { font-size: 22px; margin: 0 0 16px; color: var(--os-c-text); }
.os-c-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.os-c-course-card {
    background: var(--os-c-panel);
    border: 1px solid var(--os-c-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--os-c-shadow);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    display: block;
    color: inherit;
    text-decoration: none;
}
.os-c-course-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--os-c-shadow-lg);
    text-decoration: none;
    color: inherit;
}
.os-c-course-card .ct-thumb {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1e3a6f, #2F62AF);
    overflow: hidden;
}
.os-c-course-card .ct-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.os-c-course-card .ct-body { padding: 14px; }
.os-c-course-card .ct-cat {
    color: var(--os-c-primary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.os-c-course-card .ct-title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.35;
    margin-bottom: 8px;
    color: var(--os-c-text);
}
.os-c-course-card .ct-meta {
    color: var(--os-c-muted);
    font-size: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}
.os-c-course-card .ct-stars { color: var(--os-c-star); font-size: 13px; }
.os-c-course-card .ct-stars .count { color: var(--os-c-muted); margin-left: 4px; }
.os-c-course-card .ct-price { color: var(--os-c-text); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.os-c-course-card .ct-price.free { color: var(--os-c-free); }

/* ───────────── Mobile ───────────── */
@media (max-width: 880px) {
    body.tutor-active-page-os-course,
    body:has(.os-c-page) { padding-bottom: 84px; }
    .os-c-page { padding: 16px 0 84px; }
    .os-c-hero h1 { font-size: 26px; }
    .os-c-body { grid-template-columns: 1fr; gap: 16px; }
    .os-c-side { display: none; }
    .os-c-mobile-inline   { display: block; }
    .os-c-mobile-prereqs  { display: block; }
    .os-c-mobile-enrol    { display: flex; }
    .os-c-learn-grid      { grid-template-columns: 1fr; }
    .os-c-cert            { grid-template-columns: 1fr; padding: 24px; }
    .os-c-cert__preview   { transform: none; max-width: 320px; margin: 0 auto; }
}

/* ───────────── Tutor progress-bar shim ─────────────
 *
 * Tutor 3.9.9's stock `tutor-front.min.css` ships only an RTL rule for
 * `.tutor-progress-filled` and zero rules for the classes its own
 * course-entry-box template emits, `.tutor-progress-bar` (the rail),
 * `.tutor-progress-value` (the fill), and the surrounding
 * `.tutor-course-progress-wrapper` / `.progress-steps` /
 * `.progress-percentage` labels. The HTML renders, the CSS variable
 * `--tutor-progress-value: NN%` arrives, but every element has no
 * visible box: enrolled users on in-progress courses see a blank gap
 * in the sidebar where the bar and its labels should live. We provide
 * the missing styles, scoped to Tutor's own selectors so any Tutor
 * template reusing them (single-course sidebar, dashboard progress
 * widgets) Just Works.
 *
 * Remove this block once Tutor ships the matching CSS upstream. */

.tutor-course-progress-wrapper {
	margin-bottom: 16px;
}
.tutor-course-progress-wrapper h3 {
	font-size: 14px;
	font-weight: 700;
	color: var(--os-c-text, #1e293b);
	margin: 0 0 10px;
	letter-spacing: 0;
}
.tutor-course-progress-wrapper .list-item-progress {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.tutor-course-progress-wrapper .progress-steps,
.tutor-course-progress-wrapper .progress-percentage {
	font-size: 13px;
	color: var(--os-c-muted, #64748b);
	font-weight: 500;
}
.tutor-course-progress-wrapper .progress-percentage {
	color: var(--os-c-primary, #2F62AF);
	font-weight: 600;
}
/* Tutor's `.tutor-d-flex.tutor-align-center.tutor-justify-between` row
 * laying out the two label spans, it's there in the HTML but Tutor
 * also doesn't ship its own utility CSS in `tutor-front.min.css`. */
.tutor-course-progress-wrapper .list-item-progress > div:first-child {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.tutor-progress-bar {
	position: relative;
	width: 100%;
	height: 8px;
	background: rgba(47, 98, 175, 0.10);
	border-radius: 999px;
	overflow: hidden;
}
.tutor-progress-bar .tutor-progress-value {
	display: block;
	height: 100%;
	width: var(--tutor-progress-value, 0%);
	background: var(--os-c-primary, #2F62AF);
	border-radius: 999px;
	transition: width 240ms ease;
}

/* Tutor's "Start Learning" / primary CTA inside the course entry-box ships
 * with the theme's default link colour (dark blue) on its blue background,
 * which fails contrast. Force white text within the entry-box card. */
.tutor-sidebar-card .tutor-btn-primary,
.tutor-sidebar-card .tutor-btn-primary:link,
.tutor-sidebar-card .tutor-btn-primary:visited,
.tutor-sidebar-card .tutor-btn-primary:hover,
.tutor-sidebar-card .tutor-btn-primary:focus,
.tutor-sidebar-card .tutor-btn-primary:active {
	color: #fff;
}

.os-c .tutor-course-sidebar-card-pricing { font-variant-numeric: tabular-nums; }

/* Trainer replies under reviews (os-training-snippets onlysecurity-review-replies.php). */
.os-rr-reply { margin: 10px 0 0 12px; padding: 8px 0 8px 12px; border-left: 3px solid var(--os-c-primary); }
.os-rr-reply__who { margin: 0 0 2px; font-size: 13px; font-weight: 600; color: var(--os-c-text); }
.os-rr-reply__edited { font-weight: 400; color: var(--os-c-muted); }
.os-rr-reply__body { margin: 0; font-size: 14px; line-height: 1.55; color: var(--os-c-text); overflow-wrap: anywhere; }

/* Course notice panel, set per course in the builder (os-training-snippets onlysecurity-course-notice.php). */
.os-c-legacy-note { margin: 14px 0 0; padding: 12px 16px; border-left: 3px solid var(--os-c-primary); background: #f1f5fb; border-radius: 6px; font-size: 14px; line-height: 1.55; color: var(--os-c-text); max-width: 760px; }
.os-c-legacy-note a { color: var(--os-c-primary); font-weight: 600; }
