/*
 * Blog styles for Hauptstadt Entsorger.
 * Used by page-blog.php (listing) and blog-details.php (single post).
 * Palette: orange #FFA500, green #276C03 / #223F0F / #16300A, ink #1a1a2e,
 * page #FFF8F0. Fonts: Poppins (headings) / Inter (body).
 *
 * Enqueued only on blog pages and only depends on responsive.css — NOT on
 * ui.css, so no --hp-* token is available here. Every colour is literal.
 *
 * Contents
 *   1. Listing
 *   2. Single: hero
 *   3. Single: layout
 *   4. Single: article typography
 *   5. Single: FAQ
 *   6. Single: sidebar (TOC + contact)
 *   7. Single: prev / next
 *   8. Responsive
 */

/* ============================================================ 1. Listing */
.blog {
  width: 100%;
  padding: 80px 100px;
}

.blog__container {
  max-width: 1350px;
  margin: 0 auto;
}

.blog__intro {
  max-width: 760px;
  margin: 0 auto 56px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  line-height: 1.7;
  color: #555;
}

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

.blog__card {
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border: 1px solid #ececec;
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.blog__card:hover {
  transform: translateY(-4px);
  border-color: rgba(39, 108, 3, 0.3);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.blog__card-thumb {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: #f1f1f1;
}

.blog__card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.blog__card:hover .blog__card-thumb img { transform: scale(1.05); }

.blog__card-thumb-fallback {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #223F0F 0%, #276C03 100%);
}

.blog__card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 24px 26px;
  flex: 1;
}

.blog__card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  color: #888;
}

.blog__card-cat,
.blog__card-cat a {
  color: #FFA500;
  text-decoration: none;
  font-weight: 600;
}

.blog__card-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 1.35;
  margin: 0;
}

.blog__card-title a {
  color: #1a1a2e;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog__card-title a:hover { color: #276C03; }

.blog__card-excerpt {
  font-family: 'Inter', sans-serif;
  font-size: 15.5px;
  line-height: 1.65;
  color: #666;
  margin: 0;
}

.blog__card-more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 14.5px;
  color: #276C03;
  text-decoration: none;
  transition: gap 0.2s ease, color 0.2s ease;
}

.blog__card-more:hover { color: #FFA500; gap: 12px; }

.blog__empty {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  color: #666;
  padding: 60px 0;
}

/* Pagination */
.blog__pagination { margin-top: 56px; }

.blog__pagination .page-numbers {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
}

.blog__pagination .page-numbers li { margin: 0; }

.blog__pagination .page-numbers a,
.blog__pagination .page-numbers span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: #1a1a2e;
  background-color: #fff;
  border: 1px solid #ececec;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.blog__pagination .page-numbers a:hover {
  background-color: #FFA500;
  border-color: #FFA500;
  color: #ffffff;
}

.blog__pagination .page-numbers .current {
  background-color: #276C03;
  border-color: #276C03;
  color: #ffffff;
}

/* ======================================================== 2. Single: hero
 * A real banner: the featured image full-bleed under a brand-green veil, with
 * the breadcrumb, headline and the two facts that matter on top of it.
 *
 * The veil is not decoration. An editor picks these photographs and there is
 * no telling how bright the next one will be, so the white text needs a floor
 * it can always rely on rather than luck. */
.blog-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: clamp(320px, 38vw, 480px);
  padding: clamp(56px, 7vw, 96px) 0 clamp(32px, 3.6vw, 52px);
  overflow: hidden;
  background-color: #16300A;
}

.blog-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.blog-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.blog-hero__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(12, 30, 6, 0.66) 0%, rgba(12, 30, 6, 0.42) 42%, rgba(12, 30, 6, 0.88) 100%),
    linear-gradient(90deg, rgba(22, 48, 10, 0.55) 0%, rgba(22, 48, 10, 0.08) 65%);
}

.blog-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 100px;
}

.blog-hero__crumbs {
  margin-bottom: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}

