/* The public Trainings pages on a country site: the list (IBAO-1367), one training's details
   page and the catalog embedded in the LearnWorlds school (IBAO-1726). The purple is the
   brand's own (#562a7a and friends), spent on the price, the rule above each card and the
   action; everything else stays neutral so the price is what the eye lands on. */

.tr-page {
    --tr-purple: #562a7a;
    --tr-purple-dark: #3d1d56;
    --tr-purple-light: #8a5ba8;
    --tr-purple-wash: rgba(86, 42, 122, 0.06);
    --tr-ink: #2c3e50;
    --tr-ink-2: #5a6c7d;
    --tr-line: #e1e8ed;
}

/* No heading of its own: the layout already prints the page title as an h1, and a
   second "Trainings" under it read as a mistake. Full width rather than capped —
   capped, these two sentences broke into short ragged lines. */
.tr-intro {
    border-left: 4px solid var(--tr-purple);
    padding-left: 1rem;
    margin-bottom: 2.25rem;
}

/* Scoped with .tr-page throughout: template.css styles `.inner-page p` at 1.3rem,
   which is class+element and beats a bare `.tr-desc`. Two classes outrank it. */
.tr-page .tr-intro p { color: var(--tr-ink-2); margin-bottom: .35rem; }
.tr-page .tr-intro p:last-child { margin-bottom: 0; }

/* Auto-fit so one training does not sit in a half-empty two-column row, and the
   grid collapses on its own at narrow widths without a media query.
   min(290px, 100%) matters: .inner-page adds 20px of padding and the container
   another 15px, so a 320px phone leaves ~250px — a hard 290px floor cannot shrink
   into that and overflows into a horizontal scroll instead of collapsing. */
.tr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
    gap: 1.5rem;
}

.tr-card {
    /* Capped so a single training reads as a card rather than a full-width banner
       with its price and button marooned at opposite ends. */
    max-width: 520px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--tr-line);
    border-top: 3px solid var(--tr-purple);
    border-radius: 10px;
    padding: 1.5rem;
    transition: box-shadow .18s ease, transform .18s ease;
}

.tr-card:hover {
    box-shadow: 0 10px 28px -14px rgba(86, 42, 122, .45);
    transform: translateY(-2px);
}

.tr-page .tr-card h2 {
    font-size: 1.08rem;
    line-height: 1.35;
    color: var(--tr-ink);
    margin: 0 0 .7rem;
}

.tr-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }

.tr-tag {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .02em;
    padding: .18rem .6rem;
    border-radius: 999px;
    background: var(--tr-purple-wash);
    color: var(--tr-purple);
    white-space: nowrap;
}

/* The outcome a pass earns is the one thing worth distinguishing from the rest. */
.tr-tag-outcome { background: var(--tr-purple); color: #fff; }

.tr-page .tr-desc { color: var(--tr-ink-2); font-size: .92rem; margin-bottom: 1.25rem; }

.tr-foot {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--tr-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

.tr-price {
    font-size: 1.22rem;
    font-weight: 700;
    color: var(--tr-purple-dark);
    font-variant-numeric: tabular-nums;
}

.tr-btn {
    background: var(--tr-purple);
    border: 1px solid var(--tr-purple);
    color: #fff;
    font-size: .86rem;
    font-weight: 600;
    padding: .5rem 1.1rem;
    border-radius: 6px;
    /* Deliberately NOT nowrap: the label comes from Sanity, and a longer
       translation would otherwise run past the edge of a narrow card. */
    text-align: center;
    transition: background .15s ease;
}

.tr-btn:hover, .tr-btn:focus { background: var(--tr-purple-dark); color: #fff; text-decoration: none; }
.tr-btn:focus-visible { outline: 3px solid var(--tr-purple-light); outline-offset: 2px; }

.tr-empty {
    border: 1px dashed var(--tr-line);
    border-radius: 10px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--tr-ink-2);
    background: var(--tr-purple-wash);
}


/* ---- Card actions and the title link (IBAO-1726) ---------------------------------- */

.tr-page .tr-card h2 .tr-title-link { color: inherit; }
.tr-page .tr-card h2 .tr-title-link:hover { color: var(--tr-purple); }

.tr-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.tr-btn-ghost {
    background: transparent;
    color: var(--tr-purple);
}

.tr-btn-ghost:hover, .tr-btn-ghost:focus { background: var(--tr-purple-wash); color: var(--tr-purple-dark); }

/* ---- One training's details page (IBAO-1726) -------------------------------------- */

.tr-back {
    display: inline-block;
    margin-bottom: 1.25rem;
    color: var(--tr-purple);
    font-weight: 600;
    font-size: .9rem;
}

.tr-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 2rem;
    align-items: start;
    margin-bottom: 2.5rem;
}

.tr-detail-image {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--tr-line);
}

.tr-page .tr-lead { color: var(--tr-ink); font-size: 1.02rem; margin-bottom: 1.25rem; }

.tr-section {
    border-top: 1px solid var(--tr-line);
    padding-top: 1.5rem;
    margin-bottom: 2rem;
}

.tr-page .tr-section h2 { font-size: 1.15rem; color: var(--tr-ink); margin-bottom: .9rem; }

/* LearnWorlds sends plain text; pre-line keeps its paragraph breaks without trusting HTML. */
.tr-page .tr-about { color: var(--tr-ink-2); font-size: .95rem; white-space: pre-line; }

.tr-outline { padding-left: 1.25rem; margin: 0; }

.tr-outline li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .55rem 0;
    border-bottom: 1px dashed var(--tr-line);
    color: var(--tr-ink);
}

.tr-outline-count { color: var(--tr-ink-2); font-size: .85rem; white-space: nowrap; }

.tr-cta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---- The catalog framed inside the LearnWorlds school (IBAO-1726) ----------------- */

.tr-embed {
    margin: 0;
    padding: 4px;
    background: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.tr-embed .tr-card h2 { font-size: 1.08rem; margin: 0 0 .7rem; }
.tr-embed .tr-desc { margin-top: 0; }
.tr-embed a { text-decoration: none; }
