/* Source: blog-detail-core.css */
/* ============================================
   WHK Blog Detail - World-Class Design System
   ============================================ */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('../fonts/playfair-display-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('../fonts/playfair-display-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Brand Colors */
  --whk-navy: #0d1321;
  --whk-navy-light: #1a2332;
  --whk-blue: #2563eb;
  --whk-blue-dark: #1d4ed8;
  --whk-cyan: #06b6d4;
  --whk-accent: #4264D1;

  /* Neutrals */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  /* Spacing */
  --container-max: 1280px;
  --content-max: 840px;
  --sidebar-width: 280px;

  /* Effects */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gray-200);
  transition: all 0.3s ease;
}

.nav.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo img {
  height: 40px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--gray-600);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--whk-blue);
}

.nav-cta {
  background: var(--whk-navy);
  color: white !important;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-cta:hover {
  background: var(--gray-800);
  transform: translateY(-1px);
}

.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gray-700);
  margin: 5px 0;
  transition: 0.3s;
}

/* Mobile Menu Overlay */
.nav-mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-mobile-menu.active {
  opacity: 1;
  visibility: visible;
}

.nav-mobile-menu-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.nav-mobile-menu-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80%;
  max-width: 320px;
  background: white;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.nav-mobile-menu.active .nav-mobile-menu-content {
  transform: translateX(0);
}

.nav-mobile-close {
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 32px;
  line-height: 1;
  color: var(--gray-700);
  cursor: pointer;
  padding: 16px 24px;
  transition: color 0.2s;
}

.nav-mobile-close:hover {
  color: var(--gray-900);
}

.nav-mobile-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.nav-mobile-links li {
  border-bottom: 1px solid var(--gray-200);
}

.nav-mobile-links a {
  display: block;
  padding: 16px 24px;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-mobile-links a:hover {
  background: var(--gray-50);
  color: var(--whk-blue);
}

.nav-mobile-cta {
  background: var(--whk-navy) !important;
  color: white !important;
  margin: 16px 24px;
  border-radius: 8px;
  text-align: center;
}

.nav-mobile-cta:hover {
  background: var(--gray-800) !important;
  color: white !important;
}

/* Mobile ToC inside the slide-in menu */
.nav-mobile-toc {
  margin-top: 8px;
  padding: 8px 0 24px;
  border-top: 1px solid var(--gray-200);
}

.nav-mobile-toc-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 24px 8px;
}

.nav-mobile-menu-content .toc-list {
  border-left: none;
}

.nav-mobile-menu-content .toc-item a {
  padding: 12px 24px;
  margin-left: 0;
  border-left: none;
  font-size: 15px;
}

.nav-mobile-menu-content .toc-item.active>a,
.nav-mobile-menu-content .toc-item.active-parent>a {
  border-left: none;
}

.nav-mobile-menu-content .toc-toggle {
  right: 16px;
}

.nav-mobile-menu-content .toc-sublist {
  padding-left: 0;
}

.nav-mobile-menu-content .toc-sublist a {
  padding: 10px 24px;
}

/* Prevent body scroll when menu is open */
body.menu-open {
  overflow: hidden;
}

/* Source: blog-detail-hero-layout.css */
/* ============================================
   Hero Section
   ============================================ */
.hero {
  padding-top: 72px;
  background: linear-gradient(180deg, white 0%, var(--gray-50) 100%);
}

.hero-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 40px 24px 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-content {
  max-width: 640px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
}

.breadcrumb a {
  color: var(--gray-500);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--whk-blue);
}

.breadcrumb-sep {
  color: var(--gray-300);
}

.breadcrumb-current {
  color: var(--gray-700);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.article-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--whk-blue) 0%, var(--whk-accent) 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 0;
}

.article-category-link {
  display: inline-flex;
  text-decoration: none;
  color: inherit;
}

.hero-content-shell>.article-category-link {
  margin-bottom: 16px;
}

.article-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.article-categories:empty {
  display: none;
}

.article-category-link:hover .article-category {
  opacity: 0.85;
  transform: translateY(-1px);
}

.article-category-link .article-category {
  transition: opacity 0.2s, transform 0.2s;
}

/* Hide empty author title/role elements */
.author-title:empty,
.role:empty {
  display: none;
}

/* Hide category badge when no category is set */
.article-category-link:has(.article-category:empty) {
  display: none;
}

.article-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--gray-900);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  /* Allow breaking within words */
  word-break: break-word;
  /* Legacy support */
  hyphens: auto;
  /* Hyphenate at syllable boundaries (uses lang="de") */
}

.article-excerpt {
  font-size: 18px;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Author & Meta - Refined Layout with Icons */
.article-meta {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
}

.author {
  display: flex;
  align-items: center;
  gap: 14px;
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--whk-blue), var(--whk-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.author-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.author-name {
  font-weight: 700;
  color: var(--gray-900);
  font-size: 15px;
}

.author-title {
  font-size: 13px;
  color: var(--gray-500);
}

.author-info-link {
  text-decoration: none;
  color: inherit;
}

.author-info-link:hover .author-name {
  color: var(--whk-blue);
}

.meta-divider {
  display: none;
  /* Removed in favor of group layout */
}

.meta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gray-600);
}

.meta-icon {
  width: 18px;
  height: 18px;
  color: var(--whk-blue);
  opacity: 0.8;
  flex-shrink: 0;
}

