/* ============================================
    TA — RICH TEXT
    Styles for whatever the_content() prints (ta-rich).
============================================ */

/* ==========================================================================
   RICH TEXT — the_content()
   abbr: ta-rich
   Every tag the WordPress editor (classic or blocks) can print gets a style
   here, so post content looks right whatever the author writes.
   Used by: single course overview, single bundle modal, single post.
   Size / colour come from the wrapper: set font-size or color on it and
   everything inside scales with it (all sizes below are em).
   ========================================================================== */
.ta-rich {
    font-size: var(--ta-fs-16);
    line-height: 1.6;
    color: var(--ta-black);
    overflow-wrap: break-word;
}
.ta-rich > :first-child {
    margin-top: 0;
}
.ta-rich > :last-child {
    margin-bottom: 0;
}

/* ---- Headings ---- */
.ta-rich h1,
.ta-rich h2,
.ta-rich h3,
.ta-rich h4,
.ta-rich h5,
.ta-rich h6 {
    margin: 1.6em 0 0.6em;
    font-weight: var(--ta-fw-bold);
    line-height: 1.3;
    color: var(--ta-black);
    scroll-margin-top: 24px;
}
.ta-rich h1 { font-size: 2em; }
.ta-rich h2 { font-size: 1.6em; }
.ta-rich h3 { font-size: 1.3em; }
.ta-rich h4 { font-size: 1.15em; }
.ta-rich h5 { font-size: 1em; }
.ta-rich h6 {
    font-size: 0.875em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Text ---- */
.ta-rich p {
    margin: 0 0 1em;
}
.ta-rich span {
    font: inherit;
}
.ta-rich strong,
.ta-rich b {
    font-weight: var(--ta-fw-bold);
}
.ta-rich em,
.ta-rich i,
.ta-rich cite {
    font-style: italic;
}
.ta-rich u,
.ta-rich ins {
    text-decoration: underline;
}
.ta-rich s,
.ta-rich del,
.ta-rich strike {
    text-decoration: line-through;
}
.ta-rich small {
    font-size: 0.85em;
}
.ta-rich sub,
.ta-rich sup {
    font-size: 0.75em;
}
.ta-rich mark {
    padding: 0 0.2em;
    background-color: var(--ta-peach);
    color: inherit;
}
.ta-rich abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
}
.ta-rich a {
    color: var(--ta-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.ta-rich a:hover {
    color: var(--ta-orange);
}

/* ---- Lists ---- */
.ta-rich ul,
.ta-rich ol {
    margin: 0 0 1em;
    padding-left: 1.6em;
}
.ta-rich ul {
    list-style: disc;
}
.ta-rich ol {
    list-style: decimal;
}
.ta-rich ul ul,
.ta-rich ol ul {
    list-style: circle;
}
.ta-rich li {
    margin: 0 0 0.35em;
}
.ta-rich li::marker {
    color: var(--ta-orange);
}
.ta-rich ol > li::marker {
    font-weight: var(--ta-fw-bold);
}
.ta-rich li > ul,
.ta-rich li > ol {
    margin: 0.35em 0 0;
}
.ta-rich dl {
    margin: 0 0 1em;
}
.ta-rich dt {
    font-weight: var(--ta-fw-bold);
}
.ta-rich dd {
    margin: 0 0 0.6em 1.2em;
}

/* ---- Quotes ---- */
.ta-rich blockquote,
.ta-rich .wp-block-quote,
.ta-rich .wp-block-pullquote {
    margin: 1.5em 0;
    padding: 1em 1.4em;
    border-left: 4px solid var(--ta-orange);
    border-radius: 0 var(--ta-radius-12) var(--ta-radius-12) 0;
    background-color: var(--ta-peach-soft);
    font-style: italic;
}
.ta-rich blockquote p:last-child {
    margin-bottom: 0;
}
.ta-rich blockquote cite,
.ta-rich .wp-block-quote cite {
    display: block;
    margin-top: 0.6em;
    font-size: 0.85em;
    font-style: normal;
    color: var(--ta-gray-555);
}

/* ---- Tables ---- */
.ta-rich .wp-block-table {
    margin: 1.5em 0;
    overflow-x: auto;
}
.ta-rich table {
    width: 100%;
    margin: 1.5em 0;
    border-collapse: collapse;
    font-size: 0.95em;
}
.ta-rich .wp-block-table table {
    margin: 0;
}
.ta-rich caption {
    padding-bottom: 0.5em;
    font-size: 0.85em;
    color: var(--ta-gray-555);
    caption-side: top;
    text-align: left;
}
.ta-rich th,
.ta-rich td {
    padding: 0.7em 0.9em;
    border: 1px solid #ead9c2;
    text-align: left;
    vertical-align: top;
}
.ta-rich th {
    background-color: var(--ta-peach);
    font-weight: var(--ta-fw-bold);
}
.ta-rich tbody tr:nth-child(even) td {
    background-color: rgba(253, 227, 198, 0.25);
}
.ta-rich tfoot td {
    font-weight: var(--ta-fw-bold);
}

/* ---- Media ---- */
.ta-rich img,
.ta-rich video {
    max-width: 100%;
    height: auto;
    border-radius: var(--ta-radius-12);
}
.ta-rich figure,
.ta-rich .wp-block-image,
.ta-rich .wp-caption {
    max-width: 100%;
    margin: 1.5em 0;
}
.ta-rich figcaption,
.ta-rich .wp-caption-text,
.ta-rich .wp-element-caption {
    margin-top: 0.5em;
    font-size: 0.85em;
    text-align: center;
    color: var(--ta-gray-555);
}
.ta-rich iframe,
.ta-rich embed,
.ta-rich object {
    max-width: 100%;
}
.ta-rich .wp-block-embed__wrapper iframe,
.ta-rich iframe[src*="youtube"],
.ta-rich iframe[src*="vimeo"] {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: var(--ta-radius-12);
}

/* WordPress alignment classes */
.ta-rich .alignleft {
    float: left;
    margin: 0.3em 1.5em 1em 0;
}
.ta-rich .alignright {
    float: right;
    margin: 0.3em 0 1em 1.5em;
}
.ta-rich .aligncenter {
    display: block;
    margin-inline: auto;
}
.ta-rich .alignwide,
.ta-rich .alignfull {
    width: 100%;
}
.ta-rich::after {
    content: "";
    display: table;
    clear: both;
}
.ta-rich .has-text-align-center { text-align: center; }
.ta-rich .has-text-align-right  { text-align: right; }

/* ---- Code ---- */
.ta-rich code,
.ta-rich kbd,
.ta-rich samp {
    padding: 0.1em 0.35em;
    border-radius: var(--ta-radius-4);
    background-color: #f3eee6;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9em;
}
.ta-rich pre {
    margin: 1.5em 0;
    padding: 1em 1.2em;
    overflow-x: auto;
    border-radius: var(--ta-radius-12);
    background-color: #1f1f1f;
    color: #f5f5f5;
    font-size: 0.9em;
    line-height: 1.5;
}
.ta-rich pre code {
    padding: 0;
    background: none;
    color: inherit;
}

/* ---- Rules, buttons, columns ---- */
.ta-rich hr,
.ta-rich .wp-block-separator {
    height: 0;
    margin: 2em 0;
    border: 0;
    border-top: 1px solid #e3d6c4;
    opacity: 1;
}
.ta-rich .wp-block-button__link {
    display: inline-block;
    padding: 0.7em 1.6em;
    border-radius: var(--ta-radius-pill);
    background-color: var(--ta-orange);
    color: var(--ta-white);
    text-decoration: none;
}
.ta-rich .wp-block-button__link:hover {
    background-color: var(--ta-orange-hover);
    color: var(--ta-white);
}
.ta-rich .wp-block-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5em;
    margin: 1.5em 0;
}
.ta-rich .wp-block-column {
    flex: 1 1 240px;
    min-width: 0;
}

@media (max-width: 575.98px) {
    .ta-rich .alignleft,
    .ta-rich .alignright {
        float: none;
        margin: 1em 0;
    }
}
