/* ============================================================
   SSR BLOG  ·  serielle-fassadensanierung.de/blog
   Extends /seo/subpage.css (same Lime · Graphite · Concrete tokens).
   Adds: blog index (cards + filter), long-form article layout
   (author byline, TOC, "kurz & kompakt" box, data tables,
   expert-tip callouts, calculation box, case cards, sources),
   and the AI-ask popup (ChatGPT · Claude · Perplexity · Gemini).
   ============================================================ */

/* ---------- AI-ASK DROPDOWN (header) — mirrors index.html ---------- */
.ai-ask{position:relative}
.ai-ask .hdr-cta{cursor:pointer}
.ai-pop{position:absolute;top:calc(100% + 12px);right:0;width:min(370px,86vw);background:var(--card);border:1px solid var(--line-strong);border-radius:var(--radius);box-shadow:var(--shadow);padding:1.1rem;z-index:300;opacity:0;visibility:hidden;transform:translateY(-8px);transition:all .28s var(--ease)}
.ai-ask.open .ai-pop{opacity:1;visibility:visible;transform:translateY(0)}
.ai-pop h4{font-family:'Inter Tight';font-size:1rem;margin-bottom:.3rem;color:var(--ink);line-height:1.2}
.ai-pop p.aih{font-size:.8rem;color:var(--ink-soft);margin-bottom:.7rem;line-height:1.45}
.ai-q{width:100%;border:1px solid var(--line-strong);border-radius:.8rem;background:var(--bg);color:var(--ink);font:inherit;font-size:.83rem;line-height:1.4;padding:.6rem .7rem;min-height:116px;resize:vertical;margin-bottom:.7rem}
.ai-topics{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:.7rem}
.ai-chip{border:1px solid var(--line-strong);background:var(--bg-elevated);color:var(--ink-soft);border-radius:999px;padding:.36rem .7rem;font-weight:700;font-size:.76rem;cursor:pointer;transition:all .2s;white-space:nowrap}
.ai-chip:hover{border-color:var(--ssr-lime)}
.ai-chip.is-active{background:var(--ssr-lime);color:var(--ssr-graphite);border-color:var(--ssr-lime)}
.ai-models{display:grid;grid-template-columns:1fr 1fr;gap:.5rem;margin-top:.7rem}
.ai-models button{display:flex;align-items:center;justify-content:center;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:.7rem;padding:.62rem .6rem;min-height:48px;cursor:pointer;transition:all .2s}
.ai-models button:hover{border-color:var(--ssr-lime);transform:translateY(-2px);box-shadow:0 6px 16px rgba(0,0,0,.08)}
.ai-models .ai-logo{height:19px;width:auto;max-width:100%;display:block}
.ai-toast{margin-top:.6rem;font-size:.76rem;font-weight:700;color:var(--ssr-graphite);background:var(--ssr-lime);border-radius:.5rem;padding:.45rem .6rem;display:none}
@media(max-width:980px){.ai-pop{position:fixed;top:auto;bottom:14px;left:14px;right:14px;width:auto}}
/* header shows the AI-ask button even where the plain CTA would hide */
@media(max-width:920px){.ai-ask{display:inline-flex}}

