/* ==========================================================
   Modul „Predigtbriefe“ – Paul-Gerhardt-Gemeinde Braunschweig
   Alles gilt nur innerhalb von .pb (dem Modul) – das Template bleibt unberührt.
   Farben ändern: gleich unten bei .pb { --green … }
   ========================================================== */

/* ==========================================================
   Farben und Schriften – hier an EINER Stelle ändern
   ========================================================== */

.pb {
  --paper: #f6f3ec;
  --paper-dark: #ece7da;
  --card-light: #efe9dc;
  --green: #24483d;
  --green-dark: #17362e;
  --gold: #ad925b;
  /* Schmuck: Linien, Zweig */
  --gold-text: #86693a;
  /* Gold für Schrift – gut lesbar */
  --gold-button: #8a6d33;
  /* Knopf „Predigt lesen“ */
  --gold-button-hover: #735a29;
  --ink: #292f2a;
  --muted: #66685f;
  --line: #dfdbd0;
  --white: #fffefa;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
  --radius: 6px;
}

.pb * {
  box-sizing: border-box;
}

.pb {
  container: pb / inline-size;
  margin: 0 0 24px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  text-align: start;
}

/* Schutz vor Template-Stilen: Überschriften, Listen, Knöpfe, Bilder neutral setzen */
.pb h1,
.pb h2,
.pb h3,
.pb p,
.pb ol,
.pb ul,
.pb figure {
  margin: 0;
  padding: 0;
  color: inherit;
  letter-spacing: normal;
  text-transform: none;
  text-shadow: none;
}

.pb p {
  font-size: inherit;
  line-height: inherit;
}

.pb section,
.pb article,
.pb form,
.pb label {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-weight: inherit;
}

.pb time { color: inherit; font-style: inherit; }

.pb ol,
.pb ul { list-style: none; }

.pb li { margin: 0; padding: 0; }

.pb li::before,
.pb li::marker { content: none; }

.pb button,
.pb input {
  margin: 0;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1.3;
  box-shadow: none;
}

.pb img,
.pb svg { max-width: none; }

.pb img { display: block; }

.pb audio { display: block; width: 100%; height: 36px; margin: 0; border: 0; }

.pb a {
  color: inherit;
  text-decoration: none;
}

.pb button,
.pb input {
  font: inherit;
  color: inherit;
}

.pb button {
  cursor: pointer;
}

.pb button,
.pb a,
.pb input {
  -webkit-tap-highlight-color: transparent;
}

.pb button:focus-visible,
.pb a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.pb h1,
.pb h2,
.pb h3,
.pb p {
  margin-top: 0;
}

.pb h1,
.pb h2,
.pb h3 {
  color: inherit;                 /* Template-Farben für Überschriften nicht übernehmen */
  font-family: var(--serif);
  font-weight: normal;
  line-height: inherit;           /* wie im Entwurf: 1.6 vom Modul, sonst eigene Werte unten */
}

.pb a:hover {
  text-decoration: none;
}

/* Symbol-Sammlung (unsichtbar) */
.pb .pb-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.pb [hidden] {
  display: none !important;
}

/* Symbole (SVG) */

.pb .pb-icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pb[dir="rtl"] .pb-flip {
  transform: scaleX(-1);
}

/* ==========================================================
   Großes Kopfbild mit Überschrift und Suche
   ========================================================== */

.pb .pb-hero {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: var(--paper);
}

/* Bild rechts – es läuft nach links weich in den Hintergrund aus */

.pb .pb-hero-media {
  position: absolute;
  inset: 0 0 0 auto;
  width: 54%;
  background: var(--pb-kopfbild) 70% 22% / cover no-repeat var(--paper-dark);
}

.pb .pb-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    var(--paper) 0%,
    rgba(246,243,236,.82) 10%,
    rgba(246,243,236,.3) 22%,
    rgba(246,243,236,0) 34%);
}

.pb .pb-hero-inner {
  position: relative;
  z-index: 1;
  min-height: 480px;
  display: flex;
  align-items: center;
  padding: 48px 48px 52px;
}

.pb .pb-hero-copy {
  min-width: 0;
  max-width: 760px;
}

.pb h1 em {
  font-style: italic;
  color: inherit;
}

.pb h1 {
  margin-bottom: 20px;
  color: var(--green);
  font-size: clamp(34px, 3.4vw, 50px);
  line-height: 1.13;
  letter-spacing: -1px;
}

.pb .pb-hero-copy > p {
  max-width: 520px;
  margin-bottom: 28px;
  color: #3d433e;
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 1.7;
}

/* Suche: Eingabefeld und Knopf getrennt, wie im Entwurf */

.pb .pb-search {
  display: flex;
  gap: 10px;
  max-width: 600px;
}

