/* ============================================================
   Blog & Artikel — modernes Design (mehrsprachig)
   Nutzt die Tokens aus selva-main.css (--primary, --bg, --card …)
   ============================================================ */

/* schmalerer Lese-Container für Artikel */
.container--narrow {
    width: calc(100% - 32px);
    max-width: 760px;
}

/* ---------------------------------------------- Kontext: App-Shell (eingeloggt)
   selva-main.min.css kann veraltet sein → Dark-Theme-Variablen nicht garantiert.
   Im App-Shell (.to_main_cont) explizit helles Design erzwingen. */
.to_main_cont .blog-hero {
    background: linear-gradient(180deg, #f5f5f7 0%, #ffffff 100%);
    border-bottom: 1px solid #e5e7eb;
}
.to_main_cont .blog-hero-title { color: #1a1a2e; }
.to_main_cont .blog-hero-sub   { color: #6b7280; }

/* ---------------------------------------------- Blog-Kopf */
.blog-hero {
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-secondary, #111827) 0%, var(--bg, #0B0F1A) 100%);
    border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
}
.blog-hero-title {
    font-size: clamp(1.8rem, 4vw, 2.75rem);
    font-weight: 800;
    color: #FFFFFF;
    margin: .5rem 0 .5rem;
    line-height: 1.15;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
}
.blog-hero-sub {
    color: var(--text-secondary, #9CA3AF);
    max-width: 560px;
    margin: 0 auto 1.5rem;
    font-size: 1rem;
}

/* ---------------------------------------------- Layout: kein Aside (leer / keine mostRead) */
.blog-layout--solo {
    grid-template-columns: 1fr;
}
.blog-layout--solo .blog-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Suche */
.blog-search {
    display: flex;
    align-items: center;
    max-width: 460px;
    margin: 0 auto 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}
.blog-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.blog-search input {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--text);
    padding: .8rem 1.2rem;
    font-size: .95rem;
    outline: none;
}
.blog-search input::placeholder { color: var(--text-tertiary); }
.blog-search button {
    border: 0;
    background: var(--primary);
    color: #fff;
    padding: 0 1.1rem;
    align-self: stretch;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background .2s;
}
.blog-search button:hover { background: var(--primary-dark); }

/* Kategorie-Pills */
.blog-cats {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
}
.blog-cat-pill {
    display: inline-block;
    padding: .4rem .9rem;
    border-radius: 999px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s;
}
.blog-cat-pill:hover { color: var(--text); border-color: var(--border-light); }
.blog-cat-pill.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.blog-topic-clusters {
    /* Kein <nav>: Die globale Hauptnavigation ist absichtlich fixed.
       Diese Themenleiste bleibt dagegen immer im regulären Blogfluss. */
    position: static;
    inset: auto;
    width: auto;
    margin: 1rem auto 0;
}
.blog-topic-clusters-label {
    align-self: center;
    color: var(--text-secondary, #9CA3AF);
    font-size: .8rem;
    font-weight: 700;
    margin-right: .1rem;
}

/* ---------------------------------------------- Layout Liste */
.blog-section { padding-top: 2rem; }
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
    align-items: start;
}
@media (max-width: 900px) {
    .blog-layout { grid-template-columns: 1fr; }
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Load more */
.blog-loadmore-wrap { text-align: center; margin-top: 2rem; }
.blog-loadmore { cursor: pointer; }

/* ---------------------------------------------- Aside / Meistgelesen */
.blog-aside-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    position: sticky;
    top: 90px;
}
.blog-aside-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 1rem;
}
.blog-aside-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .9rem; }
.blog-aside-item {
    display: flex;
    gap: .75rem;
    align-items: center;
    text-decoration: none;
}
.blog-aside-item img {
    width: 64px; height: 64px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}
.blog-aside-item-title {
    display: block;
    color: var(--text);
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.35;
}
.blog-aside-item:hover .blog-aside-item-title { color: var(--primary); }
.blog-aside-item-meta { display: block; color: var(--text-tertiary); font-size: .75rem; margin-top: .2rem; }

/* ---------------------------------------------- Empty */
.blog-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-secondary);
}
.blog-empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.blog-empty-title { color: var(--text); font-size: 1.4rem; margin: 0 0 .5rem; }
.blog-empty-text { margin: 0 auto 1.5rem; max-width: 420px; }

/* ============================================================
   Artikel-Lese-Ansicht
   ============================================================ */
.article-head { padding: 2.5rem 0 1rem; }
.article-breadcrumb {
    display: flex; flex-wrap: wrap; gap: .5rem;
    font-size: .85rem; color: var(--text-tertiary);
    margin-bottom: 1rem;
}
/* The legacy app stylesheet styles every <nav> as the fixed site header.
   Both the breadcrumb and contextual city links are semantic navigation, so
   reset those header properties explicitly; otherwise they escape the article
   container and cover the article heading when the visitor is logged in. */
