:root {
  /* Palette an fvgb.de angelehnt */
  --papier: #f4f4f4;
  --papier-2: #eceff1;
  --tinte: #26343a;
  --tinte-soft: #5a6a72;
  --gruen: #004c69;      /* Petrol (Primärfarbe fvgb) */
  --gruen-hell: #0b6a8c;
  --rot: #a32b30;        /* Akzent für Hervorhebungen */
  --messing: #2ea3f2;    /* Blau als Zweitakzent (Daten, Kicker) */
  --linie: #d8dfe2;
  --gruen-blatt: #96c450; /* Grün aus dem Logo */
}

/*
Theme Name: Bücherbaum Child
Description: Divi-5-Child für buecherbaum.eu (Libertree) — Beiträge vorne, animierter Bücherbaum im Kopfbereich.
Template: Divi
Version: 0.1.0
Text Domain: buecherbaum
*/

/* ============================================================
   Bücherbaum — Gestaltung
   Scope: .bb-page  (nur Seiten mit unserem Template)
   Palette: Papier, Tinte, Blattgrün, Buchrücken-Rot, Messing
   ============================================================ */

.bb-page {
  background: var(--papier);
  color: var(--tinte);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.bb-page *,
.bb-page *::before,
.bb-page *::after { box-sizing: border-box; }

/* ---------- Kopfbereich mit Baum ---------- */

.bb-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(34px, 6vw, 74px) 0 clamp(0px, 1vw, 8px);
  background: linear-gradient(180deg, #e8f1f6 0%, #d9e8ef 58%, #edf0f1 88%, #f4f4f4 100%);
  border-bottom: 1px solid var(--linie);
}

.bb-hero__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 46%);
  align-items: end;
  gap: clamp(16px, 3vw, 44px);
}

.bb-hero__text { padding-bottom: clamp(18px, 3vw, 44px); }

.bb-kicker {
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #5a6a72;
  margin: 0 0 12px;
}

.bb-hero h1 {
  font-size: clamp(30px, 5.2vw, 58px);
  line-height: 1.06;
  margin: 0 0 16px;
  color: var(--gruen);
  letter-spacing: -.01em;
}

.bb-hero h1 em { font-style: italic; color: var(--rot); }

.bb-hero p {
  margin: 0 0 18px;
  font-size: clamp(15px, 1.6vw, 18px);
  color: #40525a;
  max-width: 46ch;
}

.bb-hero__tree { position: relative; align-self: end; margin-bottom: -4px; }
.bb-hero__tree svg { display: block; width: 100%; height: auto; }

/* ---------- Header-Bild: still, mit aufgehender Sonne ---------- */

.bb-hero__tree {
  position: relative;
  align-self: end;
  isolation: isolate;
}

/* Sonnenaufgang: warmes Licht strahlt von unten hinter dem Baum auf */
.bb-hero__tree::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6%;
  width: 132%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, 12%) scale(.55);
  background:
    radial-gradient(circle at 50% 74%,
      rgba(255, 250, 232, .95) 0%,
      rgba(255, 232, 168, .78) 12%,
      rgba(255, 212, 128, .48) 26%,
      rgba(255, 228, 176, .22) 42%,
      rgba(255, 246, 224, 0) 62%);
  filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  animation: bb-sunrise 3.6s cubic-bezier(.22, .7, .2, 1) .25s forwards;
}

@keyframes bb-sunrise {
  0%   { opacity: 0;    transform: translate(-50%, 24%) scale(.34); }
  45%  { opacity: .85; }
  75%  { opacity: 1; }
  100% { opacity: .82;  transform: translate(-50%, 0%) scale(1); }
}

/* Der Baum selbst bewegt sich nicht — nur ein Hauch mehr Licht */
.bb-tree-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  max-height: clamp(260px, 42vh, 430px);
  object-fit: contain;
  object-position: bottom center;
  animation: bb-light 3.6s ease-out .25s both;
}