.blog-hero__crumbs a {
  color: #FFA500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-hero__crumbs a:hover { color: #ffffff; }

.blog-hero__title {
  max-width: 20ch;
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-wrap: balance;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

.blog-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.blog-hero__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.blog-hero__meta-item .he-icon { color: #FFA500; }

/* ====================================================== 3. Single: layout */
.blog-detail {
  width: 100%;
  padding: clamp(40px, 4.6vw, 72px) 100px clamp(56px, 6vw, 96px);
  background-color: #FFF8F0;
}

/* 1180, not 1350. With a 320px sidebar and a 40px gap, 1350 leaves the article
   around 990px — roughly 130 characters a line, about twice a readable
   measure. This puts it near 780px, which is ~75. */
.blog-detail__container {
  max-width: 1180px;
  margin: 0 auto;
}

.blog-detail__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
}

/* The article on a white card, lifted off the cream page. Without it the text
   floated on the background with nothing holding it, which is most of why the
   page read as a raw document rather than a designed one. */
.blog-detail__content {
  padding: clamp(26px, 3.2vw, 48px);
  border-radius: 18px;
  background-color: #ffffff;
  border: 1px solid #efe7db;
  box-shadow: 0 4px 24px rgba(26, 26, 46, 0.04);
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  line-height: 1.8;
  color: #4a4a52;
}

/* ========================================== 4. Single: article typography
 * The heading margins here were commented out. With no space above them, every
 * subheading sat welded to the paragraph before it and the article had no
 * visible structure at all — that was the single biggest reason it looked
 * unfinished. */
.blog-detail__content > *:first-child { margin-top: 0; }
.blog-detail__content > *:last-child { margin-bottom: 0; }

.blog-detail__content h2,
.blog-detail__content h3,
.blog-detail__content h4 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.3;
  scroll-margin-top: 110px; /* anchored headings clear the sticky header */
}

.blog-detail__content h2 {
  font-size: clamp(22px, 2.4vw, 28px);
  margin: 2em 0 0.7em;
  padding-top: 0.6em;
  border-top: 1px solid #f0ece4;
}

/* The first heading needs no rule above it — the card edge already is one. */
.blog-detail__content > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.blog-detail__content h3 {
  font-size: clamp(18px, 1.9vw, 21px);
  margin: 1.8em 0 0.5em;
}

.blog-detail__content h4 {
  font-size: 18px;
  margin: 1.6em 0 0.5em;
}

.blog-detail__content p { margin: 0 0 1.4em; }

.blog-detail__content strong { color: #1a1a2e; font-weight: 600; }

.blog-detail__content a {
  color: #276C03;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.blog-detail__content a:hover { color: #FFA500; }

/* Custom markers: the default disc sits tight against the text and does not
   pick up the brand at all. */
.blog-detail__content ul,
.blog-detail__content ol {
  margin: 0 0 1.5em;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.blog-detail__content li {
  position: relative;
  padding-left: 30px;
  color: #4a4a52;
}

.blog-detail__content ul > li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.66em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #FFA500;
}

.blog-detail__content ol {
  counter-reset: blog-ol;
}

.blog-detail__content ol > li {
  counter-increment: blog-ol;
}

.blog-detail__content ol > li::before {
  content: counter(blog-ol) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: #276C03;
}

.blog-detail__content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.6em 0;
}

.blog-detail__content figure { margin: 1.6em 0; }
.blog-detail__content figure img { margin: 0; }

.blog-detail__content figcaption {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #888;
}

.blog-detail__content blockquote {
  margin: 1.8em 0;
  padding: 20px 26px;
  border-left: 4px solid #FFA500;
  background-color: #FFF7EC;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: #444;
}

.blog-detail__content blockquote p:last-child { margin-bottom: 0; }

.blog-detail__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 15.5px;
}

.blog-detail__content th,
.blog-detail__content td {
  padding: 12px 14px;
  border: 1px solid #ececec;
  text-align: left;
}

.blog-detail__content th {
  background-color: #F6F4EF;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: #1a1a2e;
}

/* ========================================================= 5. Single: FAQ */
.blog-faq {
  margin-top: 3em;
  padding-top: 2em;
  border-top: 1px solid #f0ece4;
  scroll-margin-top: 110px;
}

.blog-faq__title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: clamp(22px, 2.4vw, 28px);
  color: #1a1a2e;
  margin: 0 0 20px;
}

.blog-faq__item {
  border: 1px solid #ececec;
  border-radius: 12px;
  margin-bottom: 10px;
  background-color: #fff;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.blog-faq__item[open] {
  border-color: rgba(39, 108, 3, 0.4);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.blog-faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 16.5px;
  line-height: 1.45;
  color: #1a1a2e;
  transition: color 0.2s ease;
}

.blog-faq__q::-webkit-details-marker { display: none; }
.blog-faq__q:hover { color: #276C03; }

.blog-faq__icon {
  position: relative;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #EAF3E4;
  transition: background-color 0.2s ease, transform 0.25s ease;
}

.blog-faq__icon::before,
.blog-faq__icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #276C03;
  border-radius: 2px;
  transition: opacity 0.25s ease, background-color 0.2s ease;
}

.blog-faq__icon::before { width: 12px; height: 2px; }
.blog-faq__icon::after { width: 2px; height: 12px; }

.blog-faq__item[open] .blog-faq__icon {
  background-color: #FFA500;
  transform: rotate(180deg);
}

