/* === BLOG UI FIXES — Complete restyling voor Retslav blog === */
/* Stijl consistent met index.html (retslav.net) */
/* Ondersteunt zowel .blog-post (body) als .blog-article (main wrapper) */

/* ### GLOBALE SCROLL FIXES ### */
html {
  scroll-padding-top: 6rem;
  scroll-behavior: smooth;
}

/* ### STICKY TOC/SIDEBAR ### */
.blog-post aside,
.blog-post .toc-sidebar,
.blog-post nav.toc,
.blog-article aside,
.blog-article .toc-sidebar,
.blog-article nav.toc,
main > aside,
main > nav.toc,
article nav.toc,
main nav.toc {
  position: sticky !important;
  top: 6rem !important;
  align-self: start !important;
}

/* ### GRID & OVERFLOW FIXES ### */
.blog-post main,
body > main.grid {
  overflow: hidden;
  max-width: 100%;
}
.blog-post main.grid,
body main.grid {
  overflow: hidden;
}
.blog-post article.max-w-3xl,
main article.max-w-3xl {
  max-width: 100%;
  min-width: 0;
  width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* ### Z-INDEX: content boven ::before gradient ### */
.blog-post article p,
.blog-post article li,
.blog-post article div,
.blog-post article h2,
.blog-post article h3,
.blog-post article h4,
.blog-post article blockquote,
.blog-post article table,
.blog-post article pre,
.blog-post article code,
.blog-article p,
.blog-article li,
.blog-article div,
.blog-article h2,
.blog-article h3,
.blog-article h4,
.blog-article blockquote,
.blog-article table,
.blog-article pre,
.blog-article code {
  position: relative;
  z-index: 2;
}

.blog-post article h2,
.blog-post article h3,
.blog-post article h4,
.blog-article h2,
.blog-article h3,
.blog-article h4 {
  scroll-margin-top: 7rem;
}

.blog-post section:first-of-type,
.blog-article section:first-of-type {
  padding-top: 7rem !important;
}

/* === MARKETING & UI VERBETERINGEN === */

/* Gecentreerde hero-sectie (zoals index.html) */
.blog-post section:first-of-type .max-w-3xl {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.blog-post section:first-of-type h1 {
  text-align: center;
}

.blog-post section:first-of-type .inline-flex {
  justify-content: center;
  width: 100%;
}

.blog-post section:first-of-type p {
  text-align: center;
}

/* Article tekst: iets groter en beter leesbaar */
.blog-post article,
.blog-article {
  font-size: 1.05rem;
  line-height: 1.8;
}

.blog-post article p,
.blog-article p {
  margin-bottom: 1.25rem;
  color: #d1d5db;
}

.blog-post article h2,
.blog-article h2 {
  font-size: 1.75rem !important;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: #ffffff;
  border-bottom: 1px solid rgba(59,130,246,0.15);
  padding-bottom: 0.5rem;
}

.blog-post article h3,
.blog-article h3 {
  font-size: 1.35rem !important;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #f0f4ff;
}

.blog-post article ul,
.blog-post article ol,
.blog-article ul,
.blog-article ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
  color: #d1d5db;
}

.blog-post article li,
.blog-article li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.blog-post article strong,
.blog-article strong {
  color: #f0f4ff;
  font-weight: 600;
}

.blog-post article a,
.blog-article a {
  color: #60a5fa;
  text-decoration: none;
  border-bottom: 1px solid rgba(96,165,250,0.3);
  transition: border-color 0.2s;
}

.blog-post article a:hover,
.blog-article a:hover {
  border-bottom-color: #60a5fa;
}

.blog-post article blockquote,
.blog-article blockquote {
  border-left: 3px solid #3b82f6;
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(12,31,58,0.4);
  border-radius: 0 0.5rem 0.5rem 0;
  color: #cbd5e1;
  font-style: italic;
}

.blog-post article blockquote p,
.blog-article blockquote p {
  margin-bottom: 0;
}

.blog-post article code,
.blog-article code {
  background: rgba(12,31,58,0.6);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
  color: #93c5fd;
}

.blog-post article pre,
.blog-article pre {
  background: rgba(12,31,58,0.6);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 0.75rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}

.blog-post article pre code,
.blog-article pre code {
  background: none;
  padding: 0;
}

.blog-post article img,
.blog-article img {
  border-radius: 0.75rem;
  margin: 1.5rem auto;
  max-width: 100%;
  height: auto;
}

.blog-post article table,
.blog-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.blog-post article th,
.blog-article th {
  text-align: left;
  padding: 0.75rem;
  background: rgba(12,31,58,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: #93c5fd;
  font-weight: 600;
}

.blog-post article td,
.blog-article td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: #d1d5db;
}

.blog-post article tr:hover td,
.blog-article tr:hover td {
  background: rgba(59,130,246,0.05);
}

/* --- MARKETING CTA SECTION --- */
.blog-post .cta-section,
.blog-article .cta-section {
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(12,31,58,0.4));
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  margin: 2.5rem 0;
}