.meta-content {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.meta-label {
  font-size: 10px;
  color: var(--gray-400);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.meta-value {
  font-size: 13px;
  color: var(--gray-800);
  font-weight: 500;
  white-space: nowrap;
}

/* Hero Image */
.hero-image {
  width: 100%;
  max-height: 400px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-image img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
}

/* ============================================
   SVG Hero Image Compatibility
   ============================================ */

/* SVG images: ensure minimum height since SVGs may lack intrinsic dimensions */
.hero-image:has(img[src^="data:image/svg"]),
.hero-image:has(img[src$=".svg"]) {
  min-height: 300px;
}

.hero-image:has(img[src^="data:image/svg"]) img,
.hero-image:has(img[src$=".svg"]) img {
  width: auto;
  max-width: 100%;
}

/* ============================================
   Inline SVG Hero Image (converted from data URI)
   ============================================ */
/* convertSvgDataUriImgsToInline() replaces <img src="data:image/svg+xml...">
   with <div style="display:flex..."><svg>...</svg></div>
   These rules handle that converted structure */

.hero-image>[data-inline-svg="true"],
.hero-image>div:has(svg) {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-image>[data-inline-svg="true"] svg,
.hero-image>div:has(svg) svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  display: block;
}

.hero-image>[data-inline-svg="true"]>svg,
.hero-image>div>svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  display: block;
}

/* Ensure two-column grid layout for inline SVG hero images */
.hero-container:has(.hero-image > [data-inline-svg="true"]),
.hero-container:has(.hero-image > div:has(svg)) {
  grid-template-columns: 1fr 1fr;
}

/* Reading Progress */
.reading-progress {
  position: fixed;
  top: 72px;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--whk-blue), var(--whk-cyan));
  z-index: 99;
  transition: width 0.05s linear;
}

/* ============================================
   Main Content Layout
   ============================================ */
.content-wrapper {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 64px;
  position: relative;
}

/* Left Sidebar - ToC & Newsletter */
.sidebar-left {
  position: relative;
}

.sidebar-sticky {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}

.sidebar-sticky::-webkit-scrollbar {
  width: 4px;
}

.sidebar-sticky::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-sticky::-webkit-scrollbar-thumb {
  background-color: var(--gray-300);
  border-radius: 20px;
}

/* ToC */
.toc-container {
  background: white;
}

.toc-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
  padding-left: 12px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--gray-200);
}

.toc-item {
  position: relative;
}

.toc-item a {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--gray-500);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 2px solid transparent;
  margin-left: -2px;
}

.toc-item a:hover {
  color: var(--gray-800);
}

.toc-item.active>a,
.toc-item.active-parent>a {
  color: var(--whk-blue);
  border-left-color: var(--whk-blue);
  font-weight: 600;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.05), transparent);
}

.toc-toggle {
  position: absolute;
  right: 0;
  top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-400);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.toc-toggle:hover {
  color: var(--whk-blue);
}

.toc-item.expanded>.toc-toggle {
  transform: rotate(180deg);
}

