/* ============================================
   WHK Blog Detail - World-Class Design System
   ============================================ */

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

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

.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%;
  height: 100%;
  max-height: 400px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--gray-100);
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 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 {
  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;
}

/* 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);
}

.prose table {
  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;
}

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

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

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

/* 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 {
  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;
}

/* ============================================
   Related Posts & Footer
   ============================================ */
.related-section {
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 80px 24px;
}

.related-container {
  max-width: var(--container-max);
  margin: 0 auto;
}

.related-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-100);
}

.related-titles {
  max-width: 50%;
}

.related-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--whk-blue);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: block;
}

.related-title {
  font-family: var(--font-serif);
  font-size: 36px;
  color: var(--gray-900);
  line-height: 1.2;
}

.inline-search-form {
  position: relative;
  width: 300px;
}

.inline-search-input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  font-size: 14px;
  background: var(--gray-50);
  transition: all 0.2s;
}

.inline-search-input:focus {
  outline: none;
  background: white;
  border-color: var(--whk-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.inline-search-btn {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--whk-navy);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.inline-search-btn:hover {
  transform: scale(1.05);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.related-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: all 0.3s;
  border: 1px solid var(--gray-100);
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--whk-blue);
}

.related-card-image {
  height: 200px;
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.related-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.related-card:hover .related-card-image img {
  transform: scale(1.05);
}

/* Related Card Fallback - Professional Design */
.related-card-placeholder {
  position: absolute;
  inset: 0;
  display: none; /* Hidden by default, shown by JS */
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
  color: #64748b;
}

.related-card-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
  stroke: #94a3b8;
}

.related-card-placeholder::after {
  content: 'Artikel';
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
}

.related-card-content {
  padding: 24px;
}

.related-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 12px;
}

/* CTA */
.cta-section {
  background: var(--whk-navy);
  padding: 80px 24px;
  text-align: center;
  color: white;
}

.cta-title {
  font-family: var(--font-serif);
  font-size: 40px;
  margin-bottom: 16px;
}

.cta-text {
  font-size: 18px;
  color: var(--gray-300);
  margin-bottom: 32px;
}

.cta-button {
  display: inline-block;
  padding: 16px 32px;
  background: white;
  color: var(--whk-navy);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
  transition: transform 0.2s;
}

.cta-button:hover {
  transform: translateY(-2px);
}

/* Footer */
.footer {
  background: #0d1321;
  color: rgba(255, 255, 255, 0.85);
  padding: 64px 24px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-container {
  max-width: var(--container-max);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-logo {
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.footer-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
}

.social-links {
  display: flex;
  gap: 0.75rem;
}

.social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  text-decoration: none;
}

.social-link:hover {
  background: linear-gradient(135deg, #4264D1, #6CE2FF);
  border-color: transparent;
  color: #0d1321;
}

.social-link svg {
  width: 18px;
  height: 18px;
}

.footer-column h5 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1.5rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  list-style: none;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  line-height: 1.6;
}

.footer-links a:hover {
  color: #6CE2FF;
}

.footer-bottom {
  max-width: var(--container-max);
  margin: 0 auto;
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.footer-bottom a {
  color: inherit;
  text-decoration: none;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-image {
    max-height: 300px;
  }

  .content-wrapper {
    grid-template-columns: 1fr;
  }

  .sidebar-left {
    display: none;
  }

  .related-header {
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
  }

  .related-titles {
    max-width: 100%;
  }

  .inline-search-form {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-mobile-toggle {
    display: block;
  }

  .article-title {
    font-size: 32px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .social-links {
    justify-content: center;
  }

  .share-section-bottom {
    flex-direction: column;
    gap: 16px;
  }
}

/* ============================================
   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^="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;
}

/* 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,
.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%;
}

/* Show placeholder when image is missing */
.related-card-image:has(img[src=""]) .related-card-placeholder,
.related-card-image:has(img:not([src])) .related-card-placeholder {
  display: flex !important;
}
