/*
 * Styles for the PHP-rendered parts of the blog (list, cards, article,
 * related articles, share buttons). Plain CSS on purpose: the site's
 * Tailwind build only contains classes the React app uses, so classes
 * written in PHP templates would not exist there.
 *
 * Colors / fonts mirror tailwind.config.js and index.css of the React app:
 *   ink #1c2420, brand #2f8f5b (dark #236f45), brand-50 #eaf6ef,
 *   headings = Fraunces, body = Inter (both loaded by the app's CSS).
 * Page-wide resets (Tailwind "preflight") come from the app's CSS too.
 */

.wbc-blog-bg {
  position: fixed;
  inset: 0;
  z-index: -10;
}

.wbc-blog {
  padding: 7rem 1.5rem 4rem;
}
@media (min-width: 768px) {
  .wbc-blog { padding-left: 2.5rem; padding-right: 2.5rem; }
}

.wbc-container {
  max-width: 1440px;
  margin: 0 auto;
}
.wbc-narrow { max-width: 760px; }

/* ---------- List page header ---------- */
.wbc-kicker {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #2f8f5b;
  margin-bottom: 1rem;
}
.wbc-blog-head h1 {
  font-family: "Fraunces Variable", "Fraunces", serif;
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.15;
  max-width: 48rem;
}
.wbc-blog-intro {
  margin-top: 1rem;
  max-width: 42rem;
  color: rgb(28 36 32 / 0.6);
  line-height: 1.7;
}

/* ---------- Topic filter ---------- */
.wbc-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0 2.25rem;
}
.wbc-topic {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgb(28 36 32 / 0.7);
  background: #fff;
  border: 1px solid rgb(28 36 32 / 0.12);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.wbc-topic:hover { border-color: #2f8f5b; color: #236f45; }
.wbc-topic.is-active {
  background: #2f8f5b;
  border-color: #2f8f5b;
  color: #fff;
}

/* ---------- Card grid ---------- */
.wbc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}
@media (max-width: 1023px) {
  .wbc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .wbc-grid, .wbc-grid-2 { grid-template-columns: minmax(0, 1fr); }
}
.wbc-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.wbc-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid rgb(28 36 32 / 0.1);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}
.wbc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}
.wbc-card-media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #eaf6ef;
}
.wbc-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.wbc-card:hover .wbc-card-media img { transform: scale(1.05); }

