/* ==========================================================================
   Blogartikel – Gamma/Hornbach-achtige layout: ruim, strak, tabellen responsive
   ========================================================================== */

:root {
  --article-container: 80rem;   /* 1280px – breedte sectie (zoals Gamma) */
  --article-max-width: 56rem;   /* 896px – tekstblok */
  --article-content-wide: 64rem; /* 1024px – ruimte voor tabellen/prose */
  --article-primary: #a87b4b;
  --article-primary-hover: #8a5d35;
  --article-text: #171717;
  --article-text-muted: #525252;
  --article-text-light: #737373;
  --article-bg: #ffffff;
  --article-bg-subtle: #f8f7f5;
  --article-border: #e5e5e5;
  --article-radius: 0.5rem;
  --article-radius-sm: 0.375rem;
  --article-space: 1.5rem;
  --article-space-lg: 2.5rem;
}

.page-article-main {
  flex: 1 0 auto;
  padding-top: var(--header-height, 0);
  background: var(--article-bg);
}

/* ---------- Breadcrumbs ---------- */
.page-article .breadcrumbs {
  background: var(--article-bg-subtle);
  width: 100%;
  border-bottom: 1px solid var(--article-border);
}

.page-article .breadcrumbs .container-custom {
  margin-left: auto;
  margin-right: auto;
  max-width: var(--article-container);
  padding: 0.75rem 1rem;
}

@media (min-width: 640px) {
  .page-article .breadcrumbs .container-custom { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
  .page-article .breadcrumbs .container-custom { padding-left: 2rem; padding-right: 2rem; }
}

.page-article .breadcrumbs ol {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-article .breadcrumbs li { display: flex; align-items: center; gap: 0.375rem; }

.page-article .breadcrumbs a {
  font-size: 0.8125rem;
  color: var(--article-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.page-article .breadcrumbs a:hover { color: var(--article-text); }

.page-article .breadcrumbs [aria-current="page"] {
  font-size: 0.8125rem;
  color: var(--article-text);
  font-weight: 500;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-article .breadcrumbs-sep {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--article-text-light);
}

/* ---------- Container artikel (Gamma/Hornbach: ruim, strak) ---------- */
.page-article .container-narrow {
  max-width: var(--article-content-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .page-article .container-narrow { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
  .page-article .container-narrow { padding-left: 2rem; padding-right: 2rem; }
}

/* ---------- Artikel header ---------- */
.article-content-section {
  padding-bottom: 0;
}

.article-header {
  padding-top: var(--article-space-lg);
  padding-bottom: var(--article-space);
}

@media (min-width: 1024px) {
  .article-header { padding-top: 3rem; padding-bottom: 2rem; }
}

.article-title {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--article-text);
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .article-title { font-size: 2.25rem; line-height: 1.2; }
}

@media (min-width: 1024px) {
  .article-title { font-size: 2.5rem; }
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--article-text-light);
}

.article-meta time { font-style: normal; }

/* ---------- Featured image ---------- */
.article-featured-image-wrap {
  margin-bottom: var(--article-space-lg);
}

@media (min-width: 1024px) {
  .article-featured-image-wrap { margin-bottom: 3rem; }
}

.article-featured-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--article-radius);
  object-fit: cover;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* ---------- Artikel body / prose ---------- */
.article-body {
  padding-bottom: 4rem;
}

@media (min-width: 1024px) {
  .article-body { padding-bottom: 5rem; }
}

.article-prose.rte {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--article-text);
}

/* Headings – duidelijke secties (Gamma/Hornbach) */
.article-prose.rte h1 {
  margin: 2.5rem 0 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--article-text);
}

.article-prose.rte h1:first-child { margin-top: 0; }

@media (min-width: 1024px) {
  .article-prose.rte h1 { margin-top: 3rem; }
}

.article-prose.rte h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--article-text);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--article-border);
}

@media (min-width: 1024px) {
  .article-prose.rte h2 { margin-top: 3rem; font-size: 1.5rem; }
}

.article-prose.rte h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--article-text);
}

.article-prose.rte h4 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--article-text);
}

/* Paragraaf & tekst */
.article-prose.rte p {
  margin: 0 0 1.25rem;
  line-height: 1.7;
  color: var(--article-text);
}

@media (min-width: 1024px) {
  .article-prose.rte p { line-height: 1.75; }
}

.article-prose.rte p:last-child { margin-bottom: 0; }

.article-prose.rte strong {
  font-weight: 600;
  color: var(--article-text);
}

.article-prose.rte em { font-style: italic; }