.blog-faq__item[open] .blog-faq__icon::before { background-color: #fff; }
.blog-faq__item[open] .blog-faq__icon::after { opacity: 0; }

.blog-faq__a {
  padding: 0 20px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 15.5px;
  line-height: 1.75;
  color: #555;
}

.blog-faq__a p { margin: 0 0 1em; }
.blog-faq__a p:last-child { margin-bottom: 0; }
.blog-faq__a a { color: #276C03; }

/* ===================================================== 6. Single: sidebar */
.blog-detail__aside {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---- Table of contents ----
   Cream, not the solid green it was. The panel sat next to a white article as
   a heavy green slab, and every colour inside it then had to fight the
   background — the sub-headings were grey #6b7178 on green, roughly 1.5:1, and
   simply could not be read. A light panel lets the type behave normally and
   leaves green for the one thing that should stand out: where you are. */
.blog-toc {
  border-radius: 16px;
  border: 1px solid #efe7db;
  background-color: #ffffff;
  padding: 20px 18px 22px;
}

.blog-toc__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a8a82;
  margin: 0 0 12px;
}

.blog-toc__title::before {
  content: "";
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background-color: #FFA500;
}

.blog-toc__list {
  counter-reset: toc;
  list-style: none;
  margin: 0;
  padding: 0;
}

.blog-toc__item { counter-increment: toc; margin: 0; }

.blog-toc__item > a {
  display: flex;
  gap: 9px;
  padding: 8px 10px;
  border-left: 3px solid transparent;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
  color: #55584f;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.blog-toc__item > a::before {
  content: counter(toc) '.';
  flex: 0 0 auto;
  color: #b3b3aa;
  font-weight: 600;
  transition: color 0.2s ease;
}

.blog-toc__item > a:hover {
  background-color: #F4F7F1;
  color: #276C03;
}

/* Active section (set by blog.js) */
.blog-toc__item.is-active > a {
  background-color: #EAF3E4;
  border-left-color: #276C03;
  color: #1f5602;
  font-weight: 600;
}

.blog-toc__item.is-active > a::before { color: #276C03; }

.blog-toc__sublist {
  list-style: none;
  margin: 2px 0 4px;
  padding: 0 0 0 24px;
}

.blog-toc__subitem > a {
  display: block;
  padding: 6px 10px;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  color: #7b7e74;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.blog-toc__subitem > a:hover { background-color: #F4F7F1; color: #276C03; }

.blog-toc__subitem.is-active > a {
  background-color: #EAF3E4;
  border-left-color: #276C03;
  color: #1f5602;
  font-weight: 600;
}

/* ---- Direct contact ---- */
.blog-contact {
  border-radius: 16px;
  padding: 22px 20px 24px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(58, 122, 12, 0.55), transparent 62%),
    linear-gradient(150deg, #1F5602 0%, #16300A 100%);
}

.blog-contact__title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.3;
  color: #ffffff;
  margin: 0 0 16px;
}

.blog-contact__list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.blog-contact__row {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.82);
}

.blog-contact__row .he-icon {
  color: #FFA500;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.blog-contact__row a {
  color: #ffffff;
  text-decoration: none;
  word-break: break-word;
  transition: color 0.2s ease;
}

.blog-contact__row a:hover { color: #FFA500; }

.blog-contact__cta {
  display: block;
  width: 100%;
  text-align: center;
  padding: 13px 20px;
  border-radius: 30px;
  background-color: #FFA500;
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.blog-contact__cta:hover {
  background-color: #e69500;
  transform: translateY(-2px);
}

/* ================================================== 7. Single: prev / next */
.blog-detail__nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.blog-detail__nav-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 22px;
  border: 1px solid #efe7db;
  border-radius: 14px;
  background-color: #fff;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-detail__nav-link:hover {
  border-color: #276C03;
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

/* Pin each to its own side so a lone neighbour does not slide into column 1. */
.blog-detail__nav-link--prev { grid-column-start: 1; }

.blog-detail__nav-link--next {
  grid-column-end: -1;
  text-align: right;
}

.blog-detail__nav-label {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FFA500;
}

.blog-detail__nav-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.4;
  color: #1a1a2e;
}

.blog-detail__nav-link:hover .blog-detail__nav-title { color: #276C03; }

/* Shared inline icon */
.he-icon { flex: 0 0 auto; vertical-align: middle; }

/* ========================================================= 8. Responsive */
@media (max-width: 1100px) {
  .blog-detail__layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* Above the article on one column: the table of contents is a map, and a map
     belongs before the journey. Nothing to stick to either. */
  .blog-detail__aside {
    position: static;
    order: -1;
  }
}

@media (max-width: 1024px) {
  .blog,
  .blog-detail { padding-left: 40px; padding-right: 40px; }

  .blog-hero__inner { padding-left: 40px; padding-right: 40px; }

  /* The fixed mobile logo bar sits over the top of the hero. */
  .blog-hero { padding-top: calc(var(--he-mobile-header, 61px) + 48px); }

  .blog__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .blog,
  .blog-detail { padding-left: 20px; padding-right: 20px; }

  .blog-hero__inner { padding-left: 20px; padding-right: 20px; }
  .blog-hero__title { max-width: none; }

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

  .blog-detail__content {
    font-size: 16.5px;
    padding: 20px 18px;
    border-radius: 14px;
  }

  /* Two neighbour cards side by side on a phone leaves each ~18 characters. */
  .blog-detail__nav { grid-template-columns: minmax(0, 1fr); }
  .blog-detail__nav-link--next { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .blog__card,
  .blog__card-thumb img,
  .blog-detail__nav-link { transition: none; }
  .blog__card:hover,
  .blog-detail__nav-link:hover { transform: none; }
  .blog__card:hover .blog__card-thumb img { transform: none; }
}