.wbc-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem;
}
.wbc-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.wbc-chip {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #eaf6ef;
  color: #267a4c;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
a.wbc-chip:hover { background: #d3ecdc; }
.wbc-date {
  font-size: 0.75rem;
  color: rgb(28 36 32 / 0.5);
}
.wbc-card-title {
  margin-top: 0.75rem;
  font-family: "Fraunces Variable", "Fraunces", serif;
  font-weight: 500;
  font-size: 1.15rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.wbc-card-title a:hover { color: #236f45; }
.wbc-card-excerpt {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgb(28 36 32 / 0.6);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.wbc-card-more {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #2f8f5b;
}
.wbc-card-more:hover { color: #236f45; }

/* ---------- Empty states ---------- */
.wbc-empty {
  font-size: 1.05rem;
  color: rgb(28 36 32 / 0.7);
}
.wbc-empty-sub {
  margin: 0.5rem 0 1.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgb(28 36 32 / 0.5);
}

/* ---------- Pagination ---------- */
.wbc-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}
.wbc-page {
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgb(28 36 32 / 0.7);
  background: #fff;
  border: 1px solid rgb(28 36 32 / 0.12);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
a.wbc-page:hover { border-color: #2f8f5b; color: #236f45; }
.wbc-page.is-current {
  background: #2f8f5b;
  border-color: #2f8f5b;
  color: #fff;
}
.wbc-page-gap { color: rgb(28 36 32 / 0.4); }

/* ---------- Article page ---------- */
/* "Zurück zum Blog" — pill button, same look as the site's secondary buttons */
.wbc-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgb(28 36 32 / 0.15);
  font-size: 0.875rem;
  font-weight: 500;
  color: #1c2420;
  transition: border-color 0.3s;
}
.wbc-back:hover { border-color: rgb(28 36 32 / 0.4); }
.wbc-back-bottom { margin-top: 2.5rem; }

.wbc-article-meta { margin-top: 1.5rem; }
.wbc-article-title {
  margin-top: 1rem;
  font-family: "Fraunces Variable", "Fraunces", serif;
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.wbc-hero-wrap {
  max-width: 1040px;
  margin-top: 2rem;
  margin-bottom: 2.5rem;
}
.wbc-hero {
  margin: 0;
  border-radius: 1rem;
  overflow: hidden;
  background: #eaf6ef;
  aspect-ratio: 16 / 9;
  max-height: 540px;
}
.wbc-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The article text reuses .wbc-richtext from the app's CSS (same look as
   Impressum / Leitbild / course descriptions); these tweak it for long reading. */
.wbc-richtext.wbc-article-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: rgb(28 36 32 / 0.85);
}
.wbc-article-body > * + * { margin-top: 1.1em; }
.wbc-article-body h2 { margin-top: 2em; font-size: 1.5rem; }
.wbc-article-body h3 { margin-top: 1.6em; font-size: 1.2rem; }
.wbc-article-body img,
.wbc-article-body video,
.wbc-article-body iframe { max-width: 100%; height: auto; border-radius: 0.75rem; }
.wbc-article-body figure { margin-left: 0; margin-right: 0; }
.wbc-article-body figcaption { margin-top: 0.4rem; font-size: 0.8rem; color: rgb(28 36 32 / 0.5); }
.wbc-article-body blockquote {
  margin-left: 0;
  padding: 0.25rem 0 0.25rem 1.1rem;
  border-left: 3px solid #2f8f5b;
  font-style: italic;
  color: rgb(28 36 32 / 0.7);
}
.wbc-article-body table { width: 100%; border-collapse: collapse; font-size: 0.95rem; display: block; overflow-x: auto; }
.wbc-article-body th, .wbc-article-body td { padding: 0.5rem 0.75rem; border: 1px solid rgb(28 36 32 / 0.12); text-align: left; }
.wbc-article-body .alignleft { float: left; margin: 0.3rem 1.25rem 0.75rem 0; max-width: 50%; }
.wbc-article-body .alignright { float: right; margin: 0.3rem 0 0.75rem 1.25rem; max-width: 50%; }
.wbc-article-body .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wbc-article-body::after { content: ""; display: block; clear: both; }

/* ---------- Share buttons ---------- */
.wbc-share {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(28 36 32 / 0.1);
}
.wbc-share-label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgb(28 36 32 / 0.45);
}
.wbc-share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.wbc-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgb(47 143 91 / 0.1);
  color: #2f8f5b;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.wbc-share-btn:hover { background: #2f8f5b; color: #fff; }
.wbc-share-copy { padding: 0 1rem; }
.wbc-share-btn .wbc-icon { width: 1.15rem; height: 1.15rem; }

/* ---------- Related articles + topic list ---------- */
.wbc-related {
  padding: 1rem 1.5rem 5rem;
}
@media (min-width: 768px) {
  .wbc-related { padding-left: 2.5rem; padding-right: 2.5rem; }
}
.wbc-related-title {
  margin-bottom: 1.25rem;
  font-family: "Fraunces Variable", "Fraunces", serif;
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.3;
}
.wbc-related-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}
@media (min-width: 1024px) {
  .wbc-related-grid { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
}
.wbc-topics-box {
  padding: 1.5rem;
  background: #fff;
  border: 1px solid rgb(28 36 32 / 0.1);
  border-radius: 1rem;
}
.wbc-topics-box .wbc-related-title { font-size: 1.2rem; margin-bottom: 0.9rem; }
.wbc-topics-box ul { list-style: none; margin: 0; padding: 0; }
.wbc-topics-box li + li { margin-top: 0.15rem; }
.wbc-topics-box li a {
  display: block;
  padding: 0.5rem 0.75rem;
  margin: 0 -0.75rem;
  border-radius: 0.6rem;
  font-size: 0.9rem;
  color: rgb(28 36 32 / 0.75);
  transition: background 0.2s, color 0.2s;
}
.wbc-topics-box li a:hover { background: #eaf6ef; color: #236f45; }
.wbc-topics-box li a.is-active { background: #eaf6ef; color: #236f45; font-weight: 600; }
.wbc-topics-all {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #2f8f5b;
}
.wbc-topics-all:hover { color: #236f45; }

@media (prefers-reduced-motion: reduce) {
  .wbc-card, .wbc-card-media img { transition: none; }
  .wbc-card:hover { transform: none; }
  .wbc-card:hover .wbc-card-media img { transform: none; }
}

/* ---------- Landing pages (ads) ---------- */
.wbc-landing .wbc-hero-wrap { margin-top: 0; margin-bottom: 2rem; }
.wbc-landing-lead {
  margin-top: 1rem;
  margin-bottom: 2rem;
  font-size: 1.15rem;
  line-height: 1.7;
  color: rgb(28 36 32 / 0.7);
}