.toc-sublist {
  list-style: none;
  padding: 0;
  margin: 0;
  padding-left: 12px;
  overflow: hidden;
  max-height: 1000px;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.toc-sublist.collapsed {
  max-height: 0;
  opacity: 0;
}

.toc-sublist a {
  font-size: 13px;
  padding: 6px 12px;
}

/* Sidebar Newsletter Widget */
.sidebar-newsletter {
  background: linear-gradient(135deg, var(--whk-navy), #1a2744);
  padding: 24px;
  border-radius: var(--radius-md);
  color: white;
  box-shadow: var(--shadow-md);
}

.sidebar-newsletter h4,
.sidebar-newsletter .sidebar-newsletter-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: white;
}

.sidebar-newsletter p {
  font-size: 13px;
  color: var(--gray-300);
  margin-bottom: 16px;
  line-height: 1.5;
}

.sn-input {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: white;
  font-size: 13px;
  margin-bottom: 10px;
}

.sn-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.sn-btn {
  width: 100%;
  padding: 10px;
  background: var(--whk-blue);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.sn-btn:hover {
  background: var(--whk-blue-dark);
}

/* Newsletter Button States */
.sn-btn.loading {
  opacity: 0.7;
  cursor: wait;
}

.sn-btn.success {
  background: #22c55e;
}

.sn-btn.error {
  background: #ef4444;
}

.sn-btn:disabled {
  pointer-events: none;
}

.sn-input:disabled {
  opacity: 0.6;
}

/* ============================================
   Template-Specific Hero Compaction
   ============================================ */
.blog-detail-template .hero {
  background:
    radial-gradient(circle at 12% 10%, rgba(66, 100, 209, 0.07) 0%, rgba(66, 100, 209, 0) 46%),
    linear-gradient(180deg, #ffffff 0%, var(--gray-50) 70%, #f3f7ff 100%);
}

.blog-detail-template .hero-container {
  padding: 24px 24px 20px;
  gap: 30px;
  align-items: start;
}

.blog-detail-template .hero-content {
  max-width: 680px;
}

.blog-detail-template .hero-content-shell {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  padding: 24px 28px 20px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

.blog-detail-template .breadcrumb {
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-bottom: 12px;
  font-size: 12px;
  line-height: 1.4;
}

.blog-detail-template .breadcrumb-current {
  max-width: none;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  color: var(--gray-800);
  font-weight: 600;
  flex: 1 1 320px;
  min-width: 200px;
}

.blog-detail-template .breadcrumb-category-link {
  color: var(--whk-blue);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-detail-template .breadcrumb-category-link:hover {
  color: var(--whk-blue-dark);
}

.blog-detail-template .breadcrumb-category-link:has(.breadcrumb-category:empty) {
  display: none;
}

.blog-detail-template .breadcrumb:has(.breadcrumb-category-link:has(.breadcrumb-category:empty)) .breadcrumb-sep-category {
  display: none;
}

.blog-detail-template .article-category {
  padding: 3px 10px;
  font-size: 10px;
  letter-spacing: 0.45px;
  margin-bottom: 0;
}

.blog-detail-template .article-title {
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.12;
  margin-bottom: 12px;
}

.blog-detail-template .article-excerpt {
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.55;
  margin-bottom: 18px;
  color: var(--gray-600);
}

/* REFINED METADATA LAYOUT - COMPACT SINGLE ROW */
.blog-detail-template .article-meta {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.blog-detail-template .article-meta .author {
  flex: 0 1 auto;
  /* Allow shrinking */
  width: auto;
  padding: 0;
  margin: 0;
  border: none;
  gap: 14px;
}

/* Vertical divider between author and meta */
.blog-detail-template .meta-divider {
  display: block;
  width: 1px;
  height: 32px;
  background: rgba(0, 0, 0, 0.1);
}

/* New Meta Group Layout */
.blog-detail-template .meta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 32px;
  flex: 1;
  /* Take remaining space */
}

.blog-detail-template .meta-item {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: none;
  background: transparent;
  min-height: auto;
}

.blog-detail-template .meta-icon {
  width: 20px;
  height: 20px;
  color: var(--whk-blue);
  opacity: 0.9;
  padding: 2px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 4px;
}

.blog-detail-template .meta-content {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.blog-detail-template .meta-label {
  margin-bottom: 2px;
  font-size: 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--gray-500);
  font-weight: 600;
  text-transform: uppercase;
}

.blog-detail-template .meta-value {
  font-size: 13px;
  color: var(--gray-800);
  white-space: nowrap;
  font-weight: 600;
}

.blog-detail-template .author-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  /* Fix for flex child truncation/wrapping */
  min-width: 0;
}

.blog-detail-template .author-name {
  font-weight: 700;
  color: var(--gray-900);
  font-size: 15px;
  /* Ensure it wraps */
  white-space: normal;
  overflow-wrap: break-word;
  word-wrap: break-word;
  /* Force wrapping for long names to keep header compact */
  max-width: 160px;
}

.blog-detail-template .author-title {
  font-size: 13px;
  color: var(--gray-500);
}

.blog-detail-template .author-info-link {
  text-decoration: none;
  color: inherit;
}

.blog-detail-template .author-info-link:hover .author-name {
  color: var(--whk-blue);
}

.blog-detail-template .hero-meta-below {
  display: none;
  width: 100%;
  min-width: 0;
}

.blog-detail-template .hero-meta-below:empty {
  display: none;
}

.blog-detail-template .hero-container.hero-compact .hero-content-shell {
  padding: 20px 24px 18px;
}

.blog-detail-template .hero-container.hero-compact .hero-content-shell>.article-category-link,
.blog-detail-template .hero-container.hero-compact .article-categories {
  margin-bottom: 12px;
}

.blog-detail-template .hero-container.hero-compact .breadcrumb {
  margin-bottom: 10px;
}

.blog-detail-template .hero-container.hero-compact .article-title {
  font-size: clamp(28px, 3.1vw, 40px);
  line-height: 1.08;
  margin-bottom: 10px;
}

.blog-detail-template .hero-container.hero-compact .article-excerpt {
  font-size: clamp(15px, 1.45vw, 18px);
  margin-bottom: 14px;
  line-height: 1.44;
}

.blog-detail-template .hero-container.hero-compact .article-meta {
  gap: 24px;
  padding-top: 18px;
}

.blog-detail-template .hero-container.hero-compact .article-meta .author {
  gap: 12px;
}

.blog-detail-template .hero-container.hero-compact .meta-group {
  gap: 18px 24px;
}

.blog-detail-template .hero-container.meta-below-hero .article-meta {
  gap: 14px;
}

.blog-detail-template .hero-container.meta-below-hero .meta-divider {
  display: none;
}

.blog-detail-template .hero-container.meta-below-hero .article-meta .author {
  flex: 1 1 auto;
}

.blog-detail-template .hero-container.meta-below-hero .hero-meta-below {
  display: block;
}

.blog-detail-template .hero-container.meta-below-hero .hero-meta-below .meta-group {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  padding: 14px 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.blog-detail-template .hero-container.meta-below-hero .hero-meta-below .meta-item {
  min-width: 0;
}

/* Responsive adjustments for meta layout */
@media (max-width: 768px) {
  .blog-detail-template .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .blog-detail-template .article-meta .author {
    width: 100%;
  }

  .blog-detail-template .meta-divider {
    display: none;
  }

  .blog-detail-template .meta-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
  }

  .blog-detail-template .meta-item {
    gap: 8px;
  }

  .blog-detail-template .meta-icon {
    width: 18px;
    height: 18px;
    padding: 1px;
  }

  .blog-detail-template .meta-label {
    font-size: 9px;
  }

  .blog-detail-template .meta-value {
    font-size: 12px;
  }
}

.blog-detail-template .hero-media-column {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: start;
  min-width: 0;
  gap: 14px;
}

.blog-detail-template .hero-image {
  --hero-media-aspect-ratio: 1.9047619048;
  --hero-media-max-height: 420px;
  width: min(100%, calc(var(--hero-media-max-height) * var(--hero-media-aspect-ratio)));
  max-width: 100%;
  aspect-ratio: var(--hero-media-aspect-ratio);
  max-height: var(--hero-media-max-height);
  min-height: 0;
  height: auto;
  margin-inline: auto;
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.04);
  background: rgba(255, 255, 255, 0.5);
}

.blog-detail-template .hero-image img,
.blog-detail-template .hero-image>[data-inline-svg="true"],
.blog-detail-template .hero-image>div:has(svg) {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.blog-detail-template .hero-image>[data-inline-svg="true"],
.blog-detail-template .hero-image>div:has(svg) {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: inherit;
}

.blog-detail-template .hero-image img,
.blog-detail-template .hero-image>[data-inline-svg="true"] svg,
.blog-detail-template .hero-image>[data-inline-svg="true"]>svg,
.blog-detail-template .hero-image>div>svg,
.blog-detail-template .hero-image>div:has(svg) svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.blog-detail-template .hero-download-inline,
.blog-detail-template .hero-download-fallback,
.blog-detail-template .hero-side-stack {
  width: 100%;
}

.blog-detail-template .hero-side-stack {
  display: none;
  min-width: 0;
}

.blog-detail-template .hero-download-inline:empty,
.blog-detail-template .hero-download-fallback:empty,
.blog-detail-template .hero-side-stack:empty {
  display: none;
}

.blog-detail-template .hero-download-inline>*,
.blog-detail-template .hero-download-fallback>* {
  width: 100%;
  max-width: 100%;
}

/* Card can be moved into the shell for single-column/no-viewer posts */
.blog-detail-template .hero-content-shell>.hero-download-fallback {
  display: none;
}

.blog-detail-template .hero-content-shell>.hero-download-fallback.in-shell {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.blog-detail-template .hero-content-shell>.hero-download-fallback.in-shell>* {
  width: 100%;
  max-width: 100% !important;
  margin: 0 !important;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border: 1px solid rgba(148, 163, 184, 0.15) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
}

/* --- Download fallback placement ---
 * Keep viewer + download card in one stack so the card sits directly under
 * the viewer (no row-gap caused by the left content column height).
 */
.blog-detail-template .hero-download-fallback {
  display: none;
}

/* (A) No featured image + viewer: stack viewer and card in the right column */
.blog-detail-template .hero-container.viewer-replaces-image .hero-media-column {
  display: none;
}

.blog-detail-template .hero-container.viewer-replaces-image .hero-side-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  grid-column: 2;
  align-self: start;
}

.blog-detail-template .hero-container.viewer-replaces-image .hero-download-inline {
  display: none;
}

.blog-detail-template .hero-container.viewer-replaces-image .hero-download-fallback {
  display: block;
}

.blog-detail-template .hero-container.viewer-replaces-image .hero-download-fallback>* {
  max-width: 100%;
  margin: 0 !important;
}

/* (B) No featured image + no viewer: center card under hero shell */
.blog-detail-template .hero-container.single-column .hero-media-column {
  display: none;
}

.blog-detail-template .hero-container.single-column {
  row-gap: 12px;
}

.blog-detail-template .hero-container.single-column.download-in-shell {
  row-gap: 0;
}

.blog-detail-template .hero-container.single-column .hero-download-inline {
  display: none;
}

.blog-detail-template .hero-container.single-column .hero-side-stack {
  display: flex;
  justify-content: center;
  grid-column: 1;
}

.blog-detail-template .hero-container.single-column.download-in-shell .hero-side-stack {
  display: none;
}

.blog-detail-template .hero-container.single-column .hero-download-fallback {
  display: block;
  width: min(100%, 680px);
}

.blog-detail-template .hero-container.single-column .hero-download-fallback>* {
  margin: 0 !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  border-radius: 14px !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05) !important;
  padding: 0.75rem 1rem !important;
}

/* (C) Featured image + viewer: viewer remains as a full-width row below hero */
.blog-detail-template .hero-container.viewer-below-image .hero-side-stack {
  display: block;
  grid-column: 1 / -1;
}

.blog-detail-template .hero-container.viewer-below-image .hero-viewer {
  width: 100%;
  max-height: 450px;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

.blog-detail-template .hero-container.viewer-below-image .hero-download-fallback {
  display: none;
}

.blog-detail-template .hero-viewer {
  border-radius: 18px;
}

/* ============================================
   Hero Prominent Download Card
   ============================================ */
.blog-detail-template .hero-download-prominent .attachment-download-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f0f7ff 100%) !important;
  border: 1px solid rgba(59, 130, 246, 0.18) !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06) !important;
}

@media (max-width: 1024px) {
  .blog-detail-template .hero-container {
    padding: 20px 20px 18px;
    gap: 22px;
  }

  .blog-detail-template .hero-content-shell {
    padding: 16px 16px 14px;
  }

  .blog-detail-template .article-meta .author {
    flex: 1 1 100%;
    min-width: 0;
  }

  .blog-detail-template .hero-image {
    --hero-media-max-height: 360px;
  }

}

@media (max-width: 768px) {
  .blog-detail-template .hero-container {
    padding: 20px 16px 16px;
    gap: 16px;
    grid-template-columns: 1fr;
  }

  /* Hide Hero Image on Mobile ONLY when a viewer is also present */
  .blog-detail-template .hero-container.viewer-below-image .hero-image {
    display: none !important;
  }

  .blog-detail-template .breadcrumb-current {
    flex-basis: 100%;
    min-width: 0;
  }

  .blog-detail-template .article-title {
    font-size: clamp(28px, 7vw, 34px);
  }

  .blog-detail-template .article-excerpt {
    margin-bottom: 14px;
  }

  .blog-detail-template .meta-item {
    padding: 0;
  }

  .blog-detail-template .hero-media-column {
    gap: 0;
    margin-bottom: 8px;
  }

  .blog-detail-template .hero-meta-below .meta-group {
    grid-template-columns: 1fr;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  /* Make download button more prominent on mobile */
  .blog-detail-template .hero-download-inline {
    display: block !important;
    margin-top: 0;
    position: relative;
    z-index: 2;
  }

  /* Apply same styling to fallback (visible in viewer-replaces-image mode) */
  .blog-detail-template .hero-download-fallback {
    margin-top: 0;
    position: relative;
    z-index: 2;
  }

  /* Ensure download card takes full width and stands out */
  .blog-detail-template .hero-download-inline>*,
  .blog-detail-template .hero-download-fallback>* {
    width: 100%;
    max-width: 100% !important;
    margin: 0 !important;
    /* Override inline margin */
    box-sizing: border-box !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    background: linear-gradient(to bottom, #ffffff, #f8fbff) !important;
  }

  /* Viewer Container - Reset Grid Positioning */
  .blog-detail-template .hero-container.viewer-below-image .hero-side-stack,
  .blog-detail-template .hero-container.viewer-replaces-image .hero-side-stack {
    grid-column: 1;
    display: flex;
    flex-direction: column;
  }

  /* Reorder fallback download to top of stack on mobile */
  .blog-detail-template .hero-side-stack .hero-download-fallback {
    order: -1;
    margin-bottom: 16px;
    /* Spacing between download and viewer */
  }

  /* Viewer Label (Outside the scrollable area) */
  .blog-detail-template .hero-side-stack::before {
    content: 'Vorschau';
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 8px;
    margin-left: 4px;
    letter-spacing: 0.05em;
  }

  /* Viewer Styling - Clean Scrollable Area */
  .blog-detail-template .hero-viewer {
    position: relative;
    max-height: 350px;
    /* More space since image is gone */
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gray-200);
    background: #fff;
    margin-top: 0;
    border-radius: 8px;
    padding-top: 0;
    /* Remove padding */
  }

  /* Remove previous pseudo-elements to fix double scrollbars/clutter */
  .blog-detail-template .hero-viewer::before,
  .blog-detail-template .hero-viewer::after {
    display: none !important;
  }

  .blog-detail-template .hero-container.viewer-replaces-image .hero-download-fallback>*,
  .blog-detail-template .hero-container.single-column .hero-download-fallback>* {
    max-width: 100% !important;
  }

  /* Mobile optimizations for download card internals to prevent overflow */
  .blog-detail-template .hero-download-inline .attachment-download-card,
  .blog-detail-template .hero-download-fallback .attachment-download-card {
    padding: 12px !important;
    gap: 10px !important;
  }

  .blog-detail-template .hero-download-inline .attachment-download-card>a,
  .blog-detail-template .hero-download-fallback .attachment-download-card>a {
    padding: 6px 12px !important;
    font-size: 13px !important;
  }
}

/* ============================================
   WHK Hero Stacked Layout
   ============================================ */
.blog-detail-template .hero-container {
  width: min(860px, calc(100% - 48px));
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
}

.blog-detail-template .hero-content-shell {
  max-width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.94));
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  padding: 28px clamp(20px, 3vw, 28px) 26px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.blog-detail-template .hero-content-shell::before {
  content: '';
  position: absolute;
  top: -62px;
  right: -44px;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.05), rgba(14, 165, 233, 0));
  pointer-events: none;
}