/* ---------- BLOG INDEX: hero ---------- */
.blog-hero{padding:calc(var(--header-h) + 48px) 0 8px;position:relative;overflow:hidden}
.blog-hero::before{content:"";position:absolute;inset:0;z-index:0;opacity:.5;background-image:linear-gradient(var(--line) 1px,transparent 1px),linear-gradient(90deg,var(--line) 1px,transparent 1px);background-size:64px 64px;mask-image:radial-gradient(ellipse 80% 60% at 80% 10%,#000,transparent 75%)}
.blog-hero .wrap{position:relative;z-index:2}
.blog-hero .lead{margin-top:1rem}

/* ---------- CATEGORY FILTER ---------- */
.cat-filter{display:flex;flex-wrap:wrap;gap:.55rem;margin:1.8rem 0 .4rem}
.cat-btn{border:1px solid var(--line-strong);background:var(--bg-elevated);color:var(--ink-soft);border-radius:999px;padding:.5rem 1.05rem;font-weight:700;font-size:.86rem;cursor:pointer;transition:all .25s var(--ease);font-family:'Inter'}
.cat-btn:hover{border-color:var(--ssr-lime);color:var(--ink)}
.cat-btn.is-active{background:var(--ssr-graphite);color:#fff;border-color:var(--ssr-graphite)}
[data-theme="dark"] .cat-btn.is-active{background:var(--ssr-lime);color:var(--ssr-graphite);border-color:var(--ssr-lime)}

/* ---------- POST GRID / CARDS ---------- */
.post-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:26px;margin-top:1.6rem}
.post-card{display:flex;flex-direction:column;background:var(--card);border:1px solid var(--line);border-radius:var(--radius-lg);overflow:hidden;box-shadow:var(--shadow-soft);transition:transform .4s var(--ease),border-color .4s,box-shadow .4s}
.post-card:hover{transform:translateY(-6px);border-color:var(--ssr-lime);box-shadow:var(--shadow)}
.post-card.is-hidden{display:none}
.post-thumb{position:relative;aspect-ratio:16/10;overflow:hidden;background:var(--ssr-concrete-dark)}
.post-thumb img{width:100%;height:100%;object-fit:cover;transition:transform .6s var(--ease)}
.post-card:hover .post-thumb img{transform:scale(1.05)}
.post-tag{position:absolute;top:12px;left:12px;background:var(--ssr-lime);color:var(--ssr-graphite);font-size:.68rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase;padding:.34rem .7rem;border-radius:999px}
.post-body{display:flex;flex-direction:column;gap:.55rem;padding:1.3rem 1.4rem 1.5rem;flex:1}
.post-meta{display:flex;flex-wrap:wrap;gap:.5rem 1rem;font-size:.76rem;font-weight:600;color:var(--ink-soft)}
.post-meta span{display:inline-flex;align-items:center;gap:.35rem}
.post-meta .svgi{width:14px;height:14px;color:var(--ssr-lime-dark)}
[data-theme="dark"] .post-meta .svgi{color:var(--ssr-lime)}
.post-card h3{font-family:'Inter Tight';font-weight:900;font-size:1.22rem;line-height:1.25;color:var(--ink);letter-spacing:-.01em}
.post-card p{font-size:.9rem;color:var(--ink-soft);line-height:1.55;margin:0;flex:1}
.post-more{display:inline-flex;align-items:center;gap:.4rem;font-weight:800;font-size:.86rem;color:var(--ssr-graphite-deep);margin-top:.3rem}
[data-theme="dark"] .post-more{color:var(--ssr-lime)}
.post-more .svgi{width:16px;height:16px;stroke-width:2.4;transition:transform .35s var(--ease)}
.post-card:hover .post-more .svgi{transform:translateX(4px)}

/* featured (first) card spans wide on large screens */
.post-grid .post-card.featured{grid-column:1 / -1}
@media(min-width:820px){
  .post-grid .post-card.featured{flex-direction:row}
  .post-grid .post-card.featured .post-thumb{flex:0 0 46%;aspect-ratio:auto;min-height:300px}
  .post-grid .post-card.featured .post-body{padding:2rem 2.2rem;justify-content:center}
  .post-grid .post-card.featured h3{font-size:clamp(1.5rem,2.4vw,2rem)}
  .post-grid .post-card.featured p{font-size:1rem;flex:none}
}
.post-empty{grid-column:1/-1;text-align:center;color:var(--ink-soft);padding:2rem;font-weight:600;display:none}

/* ---------- ARTICLE: author byline + meta ---------- */
.art-meta{display:flex;flex-wrap:wrap;align-items:center;gap:.7rem 1.4rem;margin:1.3rem 0 .4rem}
.art-author{display:flex;align-items:center;gap:.7rem}
.art-author img{width:46px;height:46px;border-radius:50%;object-fit:cover;box-shadow:0 0 0 2px var(--ssr-lime)}
.art-author .aa-name{font-family:'Inter Tight';font-weight:800;font-size:.98rem;color:var(--ink);line-height:1.1}
.art-author .aa-role{font-size:.78rem;color:var(--ink-soft)}
.art-facts{display:flex;flex-wrap:wrap;gap:.5rem 1.2rem;font-size:.82rem;font-weight:600;color:var(--ink-soft)}
.art-facts span{display:inline-flex;align-items:center;gap:.4rem}
.art-facts .svgi{width:15px;height:15px;color:var(--ssr-lime-dark)}
[data-theme="dark"] .art-facts .svgi{color:var(--ssr-lime)}

/* ---------- AI SUMMARY BLOCK (in-article) ---------- */
.ai-summary{background:var(--bg-elevated);border:1px solid var(--line-strong);border-radius:18px;padding:1.3rem 1.4rem;margin:1.6rem 0}
.ai-summary .ais-h{display:flex;align-items:center;gap:.6rem;font-family:'Inter Tight';font-weight:800;font-size:1.02rem;color:var(--ink);margin-bottom:.3rem}
.ai-summary .ais-h .svgi{width:20px;height:20px;color:var(--ssr-lime-dark)}
[data-theme="dark"] .ai-summary .ais-h .svgi{color:var(--ssr-lime)}
.ai-summary p{font-size:.86rem;color:var(--ink-soft);margin:.2rem 0 .9rem;max-width:none}
.ai-summary .ai-models{grid-template-columns:repeat(4,1fr);max-width:420px}
@media(max-width:540px){.ai-summary .ai-models{grid-template-columns:repeat(2,1fr)}}

/* ---------- TOC "Themen auf dieser Seite" ---------- */
.toc{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:1.1rem 1.3rem;margin:1.6rem 0;box-shadow:var(--shadow-soft)}
.toc-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;width:100%;background:none;border:0;cursor:pointer;font-family:'Inter Tight';font-weight:800;font-size:1rem;color:var(--ink);padding:0}
.toc-head .svgi{width:18px;height:18px;stroke-width:2.4;color:var(--ssr-lime-dark);transition:transform .3s var(--ease)}
[data-theme="dark"] .toc-head .svgi{color:var(--ssr-lime)}
.toc.collapsed .toc-head .svgi{transform:rotate(-90deg)}
.toc-list{list-style:none;margin:.9rem 0 0;padding:0;display:grid;gap:.15rem;overflow:hidden;transition:max-height .4s var(--ease)}
.toc.collapsed .toc-list{max-height:0!important;margin:0}
.toc-list li{margin:0}
.toc-list a{display:block;font-size:.9rem;color:var(--ink-soft);padding:.4rem .6rem;border-radius:8px;border-left:2px solid transparent;line-height:1.4;transition:all .2s}
.toc-list a:hover{color:var(--ink);background:var(--bg)}
.toc-list a.active{color:var(--ink);font-weight:700;border-left-color:var(--ssr-lime);background:var(--ssr-lime-soft)}
[data-theme="dark"] .toc-list a.active{background:rgba(207,221,40,.12)}

/* ---------- "Das Thema kurz & kompakt" ---------- */
.kompakt{background:linear-gradient(180deg,var(--ssr-lime-soft),var(--bg-elevated));border:1px solid var(--line);border-radius:18px;padding:1.4rem 1.5rem;margin:1.8rem 0}
[data-theme="dark"] .kompakt{background:linear-gradient(180deg,rgba(207,221,40,.10),var(--bg-elevated))}
.kompakt h2{font-size:1.15rem!important;margin:0 0 .9rem!important}
.kompakt ul{list-style:none;margin:0;padding:0;display:grid;gap:.8rem}
.kompakt li{display:flex;gap:.7rem;align-items:flex-start;font-size:.96rem;line-height:1.55;color:var(--ink);max-width:none}
.kompakt li .kx{flex:none;margin-top:.15rem;width:22px;height:22px;border-radius:7px;background:var(--ssr-lime);color:var(--ssr-graphite);display:grid;place-items:center}
.kompakt li .kx .svgi{width:14px;height:14px;stroke-width:3}

/* ---------- DATA TABLES ---------- */
.table-wrap{overflow-x:auto;margin:1.4rem 0;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-soft)}
table.data{width:100%;border-collapse:collapse;font-size:.92rem;min-width:520px;background:var(--card)}
table.data caption{caption-side:top;text-align:left;font-size:.78rem;font-weight:700;color:var(--ink-soft);padding:.7rem 1rem 0}
table.data th,table.data td{padding:.8rem 1rem;text-align:left;vertical-align:top;line-height:1.45}
table.data thead th{background:var(--ssr-graphite);color:#fff;font-family:'Inter Tight';font-weight:800;font-size:.82rem;letter-spacing:.02em;white-space:nowrap}
[data-theme="dark"] table.data thead th{background:var(--ssr-lime);color:var(--ssr-graphite)}
table.data tbody tr:nth-child(even){background:var(--bg)}
table.data tbody td:first-child{font-weight:700;color:var(--ink)}
table.data tbody tr:last-child{font-weight:800}
table.data .hi{color:var(--ssr-graphite-deep);font-weight:800}
[data-theme="dark"] table.data .hi{color:var(--ssr-lime)}

/* ---------- EXPERT-TIP callout ---------- */
.exptip{display:flex;gap:.9rem;align-items:flex-start;background:var(--ssr-graphite);color:#fff;border-radius:16px;padding:1.2rem 1.4rem;margin:1.6rem 0}
.exptip .et-ic{flex:none;width:34px;height:34px;border-radius:10px;background:var(--ssr-lime);color:var(--ssr-graphite);display:grid;place-items:center;margin-top:.1rem}
.exptip .et-ic .svgi{width:19px;height:19px;stroke-width:2.4}
.exptip .et-b{font-size:.95rem;line-height:1.6;color:rgba(255,255,255,.92);max-width:none}
.exptip .et-b b{color:var(--ssr-lime)}
.exptip .et-lbl{display:block;font-size:.7rem;font-weight:900;letter-spacing:.16em;text-transform:uppercase;color:var(--ssr-lime);margin-bottom:.3rem}

/* ---------- CALCULATION BOX (Vollrechnung) ---------- */
.calcbox{background:var(--card);border:1px solid var(--line-strong);border-radius:18px;padding:1.4rem 1.5rem;margin:1.6rem 0;box-shadow:var(--shadow-soft)}
.calcbox h3{font-family:'Inter Tight';font-size:1.12rem;margin:0 0 1rem}
.calcbox .crow{display:flex;justify-content:space-between;gap:1rem;padding:.65rem 0;border-bottom:1px dashed var(--line);font-size:.94rem}
.calcbox .crow:last-of-type{border-bottom:0}
.calcbox .crow .cl{color:var(--ink-soft)}
.calcbox .crow .cv{font-family:'Inter Tight';font-weight:800;color:var(--ink);white-space:nowrap;text-align:right}
.calcbox .crow.total{margin-top:.4rem;border-top:2px solid var(--ssr-lime);border-bottom:0;padding-top:.9rem}
.calcbox .crow.total .cv{color:var(--ssr-graphite-deep);font-size:1.15rem}
[data-theme="dark"] .calcbox .crow.total .cv{color:var(--ssr-lime)}
.calcbox .cnote{font-size:.76rem;color:var(--ink-soft);margin-top:.9rem;line-height:1.5}

/* ---------- CASE / EXAMPLE CARDS ---------- */
.case-cards{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin:1.6rem 0}
@media(max-width:640px){.case-cards{grid-template-columns:1fr}}
.case-card{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:1.4rem 1.5rem;box-shadow:var(--shadow-soft)}
.case-card .cc-h{font-family:'Inter Tight';font-weight:800;font-size:1.05rem;color:var(--ink);margin-bottom:.8rem}
.case-card ul{list-style:none;margin:0;padding:0;display:grid;gap:.6rem}
.case-card li{display:flex;gap:.6rem;align-items:flex-start;font-size:.9rem;color:var(--ink-soft);line-height:1.5;max-width:none}
.case-card li .svgi{flex:none;margin-top:.18rem;width:15px;height:15px;color:var(--ssr-graphite);stroke-width:2.8}
[data-theme="dark"] .case-card li .svgi{color:var(--ssr-lime)}
.case-card li b{color:var(--ink)}

/* ---------- SOURCES ---------- */
.sources{margin:2rem 0 0;border-top:1px solid var(--line);padding-top:1.2rem}
.sources h2{font-size:1.15rem!important;margin:0 0 .7rem!important}
.sources ol{margin:0 0 0 1.1rem;padding:0;display:grid;gap:.5rem}
.sources li{font-size:.84rem;color:var(--ink-soft);line-height:1.5}
.sources a{color:var(--ssr-graphite-deep);font-weight:600;border-bottom:1px solid var(--ssr-lime)}
[data-theme="dark"] .sources a{color:var(--ssr-lime)}

/* ---------- inline "KI dazu fragen" (article) ---------- */
.ai-inline{display:inline-flex;align-items:center;gap:.45rem;margin-top:.4rem;font-weight:700;font-size:.86rem;color:var(--ssr-lime-dark);cursor:pointer;background:none;border:0;padding:0}
.ai-inline:hover{color:var(--ssr-lime)}
.ai-inline .svgi{width:16px;height:16px}
[data-theme="dark"] .ai-inline{color:var(--ssr-lime)}

/* pull the article headings under the fixed header when jumped to via TOC */
.article h2[id],.article h3[id]{scroll-margin-top:calc(var(--header-h) + 20px)}
