/* ============================================================================
 * learn-nuggets.css  ·  MTM Werbung: Ecken-Toast + Lade-Info (INLINE)
 * ----------------------------------------------------------------------------
 * MTM CI: Petrol #008AB6 · Dunkelblau #00466B · Blau #0078D1 · Tint #DDEBFD
 *         Grau #7C7C7B. Flach, gerundet, modern.
 * ========================================================================== */

:root {
    --mtm-petrol: #008AB6;
    --mtm-dark: #00466B;
    --mtm-blue: #0078D1;
    --mtm-tint: #DDEBFD;
    --mtm-grey: #7C7C7B;

    --tm-ad-surface: #ffffff;
    --tm-ad-fg: #12242e;
    --tm-ad-muted: var(--mtm-grey);
    --tm-ad-border: #e6e9ed;
    --tm-ad-accent: var(--mtm-petrol);
}

[data-bs-theme="dark"] {
    --tm-ad-surface: #10222c;
    --tm-ad-fg: #e9eef1;
    --tm-ad-muted: #9aa7b0;
    --tm-ad-border: #26414f;
    --tm-ad-accent: #12a6cf;
}

.tm-ad[hidden] {
    display: none !important;
}

/* --- Logo-MARKE: nur das Icon zeigen ("MTM"-Wortzeichen wegclippen) -------- */
.tm-ad-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    overflow: hidden;
    flex: 0 0 auto;
}

.tm-ad-mark img {
    height: 36px;
    width: auto;
    max-width: none;
    object-fit: cover;
    object-position: left center;
}

.tm-ad-mark .tm-ad-mark-light {
    display: block;
}

.tm-ad-mark .tm-ad-mark-dark {
    display: none;
}

[data-bs-theme="dark"] .tm-ad-mark .tm-ad-mark-light {
    display: none;
}

[data-bs-theme="dark"] .tm-ad-mark .tm-ad-mark-dark {
    display: block;
}

.tm-ad-mark--text {
    font-weight: 800;
    letter-spacing: .04em;
    color: #fff;
    background: var(--mtm-petrol);
    border-radius: 8px;
    font-size: .8rem;
    width: auto;
    padding: .25rem .45rem;
}

/* --- Text-Bausteine ------------------------------------------------------- */
.tm-ad-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--tm-ad-accent);
    margin-bottom: .25rem;
}

/* kleines Kategorie-Icon vor dem Eyebrow \u2013 dezent, gleiche Farbe */
.tm-ad-eyebrow-icon {
    font-size: .82em;
    line-height: 1;
    opacity: .95;
}

.tm-ad-title {
    display: block;
    font-size: 1.05rem;
    line-height: 1.25;
    font-weight: 700;
    color: var(--tm-ad-fg);
    margin-bottom: .4rem;
}

.tm-ad-text {
    margin: 0;
    font-size: .9rem;
    line-height: 1.5;
    color: var(--tm-ad-muted);
}

.tm-ad-cta {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--tm-ad-accent);
}

.tm-ad-cta:hover {
    text-decoration: underline;
}

.tm-ad-cta i {
    font-size: .72em;
}