.blog-detail-template .hero-copy,
.blog-detail-template .hero-download,
.blog-detail-template .hero-media {
  position: relative;
  z-index: 1;
}

.blog-detail-template .hero-copy {
  max-width: none;
  width: 100%;
}

.blog-detail-template .hero-content,
.blog-detail-template .hero-media-column,
.blog-detail-template .hero-side-stack,
.blog-detail-template .hero-meta-below,
.blog-detail-template .meta-divider {
  display: none !important;
}

.blog-detail-template .breadcrumb {
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 12.5px;
  line-height: 1.5;
}

.blog-detail-template .breadcrumb-current {
  color: var(--gray-700);
  font-weight: 500;
  flex: 0 1 auto;
  min-width: 0;
}

.blog-detail-template .article-categories {
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.blog-detail-template .article-category {
  padding: 3px 11px;
  font-size: 10.5px;
  letter-spacing: 0.45px;
}

.blog-detail-template .article-title {
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.14;
  margin-bottom: 14px;
  max-width: 760px;
  margin-inline: auto;
}

.blog-detail-template .article-excerpt {
  font-size: clamp(15px, 1.5vw, 18px);
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 18px;
  max-width: 720px;
  margin-inline: auto;
}

.blog-detail-template .article-excerpt:empty,
.blog-detail-template .hero-download:empty,
.blog-detail-template .hero-media:empty,
.blog-detail-template .hero-viewer:empty {
  display: none;
}

.blog-detail-template .article-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.blog-detail-template .article-meta .author {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  margin: 0;
  padding: 0;
  border: none;
  min-width: 0;
  justify-content: center;
  flex: 0 1 auto;
  max-width: 360px;
}

.blog-detail-template .author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: none;
  font-size: 14px;
  flex-shrink: 0;
}