.pb .pb-search-field {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 52px;
  border: 1px solid #d3d0c6;
  border-radius: var(--radius);
  background: rgba(255,254,250,.96);
  cursor: text;
}

.pb .pb-search-field:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(173,146,91,.35);
}

.pb .pb-search-field .pb-icon {
  margin-inline: 16px 8px;
  color: var(--green);
  font-size: 20px;
}

.pb .pb-search-field input {
  flex: 1;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  padding-block: 12px;
  padding-inline: 0 14px;
  font-size: 15px;
}

.pb .pb-search button {
  flex-shrink: 0;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: var(--radius);
  background: var(--green);
  color: #fff;
  font-size: 15px;
  font-weight: bold;
}

.pb .pb-search button:hover {
  background: var(--green-dark);
}

/* ==========================================================
   Hauptbereich
   ========================================================== */

.pb .pb-body {
  padding-block: 34px 8px;
}

/* Zwei Zugänge: Kirchenjahr und Bibel */

.pb .pb-access {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  margin-bottom: 46px;
}

.pb .pb-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  min-height: 168px;
  padding: 28px 30px;
  overflow: hidden;
  border-radius: var(--radius);
  transition: transform .2s ease, box-shadow .2s ease;
}

.pb .pb-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(23,54,46,.12);
}

.pb .pb-card > div {
  position: relative;
  z-index: 1;
}

.pb .pb-card.dark {
  background:
    radial-gradient(ellipse at 92% 8%, #4f7062 0%, transparent 55%),
    var(--green);
  color: #fff;
}

/* Bibelfoto nur rechts – helle Seiten, nach links weich ausgeblendet */

.pb .pb-card.light {
  background:
    linear-gradient(90deg,
      var(--card-light) 40%,
      rgba(239,233,220,.8) 56%,
      rgba(239,233,220,0) 90%),
    var(--pb-bibelbild) 46% 50% / 175% auto no-repeat,
    var(--card-light);
  color: var(--green);
}

.pb .pb-card-icon {
  position: relative;
  z-index: 1;
  margin-top: 2px;
  font-size: 42px;
  stroke-width: 1.25;
}

.pb .pb-card.light .pb-card-icon {
  color: var(--gold-text);
}

.pb .pb-card h2 {
  margin-bottom: 8px;
  font-size: 25px;
  line-height: 1.25;
}

.pb .pb-card p {
  max-width: 300px;
  margin-bottom: 0;
  font-size: 14.5px;
  line-height: 1.6;
}

.pb .pb-card.dark p {
  color: rgba(255,255,255,.86);
}

.pb .pb-card.light p {
  color: var(--ink);
}

.pb .pb-card-arrow {
  position: absolute;
  z-index: 1;
  right: 24px;
  bottom: 20px;
  font-size: 22px;
}

/* goldener Kirchturm mit Uhr als Schmuck in der grünen Karte – wie im Entwurf */

.pb .pb-ornament {
  position: absolute;
  top: 10px;
  right: 34px;
  width: 196px;
  height: auto;
  color: var(--gold);
  opacity: .6;
  pointer-events: none;
}

/* Aktuelle Predigt */

.pb .pb-featured {
  display: grid;
  grid-template-columns: minmax(240px, 430px) 1fr;
  gap: 56px;
  align-items: center;
  padding-bottom: 46px;
  border-bottom: 1px solid var(--line);
}

/* Bild zur Kirchenjahreszeit – zum Wechseln einfach die Datei
   images/aktuelle-predigt.jpg durch ein anderes Foto ersetzen */

.pb .pb-featured-image {
  aspect-ratio: 8 / 7;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper-dark);
}

.pb .pb-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pb .pb-eyebrow {
  color: var(--gold-text);
  font-size: 14px;
  font-weight: bold;
}

.pb .pb-featured h2 {
  margin: 6px 0;
  color: var(--green);
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1.2;
}

.pb .pb-occasion {
  margin-bottom: 14px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 16px;
}

.pb .pb-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 14.5px;
}

.pb .pb-meta li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pb .pb-meta li + li {
  padding-inline-start: 18px;
  border-inline-start: 1px solid var(--line);
}

.pb .pb-meta .pb-icon {
  color: var(--gold-text);
  font-size: 18px;
}

.pb .pb-featured-text {
  max-width: 560px;
  margin-bottom: 24px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.75;
}

.pb .pb-button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: var(--radius);
  background: var(--gold-button);
  color: #fff;
  font-size: 15px;
  font-weight: bold;
}

.pb .pb-button:hover {
  background: var(--gold-button-hover);
}

.pb .pb-button .pb-icon {
  font-size: 18px;
  transition: transform .2s ease;
}

.pb .pb-button:hover .pb-icon {
  transform: translateX(3px);
}

