/* ── Training LMS styles ───────────────────────────────────────────────────── */

/* This stylesheet doesn't share the main site's _reset.scss, so width:100%
   rules (e.g. .training-main) were adding padding on top of 100% instead of
   inside it — pushing content past the viewport and forcing a horizontal
   scrollbar. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    /* --tr-navy stays dark — it's already used as a background/accent
       surface (heroes, buttons, placeholders) and works fine unchanged.
       --tr-heading and --tr-accent-2 are new: --tr-navy was also used as
       *text* color throughout (headings on white cards), which would be
       nearly invisible on the dark backgrounds below, so those spots now
       use --tr-heading (light) or --tr-accent-2 (a lighter blue, for
       accents that need to read against dark, e.g. the reflection block). */
    --tr-navy: #1a2744;
    --tr-heading: #f5f5f5;
    --tr-accent-2: #6f93c9;
    --tr-gold: #c8a84b;
    --tr-gold-light: #e8d49a;
    --tr-text: #dcdcdc;
    --tr-muted: #999;
    --tr-border: rgba(255,255,255,0.12);
    --tr-bg: #111111;
    --tr-card: #1a1a1a;
    --tr-success: #3ea866;
    --tr-success-bg: rgba(62,168,102,0.15);
    --tr-radius: 6px;
    --tr-shadow: 0 2px 8px rgba(0,0,0,.4);
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
:root {
    --tr-nav-height: 94px;
}

body.training-body {
    background: var(--tr-bg);
    color: var(--tr-text);
    font-family: "Lato", sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.training-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 12px 2rem;
    background: linear-gradient(to bottom, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.25) 65%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s ease;
}

/* Spacer used on pages without a full-bleed hero */
.training-nav-spacer {
    height: var(--tr-nav-height);
    flex-shrink: 0;
}

/* Index page: collapse the main wrapper when only the hero is showing */
.training-main--hidden {
    display: none;
}

.training-header__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
    flex-shrink: 0;
}

.training-header__logo {
    height: 70px;
    width: auto;
}

.training-header__site-name {
    font-family: "Lato", sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tr-gold-light);
}

.training-header__user {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem 1rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    min-width: 0;
}

.training-header__user a {
    color: var(--tr-gold-light);
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.training-header__user a:hover {
    color: white;
}

.training-main {
    flex: 1;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.training-main--wide {
    max-width: 1200px;
}

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.training-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--tr-muted);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.training-breadcrumb a {
    color: var(--tr-gold-light);
    text-decoration: none;
}

.training-breadcrumb a:hover {
    text-decoration: underline;
}

.training-breadcrumb__sep {
    opacity: 0.4;
}

/* ── Page headings ───────────────────────────────────────────────────────── */
.training-page-title {
    font-family: "Cardo", serif;
    font-size: 2rem;
    color: var(--tr-heading);
    margin: 0 0 0.5rem;
}

.training-page-intro {
    color: var(--tr-muted);
    margin: 0 0 2rem;
    font-size: 1rem;
    line-height: 1.6;
}

/* ── Cards (program / course listings) ──────────────────────────────────── */
.training-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.training-card {
    background: var(--tr-card);
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius);
    box-shadow: var(--tr-shadow);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.training-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    border-color: var(--tr-gold);
    text-decoration: none;
    color: inherit;
}

.training-card--locked {
    position: relative;
    cursor: default;
    opacity: 0.45;
    filter: grayscale(60%);
}
.training-card--locked:hover {
    box-shadow: var(--tr-shadow);
    border-color: transparent;
}
.training-card__lock {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0,0,0,0.60);
    color: rgba(255,255,255,0.8);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.training-card__thumb {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.training-card__body {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.training-card__title {
    font-family: "Cardo", serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--tr-heading);
    margin: 0;
}

.training-card__desc {
    font-size: 0.9rem;
    color: var(--tr-muted);
    line-height: 1.5;
    margin: 0;
}

.training-card__locked-msg {
    font-size: 0.78rem;
    color: var(--tr-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0.25rem 0 0;
    font-style: italic;
}

.training-card__meta {
    font-size: 0.78rem;
    color: var(--tr-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}

/* ── Hero carousel (Training Index Page) ────────────────────────────────── */
.course-hero {
    position: relative;
    height: 100vh;
    overflow: hidden;
    background: var(--tr-navy);
}

.course-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: opacity 0.55s ease;
}

#heroBg2 {
    opacity: 0;
}

.course-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(0,0,0,0.85) 0%,
        rgba(0,0,0,0.60) 35%,
        rgba(0,0,0,0.20) 65%,
        rgba(0,0,0,0.05) 100%
    );
}