.blog-detail-template .article-meta .author-avatar.has-logo {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  height: 38px;
  border-radius: 10px;
  padding: 5px 6px;
  background: linear-gradient(135deg, #ffffff, #f4f8ff);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.blog-detail-template .article-meta .hero-author-img.logo-style {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.blog-detail-template .author-info {
  min-width: 0;
  max-width: 230px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  text-align: left;
}

.blog-detail-template .author-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  max-width: 230px;
  white-space: normal;
  line-height: 1.15;
}

.blog-detail-template .author-title {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.2;
}

.blog-detail-template .meta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  min-width: 0;
}

.blog-detail-template .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  color: var(--gray-600);
  white-space: nowrap;
  min-height: 0;
}

.blog-detail-template .meta-icon {
  display: block;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--whk-blue);
  opacity: 0.85;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.blog-detail-template .meta-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
  min-width: 0;
}

.blog-detail-template .meta-label {
  display: inline-flex;
  margin-bottom: 1px;
  font-size: 9px;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.blog-detail-template .meta-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-800);
}

.blog-detail-template .meta-value time {
  font: inherit;
  color: inherit;
}

.blog-detail-template .hero-download {
  width: 100%;
  margin-top: 16px;
}

.blog-detail-template .hero-download .attachment-download-card--hero {
  position: relative;
  display: grid !important;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  width: 100%;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 18px !important;
  gap: 14px !important;
  align-items: center !important;
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(239, 246, 255, 0.96)) !important;
  border: 1px solid rgba(59, 130, 246, 0.18) !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07) !important;
  overflow: hidden;
}

.blog-detail-template .hero-download .attachment-download-card--hero::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #2563eb, #0ea5e9);
}

.blog-detail-template .hero-download .attachment-download-card--hero.attachment-download-card--has-thumb {
  align-items: stretch;
  grid-template-columns: 120px minmax(0, 1fr);
  padding: 0 !important;
  gap: 0 !important;
  overflow: hidden;
}