.pb[dir="rtl"] .pb-button:hover .pb-icon {
  transform: scaleX(-1) translateX(3px);
}

/* ==========================================================
   Aufklappbereiche: Kirchenjahr-Kästen und Bibelbücher
   ========================================================== */

.pb .pb-card-arrow {
  transition: transform .2s ease;
}

.pb .pb-card[aria-expanded="true"] {
  box-shadow: 0 0 0 3px var(--gold);
}

.pb .pb-card[aria-expanded="true"] .pb-card-arrow {
  transform: rotate(90deg);
}

.pb[dir="rtl"] .pb-card[aria-expanded="true"] .pb-card-arrow {
  transform: scaleX(-1) rotate(90deg);
}

.pb .pb-panel {
  margin: -24px 0 46px;
  padding: 24px 28px 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,254,250,.55);
}

.pb .pb-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.pb .pb-panel-head h2 {
  margin: 0;
  color: var(--green);
  font-size: 24px;
}

.pb .pb-panel-close,
.pb .pb-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 14px;
}

.pb .pb-panel-close {
  color: var(--muted);
}

.pb .pb-reset {
  color: var(--green);
  font-weight: bold;
}

.pb .pb-panel-close:hover,
.pb .pb-reset:hover {
  border-color: var(--green);
  color: var(--green);
}

.pb .pb-panel-close .pb-icon,
.pb .pb-reset .pb-icon {
  font-size: 15px;
}

/* Kästen der Kirchenjahreszeiten – der farbige Strich zeigt die Kirchenfarbe */

.pb .pb-seasons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pb .pb-season {
  --season-color: var(--green);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 76px;
  padding: 14px 18px 14px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: inset 4px 0 0 var(--season-color);
  text-align: start;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.pb .pb-season:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: inset 4px 0 0 var(--season-color), 0 6px 16px rgba(23,54,46,.08);
}

.pb .pb-season[aria-pressed="true"] {
  border-color: var(--green);
  background: #f1f5f1;
}

.pb .pb-season:disabled {
  cursor: default;
  opacity: .6;
  transform: none;
}

.pb .pb-season-text {
  min-width: 0;
}

.pb .pb-season-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: var(--green);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.3;
}

.pb .pb-season-span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.4;
}

.pb .pb-season-now {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: .3px;
}

.pb .pb-season-badge {
  flex-shrink: 0;
  padding: 5px 12px;
  border: 1px solid #e3cf98;
  border-radius: 999px;
  background: #f8efd6;
  color: #7a5f2c;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
}

.pb .pb-season-badge.is-empty {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: normal;
}

.pb[dir="rtl"] .pb-season {
  padding: 14px 24px 14px 18px;
  box-shadow: inset -4px 0 0 var(--season-color);
}

.pb[dir="rtl"] .pb-season:hover {
  box-shadow: inset -4px 0 0 var(--season-color), 0 6px 16px rgba(23,54,46,.08);
}

/* Kleine Kästchen mit allen Büchern der Bibel */

.pb .pb-panel-hint {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.pb .pb-books-title {
  margin: 22px 0 10px;
  color: var(--green);
  font-size: 19px;
}

.pb .pb-panel-hint + .pb-books-title {
  margin-top: 0;
}

.pb .pb-books {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pb .pb-book {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--green);
  font-size: 14px;
  font-weight: bold;
  transition: border-color .15s ease;
}

.pb .pb-book:hover {
  border-color: var(--gold);
}

.pb .pb-book[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.pb .pb-book:disabled {
  border-style: dashed;
  background: transparent;
  color: var(--muted);
  font-weight: normal;
  cursor: default;
}

.pb .pb-book-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f8efd6;
  color: #7a5f2c;
  font-size: 12px;
  text-align: center;
}

.pb .pb-book[aria-pressed="true"] .pb-book-count {
  background: rgba(255,255,255,.2);
  color: #fff;
}

/* Überschrift der Liste mit Anzahl und „Auswahl aufheben“ */

.pb .pb-heading-text {
  min-width: 0;
}

.pb .pb-list-info {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14.5px;
}

@container pb (max-width: 720px) {
  .pb .pb-seasons {
    grid-template-columns: 1fr;
  }
}

@container pb (max-width: 560px) {
  .pb .pb-panel {
    margin: -20px 0 34px;
    padding: 18px 14px 22px;
  }

  .pb .pb-panel-head h2 {
    font-size: 21px;
  }

  .pb .pb-panel-close {
    padding: 0 12px;
  }

  .pb .pb-season {
    min-height: 0;
    padding: 12px 14px 12px 20px;
  }

  .pb[dir="rtl"] .pb-season {
    padding: 12px 20px 12px 14px;
  }

  .pb .pb-season-name {
    font-size: 18px;
  }

  .pb .pb-book {
    font-size: 13.5px;
  }

  .pb .pb-heading {
    align-items: flex-start;
  }
}

/* Neueste Predigten */

.pb .pb-latest {
  padding-top: 42px;
}

/* bei einer Auswahl genug Platz, damit die Liste ganz nach oben rutschen kann */

.pb .pb-latest.is-filtered {
  min-height: 85vh;
}

.pb .pb-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.pb .pb-heading h2 {
  margin-bottom: 0;
  color: var(--green);
  font-size: 30px;
}

.pb .pb-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-text);
  font-size: 15px;
  font-weight: bold;
}