/* Left column: eyebrow, title, desc, CTA, arrows — stable fixed layout */
.course-hero__panel {
    position: absolute;
    top: 50%;
    left: 3rem;
    transform: translateY(-50%);
    width: 420px;
    height: 340px;
    overflow: hidden;
    z-index: 2;
    display: flex;
    flex-direction: column;
    transition: opacity 0.25s ease;
}

.course-hero__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--tr-gold-light);
    margin: 0 0 0.5rem;
    flex-shrink: 0;
}

.course-hero__title {
    font-family: "Cardo", serif;
    font-size: 2.4rem;
    color: white;
    margin: 0 0 0.75rem;
    line-height: 1.2;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
    /* Show full title — no clamp */
    flex-shrink: 0;
}

.course-hero__desc {
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    line-height: 1.65;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    /* Description clips at 2 lines to give title room */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-shrink: 0;
}

.course-hero__cta {
    display: inline-block;
    align-self: flex-start;
    background: transparent;
    color: white;
    border: 2px solid white;
    padding: 0.6rem 1.75rem;
    border-radius: var(--tr-radius);
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    /* auto top margin keeps this anchored to the same spot */
    margin-top: auto;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.course-hero__cta:hover {
    background: var(--tr-gold);
    border-color: var(--tr-gold);
    color: var(--tr-navy);
    text-decoration: none;
}

.course-hero__arrows {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.course-carousel__btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.course-carousel__btn:hover {
    background: var(--tr-gold);
    border-color: var(--tr-gold);
    color: var(--tr-navy);
}

/* Card strip: bottom right, bleeds off right edge */
.course-hero__rail {
    position: absolute;
    bottom: 3.5rem;
    right: 0;
    left: 42%;
    z-index: 2;
    overflow: hidden;
}

.course-carousel__track {
    display: flex;
    gap: 1rem;
    padding-left: 2rem;
    padding-bottom: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
    cursor: grab;
    user-select: none;
}

.course-carousel__track::-webkit-scrollbar {
    display: none;
}

/* Portrait cards */
.carousel-card {
    flex-shrink: 0;
    width: 195px;
    height: 270px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.25s;
    background: rgba(26,39,68,0.6);
    padding: 0;
    text-align: left;
}

.carousel-card.is-active {
    border-color: var(--tr-gold);
}

.carousel-card:hover:not(.is-active):not(.carousel-card--locked) {
    border-color: rgba(255,255,255,0.45);
    transform: translateY(-5px);
}

.carousel-card--locked {
    opacity: 0.4;
    filter: grayscale(70%);
    cursor: default;
}
.carousel-card--locked.is-active {
    border-color: rgba(255,255,255,0.3);
}
.carousel-card__lock-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.6);
    color: rgba(255,255,255,0.8);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}

.course-hero__locked {
    color: rgba(255,255,255,0.65);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: auto;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
    padding: 0.6rem 1rem;
    background: rgba(0,0,0,0.30);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
}

.carousel-card__thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-card__no-thumb {
    position: absolute;
    inset: 0;
    background: var(--tr-navy);
}

/* Gradient overlay on card so text is readable */
.carousel-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.88));
    pointer-events: none;
}

.carousel-card__info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.8rem 0.85rem;
    z-index: 1;
}

.carousel-card__name {
    font-size: 0.82rem;
    font-weight: 700;
    color: white;
    margin: 0 0 0.2rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-card__desc-text {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.72);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Page heroes (course = 50vh, lesson = 25vh) ──────────────────────────── */
.page-hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--tr-navy);
    display: flex;
    align-items: flex-end;
}

.page-hero--half  { height: 50vh; min-height: 300px; }
.page-hero--quarter { height: 25vh; min-height: 160px; }

.page-hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.75;
}

.page-hero__placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--tr-navy) 0%, #2d3f6e 100%);
}

.page-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);
}

