/* ============================================================
   activeLifeLearn.css
   Ergänzungs-CSS für das öffentliche Lerneinheiten-Template.
   Wird NACH activeHome.css geladen.
   ============================================================ */


/* ── Chat-Sidebar ausblenden ──────────────────────────────── */
.all-public .activehome-chat,
.all-public #chat-toggle {
    display: none !important;
}


/* ── TwentySeventeen: Zweispaltenlayout deaktivieren ──────── */
.page-template-activeLifeLearn-template .site-content-contain #content.site-content {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

.page-template-activeLifeLearn-template .site-secondary {
    display: none !important;
}

/* Nur Theme-eigene .wrap-Container resetten (nicht den Kacheln-.wrap) */
.page-template-activeLifeLearn-template .site-branding .wrap,
.page-template-activeLifeLearn-template .site-footer .wrap,
.page-template-activeLifeLearn-template .navigation-top .wrap {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}


/* ── Top-Zeile: Logo + Fortschrittsbalken ─────────────────── */
#ec-top-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

#ec-top-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* Alle möglichen Logo-Varianten: Fallback-img, WP custom-logo, Link darum */
#ec-top-logo img,
#ec-top-logo a img {
    display: block;
    height: auto;
    width: auto !important;
    max-width: 200px;
    object-fit: contain;
}

#ec-top-logo a {
    display: flex;
    align-items: center;
    line-height: 0;
}

#ec-top-row #ec-le-progress {
    flex: 1;
    margin: 0 !important;
    min-width: 0;
}


/* ── App-Container ────────────────────────────────────────── */
.all-public.activehome-app {
    display: block;
    min-height: 100vh;
    background: #f4f7fb;
}

.all-public .activehome-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 0.75rem 3rem;
    overflow-y: visible;
}


/* ── Lernschritt: Inhalt links, Buttons rechts ─────────────── */
.all-public .unit-step-layout {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 2rem;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
}

.all-public .unit-content {
    flex: 3 1 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.all-public .choice-buttons-wrapper {
    flex: 0 0 200px !important;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: 0 0 0 1.5rem;
    border-left: 1px solid #e2e8f0;
    background: transparent !important;
    box-shadow: none !important;
}

.all-public .choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.all-public .choice-btn {
    width: 100%;
    text-align: left;
    white-space: normal;
}


/* ── Folge-LE-Block unter dem Layout ─────────
   Die Folge-LE-Kacheln werden von renderFollowupUnits() als
   eigener .ec-followup-host UNTER .unit-step-layout gerendert
   (nicht mehr im .choice-buttons-wrapper). So bleibt das
   Zeilen-Layout erhalten: Inhalt links, Buttons rechts.
   ────────────────────────────────────────────────────────── */
/* Folge-LE Kacheln: eigener Block unter dem Schritt, volle Breite.
   Abstand sitzt hier (nicht auf .ec-followup-host), damit ein leerer
   Host (FinishUnit-Schritt ohne konfigurierte Folge-LEs) keinen
   Leerraum erzeugt. */
.all-public .ec-followup-section {
    width: 100%;
    margin: 1.75rem 0 0;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.all-public .ec-followup-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 0 0 1rem;
}

.all-public .ec-followup-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.9rem;
}

.all-public .ec-followup-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 1rem 1.1rem;
    background: #e8f5f2;
    border: 1px solid #c6e5de;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s;
}

.all-public .ec-followup-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    text-decoration: none;
}

.all-public .ec-followup-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

.all-public .ec-followup-card-desc {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
    flex: 1;
}

.all-public .ec-followup-card-cta {
    margin-top: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0a524e;
}


/* ── Kacheln ──────────────────────────────────────────────── */

.all-public .unit-content .wrap {
    width: 100%;
    padding: 1.25rem 1.5rem;
    box-sizing: border-box;
}

