/* AHSE Fachbeiträge: Übersicht und Detailseite. Gescoped auf .ahse-blog und .ahse-post;
   Tokens stammen aus dem freigegebenen Design (global.css / branchen.css). */
.ahse-blog {
  --ahse-blog-accent: var(--accent, #d49e5c);
  --ahse-blog-card-bg: #fff;
  --ahse-blog-line: color-mix(in oklch, #13264c 14%, transparent);
  --ahse-blog-line-strong: color-mix(in oklch, #13264c 34%, transparent);
  --ahse-blog-text: color-mix(in oklch, #13264c 74%, transparent);
  --ahse-blog-ease: cubic-bezier(.2, 0, 0, 1);
  color: var(--bg, #13264c);
}

/* ---------------------------------------------------------------- Filter */
.ahse-blog__filter { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 clamp(28px, 4vw, 44px); }
.ahse-blog__chip {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 18px;
  border: 1px solid var(--ahse-blog-line); border-radius: 999px; background: #fff;
  color: var(--bg, #13264c); text-decoration: none;
  font-family: var(--font-display, inherit); font-size: .8rem; font-weight: 600; line-height: 1.3;
  transition: background .22s var(--ahse-blog-ease), color .22s var(--ahse-blog-ease), border-color .22s var(--ahse-blog-ease);
}
.ahse-blog__chip::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ahse-blog-accent); }
.ahse-blog__chip:hover { background: var(--bg, #13264c); border-color: var(--bg, #13264c); color: var(--fg, #f5f6f7); }
.ahse-blog__chip.is-active { background: var(--bg, #13264c); border-color: var(--bg, #13264c); color: var(--fg, #f5f6f7); }
.ahse-blog__chip.is-active::before { background: var(--ahse-blog-accent); }

/* ----------------------------------------------------------------- Karten */
.ahse-blog__card { position: relative; min-width: 0; background: var(--ahse-blog-card-bg); border: 1px solid var(--ahse-blog-line); border-radius: 8px; overflow: hidden; transition: border-color .22s var(--ahse-blog-ease), transform .22s var(--ahse-blog-ease), box-shadow .22s var(--ahse-blog-ease); }
.ahse-blog__card:hover { border-color: var(--ahse-blog-line-strong); transform: translateY(-2px); box-shadow: 0 18px 40px color-mix(in oklch, #13264c 12%, transparent); }
.ahse-blog__media { display: block; overflow: hidden; background: color-mix(in oklch, #13264c 6%, transparent); }
.ahse-blog__media img, .ahse-blog__image { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) contrast(1.06); transition: transform .4s var(--ahse-blog-ease); }
.ahse-blog__card:hover .ahse-blog__image { transform: scale(1.03); }
.ahse-blog__body { display: flex; flex-direction: column; align-items: flex-start; padding: 24px 24px 26px; }
.ahse-blog__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 12px; color: var(--ahse-blog-text); font-family: var(--font-display, inherit); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; line-height: 1.4; }
.ahse-blog__category { display: inline-flex; align-items: center; color: var(--bg, #13264c); }
.ahse-blog__category::after { content: ""; display: inline-block; width: 18px; height: 1px; margin-inline-start: 12px; background: var(--ahse-blog-accent); }
.ahse-blog__title { margin: 0; font-family: var(--font-display, inherit); font-size: clamp(1.08rem, 1.4vw, 1.3rem); font-weight: 600; line-height: 1.35; letter-spacing: -.01em; color: var(--bg, #13264c); overflow-wrap: anywhere; hyphens: auto; }
.ahse-blog__title a { color: inherit; text-decoration: none; }
.ahse-blog__title a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--ahse-blog-accent); }
.ahse-blog__title a::after { content: ""; position: absolute; inset: 0; }
.ahse-blog__excerpt { margin: 14px 0 0; color: var(--ahse-blog-text); font-size: .98rem; line-height: 1.75; }
.ahse-blog__more { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin: 14px 0 0; color: var(--bg, #13264c); font-family: var(--font-display, inherit); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.ahse-blog__more span { color: var(--ahse-blog-accent); transition: transform .22s var(--ahse-blog-ease); }
.ahse-blog__card:hover .ahse-blog__more span { transform: translateX(4px); }
.ahse-blog__card:focus-within { outline: 3px solid var(--bg, #13264c); outline-offset: 4px; }
.ahse-blog__card a:focus-visible { outline: none; }

/* Raster mit drei Spalten */
.ahse-blog__grid { display: grid; gap: 24px; }
.ahse-blog__grid--grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ahse-blog__card--grid .ahse-blog__media { aspect-ratio: 100 / 62; }

/* Liste: Bild links, Text rechts */
.ahse-blog__grid--list { grid-template-columns: minmax(0, 1fr); gap: 20px; }
.ahse-blog__card--list { display: grid; grid-template-columns: minmax(0, 38fr) minmax(0, 62fr); align-items: stretch; }
.ahse-blog__card--list .ahse-blog__media { height: 100%; min-height: 220px; }
.ahse-blog__card--list .ahse-blog__body { justify-content: center; padding: 28px 30px 30px; }

/* Aufmacher: größer, Bild links */
.ahse-blog__card--feature { display: grid; grid-template-columns: minmax(0, 54fr) minmax(0, 46fr); align-items: stretch; margin-bottom: 28px; border-top: 3px solid var(--ahse-blog-accent); }
.ahse-blog__card--feature .ahse-blog__media { height: 100%; min-height: 320px; }
.ahse-blog__card--feature .ahse-blog__body { justify-content: center; padding: clamp(28px, 3vw, 48px); }
.ahse-blog__card--feature .ahse-blog__title { font-size: clamp(1.45rem, 2.4vw, 2.1rem); line-height: 1.22; }
.ahse-blog__card--feature .ahse-blog__excerpt { font-size: 1.04rem; max-width: 60ch; }

/* ------------------------------------------------------------ Blättern */
.ahse-blog__pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: clamp(32px, 4vw, 52px); padding-top: 24px; border-top: 1px solid var(--ahse-blog-line); }
.ahse-blog__pagecount { margin: 0; color: var(--ahse-blog-text); font-family: var(--font-display, inherit); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.ahse-blog__pages { display: flex; flex-wrap: wrap; gap: 8px; }
.ahse-blog__pages :is(a, span) { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 0 14px; border: 1px solid var(--ahse-blog-line); border-radius: 4px; color: var(--bg, #13264c); font-family: var(--font-display, inherit); font-size: .8rem; font-weight: 600; text-decoration: none; }
.ahse-blog__pages a:hover { border-color: var(--bg, #13264c); background: var(--bg, #13264c); color: var(--fg, #f5f6f7); }
.ahse-blog__pages .current { background: var(--bg, #13264c); border-color: var(--bg, #13264c); color: var(--fg, #f5f6f7); }
.ahse-blog__pages .dots { border-color: transparent; }
.ahse-blog__empty { margin: 0; color: var(--ahse-blog-text); font-size: 1rem; }

/* Auf dunklen Abschnitten (z. B. verwandte Beiträge) */
.section--deep .ahse-blog, .ahse-post__related .ahse-blog {
  --ahse-blog-card-bg: color-mix(in oklch, #f5f6f7 5%, transparent);
  --ahse-blog-line: color-mix(in oklch, #f5f6f7 18%, transparent);
  --ahse-blog-line-strong: color-mix(in oklch, #f5f6f7 40%, transparent);
  --ahse-blog-text: color-mix(in oklch, #f5f6f7 72%, transparent);
  color: var(--fg, #f5f6f7);
}
.ahse-post__related .ahse-blog__title, .ahse-post__related .ahse-blog__category, .ahse-post__related .ahse-blog__more a { color: var(--fg, #f5f6f7); }
.ahse-post__related .ahse-blog__card :is(a):focus-visible { outline-color: var(--ahse-blog-accent); }

/* ====================================================== Detailseite ===== */
.ahse-post { display: block; }
/* Lange deutsche Komposita dürfen auf schmalen Geräten umbrechen. */
.ahse-post :is(h1, h2, h3, h4, p, li, a, blockquote, figcaption, time),
.ahse-blog-page :is(h1, h2, h3, p, li, a) { overflow-wrap: anywhere; hyphens: auto; }
.ahse-post__hero { padding-block: clamp(32px, 5vw, 72px) clamp(36px, 5vw, 64px); }
.ahse-post__hero-inner { max-width: 62rem; }
.ahse-post__hero h1 { max-width: 22ch; font-size: clamp(2rem, 4vw, 3.6rem); line-height: 1.12; overflow-wrap: anywhere; hyphens: auto; }
.ahse-post__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 22px 0 0; color: color-mix(in oklch, #f5f6f7 72%, transparent); font-family: var(--font-display, inherit); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.ahse-post .ahse-breadcrumbs { margin-bottom: 26px; }
.ahse-post .ahse-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; font-size: .7rem; line-height: 1.6; color: color-mix(in oklch, #f5f6f7 72%, transparent); }
.ahse-post .ahse-breadcrumbs li + li::before { content: "/"; margin-inline-end: 8px; opacity: .55; }
.ahse-post .ahse-breadcrumbs a { display: inline-block; padding-block: 6px; text-decoration: none; }
.ahse-post .ahse-breadcrumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }

.ahse-post__figure-wrap { background: linear-gradient(to bottom, var(--bg, #13264c) 55%, var(--surface, #f5f6f7) 55%); }
.ahse-post__figure { margin: 0 auto; }
.ahse-post__image { display: block; width: 100%; height: auto; max-height: 560px; object-fit: cover; border-radius: 8px; border: 1px solid color-mix(in oklch, #f5f6f7 18%, transparent); }
.ahse-post__caption { margin: 12px 0 0; color: color-mix(in oklch, #13264c 66%, transparent); font-size: .8rem; line-height: 1.6; }

.ahse-post__content { padding-block: clamp(40px, 5vw, 72px) clamp(48px, 6vw, 88px); }
.ahse-post__body { max-width: 74ch; margin-inline: auto; color: color-mix(in oklch, #13264c 78%, transparent); font-size: 1.05rem; line-height: 1.8; }
.ahse-post__body > :first-child { margin-top: 0; }
.ahse-post__body :is(h2, h3, h4) { color: var(--bg, #13264c); font-family: var(--font-display, inherit); line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; }
.ahse-post__body h2 { max-width: 26ch; margin: clamp(44px, 5vw, 68px) 0 0; font-size: clamp(1.5rem, 2.4vw, 2.1rem); }
.ahse-post__body h2::after { content: ""; display: block; width: 56px; height: 2px; margin-top: 18px; background: var(--ahse-blog-accent, #d49e5c); }
.ahse-post__body h3 { margin: clamp(30px, 3vw, 44px) 0 0; font-size: clamp(1.15rem, 1.6vw, 1.4rem); }
.ahse-post__body h4 { margin: 28px 0 0; font-size: 1.05rem; }
.ahse-post__body p { margin: 18px 0 0; }
.ahse-post__body a { color: var(--bg, #13264c); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ahse-blog-accent, #d49e5c); }
.ahse-post__body :is(ul, ol) { margin: 20px 0 0; padding-inline-start: 1.3em; }
.ahse-post__body li { margin-top: 8px; }
.ahse-post__body li::marker { color: var(--ahse-blog-accent, #d49e5c); }
.ahse-post__body img { max-width: 100%; height: auto; border-radius: 8px; margin-top: 24px; }
.ahse-post__body figure { margin: 28px 0 0; }
.ahse-post__body figcaption { margin-top: 10px; font-size: .82rem; color: color-mix(in oklch, #13264c 62%, transparent); }
.ahse-post__body strong { color: var(--bg, #13264c); font-weight: 600; }
.ahse-post__body :is(sub, sup) { line-height: 0; }
.ahse-post__body blockquote { margin: 32px 0 0; padding: 4px 0 4px 24px; border-inline-start: 2px solid var(--ahse-blog-accent, #d49e5c); color: var(--bg, #13264c); font-family: var(--font-display, inherit); font-size: clamp(1.1rem, 1.8vw, 1.35rem); font-weight: 500; line-height: 1.45; }
.ahse-post__body blockquote p { margin-top: 12px; }
.ahse-post__body blockquote > :first-child { margin-top: 0; }
.ahse-post__body section { margin-top: clamp(28px, 3vw, 40px); }
.ahse-post__body header { margin: 0; }
/* Auszeichnungen aus den übernommenen Beiträgen */
.ahse-post__body .einleitung { margin: 0 0 8px; color: var(--bg, #13264c); font-family: var(--font-display, inherit); font-size: clamp(1.14rem, 1.8vw, 1.38rem); font-weight: 500; line-height: 1.5; }
.ahse-post__body :is(.hinweis, .zusammenfassung, .schlussaussage) { margin-top: clamp(32px, 4vw, 48px); padding: clamp(22px, 3vw, 32px); border: 1px solid var(--ahse-blog-line, color-mix(in oklch, #13264c 14%, transparent)); border-radius: 8px; background: color-mix(in oklch, #13264c 3%, transparent); }
.ahse-post__body :is(.hinweis, .zusammenfassung, .schlussaussage) > :first-child { margin-top: 0; }
.ahse-post__body :is(.hinweis, .zusammenfassung, .schlussaussage) :is(h2, h3) { margin-top: 0; font-size: clamp(1.05rem, 1.4vw, 1.25rem); }
.ahse-post__body :is(.hinweis, .zusammenfassung, .schlussaussage) h2::after { display: none; }
.ahse-post__body .hinweis { border-inline-start: 3px solid var(--ahse-blog-accent, #d49e5c); background: color-mix(in oklch, #d49e5c 8%, transparent); }
.ahse-post__body .zusammenfassung { border-top: 3px solid var(--ahse-blog-accent, #d49e5c); }
.ahse-post__body .schlussaussage { border: 0; border-top: 1px solid var(--ahse-blog-line, color-mix(in oklch, #13264c 14%, transparent)); border-radius: 0; padding-inline: 0; background: none; color: var(--bg, #13264c); font-family: var(--font-display, inherit); font-size: clamp(1.1rem, 1.7vw, 1.3rem); font-weight: 500; line-height: 1.45; }
.ahse-post__body .reaktionsgleichung { padding: 14px 18px; border-radius: 4px; background: color-mix(in oklch, #13264c 5%, transparent); font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: .95rem; overflow-x: auto; }

/* FAQ-Block im Beitrag: helle Fläche statt Navy, damit der Lesefluss nicht bricht. */
.ahse-post__body .ahse-kb-faq {
  --ahse-kb-accent: #d49e5c;
  margin: clamp(40px, 5vw, 64px) 0 0;
  padding: clamp(24px, 3vw, 36px) clamp(20px, 3vw, 32px);
  border: 1px solid color-mix(in oklch, #13264c 14%, transparent);
  border-top: 3px solid var(--ahse-kb-accent);
  border-radius: 8px;
  background: color-mix(in oklch, #13264c 3%, transparent);
  color: var(--bg, #13264c);
}
.ahse-post__body .ahse-kb-heading { margin: 0 0 18px; font-family: var(--font-display, inherit); font-size: clamp(1.3rem, 2vw, 1.7rem); font-weight: 600; color: var(--bg, #13264c); }
.ahse-post__body .ahse-kb-heading::after { display: none; }
.ahse-post__body .ahse-kb-list { border-block-start-color: color-mix(in oklch, #13264c 14%, transparent); }
.ahse-post__body .ahse-kb-item { border-block-end-color: color-mix(in oklch, #13264c 14%, transparent); }
.ahse-post__body .ahse-kb-faq summary { color: var(--bg, #13264c); }
.ahse-post__body .ahse-kb-answer { color: color-mix(in oklch, #13264c 76%, transparent); }
.ahse-post__body .ahse-kb-answer p { margin: 14px 0 0; }
.ahse-post__body .ahse-kb-faq summary:focus-visible { outline-color: var(--bg, #13264c); }

.ahse-post__terms { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: 74ch; margin: clamp(40px, 5vw, 60px) auto 0; padding-top: 26px; border-top: 1px solid var(--ahse-blog-line, color-mix(in oklch, #13264c 14%, transparent)); }
.ahse-post__terms-label { color: color-mix(in oklch, #13264c 66%, transparent); font-family: var(--font-display, inherit); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.ahse-post__terms .ahse-blog__chip { --ahse-blog-accent: #d49e5c; --ahse-blog-line: color-mix(in oklch, #13264c 14%, transparent); }
.ahse-post__related { padding-block: clamp(48px, 6vw, 88px); }
.ahse-post__related h2 { max-width: 24ch; margin: 0 0 clamp(28px, 4vw, 44px); font-size: clamp(1.5rem, 2.4vw, 2.1rem); }
.ahse-post__related h2::after { content: ""; display: block; width: 56px; height: 2px; margin-top: 18px; background: var(--accent, #d49e5c); }
.ahse-post__back { margin: clamp(28px, 3vw, 40px) 0 0; }

/* Übersichtsseite (Elementor-Seite und Archiv-Template) */
.ahse-blog-page .page-hero h1 { max-width: 20ch; }
.ahse-blog-page .page-hero .lead { max-width: 62ch; }
.ahse-blog-page .ahse-breadcrumbs { margin-bottom: 26px; }
.ahse-blog-page .ahse-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; font-size: .7rem; line-height: 1.6; color: color-mix(in oklch, #f5f6f7 72%, transparent); }
.ahse-blog-page .ahse-breadcrumbs li + li::before { content: "/"; margin-inline-end: 8px; opacity: .55; }
.ahse-blog-page .ahse-breadcrumbs a { display: inline-block; padding-block: 6px; text-decoration: none; }
.ahse-blog-page .ahse-breadcrumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ahse-blog-page .ahse-breadcrumbs [aria-current] { display: inline-block; padding-block: 6px; }
/* Gleich hohe Karten je Rasterreihe */
.ahse-blog__grid--grid .ahse-blog__card { display: flex; flex-direction: column; }
.ahse-blog__grid--grid .ahse-blog__body { flex: 1 1 auto; }
.ahse-blog__grid--grid .ahse-blog__more { margin-top: auto; padding-top: 14px; }

/* ------------------------------------------------------------ Responsive */
@media (max-width: 1000px) {
  .ahse-blog__grid--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ahse-blog__card--feature { grid-template-columns: minmax(0, 1fr); }
  .ahse-blog__card--feature .ahse-blog__media { min-height: 0; aspect-ratio: 100 / 52; }
}
@media (max-width: 760px) {
  .ahse-blog__grid--grid { grid-template-columns: minmax(0, 1fr); }
  .ahse-blog__card--list { grid-template-columns: minmax(0, 1fr); }
  .ahse-blog__card--list .ahse-blog__media { min-height: 0; aspect-ratio: 100 / 58; }
  .ahse-blog__card--list .ahse-blog__body { padding: 22px 20px 24px; }
  .ahse-blog__body { padding: 22px 20px 24px; }
  .ahse-blog__pagination { flex-direction: column; align-items: flex-start; }
  .ahse-post__body { font-size: 1rem; }
  .ahse-post__figure-wrap { background: linear-gradient(to bottom, var(--bg, #13264c) 40%, var(--surface, #f5f6f7) 40%); }
  .ahse-post__image { max-height: 320px; }
}
@media (max-width: 420px) {
  .ahse-blog__chip { font-size: .75rem; padding: 6px 14px; }
  .ahse-blog__filter { gap: 8px; }
  .ahse-post__back .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .ahse-blog__card, .ahse-blog__image, .ahse-blog__more a span { transition: none; }
  .ahse-blog__card:hover { transform: none; }
  .ahse-blog__card:hover .ahse-blog__image { transform: none; }
}