.page-hero__content {
    position: relative;
    z-index: 2;
    padding: 1.5rem 2.5rem;
    width: 100%;
}

.page-hero__title {
    font-family: "Cardo", serif;
    font-size: 2.2rem;
    color: white;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    line-height: 1.2;
}

/* ── Progress bar ────────────────────────────────────────────────────────── */
.tr-progress {
    margin-top: 0.75rem;
}

.tr-progress__bar {
    height: 6px;
    background: var(--tr-border);
    border-radius: 3px;
    overflow: hidden;
}

.tr-progress__fill {
    height: 100%;
    background: var(--tr-gold);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.tr-progress__label {
    font-size: 0.78rem;
    color: var(--tr-muted);
    margin-top: 0.3rem;
}

/* ── Module list (inside CoursePage) ────────────────────────────────────── */
.training-module {
    background: var(--tr-card);
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius);
    margin-bottom: 1rem;
    box-shadow: var(--tr-shadow);
    overflow: hidden;
}

.training-module__header {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--tr-border);
}

.training-module__title {
    font-family: "Cardo", serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tr-heading);
    margin: 0;
}

.training-module__meta {
    font-size: 0.82rem;
    color: var(--tr-muted);
    white-space: nowrap;
}

/* ── Lesson rows ─────────────────────────────────────────────────────────── */
.training-lessons {
    list-style: none;
    margin: 0;
    padding: 0;
}

.training-lesson-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--tr-border);
    gap: 0.75rem;
}

.training-lesson-row:last-child {
    border-bottom: none;
}

.training-lesson-row__check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--tr-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 0.7rem;
}

.training-lesson-row__check--done {
    background: var(--tr-success);
    border-color: var(--tr-success);
}

.training-lesson-row__title {
    flex: 1;
    text-decoration: none;
    color: var(--tr-heading);
    font-size: 0.95rem;
    font-weight: 700;
}

.training-lesson-row__title:hover {
    text-decoration: underline;
}

.training-lesson-row__title--done {
    color: var(--tr-muted);
    font-weight: 400;
}

/* ── Lesson page ─────────────────────────────────────────────────────────── */
.lesson-video {
    margin-bottom: 1.5rem;
}

.lesson-video__embed iframe,
.lesson-video__embed embed,
.lesson-video__embed object {
    /* Wagtail's embed HTML hardcodes width/height attributes straight from
       the provider's oEmbed response (often a tiny default like 200x113,
       not the video's real aspect ratio) — height:auto here overrides that
       fixed attribute so aspect-ratio actually controls the rendered size
       instead of leaving the iframe stretched to 100% width but stuck at
       a few dozen pixels tall. */
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    border-radius: var(--tr-radius);
    border: none;
    display: block;
}

.lesson-video__placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--tr-navy);
    border-radius: var(--tr-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.4);
}

.lesson-video__placeholder i {
    font-size: 3rem;
}

.lesson-video__placeholder p {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0;
}

.lesson-video__caption {
    font-size: 0.85rem;
    color: var(--tr-muted);
    margin: 0.6rem 0 0;
    font-style: italic;
    line-height: 1.5;
}

.lesson-body {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--tr-text);
    max-width: 720px;
}

.lesson-body p { margin: 0 0 1em; }
.lesson-body h2 { font-family: "Cardo", serif; color: var(--tr-heading); margin: 1.5em 0 0.5em; }
.lesson-body h3 { font-family: "Cardo", serif; color: var(--tr-heading); margin: 1.2em 0 0.4em; }

/* Rich-text video/embed wrapper — same fix as main.scss's .responsive-object,
   needed here too since training.css is a separate stylesheet. See
   settings/base.py's WAGTAILEMBEDS_RESPONSIVE_HTML. */
.responsive-object {
    position: relative;
    width: 100%;
    height: 0;
    margin: 1.5rem 0;
}

.responsive-object iframe,
.responsive-object object,
.responsive-object embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── Scripture block ─────────────────────────────────────────────────────── */
.scripture-block {
    background: rgba(200,168,75,0.08);
    border-left: 4px solid var(--tr-gold);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--tr-radius) var(--tr-radius) 0;
}