@keyframes bb-light {
  0%   { filter: brightness(.9) saturate(.92); }
  100% { filter: brightness(1.05) saturate(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .bb-hero__tree::before { animation: none; opacity: .8; transform: translate(-50%, 2%) scale(1.04); }
  .bb-tree-img { animation: none; }
}

/* ---------- Beiträge ---------- */

.bb-posts {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 52px) 22px clamp(40px, 6vw, 80px);
}

.bb-posts__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px;
  border-bottom: 1px solid var(--linie);
  padding-bottom: 10px;
}

.bb-posts__head h2 {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 27px);
  color: var(--gruen);
}

.bb-posts__head span {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #5a6a72;
}

.bb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2.2vw, 26px);
}

.bb-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--linie);
  border-radius: 4px;
  padding: 22px 24px 20px;
  display: flex;
  flex-direction: column;
  transition: box-shadow .25s ease, transform .25s ease;
}

.bb-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 76, 105, .10);
}

.bb-card--lead {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.bb-card__body { padding: 24px 26px; }

.bb-card__thumb {
  background: repeating-linear-gradient(135deg, #e4eaec 0 12px, #eef2f3 12px 24px);
  border-left: 1px solid var(--linie);
  min-height: 220px;
}

.bb-card--lead .bb-card__thumb { border-left: 0; border-right: 1px solid var(--linie); }

.bb-date {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #2b7fa6;
  margin: 0 0 8px;
}

.bb-card h3 {
  margin: 0 0 10px;
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.24;
  color: var(--gruen);
}

.bb-card h3 a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}

.bb-card h3 a:hover { border-color: var(--rot); }

.bb-card p {
  margin: 0 0 16px;
  font-size: 15.5px;
  color: var(--tinte-soft);
}

.bb-more {
  margin-top: auto;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--rot);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bb-more::after { content: "→"; transition: transform .2s ease; }
.bb-more:hover::after { transform: translateX(3px); }

.bb-empty {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--linie);
  color: var(--tinte-soft);
  text-align: center;
}

/* ---------- Fußnote ---------- */

.bb-note {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 22px 56px;
  font-size: 13.5px;
  color: var(--tinte-soft);
  border-top: 1px solid var(--linie);
  padding-top: 18px;
}

/* ---------- Mobil ---------- */

@media (max-width: 860px) {
  .bb-hero__inner {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 6px;
  }
  .bb-hero__tree {
    order: -1;
    max-width: 340px;
    margin: 0 auto;
  }
  .bb-hero h1 { font-size: clamp(27px, 8vw, 38px); }
  .bb-hero__text { padding-bottom: 6px; }
  .bb-grid { grid-template-columns: 1fr; }
  .bb-card--lead { grid-template-columns: 1fr; }
  .bb-card--lead .bb-card__thumb { border-right: 0; border-bottom: 1px solid var(--linie); min-height: 170px; }
}

/* ---------- Einzelner Beitrag ---------- */

.bb-article {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 56px) 22px clamp(40px, 6vw, 72px);
}

.bb-article__head {
  border-bottom: 1px solid var(--linie);
  padding-bottom: 18px;
  margin-bottom: clamp(20px, 3vw, 32px);
}

.bb-article__head h1 {
  margin: 0;
  font-size: clamp(27px, 4.2vw, 46px);
  line-height: 1.12;
  color: var(--gruen);
  letter-spacing: -.01em;
}

.bb-article__body {
  font-size: clamp(16px, 1.65vw, 18.5px);
  color: var(--tinte);
}

.bb-article__body p { margin: 0 0 1.15em; }
.bb-article__body h2 {
  font-size: clamp(21px, 2.4vw, 27px);
  color: var(--gruen);
  margin: 1.9em 0 .55em;
  line-height: 1.2;
}
.bb-article__body h3 {
  font-size: clamp(18px, 1.9vw, 21px);
  color: var(--gruen);
  margin: 1.6em 0 .5em;
}
.bb-article__body a { color: var(--rot); text-decoration: underline; text-underline-offset: 2px; }
.bb-article__body ul, .bb-article__body ol { margin: 0 0 1.2em 1.2em; }
.bb-article__body li { margin-bottom: .4em; }
.bb-article__body blockquote {
  margin: 1.5em 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--messing);
  font-style: italic;
  color: var(--tinte-soft);
}
.bb-article__body img { max-width: 100%; height: auto; border-radius: 3px; }
.bb-article__body figure { margin: 1.6em 0; }
.bb-article__body figcaption {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12.5px;
  color: var(--tinte-soft);
  margin-top: 6px;
}