.article-page nav.article-breadcrumb,
.article-page nav.article-tags {
    position: static;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    z-index: auto;
    height: auto;
    min-height: 0;
    line-height: normal;
    background: transparent;
    box-shadow: none;
    font-family: inherit;
}
.article-breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.article-breadcrumb a:hover { color: var(--primary); }
.article-title {
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-fill-color: currentColor;
    margin: 0 0 .75rem;
}
.article-lead {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 1rem;
}
.article-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
    font-size: .85rem; color: var(--text-tertiary);
}
.article-meta .dot { opacity: .5; }
.article-meta-cat { color: var(--primary-light); font-weight: 700; text-decoration: none; text-transform: uppercase; letter-spacing: .03em; }
.article-meta-cat:hover { text-decoration: underline; }

.article-cover { margin: 1.5rem 0 2rem; }
.article-cover .container--narrow {
    aspect-ratio: 16 / 8;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
}
.article-cover img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border: 0;
}

/* Inhalt-Typografie */
.article-content {
    color: var(--text);
    font-size: 1.05rem;
    line-height: 1.8;
}
.article-content > *:first-child { margin-top: 0; }
.article-content p { margin: 0 0 1.3rem; color: var(--text-secondary); }
/* Zusätzliche Absicherung für manuell eingegebene, wirklich leere Absätze. */
.article-content p:empty { display: none; }
.article-content h2 { font-size: 1.6rem; font-weight: 700; margin: 2.2rem 0 1rem; color: var(--text); }
.article-content h3 { font-size: 1.3rem; font-weight: 700; margin: 1.8rem 0 .8rem; color: var(--text); }
.article-content a { color: var(--primary); text-decoration: underline; }
.article-content ul, .article-content ol { margin: 0 0 1.3rem 1.3rem; color: var(--text-secondary); }
.article-content li { margin-bottom: .5rem; }
.article-content img { max-width: 100%; height: auto; border-radius: 12px; margin: 1.5rem 0; }
.article-content blockquote {
    margin: 1.5rem 0;
    padding: .8rem 1.2rem;
    border-left: 4px solid var(--primary);
    background: var(--bg-secondary);
    border-radius: 0 10px 10px 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* Tags */
.article-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 2rem 0 1rem; }
.article-tags-label { font-weight: 700; color: var(--text); margin-right: .25rem; }
.article-tag {
    font-size: .8rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
}
.article-tag:hover { color: var(--primary); border-color: var(--primary); }

/* A single contextual conversion path at the end of every article. */
.article-signup-cta {
    margin: 2.25rem 0 1.5rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 45, 107, .35);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 45, 107, .11), rgba(124, 58, 237, .10));
}
.article-signup-cta h2 { margin: 0 0 .5rem; font-size: 1.3rem; }
.article-signup-cta p { margin: 0 0 1rem; color: var(--text-secondary); }
.article-signup-cta .btn-primary { font-size: .95rem; padding: .75rem 1.25rem; }

/* Teilen */
.article-share { display: flex; align-items: center; gap: .6rem; margin: 1.5rem 0 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.article-share-label { font-weight: 700; color: var(--text); margin-right: .25rem; }
.article-share-btn {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all .2s;
}
.article-share-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; transform: translateY(-2px); }

.article-related { border-top: 1px solid var(--border); margin-top: 2rem; }

@media (max-width: 699px) {
    /* Blog-Index: volle, ruhige Lesebreite; nur eine Karte pro Zeile. */
    .blog-hero { padding: 1.35rem 16px 1.1rem; }
    .blog-hero-title { font-size: 1.75rem; }
    .blog-hero-sub { margin-bottom: 1rem; font-size: .95rem; }
    .blog-cats {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
        margin-left: -4px;
        padding: 0 4px .35rem;
    }
    .blog-cats::-webkit-scrollbar { display: none; }
    .blog-cat-pill { flex: 0 0 auto; }
    /* Keep the mobile topic label on one line; otherwise flex shrink makes it vertical. */
    .blog-topic-clusters { align-items: center; }
    .blog-topic-clusters-label { flex: 0 0 auto; white-space: nowrap; }
    .blog-section { padding: 1.25rem 0 2.5rem; }
    .blog-section > .container { width: calc(100% - 32px); }
    .blog-layout--solo .blog-main { width: 100%; align-items: stretch; text-align: left; }
    .blog-grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }

    /* Artikel: komfortable 16px Seitenabstand und ein bewusstes 4:3-Cover,
       damit Hochformat-Originale nicht die gesamte erste Bildschirmseite füllen. */
    .article-head { padding: 1.5rem 0 .75rem; }
    .article-breadcrumb { font-size: .78rem; margin-bottom: .8rem; }
    .article-title { font-size: 1.55rem; line-height: 1.18; }
    .article-lead { font-size: 1rem; line-height: 1.55; }
    .article-meta { font-size: .78rem; }
    .article-cover { margin: 1rem 0 1.5rem; }
    .article-cover .container--narrow { aspect-ratio: 4 / 3; border-radius: 14px; }
    .article-content { font-size: 1rem; line-height: 1.72; }
    .article-content h2 { font-size: 1.4rem; margin-top: 1.8rem; }
    .article-content h3 { font-size: 1.2rem; }
}