.pb .pb-link:hover {
  text-decoration: underline;
}

/* ==========================================================
   Predigtbriefe – jede Predigt steckt in einem Umschlag.
   Klick: Siegel bricht, Klappe geht auf, der Brief kommt heraus
   und legt sich vor den Umschlag.
   Idee: „Envelope“ von darvil82 auf CodePen (MIT) – eigene Umsetzung.
   ========================================================== */

.pb .pb-letters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 34px 26px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.pb .brief {
  --flap-h: 104px;
  --season-color: var(--green);
  position: relative;
  z-index: 0;
  min-height: 324px;
  perspective: 1400px;
  transition: transform .25s ease;
}

/* während der Bewegung über den Nachbarbriefen */

.pb .brief.is-active {
  z-index: 5;
}

/* weicher Schatten unter dem Umschlag */

.pb .brief::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(41,47,42,.06), 0 12px 28px rgba(41,47,42,.09);
}

/* Innenseite – sieht man nur, wenn der Brief herauskommt */

.pb .brief-innen,
.pb .brief-tasche {
  position: absolute;
  inset: 0;
  border-radius: 12px;
}

.pb .brief-innen {
  z-index: 1;
  background: #eadcb6;
  box-shadow: inset 0 0 28px rgba(90,70,30,.22);
}

/* Vorderseite mit V-Ausschnitt oben – wie bei einem echten Umschlag */

.pb .brief-tasche {
  z-index: 3;
  border: 1px solid #ead9ad;
  background:
    radial-gradient(120% 80% at 50% 100%, rgba(255,255,255,.75), transparent 60%),
    #fffaf0;
  clip-path: polygon(0 0, 50% calc(var(--flap-h) * .62), 100% 0, 100% 100%, 0 100%);
}

/* Die ganze Vorderseite ist der Knopf „Brief öffnen“ */

.pb .brief-vorne {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: calc(var(--flap-h) + 16px) 22px 18px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  text-align: start;
}

.pb .brief-vorne:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
  border-radius: 12px;
}

.pb .brief-zeile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.pb .brief-label {
  padding: 3px 9px;
  border: 1px solid #ecd9a4;
  border-radius: 6px;
  background: #fbf0cf;
  color: #7a5f2c;
  font-size: 11.5px;
  font-weight: bold;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.pb .brief-datum {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: bold;
}

.pb .brief-titel {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  color: #8a6416;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: bold;
  line-height: 1.3;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pb .brief-zweit {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pb .brief-zweit[lang="fa"] {
  font-family: Tahoma, var(--sans);
}

.pb .brief-fuss {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #efe3c4;
}

.pb .brief-stelle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 10px;
  border: 1px solid #e6dcc4;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
}

.pb .brief-stelle .pb-icon,
.pb .brief-meta .pb-icon {
  color: var(--gold-text);
  font-size: 15px;
}

.pb .brief-oeffnen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold-text);
  font-size: 14px;
  font-weight: bold;
  white-space: nowrap;
}

.pb .brief-oeffnen .pb-icon {
  font-size: 16px;
  transition: transform .2s ease;
}

.pb .brief-vorne:hover .brief-oeffnen .pb-icon {
  transform: translateX(3px);
}

.pb[dir="rtl"] .brief-vorne:hover .brief-oeffnen .pb-icon {
  transform: scaleX(-1) translateX(3px);
}

/* Klappe mit Siegel – dreht sich beim Öffnen nach oben */

.pb .brief-klappe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  height: var(--flap-h);
  transform-origin: top center;
  transition: transform .4s cubic-bezier(.3,.7,.4,1);
  pointer-events: none;
}

.pb .brief-klappe-form,
.pb .brief-klappe-form::after {
  position: absolute;
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 50% 100%);
}

.pb .brief-klappe-form {
  inset: 0;
  background: #d6be86;
  /* goldene Kante */;
}