/* Links */
.article-prose.rte a {
  color: var(--article-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.article-prose.rte a:hover { color: var(--article-primary-hover); }

/* Lijsten */
.article-prose.rte ul,
.article-prose.rte ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.article-prose.rte ul { list-style-type: disc; }

.article-prose.rte ol { list-style-type: decimal; }

.article-prose.rte li {
  margin-bottom: 0.35rem;
  padding-left: 0.25rem;
}

.article-prose.rte li::marker { color: var(--article-text-light); }

/* Blockquote */
.article-prose.rte blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  padding-left: 1.25rem;
  border-left: 4px solid var(--article-primary);
  background: var(--article-bg-subtle);
  border-radius: 0 var(--article-radius-sm) var(--article-radius-sm) 0;
  color: var(--article-text-muted);
  font-style: italic;
}

@media (min-width: 1024px) {
  .article-prose.rte blockquote { margin: 2rem 0; padding: 1.5rem 2rem; padding-left: 1.5rem; }
}

/* ---------- Tabellen: responsive, op PC volledig zichtbaar (Gamma/Hornbach) ---------- */
.article-prose.rte .rte__table-wrapper,
.article-prose.rte .table-wrapper {
  margin: var(--article-space) 0 var(--article-space-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--article-radius);
  border: 1px solid var(--article-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

@media (min-width: 1024px) {
  .article-prose.rte .rte__table-wrapper,
  .article-prose.rte .table-wrapper { margin: 2rem 0; }
}

/* Mobiel: tabel kan horizontaal scrollen als hij te breed is */
.article-prose.rte .rte__table-wrapper::-webkit-scrollbar,
.article-prose.rte .table-wrapper::-webkit-scrollbar {
  height: 6px;
}

.article-prose.rte .rte__table-wrapper::-webkit-scrollbar-thumb,
.article-prose.rte .table-wrapper::-webkit-scrollbar-thumb {
  background: var(--article-border);
  border-radius: 3px;
}

.article-prose.rte table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  background: var(--article-bg);
  table-layout: auto;
}

@media (min-width: 768px) {
  .article-prose.rte table { font-size: 1rem; }
}

.article-prose.rte thead {
  background: var(--article-bg-subtle);
  border-bottom: 2px solid var(--article-border);
}

.article-prose.rte th {
  padding: 0.875rem 1.25rem;
  text-align: left;
  font-weight: 600;
  color: var(--article-text);
  white-space: normal;
  word-wrap: break-word;
}

.article-prose.rte td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--article-border);
  color: var(--article-text);
  white-space: normal;
  word-wrap: break-word;
}

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

.article-prose.rte tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

.article-prose.rte tbody tr:hover {
  background: rgba(168, 123, 75, 0.05);
}

/* Tabel direct in .rte (geen wrapper): responsive container */
.article-prose.rte > table {
  display: block;
  margin: var(--article-space) 0 var(--article-space-lg);
  border-radius: var(--article-radius);
  border: 1px solid var(--article-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Desktop: tabel 100% breedte, volledig zichtbaar, geen scroll */
@media (min-width: 1024px) {
  .article-prose.rte > table {
    overflow-x: visible;
    width: 100%;
    display: table;
  }
}

.article-prose.rte > table thead { background: var(--article-bg-subtle); }

.article-prose.rte > table th,
.article-prose.rte > table td {
  padding: 0.875rem 1.25rem;
  border: 1px solid var(--article-border);
  white-space: normal;
}

.article-prose.rte > table th {
  font-weight: 600;
  text-align: left;
}

.article-prose.rte > table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

/* Als table direct child is (geen inner table): zelfde cellen-styling */
.article-prose.rte > table > thead > tr > th,
.article-prose.rte > table > tbody > tr > td {
  padding: 0.875rem 1.25rem;
  white-space: normal;
  word-wrap: break-word;
}

/* ---------- Figure / afbeeldingen in artikel ---------- */
.article-prose.rte figure {
  margin: var(--article-space-lg) 0;
}

@media (min-width: 1024px) {
  .article-prose.rte figure { margin: 3rem 0; }
}

.article-prose.rte figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--article-radius-sm);
  border: 1px solid var(--article-border);
}

.article-prose.rte figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--article-text-muted);
  line-height: 1.5;
}

.article-prose.rte img {
  max-width: 100%;
  height: auto;
  border-radius: var(--article-radius-sm);
  border: 1px solid var(--article-border);
}

/* ---------- FAQ / schema blokken (onsichtbaar) ---------- */
.article-prose.rte script { display: none; }

/* ---------- Error state ---------- */
.article-error-section {
  padding: 4rem 0;
  text-align: center;
}

.article-error-title {
  margin: 0 0 1rem;
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--article-text);
}

.article-error-tip {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--article-bg-subtle);
  border-radius: var(--article-radius-sm);
  font-size: 0.9375rem;
  color: var(--article-text-muted);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.article-error-section a {
  color: var(--article-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-error-section a:hover { color: var(--article-primary-hover); }