.blog-detail-template .hero-download .attachment-download-card__thumb {
  width: 120px;
  min-height: 120px;
  flex-shrink: 0;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.blog-detail-template .hero-download .attachment-download-card__thumb img,
.blog-detail-template .hero-download .attachment-download-card__thumb svg,
.blog-detail-template .hero-download .attachment-download-card__thumb [data-inline-svg='true'] {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.blog-detail-template .hero-download .attachment-download-card__thumb [data-inline-svg='true'],
.blog-detail-template .hero-download .attachment-download-card__thumb > div:has(svg) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.blog-detail-template .hero-download .attachment-download-card__body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  flex: 1;
  min-width: 0;
}

.blog-detail-template .hero-download .attachment-download-card__icon {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.blog-detail-template .hero-download .attachment-download-card__info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.blog-detail-template .hero-download .attachment-download-card__filename {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  line-height: 1.2 !important;
}

.blog-detail-template .hero-download .attachment-download-card__filemeta {
  margin-top: 4px !important;
  font-size: 13px !important;
  color: #475569 !important;
}

.blog-detail-template .hero-download .attachment-download-card__cta,
.blog-detail-template .hero-download .attachment-download-card--hero a[download] {
  align-items: center;
  justify-content: center;
  padding: 10px 16px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #0ea5e9, #2563eb) !important;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.16);
}

.blog-detail-template .hero-media {
  width: 100%;
  margin-top: 10px;
}

.blog-detail-template .hero-image,
.blog-detail-template .hero-viewer {
  margin-top: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  background: white;
}

.blog-detail-template .hero-image {
  --hero-media-aspect-ratio: 1.9047619048;
  width: 100%;
  max-width: 100%;
  aspect-ratio: var(--hero-media-aspect-ratio);
  max-height: min(54vh, 460px);
}

.blog-detail-template .hero-image img,
.blog-detail-template .hero-image > [data-inline-svg='true'],
.blog-detail-template .hero-image > div:has(svg) {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.blog-detail-template .hero-image img,
.blog-detail-template .hero-image > [data-inline-svg='true'] svg,
.blog-detail-template .hero-image > [data-inline-svg='true'] > svg,
.blog-detail-template .hero-image > div > svg,
.blog-detail-template .hero-image > div:has(svg) svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--gray-50);
}

.blog-detail-template .hero-viewer {
  position: relative;
}

.blog-detail-template .attachment-viewer--hero {
  width: 100%;
}

.blog-detail-template .attachment-viewer--hero .attachment-viewer__preview {
  position: relative;
  height: 360px;
  min-height: 360px;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fafc, #eef5ff);
}

.blog-detail-template .attachment-viewer--hero .attachment-viewer__preview img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.blog-detail-template .attachment-viewer--hero .attachment-viewer__preview::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 120px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.14), rgba(15, 23, 42, 0));
  pointer-events: none;
}

.blog-detail-template .attachment-viewer--hero .attachment-viewer__preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--gray-600);
  text-align: center;
}

.blog-detail-template .attachment-viewer--hero .attachment-viewer__preview-placeholder strong {
  color: var(--gray-800);
  font-size: 16px;
}

.blog-detail-template .attachment-viewer--hero .attachment-viewer__load-trigger {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 240px;
  padding: 11px 18px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--whk-blue);
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
}

.blog-detail-template .attachment-viewer--hero .attachment-viewer__interactive {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.blog-detail-template .attachment-viewer--hero[data-viewer-mode='preview'] .attachment-viewer__interactive,
.blog-detail-template .attachment-viewer--hero[data-viewer-mode='idle'] .attachment-viewer__interactive {
  display: none;
}

.blog-detail-template .attachment-viewer--hero[data-viewer-mode='loading'] .attachment-viewer__preview,
.blog-detail-template .attachment-viewer--hero[data-viewer-mode='office'] .attachment-viewer__preview,
.blog-detail-template .attachment-viewer--hero[data-viewer-mode='fallback'] .attachment-viewer__preview {
  display: none;
}

.blog-detail-template .attachment-viewer--hero[data-viewer-mode='loading'] .attachment-viewer__interactive::before {
  content: 'Browser-Vorschau wird geladen...';
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(241, 245, 249, 0.92));
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.blog-detail-template .attachment-viewer--hero[data-viewer-mode='fallback'] .attachment-viewer__interactive::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.96));
  pointer-events: none;
}