.pb .brief-klappe-form::after {
  content: "";
  inset: 0 2px 2.5px;
  background: linear-gradient(180deg, #f7eed6, #ecdcb1);
}

.pb .brief-siegel {
  position: absolute;
  top: calc(100% - 24px);
  left: 50%;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #dcbf72, #a07f3d 58%, #74582a);
  box-shadow: 0 2px 5px rgba(60,40,10,.35), inset 0 0 0 3px rgba(255,255,255,.18), inset 0 -2px 4px rgba(0,0,0,.25);
  color: #fff6dc;
  font-size: 18px;
}

/* Briefmarke in der Kirchenfarbe und Poststempel */

.pb .brief-marke {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 6;
  width: 48px;
  height: 56px;
  padding: 4px;
  background: radial-gradient(circle at 4px 4px, transparent 2.2px, #fffdf6 2.5px) -4px -4px / 8px 8px;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.14));
  transform: rotate(4deg);
  pointer-events: none;
}

.pb .brief-marke-bild {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: var(--season-color);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.55);
  color: rgba(255,255,255,.92);
  font-size: 22px;
}

.pb .brief-stempel {
  position: absolute;
  top: 20px;
  right: 40px;
  z-index: 6;
  width: 72px;
  height: 72px;
  color: rgba(134,105,58,.78);
  transform: rotate(-12deg);
  pointer-events: none;
}

/* Der Brief selbst */

.pb .brief-papier {
  position: absolute;
  inset: 10px 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px 14px;
  overflow: hidden;
  border-top: 4px solid var(--season-color);
  border-radius: 8px;
  background: #fffefb;
  box-shadow: 0 1px 3px rgba(41,47,42,.12);
}

.pb .brief-kopf {
  margin: 0;
  padding-inline-end: 40px;
  color: color-mix(in srgb, var(--season-color) 48%, #1d1a12);
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.pb .brief-papier-titel {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--green);
  font-size: 22px;
  line-height: 1.25;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pb .brief-papier-titel:focus {
  outline: none;
}

.pb .brief-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.pb .brief-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pb .brief-text {
  display: -webkit-box;
  margin: 2px 0 0;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.6;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pb .brief-papier .brief-zweit {
  margin: -4px 0 0;
}

/* kleine Zierlinie mit Kreuz über der Unterschrift */

/* Unterschrift und Knöpfe stehen immer unten im Brief */

.pb .brief-schluss {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

/* Überschriften im Brief nie zusammendrücken – nur der Kurztext darf kürzer werden */

.pb .brief-papier > * {
  flex-shrink: 0;
}

.pb .brief-papier > .brief-text {
  flex-shrink: 1;
  min-height: 0;
}

.pb .brief-zier {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--gold);
  font-size: 14px;
}

.pb .brief-zier::before,
.pb .brief-zier::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e3d3a8);
}

.pb .brief-zier::after {
  background: linear-gradient(90deg, #e3d3a8, transparent);
}

.pb .brief-gruss {
  margin: 0;
  color: var(--gold-text);
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
}

.pb .brief-aktionen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pb .brief-lesen,
.pb .brief-teilen {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
}

.pb .brief-lesen {
  background: var(--gold-button);
  color: #fff;
}

.pb .brief-lesen:hover {
  background: var(--gold-button-hover);
}

.pb .brief-teilen {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green);
}

.pb .brief-teilen:hover {
  border-color: var(--green);
}

.pb .brief-lesen .pb-icon,
.pb .brief-teilen .pb-icon {
  font-size: 16px;
}

.pb .brief-zu {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}

.pb .brief-zu:hover {
  background: #f3efe4;
  color: var(--green);
}

/* ----- Zustände: offen, öffnet sich, schließt sich ----- */

.pb .brief.is-open .brief-papier {
  z-index: 8;
  transform: translateY(0) rotate(-.8deg);
  box-shadow: 0 16px 34px rgba(41,47,42,.2);
}

.pb .brief.is-open .brief-klappe {
  z-index: 1;
  opacity: 0;
  transform: rotateX(-180deg);
}

.pb .brief.is-opening .brief-papier {
  animation: brief-heraus 1.1s cubic-bezier(.45,.05,.3,1) both;
}

.pb .brief.is-opening .brief-klappe {
  animation: klappe-auf 1.1s ease both;
}

.pb .brief.is-opening .brief-siegel,
.pb .brief.is-open .brief-siegel {
  animation: siegel-weg .3s ease both;
}

.pb .brief.is-closing .brief-papier {
  animation: brief-hinein .9s cubic-bezier(.45,.05,.3,1) both;
}

.pb .brief.is-closing .brief-klappe {
  animation: klappe-zu .9s ease both;
}

.pb .brief.is-closing .brief-siegel {
  animation: siegel-zurueck .9s ease both;
}

@keyframes brief-heraus {
  0%, 30% { transform: translateY(0) rotate(0); z-index: 2; box-shadow: 0 1px 3px rgba(41,47,42,.12); }
  60%     { transform: translateY(-60%) rotate(0); z-index: 2; }
  61%     { transform: translateY(-60%) rotate(0); z-index: 8; }
  100%    { transform: translateY(0) rotate(-.8deg); z-index: 8; box-shadow: 0 16px 34px rgba(41,47,42,.2); }
}

@keyframes brief-hinein {
  0%       { transform: translateY(0) rotate(-.8deg); z-index: 8; }
  40%      { transform: translateY(-60%) rotate(0); z-index: 8; }
  41%      { transform: translateY(-60%) rotate(0); z-index: 2; }
  75%, 100% { transform: translateY(0) rotate(0); z-index: 2; }
}

@keyframes klappe-auf {
  0%   { transform: rotateX(0); z-index: 5; opacity: 1; filter: none; }
  18%  { z-index: 5; }
  19%  { z-index: 1; }
  32%  { transform: rotateX(-180deg); filter: brightness(.92); }
  80%  { transform: rotateX(-180deg); opacity: 1; z-index: 1; }
  100% { transform: rotateX(-180deg); opacity: 0; z-index: 1; filter: brightness(.92); }
}

@keyframes klappe-zu {
  0%   { transform: rotateX(-180deg); opacity: 0; z-index: 1; filter: brightness(.92); }
  30%  { opacity: 1; }
  75%  { transform: rotateX(-180deg); z-index: 1; }
  87%  { z-index: 1; }
  88%  { z-index: 5; }
  100% { transform: rotateX(0); opacity: 1; z-index: 5; filter: none; }
}

@keyframes siegel-weg {
  to { opacity: 0; transform: scale(.5) rotate(-20deg); }
}

@keyframes siegel-zurueck {
  0%, 80% { opacity: 0; transform: scale(.5) rotate(-20deg); }
  100%    { opacity: 1; transform: none; }
}

/* Maus darüber: Umschlag hebt sich, Klappe lupft ein wenig */

@media (hover: hover) {
  .pb .brief:not(.is-open):not(.is-opening):not(.is-closing):hover {
    transform: translateY(-4px);
  }

  .pb .brief:not(.is-open):not(.is-opening):not(.is-closing):hover .brief-klappe {
    transform: rotateX(-24deg);
  }
}

/* Persisch: gespiegelt */

.pb[dir="rtl"] .brief-marke {
  right: auto;
  left: 16px;
  transform: rotate(-4deg);
}

.pb[dir="rtl"] .brief-stempel {
  right: auto;
  left: 40px;
  transform: rotate(12deg);
}

.pb[dir="rtl"] .brief-zu {
  right: auto;
  left: 6px;
}

.pb[dir="rtl"] .brief-kopf {
  letter-spacing: 0;
}

.pb[dir="rtl"] .brief-label {
  letter-spacing: 0;
}

/* Kleine Bildschirme */

@container pb (max-width: 560px) {
  .pb .pb-letters {
    gap: 26px;
  }

  .pb .brief {
    --flap-h: 92px;
    min-height: 306px;
  }

  .pb .brief-vorne {
    padding: calc(var(--flap-h) + 14px) 18px 16px;
  }

  .pb .brief-titel {
    font-size: 19px;
  }

  .pb .brief-papier {
    padding: 14px 16px;
  }

  .pb .brief-papier-titel {
    font-size: 20px;
  }
}

/* Schmale Briefe (richtet sich nach der Breite des Briefs, nicht des Bildschirms) */

.pb .brief {
  container: brief / inline-size;
}

@container brief (max-width: 380px) {
  .pb .brief-papier {
    gap: 6px;
    padding: 14px 16px;
  }

  .pb .brief-papier-titel {
    font-size: 20px;
  }

  .pb .brief-meta {
    column-gap: 12px;
    font-size: 13px;
  }

  .pb .brief-zier {
    display: none;
  }

  .pb .brief-teilen {
    padding: 0 11px;
  }

  .pb .teilen-text {
    /* nur das Symbol zeigen – Vorlesen klappt weiter */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@container brief (max-width: 320px) {
  .pb .brief-papier > .brief-text {
    display: none;
  }
}

/* Wer „Bewegung reduzieren“ eingestellt hat, bekommt den Brief ohne Animation */

@media (prefers-reduced-motion: reduce) {
  .pb .brief,
  .pb .brief * {
    animation: none !important;
  }
}

/* kurze Rückmeldung, z. B. „Link kopiert“ */


.pb .pb-empty {
  padding: 24px 0;
  color: var(--muted);
}

/* ==========================================================
   Persisch (von rechts nach links)
   ========================================================== */

.pb[dir="rtl"] {
  font-family: Tahoma, var(--sans);
}

.pb[dir="rtl"] .pb-hero-media {
  inset: 0 auto 0 0;
}

.pb[dir="rtl"] .pb-hero-media::after {
  background: linear-gradient(270deg,
    var(--paper) 0%,
    rgba(246,243,236,.82) 10%,
    rgba(246,243,236,.3) 22%,
    rgba(246,243,236,0) 34%);
}

.pb[dir="rtl"] .pb-card.light {
  background:
    linear-gradient(270deg,
      var(--card-light) 40%,
      rgba(239,233,220,.8) 56%,
      rgba(239,233,220,0) 90%),
    var(--pb-bibelbild) 46% 50% / 175% auto no-repeat,
    var(--card-light);
}

.pb[dir="rtl"] .pb-card-arrow {
  right: auto;
  left: 24px;
}

/* Turm gespiegelt: das Kirchendach zeigt zum Text */

.pb[dir="rtl"] .pb-ornament {
  right: auto;
  left: 34px;
  transform: scaleX(-1);
}

/* ==========================================================
   Kleinere Bildschirme
   ========================================================== */

@container pb (max-width: 1060px) {
  /* Text und Bild teilen sich die Breite, damit sich nichts überlappt */

  .pb .pb-hero-copy {
    max-width: 48%;
  }

  .pb .pb-hero-media {
    width: 52%;
    background-position: 75% 22%;
  }

  /* Kirchturm etwas kleiner, damit er den Text nicht berührt */

  .pb .pb-ornament {
    right: 40px;
    width: 160px;
  }

  .pb[dir="rtl"] .pb-ornament {
    left: 40px;
  }

  .pb .pb-card.dark > div {
    padding-inline-end: 90px;
  }

  .pb .pb-card.dark p {
    max-width: 240px;
  }
}

@container pb (max-width: 960px) {
  /* Kirchturm klein oben in der Ecke, ohne Bögen und Dach */

  .pb .pb-ornament {
    top: 4px;
    right: 4px;
    width: 112px;
    opacity: .45;
  }

  .pb[dir="rtl"] .pb-ornament {
    right: auto;
    left: 4px;
  }

  .pb .pb-ornament-extra {
    display: none;
  }

  .pb .pb-card.dark > div {
    padding-inline-end: 56px;
  }

  .pb .pb-card.dark p {
    max-width: none;
  }
}

@container pb (max-width: 820px) {
  /* die beiden Karten untereinander statt nebeneinander */

  .pb .pb-access {
    grid-template-columns: 1fr;
  }

  /* Bild oben, Text darunter – so bleibt die Schrift gut lesbar */

  .pb .pb-hero-media,
  .pb[dir="rtl"] .pb-hero-media {
    position: relative;
    inset: auto;
    width: 100%;
    height: 260px;
    background-position: 62% 22%;
  }

  .pb .pb-hero-media::after,
  .pb[dir="rtl"] .pb-hero-media::after {
    background: linear-gradient(180deg, rgba(246,243,236,0) 55%, var(--paper) 100%);
  }

  .pb .pb-hero-inner {
    min-height: 0;
    padding: 6px 28px 36px;
  }

  .pb .pb-hero-copy {
    max-width: 640px;
  }

  .pb .pb-featured {
    grid-template-columns: minmax(200px, 320px) 1fr;
    gap: 32px;
  }
}

/* Tablet hochkant: Karten sind wieder breit – Kirchturm wieder groß */

@container pb (min-width: 561px) and (max-width: 820px) {
  .pb .pb-ornament {
    top: 10px;
    right: 34px;
    width: 196px;
    opacity: .6;
  }

  .pb[dir="rtl"] .pb-ornament {
    left: 34px;
  }

  .pb .pb-ornament-extra {
    display: inline;
  }

  .pb .pb-card.dark p {
    max-width: 300px;
  }
}

@container pb (max-width: 560px) {
  /* am Handy nur die jeweils andere Sprache zeigen */

  /* die Suche steht direkt darunter – Lupe oben nicht nötig */

  .pb .pb-hero-media,
  .pb[dir="rtl"] .pb-hero-media {
    height: 210px;
  }

  .pb h1 {
    font-size: 34px;
    letter-spacing: -.6px;
  }

  .pb .pb-hero-copy > p {
    font-size: 16px;
  }

  .pb .pb-search button {
    padding: 0 18px;
  }

  .pb .pb-body {
    padding-block: 24px 8px;
  }

  .pb .pb-hero-inner { padding-inline: 18px; }

  .pb .pb-access {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 34px;
  }

  .pb .pb-card {
    min-height: 0;
    gap: 16px;
    padding: 22px 20px 46px;
  }

  .pb .pb-card-icon {
    font-size: 36px;
  }

  .pb .pb-card h2 {
    font-size: 22px;
  }

  /* Turm am Handy oben rechts – der Text macht etwas Platz */

  .pb .pb-card.dark > div {
    padding-inline-end: 40px;
  }

  /* Bibelfoto am Handy etwas stärker abdecken, damit der Text gut lesbar bleibt */

  .pb .pb-card.light {
    background:
      linear-gradient(90deg,
        var(--card-light) 45%,
        rgba(239,233,220,.85) 62%,
        rgba(239,233,220,0) 100%),
      var(--pb-bibelbild) 46% 50% / 175% auto no-repeat,
      var(--card-light);
  }

  .pb[dir="rtl"] .pb-card.light {
    background:
      linear-gradient(270deg,
        var(--card-light) 45%,
        rgba(239,233,220,.85) 62%,
        rgba(239,233,220,0) 100%),
      var(--pb-bibelbild) 46% 50% / 175% auto no-repeat,
      var(--card-light);
  }

  .pb .pb-featured {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-bottom: 36px;
  }

  .pb .pb-featured-image {
    aspect-ratio: 4 / 3;
  }

  .pb .pb-featured h2 {
    font-size: 30px;
  }

  .pb .pb-featured-text {
    font-size: 16px;
  }

  .pb .pb-latest {
    padding-top: 32px;
  }

  .pb .pb-heading {
    flex-wrap: wrap;
  }

  .pb .pb-heading h2 {
    font-size: 26px;
  }
}

/* sehr kleine Handys */

@container pb (max-width: 320px) {
  .pb .pb-search button {
    padding: 0 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pb *,
  .pb *::before,
  .pb *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}


/* ==========================================================
   Ergänzungen für Joomla
   ========================================================== */

/* Sprachumschalter oben im Kopfbereich */
.pb .pb-lang {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 14px;
}

.pb .pb-lang-button {
  min-height: 36px;
  padding: 4px 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.pb .pb-lang-button[lang="fa"] { font-family: Tahoma, var(--sans); }

.pb .pb-lang-button[aria-pressed="true"] {
  color: var(--green);
  font-weight: bold;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.pb .pb-lang-divider { color: #b5b1a6; }

/* Aktuelle Predigt: Prediger, Audio, zweiter Knopf */
.pb .pb-featured-preacher {
  margin: -6px 0 16px;
  color: var(--gold-text);
  font-family: var(--serif);
  font-style: italic;
}

.pb .pb-featured-audio { max-width: 520px; margin: 0 0 18px; }

.pb .pb-featured-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pb .pb-button-light {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--green);
  font-size: 15px;
  font-weight: bold;
}

.pb .pb-button-light:hover { border-color: var(--green); }

/* Hinweis „auch auf Persisch“ auf dem Umschlag */
.pb .brief-fa {
  align-self: flex-start;
  padding: 1px 9px;
  border-radius: 999px;
  background: #f6efe0;
  color: #7a5f2c;
  font-family: Tahoma, var(--sans);
  font-size: 12.5px;
}

.pb[dir="rtl"] .brief-fa { font-family: Tahoma, var(--sans); }

/* Brief: Anhören und zweite Sprache */
.pb .brief-audio { margin: 2px 0 0; }

.pb .brief-pdf2 {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--green);
  font-family: Tahoma, var(--sans);
  font-size: 13.5px;
  font-weight: bold;
}

.pb .brief-pdf2:hover { border-color: var(--green); }

/* Ohne JavaScript: einfache Liste (auch für Suchmaschinen) */
.pb .pb-noscript {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.pb .pb-noscript a {
  color: var(--green);
  text-decoration: underline;
}

/* Text nur für Vorleseprogramme */
.pb .pb-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Kurzmeldung (hängt am Ende der Seite, außerhalb des Moduls) */
.pb-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 2000;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: #17362e;
  color: #fff;
  font: 14px/1.4 Arial, Helvetica, sans-serif;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  transform: translateX(-50%);
}

.pb-toast[hidden] { display: none; }

/* Briefe mit Tonaufnahme sind etwas höher (Platz für den Abspieler) */
.pb .brief.hat-audio { min-height: 352px; }

@container pb (max-width: 560px) {
  .pb .brief.hat-audio { min-height: 334px; }
}

/* „Weitere Predigten zeigen“ unter der Liste */
.pb .pb-more-wrap {
  display: flex;
  justify-content: center;
}

.pb .pb-more {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  margin-top: 30px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--green);
  font-size: 15px;
  font-weight: bold;
}

.pb .pb-more:hover { border-color: var(--green); }

/* Beim Springen zur Liste nicht unter einem festen Seitenkopf verschwinden */
.pb .pb-latest,
.pb .pb-panel {
  scroll-margin-top: var(--pb-abstand-oben, 96px);
}