.all-public .unit-content .ec_tile_group_header {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.all-public .unit-content .ec_tile_group_description {
    font-size: 0.92rem;
    color: #64748b;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.all-public .unit-content .grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.all-public .unit-content .card {
    border-radius: 12px;
    padding: 1.1rem 1.2rem 1rem;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 120px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.all-public .unit-content .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
}

/* Marken-Tints (angeglichen an .card[data-accent]-Palette in css/style.css):
   Teal · Amber · Soft-Red · Mint · Ice · Cream statt Bonbon-Regenbogen. */
.all-public .unit-content .card[data-accent="1"] { background: #e8f5f2; border-color: #c6e5de; }
.all-public .unit-content .card[data-accent="2"] { background: #fff4e8; border-color: #f4dcbb; }
.all-public .unit-content .card[data-accent="3"] { background: #ffecec; border-color: #f6cfcf; }
.all-public .unit-content .card[data-accent="4"] { background: #eaf9f6; border-color: #c8ebe3; }
.all-public .unit-content .card[data-accent="5"] { background: #f0f8ff; border-color: #d4e6f6; }
.all-public .unit-content .card[data-accent="6"] { background: #fff8f4; border-color: #f2ddcf; }

.all-public .unit-content .card_title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    text-align: center;
}

.all-public .unit-content .card_subtitle {
    font-size: 0.84rem;
    font-weight: 600;
    color: #475569;
    line-height: 1.4;
    text-align: center;
}

.all-public .unit-content .card_content {
    font-size: 0.84rem;
    color: #64748b;
    line-height: 1.55;
    margin-top: 0.2rem;
    text-align: center;
}

.all-public .unit-content .card::after {
    content: "→ Mehr erfahren";
    display: block;
    margin-top: auto;
    padding-top: 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0f6e69;
    text-align: center;
    letter-spacing: 0.02em;
}


/* ── Overlay ──────────────────────────────────────────────────
   Struktur (kein Wrapper-div vorhanden):
     .overlay-global
       button.close
       #overlayTitle
       #overlayText
       button.overlay-close-bottom

   Fix: display:block + margin:0 auto auf jedem Kind-Element
   → sie stapeln sich zentral und direkt aneinander, bilden
   eine visuelle Card ohne Flex-Trennung.
   ────────────────────────────────────────────────────────── */

.all-public .unit-content .overlay-global {
    display: none;
    position: fixed !important;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    overflow-y: auto;
    padding: 3rem 1.25rem 2rem;
}

.all-public .unit-content .overlay-global.active {
    display: block;
}

/* × – fix oben rechts, immer über dem Overlay */
.all-public .unit-content .overlay-global > button.close {
    position: fixed !important;
    top: 1rem;
    right: 1rem;
    width: 2.25rem;
    height: 2.25rem;
    background: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10000;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.all-public .unit-content .overlay-global > button.close:hover {
    background: #f1f5f9;
}

/* Gemeinsame Basis für alle Card-Teile */
.all-public .unit-content .ec_overlay_title,
.all-public .unit-content .ec_overlay_text,
.all-public .unit-content .overlay-close-bottom {
    display: block;
    width: 100%;
    max-width: 660px;
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    box-sizing: border-box;
}

/* Titel – oben gerundete Ecken + Schatten */
.all-public .unit-content .ec_overlay_title {
    border-radius: 16px 16px 0 0;
    padding: 2rem 2rem 0.75rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    box-shadow: 0 8px 40px rgba(0,0,0,0.14);
}

/* Text – mittleres Stück */
.all-public .unit-content .ec_overlay_text {
    padding: 0.25rem 2rem 1.5rem;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.75;
}

/* Schließen-Button – unteres Stück, immer sichtbar */
.all-public .unit-content .overlay-close-bottom {
    border: none !important;
    border-top: 1px solid #e2e8f0 !important;
    border-radius: 0 0 16px 16px;
    background: #f8fafc !important;
    padding: 0.9rem 2rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569 !important;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
    position: static !important;    /* activeHome.css-Override verhindern */
    bottom: auto !important;
    width: 100% !important;         /* Button füllt Card-Breite */
}

.all-public .unit-content .overlay-close-bottom:hover {
    background: #f1f5f9 !important;
    color: #1e293b !important;
}


/* ── Zweispalten-Layout im Inhalt (ec-two-col) ─────────────── */
.all-public .ec-two-col {
    display: flex !important;
    gap: 2rem;
    align-items: flex-start;
}

.all-public .ec-col { flex: 1; }

.all-public .ec-two-col--70-30 .ec-col:first-child { flex: 7; }
.all-public .ec-two-col--70-30 .ec-col:last-child  { flex: 3; }
.all-public .ec-two-col--30-70 .ec-col:first-child { flex: 3; }
.all-public .ec-two-col--30-70 .ec-col:last-child  { flex: 7; }
.all-public .ec-two-col--50-50 .ec-col:first-child { flex: 1; }
.all-public .ec-two-col--50-50 .ec-col:last-child  { flex: 1; }

.all-public .ec-col img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}


/* ── Header ───────────────────────────────────────────────── */
.all-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.all-header-right { display: flex; align-items: center; gap: 1rem; }

.all-login-btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: #0f6e69;
    color: #fff !important;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}

.all-login-btn:hover { background: #0a524e; text-decoration: none; }


/* ── Fehlermeldungen ─────────────────────────────────────── */
.all-error-wrapper {
    max-width: 700px;
    margin: 4rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.07);
    text-align: center;
}

.all-load-error { padding: 2rem; color: #e53e3e; text-align: center; font-size: 1rem; }


/* ── Footer ──────────────────────────────────────────────── */
.all-footer {
    margin-top: 3rem;
    padding-top: 1.2rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.82rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.all-footer a { color: #64748b; text-decoration: none; }
.all-footer a:hover { color: #0f6e69; text-decoration: underline; }
.all-footer-sep { color: #cbd5e1; }


/* ── Überschriften im Lernschritt ─────────────────────────── */
.all-public .unit-content h1,
.all-public .unit-content h2,
.all-public .unit-content h3,
.all-public .unit-content h4 {
    font-weight: 700;
    line-height: 1.35;
    margin: 1.1rem 0 0.5rem;
}

.all-public .unit-content h1 { font-size: 1.7rem; }
.all-public .unit-content h2 { font-size: 1.4rem; }
.all-public .unit-content h3 { font-size: 1.2rem; }
.all-public .unit-content h4 { font-size: 1.05rem; }

/* Markdown-Fettung (**Text**) sichtbar machen.
   !important schlägt eine evtl. spezifischere Theme-Regel; font-synthesis
   erzwingt einen synthetischen Fett-Schnitt, falls die geladene Schrift
   keinen echten Bold-Schnitt mitbringt (häufige Ursache, wenn font-weight:700
   zwar berechnet, aber nicht sichtbar fett dargestellt wird). */
.all-public .unit-content strong,
.all-public .unit-content b {
    font-weight: 700 !important;
    font-synthesis: weight;
    -webkit-font-synthesis: weight;
}

/* Normalen Fließtext nicht fett */
.all-public .unit-content p,
.all-public .unit-content li {
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ── Prozess-Widget: kompakter ────────────────────────────── */
.all-public .ec-prozess {
    font-size: 1rem;
}

.all-public .ec-pz-flow-wrap {
    margin: 3.5rem 0 !important;
}

.all-public .ec-pz-caption {
    font-size: 1.6rem !important;
    padding: 12px 16px !important;
    min-height: auto !important;
}

.all-public .ec-pz-btn {
    padding: 7px 16px !important;
    font-size: 0.85rem !important;
}

.all-public .ec-prozess-headline {
    font-size: 1.8rem !important;
}


/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .all-public .activehome-main { padding: 1rem 0.75rem 2rem; }
    .all-public .choice-buttons-wrapper { flex: 0 0 160px !important; }
}

@media (max-width: 768px) {
    .all-public .activehome-main { padding: 0.5rem 0.25rem 2rem; }

    #ec-top-logo { display: none !important; }

    /* Äußeren weißen Rahmen auf Mobil entfernen – volle Breite nutzen */
    #unit-view-wrapper {
        padding: 0.75rem 0.5rem !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin-top: 0.25rem !important;
    }

    /* Kacheln-Wrap-Innenabstand reduzieren */
    .all-public .unit-content .wrap { padding: 0.5rem 0; }

    /* Kacheln: alle untereinander */
    .all-public .unit-content .grid,
    .all-public .ec-followup-grid {
        grid-template-columns: 1fr !important;
    }

    /* Zweispaltige Inhaltsblöcke (Freitext / Kachel-Overlay) einspalt. */
    .ec-two-col-grid { grid-template-columns: 1fr !important; }

    .all-public .unit-step-layout { flex-direction: column !important; }

    .all-public .choice-buttons-wrapper {
        flex: none !important;
        width: 100% !important;
        border-left: none;
        border-top: 1px solid #e2e8f0;
        padding: 1rem 0 0;
        justify-content: flex-start !important;
    }

    .all-public .ec-two-col { flex-direction: column !important; }

    .all-public .ec-two-col--70-30 .ec-col,
    .all-public .ec-two-col--30-70 .ec-col,
    .all-public .ec-two-col--50-50 .ec-col { flex: 1 1 100% !important; }

    .all-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .all-login-btn { font-size: 0.85rem; padding: 0.45rem 1rem; }
    .all-footer { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
    .all-footer-sep { display: none; }

    /* Overlay auf Mobil */
    .all-public .unit-content .ec_overlay_title,
    .all-public .unit-content .ec_overlay_text,
    .all-public .unit-content .overlay-close-bottom {
        max-width: 100%;
    }

    /* Feedback: Sterne kleiner damit alle 5 auf eine Zeile passen */
    .feedback-widget { max-width: 100%; padding: 1.25rem 0.75rem; }
    .feedback-stars  { font-size: 1.75rem; }
    .feedback-stars .star { margin: 0 0.1rem; }
}

@media (max-width: 480px) {
    .all-public .unit-content .grid,
    .all-public .ec-followup-grid { grid-template-columns: 1fr !important; }
}