.scripture-block__reference {
    font-weight: 700;
    color: var(--tr-gold-light);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.scripture-block__text {
    font-family: "Cardo", serif;
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--tr-text);
    margin: 0 0 0.35rem;
}

.scripture-block__version {
    font-size: 0.78rem;
    color: var(--tr-muted);
}

/* ── Reflection Questions block ──────────────────────────────────────────── */
.reflection-block {
    background: rgba(111,147,201,0.1);
    border-left: 4px solid var(--tr-accent-2);
    padding: 1.1rem 1.25rem 1.1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--tr-radius) var(--tr-radius) 0;
}

.reflection-block__intro {
    font-weight: 700;
    color: var(--tr-accent-2);
    font-size: 0.9rem;
    margin: 0 0 0.75rem;
}

.reflection-block__list {
    margin: 0;
    padding-left: 1.25rem;
}

.reflection-block__item {
    color: var(--tr-text);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.reflection-block__item:last-child {
    margin-bottom: 0;
}

/* ── Exercise block ──────────────────────────────────────────────────────── */
.exercise-block {
    background: rgba(200,168,75,0.08);
    border: 1px solid rgba(200,168,75,0.35);
    border-radius: var(--tr-radius);
    padding: 1.1rem 1.25rem;
    margin: 1.5rem 0;
}

.exercise-block__title {
    font-family: "Cardo", serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--tr-heading);
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exercise-block__title i {
    color: var(--tr-gold);
    font-size: 0.9rem;
}

.exercise-block__instructions {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--tr-text);
}

.exercise-block__instructions p { margin: 0 0 0.75em; }
.exercise-block__instructions p:last-child { margin-bottom: 0; }
.exercise-block__instructions ol,
.exercise-block__instructions ul {
    padding-left: 1.25rem;
    margin: 0 0 0.75em;
}

/* ── Resource download block ─────────────────────────────────────────────── */
.resource-block {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--tr-card);
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius);
    padding: 0.85rem 1.25rem;
    margin: 1rem 0;
}

.resource-block__icon {
    color: var(--tr-gold);
    font-size: 1.4rem;
    flex-shrink: 0;
}

.resource-block__info {
    flex: 1;
}

.resource-block__title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--tr-heading);
}

.resource-block__desc {
    font-size: 0.82rem;
    color: var(--tr-muted);
}

.resource-block__download {
    background: var(--tr-navy);
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: var(--tr-radius);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.resource-block__download:hover {
    background: var(--tr-gold);
    color: var(--tr-navy);
    text-decoration: none;
}

/* ── Mark Complete button ────────────────────────────────────────────────── */
.lesson-complete-area {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--tr-border);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.lesson-complete-btn {
    background: var(--tr-navy);
    color: white;
    border: none;
    padding: 0.75rem 1.75rem;
    font-family: "Lato", sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: var(--tr-radius);
    cursor: pointer;
    transition: background 0.2s;
}

.lesson-complete-btn:hover {
    background: var(--tr-gold);
    color: var(--tr-navy);
}

.lesson-completed-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--tr-success-bg);
    color: var(--tr-success);
    padding: 0.6rem 1.25rem;
    border-radius: var(--tr-radius);
    font-weight: 700;
    font-size: 0.9rem;
}

.lesson-nav {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.lesson-nav a {
    color: var(--tr-heading);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius);
    transition: border-color 0.2s, background 0.2s;
}

.lesson-nav a:hover {
    border-color: var(--tr-gold);
    background: rgba(255,255,255,0.06);
}

/* ── Login page ──────────────────────────────────────────────────────────── */
.training-login-page {
    margin: 0;
    padding: 0;
}

.training-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url("../images/map-dark.1f8d1b23f201.jpg") no-repeat center center / cover;
    box-sizing: border-box;
    padding: 1.5rem;
}

.training-login-box {
    background: rgba(22, 24, 30, 0.90);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    padding: 2.75rem 2.25rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.70);
}

.training-login-box__logo {
    display: block;
    margin: 0 auto 1.5rem;
    height: 50px;
}

.training-login-box h1 {
    font-family: "Cardo", serif;
    font-size: 1.5rem;
    color: var(--tr-heading);
    text-align: center;
    margin: 0 0 0.25rem;
}

.training-login-box__sub {
    text-align: center;
    color: var(--tr-muted);
    font-size: 0.88rem;
    margin-bottom: 1.75rem;
}