.tm-ad-cta--primary {
    background: var(--mtm-petrol);
    color: #fff;
    padding: .6rem 1.05rem;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.tm-ad-cta--primary:hover {
    background: var(--mtm-dark);
    text-decoration: none;
}

/* --- Navigation ----------------------------------------------------------- */
.tm-ad-nav {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.tm-ad-navbtn {
    border: 1px solid var(--tm-ad-border);
    background: transparent;
    color: var(--tm-ad-muted);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: .78rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color .12s ease, border-color .12s ease;
}

.tm-ad-navbtn:hover {
    color: var(--mtm-petrol);
    border-color: var(--mtm-petrol);
}

.tm-ad-count {
    font-size: .76rem;
    color: var(--tm-ad-muted);
    min-width: 3.2em;
    text-align: center;
}

.tm-ad-x {
    border: 0;
    background: transparent;
    color: var(--tm-ad-muted);
    cursor: pointer;
    padding: .25rem;
    line-height: 1;
    border-radius: 6px;
}

.tm-ad-x:hover {
    color: var(--tm-ad-fg);
    background: rgba(0, 0, 0, .06);
}

/* ==========================================================================
 *  TOAST (Ecke) – Logo NEBEN dem Titel, breiter
 * ======================================================================== */
.tm-ad--toast {
    position: fixed;
    z-index: 1080;
    width: min(460px, calc(100vw - 2rem));
    pointer-events: none;
}

.tm-ad--bottom-right {
    right: 1.25rem;
    bottom: 1.25rem;
}

.tm-ad--bottom-left {
    left: 1.25rem;
    bottom: 1.25rem;
}

.tm-ad--top-right {
    right: 1.25rem;
    top: 5rem;
}

.tm-ad--top-left {
    left: 1.25rem;
    top: 5rem;
}

.tm-ad--toast .tm-ad-card {
    pointer-events: auto;
    position: relative;
    background: var(--tm-ad-surface);
    border: 1px solid var(--tm-ad-border);
    border-radius: 16px;
    padding: 1.3rem 1.4rem 1.2rem;
    box-shadow: 0 12px 34px rgba(0, 70, 107, .16);
    transform: translateY(12px);
    opacity: 0;
    transition: transform .24s ease, opacity .24s ease;
}

.tm-ad--toast.is-in .tm-ad-card {
    transform: translateY(0);
    opacity: 1;
}

.tm-ad--toast.is-leaving .tm-ad-card {
    transform: translateY(8px);
    opacity: 0;
}

.tm-ad--toast .tm-ad-x {
    position: absolute;
    top: .6rem;
    right: .6rem;
}

/* Kopf: Logo-Marke links, Eyebrow/Titel rechts daneben (vertikal zentriert) */
.tm-ad-head {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-bottom: .7rem;
    padding-right: 1.4rem;
}

.tm-ad-headtext {
    min-width: 0;
}

.tm-ad-headtext .tm-ad-eyebrow {
    margin-bottom: .2rem;
}

.tm-ad-headtext .tm-ad-title {
    margin-bottom: 0;
}

.tm-ad-text {
    margin: 0;
    font-size: .9rem;
    line-height: 1.5;
    color: var(--tm-ad-muted);
}

.tm-ad-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: .95rem;
}

/* sanftes Cross-Fade beim Auto-Wechsel */
.tm-ad--toast .tm-ad-card {
    animation: tm-ad-fade .28s ease;
}

@keyframes tm-ad-fade {
    from {
        opacity: .35;
    }

    to {
        opacity: 1;
    }
}

/* ==========================================================================
 *  LADE-INFO (INLINE) – modern, ganz unten
 * ======================================================================== */
.tm-adline {
    margin: 1.25rem 0 .25rem;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s ease, transform .2s ease;
}

.tm-adline.is-in {
    opacity: 1;
    transform: none;
}

.tm-adline.is-leaving {
    opacity: 0;
    transform: translateY(-4px);
}

.tm-adline-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.1rem;
    align-items: center;
    background: var(--tm-ad-surface);
    border: 1px solid var(--tm-ad-border);
    border-radius: 14px;
    padding: 1.15rem 1.3rem;
    box-shadow: 0 6px 20px rgba(0, 70, 107, .07);
}

.tm-adline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    flex: 0 0 auto;
    color: var(--mtm-petrol);
    background: var(--mtm-tint);
    background: color-mix(in srgb, var(--mtm-petrol) 14%, transparent);
    font-size: 1.1rem;
}

[data-bs-theme="dark"] .tm-adline-icon {
    background: color-mix(in srgb, var(--mtm-petrol) 22%, transparent);
}

.tm-adline-body {
    min-width: 0;
}

.tm-adline-body .tm-ad-eyebrow {
    margin-bottom: .3rem;
}

.tm-adline-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--tm-ad-fg);
    margin-bottom: .3rem;
}

.tm-adline-text {
    margin: 0;
    font-size: .9rem;
    line-height: 1.55;
    color: var(--tm-ad-muted);
}

.tm-adline-note {
    margin: .55rem 0 0;
    font-size: .76rem;
    line-height: 1.4;
    color: var(--tm-ad-muted);
    opacity: .85;
}

.tm-adline-cta {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: 0 0 auto;
}

/* ==========================================================================
 *  RESPONSIVE
 * ======================================================================== */
@media (max-width: 768px) {
    .tm-ad--toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        width: auto;
    }

    .tm-adline-inner {
        grid-template-columns: auto 1fr;
        row-gap: .9rem;
    }

    .tm-adline-cta {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .tm-adline-cta .tm-ad-cta--primary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 479px) {
    .tm-ad--toast {
        display: none !important;
    }

    .tm-adline-icon {
        display: none;
    }

    .tm-adline-inner {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
 *  MOTION
 * ======================================================================== */
@media (prefers-reduced-motion: reduce) {

    .tm-ad-card,
    .tm-adline {
        transition: none !important;
        animation: none !important;
    }

    .tm-ad--toast .tm-ad-card {
        transform: none;
        opacity: 1;
    }

    .tm-adline {
        transform: none;
        opacity: 1;
    }
}

/* ============================================================================
 * ZUSATZ f\u00fcr learn-nuggets.css  \u2013  schwebende Lade-Karte (minVisibleMs)
 * ----------------------------------------------------------------------------
 * Wird nur genutzt, wenn der Ladevorgang schneller endet als minVisibleMs
 * (z.\u202fB. im Viewer). Die Karte l\u00f6st sich aus #stageProgress und zeigt sich
 * kurz fixiert unten mittig \u2013 damit sie auch bei sehr kurzem Laden sichtbar ist.
 * ========================================================================== */
.tm-adline.is-floating {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%);
    width: min(560px, calc(100vw - 2rem));
    margin: 0;
    z-index: 1085;
}

/* Elevation nur im schwebenden Zustand (inline bleibt flach) */
.tm-adline.is-floating .tm-adline-inner {
    box-shadow: 0 14px 40px rgba(0, 70, 107, .20);
}

@media (max-width: 560px) {
    .tm-adline.is-floating {
        left: 1rem;
        right: 1rem;
        transform: none;
        width: auto;
    }
}