@import url('https://fonts.googleapis.com/css2?family=Funnel+Display:wght@400;500;600;700&display=swap');

/* Reset & Base Styles */
:root {
  --primary-color: #1a2e4a;
  --accent-color: #f0b429;
  --bg-white: #ffffff;
  --bg-gray: #f5f7fa;
  --text-color: #1a1a2e;
  --font-main: 'Funnel Display', Georgia, serif;
  --transition: all 0.3s ease;
  --shadow: 0 4px 6px rgba(0,0,0,0.05);
}

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



body {
  font-family: var(--font-main);
  color: var(--text-color);
  background-color: var(--bg-white);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: var(--transition);
}

h1, h2, h3, h4 {
  margin-bottom: 1rem;
  line-height: 1.2;
}

p {
  margin-bottom: 1rem;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header */
.site-header {
  background-color: var(--bg-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  max-width: 1400px;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: bold;
  font-size: 1.25rem;
  color: var(--primary-color);
  flex-shrink: 0;
}

.logo svg {
  width: 32px;
  height: 32px;
  min-width: 32px;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.main-nav .btn {
  padding: 0.6rem 1.1rem;
}

.nav-link {
  font-weight: 500;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--accent-color);
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.btn-accent {
  background-color: var(--accent-color);
  color: var(--text-color);
}

.btn-accent:hover {
  background-color: #d99c1e;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--bg-white);
}

.btn-primary:hover {
  background-color: #112036;
}

.btn-outline {
  border-color: var(--accent-color);
  color: var(--bg-white);
}

.btn-outline:hover {
  background-color: var(--accent-color);
  color: var(--text-color);
}

.burger-menu {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--primary-color);
}

/* Hero Section */
.hero {
  background-color: var(--primary-color);
  color: var(--bg-white);
  padding: 6rem 0;
  position: relative;
  overflow: hidden;
}

.hero-bg-svg {
  position: absolute;
  top: -50%;
  right: -10%;
  opacity: 0.05;
  width: 800px;
  height: 800px;
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

/* Grid Section (4 Kacheln) */
.features {
  padding: 4rem 0;
  background-color: var(--bg-white);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature-card {
  background-color: var(--bg-gray);
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--text-color);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.feature-icon {
  width: 48px;
  height: 48px;
  color: var(--primary-color);
}

.feature-card h3 {
  margin: 0;
}

/* Risikokategorien Section */
.risk-categories {
  padding: 4rem 0;
  background-color: var(--bg-gray);
}

.risk-intro {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem auto;
}

.risk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.risk-card {
  background-color: var(--bg-white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.risk-indicator {
  height: 6px;
  width: 100%;
}

.risk-card.red .risk-indicator { background-color: #e53e3e; }
.risk-card.orange .risk-indicator { background-color: #dd6b20; }
.risk-card.green .risk-indicator { background-color: #38a169; }

.risk-content {
  padding: 2rem;
}

/* Newsletter Section */
.newsletter {
  padding: 5rem 0;
  background-color: var(--primary-color);
  color: var(--bg-white);
  text-align: center;
}

.newsletter h2 {
  font-size: 2.5rem;
}

.newsletter p {
  margin-bottom: 2rem;
}

.newsletter-form {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group input[type="text"],
.form-group input[type="email"] {
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.form-checkbox input {
  margin-top: 0.25rem;
}

/* CTA Banner */
.cta-banner {
  background-color: var(--accent-color);
  color: var(--text-color);
  padding: 4rem 0;
  text-align: center;
}

.cta-banner h2 {
  margin-bottom: 2rem;
}

/* Generic Page Content */
.page-content {
  padding: 4rem 0;
}

.page-content h1 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 2rem;
}

.page-content h2 {
  margin-top: 2rem;
  color: var(--primary-color);
}

/* Footer */
.site-footer {
  background-color: var(--primary-color);
  color: var(--bg-white);
  padding: 4rem 0 2rem 0;
}

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

.footer-col h3 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: var(--accent-color);
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.75rem;
}

.footer-col ul li a {
  color: #ccc;
}

.footer-col ul li a:hover {
  color: var(--bg-white);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.875rem;
  color: #ccc;
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  z-index: 200;
  flex-direction: column;
  padding: 2rem;
}

.mobile-nav-overlay.active {
  display: flex;
}

.close-menu {
  align-self: flex-end;
  background: none;
  border: none;
  color: var(--bg-white);
  font-size: 2rem;
  cursor: pointer;
  margin-bottom: 2rem;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: 1.25rem;
}

.mobile-nav-links a {
  color: var(--bg-white);
}

/* Responsive Breakpoints */
@media (max-width: 1240px) {
  .main-nav {
    display: none;
  }
  
  .burger-menu {
    display: block;
  }
}

@media (min-width: 1241px) and (max-width: 1340px) {
  .main-nav {
    gap: 0.8rem;
  }
  .nav-link {
    font-size: 0.9rem;
  }
  .main-nav .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  .logo {
    font-size: 1.1rem;
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.25rem;
  }

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

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

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
  }
  
}

/* Layout Gesetz-Seite */
.gesetz-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 3rem;
  align-items: start;
}

.gesetz-sidebar {
  position: sticky;
  top: 100px;
  background: var(--bg-gray);
  padding: 1.5rem;
  border-radius: 8px;
}

.gesetz-sidebar h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 0.5rem;
}

.gesetz-sidebar ul {
  list-style: none;
}

.gesetz-sidebar ul li {
  margin-bottom: 0.5rem;
}

.gesetz-sidebar ul li a {
  color: var(--text-color);
  display: block;
  padding: 0.25rem 0;
  font-size: 0.95rem;
}

.gesetz-sidebar ul li a:hover {
  color: var(--primary-color);
}

.gesetz-header-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.search-container {
  flex: 1;
  max-width: 400px;
}

#gesetz-suche {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

/* Accordion */
details.accordion {
  margin-bottom: 1rem;
  background: var(--bg-gray);
  border-radius: 4px;
  overflow: hidden;
}

details.accordion summary {
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-white);
  border: 1px solid #e2e8f0;
}

details.accordion summary::-webkit-details-marker {
  display: none;
}

details.accordion summary::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--primary-color);
}

details.accordion[open] summary::after {
  content: '-';
}

.accordion-content {
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
  border-top: none;
}

mark {
  background-color: yellow;
  color: black;
}

/* Timeline */
.timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 4rem 0;
  padding-top: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary-color);
}

.timeline-event {
  position: relative;
  width: 18%;
  text-align: center;
}

.timeline-event::before {
  content: '';
  position: absolute;
  top: -2.6rem;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: var(--accent-color);
  border-radius: 50%;
  border: 4px solid var(--bg-white);
}

.timeline-date {
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

/* Betroffenen Cards (Zusammenfassung) */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.role-card {
  background: var(--bg-gray);
  padding: 2rem;
  border-radius: 8px;
  border-top: 4px solid var(--primary-color);
}

.role-card ul {
  padding-left: 1.5rem;
  margin-top: 1rem;
}

/* KMU Steps */
.kmu-step {
  margin-bottom: 3rem;
  background: var(--bg-gray);
  padding: 2rem;
  border-radius: 8px;
  position: relative;
}

.step-number {
  position: absolute;
  top: -1.5rem;
  left: -1.5rem;
  width: 3rem;
  height: 3rem;
  background: var(--accent-color);
  color: var(--text-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  box-shadow: var(--shadow);
}

.kmu-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  background: var(--bg-white);
}

.kmu-table th, .kmu-table td {
  padding: 1rem;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.kmu-table th {
  background: var(--primary-color);
  color: var(--bg-white);
}

.cta-box {
  background: #e2e8f0;
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Compliance Checker */
.compliance-container {
  background: var(--bg-gray);
  padding: 3rem;
  border-radius: 8px;
  max-width: 800px;
  margin: 0 auto;
}

.progress-bar-container {
  width: 100%;
  background: #e2e8f0;
  height: 10px;
  border-radius: 5px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent-color);
  width: 20%;
  transition: width 0.3s ease;
}

.step-indicator {
  text-align: right;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1rem;
}

.compliance-step {
  display: none;
}

.compliance-step.active {
  display: block;
}

.compliance-step h2 {
  margin-bottom: 1.5rem;
}

.compliance-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.compliance-option {
  background: var(--bg-white);
  border: 2px solid #e2e8f0;
  border-radius: 4px;
  padding: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

.compliance-option:hover {
  border-color: var(--primary-color);
}

.compliance-option input[type="radio"],
.compliance-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.step-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}

.result-card {
  text-align: center;
  padding: 3rem;
  border-radius: 8px;
  background: var(--bg-white);
  box-shadow: var(--shadow);
}

.result-card.green { border-top: 6px solid #38a169; }
.result-card.yellow { border-top: 6px solid #ecc94b; }
.result-card.red { border-top: 6px solid #e53e3e; }

.result-card h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .gesetz-layout {
    grid-template-columns: 1fr;
  }
  .gesetz-sidebar {
    display: none;
  }
  .timeline {
    flex-direction: column;
    padding-top: 0;
    padding-left: 2rem;
    margin: 2rem 0;
  }
  .timeline::before {
    width: 4px;
    height: 100%;
    left: 0;
    top: 0;
  }
  .timeline-event {
    width: 100%;
    text-align: left;
    margin-bottom: 2rem;
  }
  .timeline-event::before {
    left: -2.6rem;
    top: 0;
    transform: none;
  }
  .roles-grid {
    grid-template-columns: 1fr;
  }
  .cta-box {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  .compliance-container {
    padding: 1.5rem;
  }
}

/* Form Styles Extension */
.honeypot {
  display: none !important;
}

.error-msg {
  color: #e53e3e;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

.form-feedback {
  padding: 1rem;
  border-radius: 4px;
  background-color: var(--bg-gray);
  border-left: 4px solid var(--primary-color);
}

.btn-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-left: 0.5rem;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}


/* --- USER OVERRIDES --- */
.container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.header-inner {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.footer-grid {
    gap: 2rem;
}

@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .page-content {
        padding: 1.5rem 1rem;
    }
    .footer-grid {
        gap: 1.5rem;
    }
}

.hero .btn-primary, .cta-banner .btn-primary {
    background-color: #f0b429 !important;
    color: #1a2e4a !important;
    padding: 0.75rem 1.75rem !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
}

#newsletter-form {
    scroll-margin-top: 90px;
}

/* --- USER OVERRIDES v2 --- */
.cta-banner .btn-primary, .cta-banner .btn-outline {
    border: 2px solid #1a2e4a !important;
    background: transparent !important;
    color: #1a2e4a !important;
    padding: 0.75rem 1.75rem !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
}
.cta-banner .btn-primary:hover, .cta-banner .btn-outline:hover {
    background: #1a2e4a !important;
    color: #fff !important;
}
#newsletter-form {
    scroll-margin-top: 90px;
}
.risk-card.amber { border-left-color: #f59e0b; }
.risk-card.amber .risk-indicator { background-color: #f59e0b; }
.timeline-event.abgelaufen::before {
    background-color: #e74c3c !important;
    border-color: #e74c3c !important;
}
.timeline-event.abgelaufen .timeline-date {
    color: #e74c3c !important;
}
.accordion {
    scroll-margin-top: 90px;
}
@media (max-width: 768px) {
    .cta-buttons-stack {
        flex-direction: column;
        width: 100%;
    }
    .cta-buttons-stack .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Fix accordion summary alignment */
.accordion summary {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
}
.accordion summary span {
    margin-left: auto !important;
    margin-right: 1.5rem !important;
    white-space: nowrap !important;
    text-align: right;
}

/* Fix risk grid to 4 columns on desktop */
@media (min-width: 1024px) {
    .risk-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 1rem !important;
    }
    .risk-card {
        padding: 1rem !important;
    }
    .risk-card h3 {
        font-size: 1rem !important;
    }
    .risk-card ul {
        font-size: 0.85rem !important;
    }
}

/* --- Responsive Fixes --- */
.timeline-lateral {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    margin: 3rem 0;
}
.timeline-lateral .timeline-event {
    flex: 1;
    min-width: 0;
}
@media (max-width: 768px) {
    .timeline-lateral {
        flex-direction: column;
    }
    .timeline-lateral .timeline-event {
        width: 100% !important;
    }
}
.table-responsive {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

/* --- FAQ Page --- */
.faq-filter-bar {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}
.faq-filter-btn {
    background: #f5f7fa;
    color: #1a2e4a;
    border: 1px solid #dde3ec;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
    transition: all 0.2s;
}
.faq-filter-btn.active {
    background: #1a2e4a;
    color: #fff;
    border-color: #1a2e4a;
}
.faq-item {
  border: 1px solid #dde3ec;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  transition: box-shadow 0.2s;
}
.faq-item[open] {
  box-shadow: 0 4px 16px rgba(26,46,74,0.10);
}
.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}
.faq-item summary::after { content: "＋"; color: #f0b429; }
.faq-item[open] summary::after { content: "－"; }
.faq-item[open] summary { 
  background: #1a2e4a; 
  color: #fff; 
}
.faq-answer {
  padding: 1.25rem 1.5rem;
  line-height: 1.8;
  color: #333;
  background: #fff;
  border-top: 1px solid #dde3ec;
}
.faq-search-wrapper {
    margin-bottom: 1.5rem;
}
#faq-suche {
    width: 100%;
    max-width: 600px;
    padding: 0.75rem 1rem;
    border: 1px solid #dde3ec;
    border-radius: 4px;
    font-size: 1rem;
}
#faq-counter {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}
@media (min-width: 1024px) {
    .faq-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        align-items: start;
    }
}

/* ==========================================================================
   BLOG STYLE EXTENSIONS (HEADLESS SUPABASE & MARKED.JS INTEGRATION)
   ========================================================================== */

/* --- Category Filter & Search Bar --- */
.blog-filter-bar {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
}
.blog-filter-btn {
    background: #f5f7fa;
    color: #1a2e4a;
    border: 1px solid #dde3ec;
    border-radius: 4px;
    padding: 0.5rem 1.25rem;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
.blog-filter-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: var(--primary-color);
}
.blog-filter-btn.active {
    background: var(--primary-color);
    color: var(--bg-white);
    border-color: var(--primary-color);
}
.blog-search-wrapper {
    margin-bottom: 2rem;
}
#blog-suche {
    width: 100%;
    max-width: 600px;
    padding: 0.75rem 1rem;
    border: 1px solid #dde3ec;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
#blog-suche:focus {
    outline: none;
    border-color: var(--accent-color);
}
#blog-counter {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

/* --- Blog Grid --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* --- Blog Card --- */
.blog-card {
    background: var(--bg-white);
    border-radius: 8px;
    border: 1px solid #dde3ec;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}
.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(26,46,74,0.08);
    border-color: #cbd5e1;
}
.blog-card-image-wrapper {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background-color: var(--bg-gray);
    overflow: hidden;
}
.blog-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.blog-card:hover .blog-card-image {
    transform: scale(1.04);
}
.blog-card-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--accent-color);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 2;
}
.blog-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.75rem;
}
.blog-card-divider {
    color: #ccc;
}
.blog-card-title {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    /* Limit title to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card-excerpt {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    /* Limit excerpt to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card-link {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    margin-top: auto;
    transition: color 0.2s;
}
.blog-card:hover .blog-card-link {
    color: var(--accent-color);
}

/* --- Skeleton Shimmer UI --- */
.blog-skeleton-card {
    background: var(--bg-white);
    border-radius: 8px;
    border: 1px solid #dde3ec;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.skeleton {
    background: #e2e8f0;
    background: linear-gradient(90deg, #f5f7fa 25%, #e2e8f0 50%, #f5f7fa 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    border-radius: 4px;
}
@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-image {
    width: 100%;
    height: 180px;
    border-radius: 6px;
}
.skeleton-badge {
    width: 80px;
    height: 20px;
}
.skeleton-title {
    width: 90%;
    height: 24px;
}
.skeleton-text {
    width: 100%;
    height: 16px;
}
.skeleton-text.short {
    width: 60%;
}

/* --- Single Post Detail Layout --- */
.blog-back-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
}
.blog-back-link:hover {
    color: var(--accent-color);
    transform: translateX(-4px);
}
.blog-post-article {
    max-width: 800px;
    margin: 0 auto;
}
.blog-post-header {
    margin-bottom: 2rem;
    text-align: center;
}
.blog-post-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.blog-post-date, .blog-post-readtime {
    font-size: 0.95rem;
    color: #666;
}
.blog-post-divider {
    color: #ccc;
}
.blog-detail-image-wrapper {
    width: 100%;
    max-height: 420px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow);
}
.blog-detail-image {
    width: 100%;
    height: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

/* --- Markdown Rendered Content Typography --- */
.markdown-body {
    color: var(--text-color);
    line-height: 1.8;
    font-size: 1.1rem;
}
.markdown-body p {
    margin-bottom: 1.5rem;
}
.markdown-body h2 {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
}
.markdown-body h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}
.markdown-body h4 {
    font-size: 1.125rem;
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}
.markdown-body hr {
    height: 1px;
    background-color: #cbd5e1;
    border: none;
    margin: 2rem 0;
}
.markdown-body a {
    color: #0366d6;
    text-decoration: underline;
}
.markdown-body a:hover {
    color: var(--accent-color);
}
.markdown-body strong {
    font-weight: 700;
}
.markdown-body blockquote {
    padding: 0.75rem 1.5rem;
    color: #334155;
    border-left: 4px solid var(--accent-color);
    background-color: var(--bg-gray);
    margin: 1.5rem 0;
    border-radius: 0 6px 6px 0;
}
.markdown-body blockquote p {
    margin-bottom: 0;
    font-style: italic;
}
.markdown-body ul, .markdown-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}
.markdown-body li {
    margin-bottom: 0.5rem;
}
.markdown-body ul {
    list-style-type: disc;
}
.markdown-body ol {
    list-style-type: decimal;
}

/* Markdown Table support */
.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 1rem;
}
.markdown-body th, .markdown-body td {
    padding: 0.75rem 1rem;
    border: 1px solid #dde3ec;
    text-align: left;
}
.markdown-body th {
    background-color: var(--primary-color);
    color: var(--bg-white);
    font-weight: bold;
}
.markdown-body tr:nth-child(even) {
    background-color: #f8fafc;
}
.markdown-body table tr:hover {
    background-color: #f1f5f9;
}