.blog-post .cta-section h3,
.blog-article .cta-section h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.75rem;
  border: none;
}

.blog-post .cta-section p,
.blog-article .cta-section p {
  color: #94a3b8;
  margin-bottom: 1.25rem;
}

.blog-post .cta-section .btn-attract,
.blog-article .cta-section .btn-attract {
  display: inline-block;
  background: linear-gradient(270deg, #3b82f6, #0b3c8a, #609dffaf, #3b82f6);
  background-size: 800% 800%;
  animation: gradient-fade 6s ease infinite;
  color: white;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 0.75rem;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.blog-post .cta-section .btn-attract:hover,
.blog-article .cta-section .btn-attract:hover {
  transform: scale(1.03);
}

@keyframes gradient-fade {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Highlight box (info/warning) */
.blog-post .highlight-box,
.blog-article .highlight-box {
  background: rgba(12,31,58,0.5);
  border-left: 3px solid #3b82f6;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.blog-post .highlight-box p,
.blog-article .highlight-box p {
  margin: 0;
}

.blog-post .highlight-box.warning,
.blog-article .highlight-box.warning {
  border-left-color: #f59e0b;
}

.blog-post .highlight-box.success,
.blog-article .highlight-box.success {
  border-left-color: #10b981;
}

/* Signal header (voor signalen-posts zoals post-10) */
.blog-article .signal-header {
  border-left: 4px solid #22d3ee;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.blog-article .signal-header span {
  color: #22d3ee;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

/* Action box (voor direct-actie blokken) */
.blog-article .action-box {
  background: rgba(12,31,58,0.5);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.blog-article .action-box h3 {
  margin-top: 0;
}

/* Step cards (voor how-to guides) */
.blog-post .step-card,
.blog-article .step-card {
  background: rgba(12,31,58,0.3);
  border: 1px solid rgba(22,49,83,0.8);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.blog-post .step-card:hover,
.blog-article .step-card:hover {
  border-color: rgba(59,130,246,0.3);
}

.blog-post .step-number,
.blog-article .step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: rgba(59,130,246,0.15);
  color: #93c5fd;
  font-weight: 700;
  font-size: 0.875rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

/* --- TOC STYLING --- */
.toc-sidebar,
nav.toc,
main > aside {
  background: rgba(12, 31, 58, 0.3);
  border: 1px solid rgba(22, 49, 83, 0.8);
  border-radius: 0.75rem;
  padding: 1.25rem;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(59,130,246,0.3) transparent;
}

.toc-sidebar h3,
nav.toc h3,
main > aside h3 {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #93c5fd;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0.5rem;
}

.toc-sidebar ul,
nav.toc ul,
main > aside ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-sidebar li,
nav.toc li,
main > aside li {
  margin-bottom: 0.25rem;
}

.toc-sidebar a,
nav.toc a,
main > aside a {
  color: #9fb3c8;
  font-size: 0.8125rem;
  line-height: 1.5;
  display: block;
  padding: 0.2rem 0;
  text-decoration: none;
  transition: color 0.15s;
}

.toc-sidebar a:hover,
nav.toc a:hover,
main > aside a:hover {
  color: #60a5fa;
}

/* --- RESPONSIVE --- */
@media (max-width: 1023px) {
  .toc-sidebar,
  nav.toc,
  main > aside {
    display: none;
  }
}

@media (max-width: 767px) {
  .blog-post section:first-of-type,
  .blog-article section:first-of-type {
    padding-top: 5.5rem !important;
  }
  
  .blog-post main,
  .blog-post article,
  .blog-article {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .blog-post article p,
  .blog-post article li,
  .blog-article p,
  .blog-article li {
    font-size: 0.9375rem;
    line-height: 1.65;
  }
  
  .blog-post article h2,
  .blog-article h2 {
    font-size: 1.5rem !important;
  }
  
  .blog-post article h3,
  .blog-article h3 {
    font-size: 1.25rem !important;
  }

  .blog-post .cta-section,
  .blog-article .cta-section {
    padding: 1.25rem;
  }

  .blog-post article table,
  .blog-article table {
    font-size: 0.8rem;
  }

  .blog-post article th,
  .blog-post article td,
  .blog-article th,
  .blog-article td {
    padding: 0.5rem;
  }
}

/* Print optimalisatie */
@media print {
  .toc-sidebar,
  nav.toc,
  main > aside,
  .chat-floating-btn,
  .chat-panel {
    display: none !important;
  }
  
  .blog-post main,
  .blog-article {
    display: block !important;
  }
  
  .blog-post article,
  .blog-article {
    max-width: 100% !important;
  }
}