.training-login-field {
    margin-bottom: 1rem;
}

.training-login-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tr-heading);
    margin-bottom: 0.35rem;
}

.training-login-field input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius);
    font-size: 0.95rem;
    font-family: "Lato", sans-serif;
    background: var(--tr-bg);
    color: var(--tr-text);
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.training-login-field input:focus {
    outline: none;
    border-color: var(--tr-gold);
}

.training-login-error {
    background: rgba(198,40,40,0.15);
    color: #ff6b6b;
    padding: 0.6rem 0.9rem;
    border-radius: var(--tr-radius);
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

/* Field-level errors on the signup form reuse .training-login-error but sit
   right under their input rather than at the top of the whole form. */
.training-login-field .training-login-error {
    margin-top: 0.4rem;
    margin-bottom: 0;
}

.training-login-help {
    color: var(--tr-muted);
    font-size: 0.78rem;
    line-height: 1.5;
    margin-top: 0.4rem;
}
.training-login-help ul {
    margin: 0;
    padding-left: 1.1rem;
}

.training-login-checkbox {
    margin-bottom: 1.25rem;
}
.training-login-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}
.training-login-checkbox input[type="checkbox"] {
    width: auto;
    margin-top: 0.2rem;
    flex-shrink: 0;
}
.training-login-checkbox span {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--tr-text);
}
.training-login-checkbox span b {
    color: var(--tr-heading);
}

.training-login-submit {
    width: 100%;
    background: var(--tr-navy);
    color: white;
    border: none;
    padding: 0.75rem;
    font-family: "Lato", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border-radius: var(--tr-radius);
    cursor: pointer;
    transition: background 0.2s;
}

.training-login-submit:hover {
    background: var(--tr-gold);
    color: var(--tr-navy);
}

/* Same button treatment on an <a> instead of a <button>, e.g. the "Sign In"
   link on the password-reset-complete page. */
.training-login-submit--link {
    display: block;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.training-login-footer {
    text-align: center;
    margin: 1.5rem 0 0;
    font-size: 0.88rem;
    color: var(--tr-muted);
}
.training-login-footer a {
    color: var(--tr-gold);
    font-weight: 700;
    text-decoration: none;
}
.training-login-footer a:hover {
    text-decoration: underline;
}

/* ── Progress page ───────────────────────────────────────────────────────── */
.tr-progress-card {
    background: var(--tr-card);
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--tr-shadow);
}

.tr-progress-card__title {
    font-family: "Cardo", serif;
    font-size: 1.15rem;
    color: var(--tr-heading);
    margin: 0 0 0.75rem;
}

.tr-progress-card__title a {
    color: inherit;
    text-decoration: none;
}

.tr-progress-card__title a:hover {
    text-decoration: underline;
}

/* ── Section labels ──────────────────────────────────────────────────────── */
.training-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tr-muted);
    margin: 2rem 0 0.75rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .course-hero__panel {
        left: 1.5rem;
        right: 1.5rem;
        max-width: 100%;
        top: auto;
        bottom: 320px;
        transform: none;
        height: auto;
        overflow: visible;
    }
    .course-hero__title {
        font-size: 1.9rem;
    }
    .course-hero__cta {
        /* .course-hero__panel switches to height:auto on mobile, so the
           desktop rule's margin-top:auto has no surplus space left to
           distribute and collapses to 0 — set an explicit gap instead. */
        margin-top: 1.25rem;
    }
    .course-hero__rail {
        left: 0;
        bottom: 1.5rem;
    }
    .course-hero__overlay {
        background: linear-gradient(
            to bottom,
            rgba(0,0,0,0.15) 0%,
            rgba(0,0,0,0.70) 45%,
            rgba(0,0,0,0.40) 100%
        );
    }
}

@media (max-width: 640px) {
    .training-header {
        padding: 0 1rem;
    }
    .training-header__site-name {
        display: none;
    }
    .training-main {
        padding: 1.25rem 1rem;
    }
    .training-card-grid {
        grid-template-columns: 1fr;
    }
    .lesson-complete-area {
        flex-direction: column;
        align-items: flex-start;
    }
    .lesson-nav {
        margin-left: 0;
    }
}