.bb-back {
  display: inline-block;
  margin-top: clamp(28px, 4vw, 44px);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--rot);
  text-decoration: none;
}
.bb-back:hover { text-decoration: underline; }

/* ---------- Archiv / Kategorie ---------- */

.bb-posts--archive { padding-top: clamp(26px, 4vw, 44px); }

.bb-pager {
  margin-top: clamp(22px, 3vw, 36px);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13.5px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.bb-pager a, .bb-pager span {
  padding: 7px 12px;
  border: 1px solid var(--linie);
  border-radius: 3px;
  color: var(--tinte);
  text-decoration: none;
  background: #ffffff;
}
.bb-pager .current { background: var(--gruen); color: #fff; border-color: var(--gruen); }

/* ---------- Kopfbereich mit WordPress-Menü ---------- */

.bb-header {
  background: linear-gradient(180deg, #ffffff 0%, #f1f4f5 100%);
  border-bottom: 1px solid var(--linie);
}

.bb-header__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.bb-brand {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.bb-brand__name {
  font-size: clamp(19px, 2vw, 23px);
  font-weight: 600;
  color: var(--gruen);
  letter-spacing: -.01em;
}

.bb-brand__claim {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--tinte-soft);
}

.bb-nav__list,
.bb-nav .menu {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.bb-nav__list li,
.bb-nav .menu li { position: relative; }

.bb-nav__list a,
.bb-nav .menu a {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13.5px;
  letter-spacing: .04em;
  color: var(--tinte);
  text-decoration: none;
  padding: 6px 0;
  display: inline-block;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, color .2s ease;
}

.bb-nav__list a:hover,
.bb-nav .menu a:hover {
  color: var(--rot);
  border-color: var(--rot);
}

.bb-nav .sub-menu {
  list-style: none;
  margin: 0;
  padding: 8px 0 0;
}

/* ---------- Fußbereich ---------- */

.bb-footer {
  background: #004c69;
  color: #dfe8dd;
  margin-top: 40px;
}

.bb-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12.5px;
}

.bb-footer p { margin: 0; }

.bb-footer__list {
  list-style: none;
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0;
}

.bb-footer__list a {
  color: #dfe8dd;
  text-decoration: none;
}

.bb-footer__list a:hover { text-decoration: underline; }

.bb-main { min-height: 40vh; }

@media (max-width: 640px) {
  .bb-header__inner { padding: 12px 16px; }
  .bb-nav__list, .bb-nav .menu { gap: 14px; }
}

/* Divi-Linkfarben im Header ueberschreiben */
.bb-header .bb-brand,
.bb-header .bb-brand:hover,
.bb-header a.bb-brand { color: #004c69 !important; text-decoration: none !important; }
.bb-header .bb-brand__name { color: #004c69 !important; }
.bb-header .bb-brand__claim { color: #5a6a72 !important; }
.bb-header .bb-nav__list a,
.bb-header .menu a { color: #26343a !important; }

/* Logo im Header */
.bb-header .bb-brand { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.bb-header .bb-brand__logo { width: 44px; height: auto; display: block; flex: 0 0 auto; }
.bb-header .bb-brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.bb-header .bb-brand__logo + .bb-brand__text { margin-top: 2px; }

.bb-footer__widgets { flex: 1 1 100%; }
.bb-footer__title {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #a9c4b4;
  margin: 0 0 8px;
}
.bb-footer__widget { font-size: 13px; line-height: 1.6; }
.bb-footer__widget a { color: #e8f0e6; }

/* Grundfläche der Seite (außerhalb der Wrapper) */
body { background: #f4f4f4; }
.bb-page .bb-date, .bb-card .bb-date, p.bb-date { color: #2b7fa6 !important; }