.blog-detail-template .attachment-viewer--hero .sheetjs-fallback,
.blog-detail-template .attachment-viewer--hero .oo-iframe-wrap {
  width: 100%;
  min-height: 360px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.blog-detail-template .attachment-viewer--hero .sheet-panel {
  min-height: 0;
}

@media (max-width: 768px) {
  .blog-detail-template .hero-container {
    width: calc(100% - 20px);
    padding: 16px 0 12px;
  }

  .blog-detail-template .hero-content-shell {
    padding: 18px 16px 16px;
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  }

  .blog-detail-template .breadcrumb {
    margin-bottom: 10px;
    font-size: 11px;
  }

  .blog-detail-template .article-categories {
    gap: 6px;
    margin-bottom: 12px;
  }

  .blog-detail-template .article-title {
    font-size: 24px;
    line-height: 1.16;
    margin-bottom: 10px;
    max-width: none;
  }

  .blog-detail-template .article-excerpt {
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: 14px;
  }

  .blog-detail-template .article-meta {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 11.5px;
    padding-top: 12px;
  }

  .blog-detail-template .author-avatar {
    width: 38px;
    height: 38px;
    font-size: 12px;
  }

  .blog-detail-template .article-meta .author-avatar.has-logo {
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    height: 32px;
    padding: 4px 5px;
    border-radius: 8px;
  }

  .blog-detail-template .author-info {
    max-width: 200px;
  }

  .blog-detail-template .author-name {
    font-size: 14px;
    white-space: normal;
    text-align: left;
    max-width: 200px;
    line-height: 1.18;
  }

  .blog-detail-template .author-title {
    font-size: 12px;
  }

  .blog-detail-template .meta-value {
    font-size: 11px;
  }

  .blog-detail-template .meta-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    width: 100%;
  }

  .blog-detail-template .meta-item {
    align-items: flex-start;
    gap: 6px;
    padding: 7px 8px;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.16);
    white-space: normal;
    min-width: 0;
  }

  .blog-detail-template .meta-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
  }

  .blog-detail-template .meta-icon {
    width: 12px;
    height: 12px;
    padding: 0;
    border-radius: 0;
  }

  .blog-detail-template .meta-label {
    font-size: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .blog-detail-template .hero-download,
  .blog-detail-template .hero-media {
    width: 100%;
  }

  .blog-detail-template .hero-download {
    margin-top: 18px;
  }

  .blog-detail-template .hero-download .attachment-download-card--hero {
    box-sizing: border-box !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12) !important;
  }

  .blog-detail-template .hero-download .attachment-download-card--hero:not(.attachment-download-card--has-thumb) {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    align-items: start !important;
    padding: 14px !important;
    gap: 12px !important;
  }

  .blog-detail-template .hero-download .attachment-download-card--hero.attachment-download-card--has-thumb {
    flex-direction: column;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .blog-detail-template .hero-download .attachment-download-card__thumb {
    width: 100%;
    min-height: 172px;
    height: 172px;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  .blog-detail-template .hero-download .attachment-download-card__body {
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    padding: 14px;
    gap: 12px;
  }

  .blog-detail-template .hero-download .attachment-download-card--hero:not(.attachment-download-card--has-thumb) .attachment-download-card__icon {
    grid-column: 1;
    grid-row: 1;
  }

  .blog-detail-template .hero-download .attachment-download-card--hero:not(.attachment-download-card--has-thumb) .attachment-download-card__info {
    grid-column: 2;
    align-self: center;
  }

  .blog-detail-template .hero-download .attachment-download-card--hero:not(.attachment-download-card--has-thumb) a[download] {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 0;
  }

  .blog-detail-template .hero-download .attachment-download-card__icon {
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
  }

  .blog-detail-template .hero-download .attachment-download-card__filename {
    font-size: 16px !important;
  }

  .blog-detail-template .hero-download .attachment-download-card__filemeta {
    font-size: 13px !important;
  }

  .blog-detail-template .hero-download .attachment-download-card--hero a[download] {
    width: 100%;
    margin-top: 4px;
  }

  .blog-detail-template .hero-media {
    margin-top: 12px;
  }

  .blog-detail-template .hero-image {
    max-height: 260px;
    border-radius: 16px;
  }

  .blog-detail-template .attachment-viewer--hero .attachment-viewer__preview {
    height: 220px;
    min-height: 220px;
  }

  .blog-detail-template .attachment-viewer--hero .sheetjs-fallback,
  .blog-detail-template .attachment-viewer--hero .oo-iframe-wrap {
    min-height: 220px;
  }

  .blog-detail-template .attachment-viewer--hero .attachment-viewer__interactive {
    min-height: 220px;
  }

  .blog-detail-template .attachment-viewer--hero .attachment-viewer__load-trigger {
    min-width: calc(100% - 24px);
    bottom: 12px;
    padding: 10px 14px;
    font-size: 12px;
  }
}

/* Source: blog-detail-article.css */
/* Main Article Content */
.article-content {
  min-width: 0;
  max-width: var(--content-max);
}

.prose {
  font-size: 19px;
  line-height: 1.75;
  color: var(--gray-700);
}

.prose h2 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  color: var(--gray-900);
  margin: 56px 0 24px;
  line-height: 1.3;
  scroll-margin-top: 100px;
}

.prose h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-800);
  margin: 40px 0 16px;
  line-height: 1.4;
  scroll-margin-top: 100px;
}

.prose p {
  margin-bottom: 24px;
}

.prose strong {
  color: var(--gray-900);
  font-weight: 600;
}

.prose a {
  color: var(--whk-blue);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(37, 99, 235, 0.3);
  transition: all 0.2s;
}

.prose a:hover {
  text-decoration-color: var(--whk-blue);
  color: var(--whk-blue-dark);
}

.prose ul,
.prose ol {
  margin: 24px 0;
  padding-left: 24px;
}

.prose li {
  margin-bottom: 12px;
}

.prose li::marker {
  color: var(--whk-blue);
}

.prose blockquote {
  margin: 32px 0;
  padding: 24px 32px;
  background: white;
  border-left: 4px solid var(--whk-blue);
  box-shadow: var(--shadow-sm);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  font-size: 20px;
  color: var(--gray-800);
}

.prose img {
  width: 100%;
  border-radius: var(--radius-md);
  margin: 32px 0;
  box-shadow: var(--shadow-md);
}

/* Table wrapper for horizontal scroll on overflow */
.prose .table-wrapper {
  width: 100%;
  margin: 32px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}

.prose .table-wrapper table {
  margin: 0;
  border: none;
  border-radius: 0;
}

.prose table {
  width: 100%;
  min-width: 100%;
  margin: 32px 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  font-size: 16px;
  table-layout: auto;
}

.prose th,
.prose td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.prose th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
}

.prose td {
  min-width: 120px;
}

.prose tr:last-child td {
  border-bottom: none;
}

/* Responsive table handling */
@media (max-width: 768px) {
  .prose table {
    font-size: 14px;
  }

  .prose th,
  .prose td {
    padding: 12px 10px;
  }

  .prose td {
    min-width: 100px;
  }
}

/* Callout */
.callout {
  margin: 32px 0;
  padding: 24px;
  background: linear-gradient(135deg, #eff6ff, #f0f9ff);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  display: flex;
  gap: 16px;
}

.callout-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--whk-blue);
}

.callout-content strong {
  display: block;
  margin-bottom: 6px;
  color: var(--whk-blue-dark);
}

/* Article Footer */
.article-footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--gray-200);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.tag {
  padding: 6px 14px;
  background: white;
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.tag:hover {
  background: var(--whk-blue);
  border-color: var(--whk-blue);
  color: white;
}

/* Share Buttons (Bottom) */
.share-section-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding: 24px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
}

.share-label {
  font-weight: 600;
  color: var(--gray-700);
}

.share-icons {
  display: flex;
  gap: 12px;
}

.share-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  text-decoration: none;
  transition: all 0.2s;
}

.share-btn:hover {
  background: var(--whk-blue);
  border-color: var(--whk-blue);
  color: white;
  transform: translateY(-2px);
}

/* Author Box */
.author-box {
  padding: 32px;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  display: flex;
  gap: 24px;
}

.author-box-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--whk-blue), var(--whk-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 28px;
  flex-shrink: 0;
}

.author-box-content h4,
.author-box-content .author-box-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.author-box-content .role {
  font-size: 14px;
  color: var(--whk-blue);
  margin-bottom: 12px;
}

