/* ============================================
   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: 16px;
}

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

.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;
}

.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 */
.article-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
}

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

.author-avatar {
  width: 40px;
  height: 40px;
  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: 16px;
}

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

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

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

.meta-divider {
  width: 1px;
  height: 32px;
  background: var(--gray-200);
}

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

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

.meta-value {
  font-size: 13px;
  color: var(--gray-700);
  font-weight: 500;
}

/* 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 > div:has(svg) {
  width: 100%;
  height: 100%;
  min-height: 300px;
  border-radius: inherit;
}

.hero-image > div:has(svg) svg {
  width: 100%;
  height: auto;
  max-height: 400px;
}

.hero-image > div > svg {
  width: 100%;
  height: auto;
  max-height: 400px;
  max-width: 100%;
}

/* Ensure two-column grid layout for inline SVG hero images */
.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;
}

