/*
 * Blog styles for Hauptstadt Entsorger.
 * Used by page-blog.php (listing) and blog-details.php (detail).
 * Matches the theme palette: orange #FFA500, green #276C03 / #223F0F,
 * fonts Poppins (headings) / Inter (body), container max-width 1350px.
 * Every selector is scoped to .blog* so the rest of the site is unaffected,
 * and the file is only enqueued on blog pages (see functions.php).
 */

/* ================================================================== */
/* Blog 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-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog__card:hover {
  transform: translateY(-4px);
  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: 24px 26px 28px;
  flex: 1;
}

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

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

.blog__card-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 22px;
  line-height: 1.3;
  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: 16px;
  line-height: 1.6;
  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: 500;
  font-size: 15px;
  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: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: #1a1a2e;
  background-color: #f4f4f4;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

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

/* ================================================================== */
/* Blog detail (single post) — two-column layout                       */
/* ================================================================== */

/* Hero banner fallback (used when a post has no featured image; when it
   does, the image is applied inline in blog-details.php and wins). Reuses
   the shared .about-banner styles already defined in main.css. */
.about-banner--blog {
  background-image: linear-gradient(135deg, #223F0F 0%, #276C03 100%);
}

.blog-detail {
  width: 100%;
  padding: 56px 100px 90px;
}

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

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

/* ---- Head: title, meta, badges ---- */
.blog-detail__head {
  margin-bottom: 40px;
}

.blog-detail__title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 40px;
  line-height: 1.2;
  color: #1a1a2e;
  margin: 0 0 18px;
}

.blog-detail__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #888;
  margin-bottom: 22px;
}

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

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

.blog-detail__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.blog-detail__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid #e6e6e6;
  border-radius: 30px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  background-color: #fff;
}

.blog-detail__badge--star .he-icon  { color: #FFA500; }
.blog-detail__badge--check .he-icon { color: #2B9348; }
.blog-detail__badge--clock .he-icon { color: #FFA500; }
.blog-detail__badge--pin .he-icon   { color: #2E6FE6; }

/* ---- Two-column grid ---- */
.blog-detail__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 48px;
  align-items: start;
}

/* ---- Main content ---- */
.blog-detail__content {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  line-height: 1.8;
  color: #444;
}

.blog-detail__content > *:first-child {
  margin-top: 0;
}

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

.blog-detail__content h2 { font-size: 28px; }
.blog-detail__content h3 { font-size: 22px; }
.blog-detail__content h4 { font-size: 19px; }

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

.blog-detail__content a {
  color: #276C03;
  text-decoration: underline;
}

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

.blog-detail__content ul,
.blog-detail__content ol {
  margin: 0 0 1.3em 1.4em;
}

.blog-detail__content li {
    margin-bottom: 0.5em;
    color: #555 !important;
}

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

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

/* ---- FAQ accordion ---- */
.blog-faq {
  margin-top: 56px;
  scroll-margin-top: 110px;
}

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

.blog-faq__item {
  border: 1px solid #eee;
  border-radius: 10px;
  margin-bottom: 12px;
  background-color: #fff;
  overflow: hidden;
}

.blog-faq__item[open] {
  border-color: #FFD79A;
  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: 18px 22px;
  cursor: pointer;
  list-style: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 18px;
  color: #1a1a2e;
}

.blog-faq__q::-webkit-details-marker { display: none; }

.blog-faq__icon {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.blog-faq__icon::before,
.blog-faq__icon::after {
  content: '';
  position: absolute;
  background-color: #FFA500;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.blog-faq__icon::before {
  top: 8px;
  left: 0;
  width: 18px;
  height: 2px;
}

.blog-faq__icon::after {
  top: 0;
  left: 8px;
  width: 2px;
  height: 18px;
}

.blog-faq__item[open] .blog-faq__icon::after {
  transform: rotate(90deg);
  opacity: 0;
}

.blog-faq__a {
  padding: 0 22px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  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; }

/* ---- Sidebar (sticky) ---- */
.blog-detail__aside {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Table of contents */
.blog-toc {
  background-color: #F7F8F9;
  border-radius: 14px;
  padding: 24px 24px 26px;
}

.blog-toc__title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8f98;
  margin: 0 0 14px;
}

.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: 8px;
  padding: 8px 12px;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: #4a4f57;
  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: #9aa0a8;
  font-weight: 600;
}

.blog-toc__item > a:hover {
  color: #1a1a2e;
}

/* Active section highlight (set by blog.js) */
.blog-toc__item.is-active > a {
  background-color: #FFF1DC;
  border-left-color: #FFA500;
  color: #1a1a2e;
  font-weight: 600;
}

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

/* Nested H3 sub-items */
.blog-toc__sublist {
  list-style: none;
  margin: 2px 0 4px;
  padding: 0 0 0 26px;
}

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

.blog-toc__subitem > a:hover {
  color: #1a1a2e;
}

.blog-toc__subitem.is-active > a {
  background-color: #FFF1DC;
  border-left-color: #FFA500;
  color: #1a1a2e;
  font-weight: 600;
}

/* Direct contact box */
.blog-contact {
  border: 1px solid #ececec;
  border-radius: 14px;
  padding: 26px 26px 28px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

.blog-contact__title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 20px;
  color: #1a1a2e;
  margin: 0 0 18px;
}

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

.blog-contact__row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
}

.blog-contact__row .he-icon {
  color: #FFA500;
  width: 20px;
  height: 20px;
}

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

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

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

.blog-contact__cta:hover {
  background-color: #276C03;
}



/* ================================================================== */
/* Responsive                                                          */
/* ================================================================== */
@media (max-width: 1100px) {
  .blog-detail__layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  /* On narrow screens the TOC moves above the content and stops sticking. */
  .blog-detail__aside {
    position: static;
    order: -1;
  }
}

@media (max-width: 1024px) {
  .blog,
  .blog-detail {
    padding: 60px 40px;
  }
  .blog__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .blog,
  .blog-detail {
    padding: 44px 20px;
  }
  .blog__grid {
    grid-template-columns: 1fr;
  }
  .blog-detail__title {
    font-size: 30px;
  }
  .blog-detail__content h2 { font-size: 24px; }
  .blog-detail__content h3 { font-size: 20px; }
}