/* Author Link Styles */
.author-info-link,
.author-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.author-info-link:hover .author-name,
.author-link:hover .author-box-name {
  color: var(--whk-blue);
}

.author-info-link:hover .author-title,
.author-link:hover .role {
  text-decoration: underline;
}

/* Source: blog-detail-enhancements.css */
/* ============================================
   New Styles for Enhanced Features
   ============================================ */

/* Copy Link Button */
.copy-link-btn {
  position: relative;
  background: none;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  padding: 0.75rem;
  border-radius: 8px;
  color: #64748b;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-link-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.copy-link-btn.copied {
  background: #ecfdf5;
  border-color: #10b981;
  color: #10b981;
}

.copy-tooltip {
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Author Box with Dynamic Image */
.author-box-avatar {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.author-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.author-avatar-img.logo-style {
  object-fit: contain;
  padding: 8px;
  background: #fff;
}

/* Wider container for logo avatars */
.author-box-avatar.has-logo {
  width: auto;
  min-width: 64px;
  max-width: 140px;
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
}

.author-box-avatar.has-logo .author-avatar-img {
  width: auto;
  height: 40px;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.author-initials {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Hero Author Avatar (smaller) */
.article-meta .author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-author-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.hero-author-img.logo-style {
  object-fit: contain;
  padding: 6px;
  background: #fff;
}

/* Wider container for logo avatars in hero */
.article-meta .author-avatar.has-logo {
  width: auto;
  min-width: 44px;
  max-width: 110px;
  padding: 8px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
}

.article-meta .author-avatar.has-logo .hero-author-img {
  width: auto;
  height: 28px;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.hero-author-initials {
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* ============================================
   Hide Empty Featured Image Containers
   ============================================ */

/* Hide related card image container when img has no valid src */
.related-card-image:has(img[src=""]),
.related-card-image:has(img[src="undefined"]),
.related-card-image:has(img[src="null"]),
.related-card-image:has(img[src^="data:image/gif"]),
.related-card-image:has(img:not([src])) {
  display: none;
}

/* Hide article hero image container when empty */
.hero-image:has(img[src=""]),
.hero-image:has(img[src^="data:image/gif"]),
.hero-image:has(img:not([src])) {
  display: none;
}

/* When hero-image is hidden, make the grid single column so content takes full width */
.hero-container:has(.hero-image:empty),
.hero-container:has(.hero-image[style*="display: none"]),
.hero-container:has(.hero-image:has(img[src=""])),
.hero-container:has(.hero-image:has(img:not([src]))),
.hero-container:has(.hero-image.no-image) {
  grid-template-columns: 1fr;
}

/* Also handle case where hero-image was completely removed from DOM */
.hero-container:not(:has(.hero-image)) {
  grid-template-columns: 1fr;
}

/* SVG data URIs should maintain two-column layout (override single-column rules above) */
.hero-container:has(.hero-image:has(img[src^="data:image/svg"])),
.hero-container:has(.hero-image:has(img[src$=".svg"])) {
  grid-template-columns: 1fr 1fr;
}

/* When container is single column, allow hero-content to take full width */
.hero-container:not(:has(.hero-image)) .hero-content,
.hero-container:has(.hero-image.no-image) .hero-content {
  max-width: 100%;
}

/* Fallback for browsers without :has() support - hide via JS class */
.related-card-image.no-image,
.related-card.no-image .related-card-image,
.hero-image.no-image {
  display: none;
}

/* JS fallback: when hero-image has no-image class, make container single column */
.hero-container.single-column {
  grid-template-columns: 1fr;
}

/* JS fallback: allow hero-content full width in single column mode */
.hero-container.single-column .hero-content {
  max-width: 100%;
}

/* Static server-selected viewer variant still uses a two-column hero without a hero-image node. */
.hero-container.viewer-replaces-image,
.hero-container[data-hero-variant="viewer"] {
  grid-template-columns: 1fr 1fr;
}

.hero-container.viewer-replaces-image .hero-content,
.hero-container[data-hero-variant="viewer"] .hero-content {
  max-width: 640px;
}

/* ============================================
   Hero Viewer (Spreadsheet in Hero Grid)
   ============================================ */

/* Collapse hero-viewer when empty (no xlsx attachments) */
.hero-viewer:empty {
  display: none;
}

/* Keep only generic viewer styling in this file.
   Template-specific placement/state logic lives in blog-detail-hero-layout.css. */
.hero-viewer {
  width: 100%;
  max-height: 450px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

/* --- Responsive: tablet and below --- */
@media (max-width: 1024px) {
  .hero-viewer {
    max-height: 400px;
  }
}

@media (max-width: 768px) {
  .hero-viewer {
    max-height: 350px;
  }
}

/* ============================================
   Responsive Overflow Clamps
   ============================================ */

/* audit:overflow-clamp */
/* Display math (block equations) - centered and full width */
mjx-container[display="true"],
.MathJax_Display {
  max-width: 100%;
  overflow-x: auto;
  display: block;
  text-align: left;
  width: 100%;
}

/* Inline math - stays inline with text (important for lists!) */
mjx-container:not([display="true"]) {
  display: inline;
  max-width: 100%;
  overflow-x: auto;
}

pre,
code {
  overflow-x: auto;
}

img,
svg,
video,
iframe {
  max-width: 100%;
  height: auto;
}

/* ============================================
   Related Card - No Image Handling
   ============================================ */

/* Related card without image - add padding to content for visual balance */
.related-card:has(.related-card-image[style*="display: none"]) .related-card-content,
.related-card:has(.related-card-image.no-image) .related-card-content,
.related-card:has(.related-card-image:empty) .related-card-content {
  padding: 32px 20px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* JS fallback for browsers without :has() support */
.related-card.no-image .related-card-content {
  padding: 32px 20px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Source: responsive-fixes.css */
/* === RESPONSIVE CLAMP FIX (auto-generated) === */
/* Long words in headings/text */
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}
/* === END RESPONSIVE CLAMP FIX === */
