:root{
  --bg: #f3f4f6;
  --text: #1f2a37;
  --muted: #6b7280;

  --gold1: #fde68a;
  --gold2: #f59e0b;
  --gold3: #b45309;

  --green: #166534;
  --red: #b91c1c;

  --wood1: #6b3f1d;
  --wood2: #4a2a14;

  --paper1: #fff3d3;
  --paper2: #e8d2a6;

  --radius: 18px;
  --shadow: 0 18px 40px rgba(0,0,0,.18);
  --shadowSoft: 0 10px 24px rgba(0,0,0,.14);
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #fefce8 0, #f3f4f6 55%, #e5e7eb 100%);
  overflow-x:hidden;
}
a{color:inherit;text-decoration:none}

/* ================= HERO ================= */
.hero{
  position:relative;
  height: clamp(280px, 40vh, 420px);
  overflow:hidden;
  border-bottom: 1px solid rgba(0,0,0,.10);
}
.hero__bg{
  position:absolute; inset:0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,.28), rgba(0,0,0,.06)),
    url("../img/hero.png");
  background-size: cover;
  background-position: 50% 42%;
  transform: scale(1.06);
  filter: contrast(1.08) saturate(1.06) brightness(1.02);
}
.hero__inner{
  position:relative;
  height:100%;
  max-width:1100px;
  margin:0 auto;
  padding: 18px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
}
.hero__logo{
  width: min(920px, 94vw);
  height:auto;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,.55));
}

/* ============ SCROLL BAR (Tabs) ============ */
.scroll-bar{
  position:relative;
  background: linear-gradient(to bottom, var(--wood1), var(--wood2));
  border-top: 4px solid #8b5a2b;
  border-bottom: 4px solid #8b5a2b;
  box-shadow: inset 0 8px 14px rgba(0,0,0,.25);
}
.scroll-bar__inner{
  max-width:1100px;
  margin:0 auto;
  padding: 14px 18px;
  display:flex;
  justify-content:center;
  align-items:center;
  width:100%;
  gap: 14px;
}
.scroll-btn{
  appearance:none;
  min-width: 140px;
  text-align:center;
  background: linear-gradient(var(--gold1), var(--gold2));
  border: 2px solid #8b5a2b;
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 900;
  color: #3b1f0f;
  cursor:pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.65),
    0 4px 10px rgba(0,0,0,.28);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.scroll-btn:hover{ transform: translateY(-1px); filter: saturate(1.03); }
.scroll-btn.is-active{
  background: linear-gradient(#fff2c9, #f1b94a);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.8),
    0 7px 16px rgba(0,0,0,.34);
}

/* ================= LAYOUT ================= */
.page{
  max-width:1100px;
  margin: 0 auto;
  padding: 18px 18px 36px;
  display:grid;
  grid-template-columns: 1.65fr .75fr;
  gap: 18px;
  align-items:start;
}
.left{display:flex; flex-direction:column; gap: 14px;}

/* ================= PARCHMENT CARDS ================= */
.parchment-card,
.sidecard{
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.45), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(0,0,0,.04), transparent 55%),
    linear-gradient(to bottom, rgba(255,243,211,.92), rgba(232,210,166,.90));
  border: 1px solid rgba(90,51,22,.22);
  border-radius: var(--radius);
  box-shadow: var(--shadowSoft);
}

/* ================= FILTERS ================= */
.filters{ padding: 12px; }
.filters__row{
  display:grid;
  grid-template-columns: 1.4fr .8fr .8fr;
  gap: 10px;
}
.field{display:flex; flex-direction:column; gap:6px;}
.field label{
  font-size: 12px;
  font-weight: 800;
  color: rgba(59,31,15,.82);
}
.field input, .field select{
  width:100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(90,51,22,.25);
  background: rgba(255,255,255,.86);
  outline:none;
}
.field input:focus, .field select:focus{
  border-color: rgba(180,83,9,.55);
  box-shadow: 0 0 0 2px rgba(245,158,11,.18);
}
.filters__row2{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-top: 10px;
}
.results{
  margin-left:auto;
  color: rgba(59,31,15,.75);
  font-weight: 800;
}
.fav-toggle{
  display:inline-flex;
  gap: 10px;
  align-items:center;
  cursor:pointer;
  user-select:none;
  color: rgba(59,31,15,.92);
  font-weight: 900;
}
.fav-toggle input{ display:none; }
.fav-toggle__box{
  width:18px;height:18px;
  border-radius:5px;
  border:2px solid rgba(59,31,15,.55);
  background: rgba(255,255,255,.85);
}
.fav-toggle.is-on .fav-toggle__box{
  background: rgba(245,158,11,.85);
  border-color: rgba(180,83,9,.85);
}
.mini-btn{
  border: 1px solid rgba(90,51,22,.25);
  background: rgba(255,255,255,.78);
  border-radius: 10px;
  padding: 9px 12px;
  cursor:pointer;
  font-weight: 900;
}

/* ================= PARCHMENT (Programm) ================= */
.parchment{
  background:
    radial-gradient(circle at 15% 25%, rgba(255,255,255,.55), transparent 58%),
    radial-gradient(circle at 75% 65%, rgba(0,0,0,.05), transparent 60%),
    linear-gradient(to bottom, var(--paper1), var(--paper2));
  border: 1px solid rgba(90,51,22,.22);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px 14px;
  position: relative;
}
.parchment::before{
  content:"";
  position:absolute;
  inset: 10px;
  border: 1px solid rgba(90,51,22,.20);
  border-radius: calc(var(--radius) - 6px);
  pointer-events:none;
  opacity: .65;
}
.parchment-title{
  text-align:center;
  font-family: Georgia, "Times New Roman", serif;
  color: #5a3316;
  font-size: 38px;
  letter-spacing: .02em;
  margin: 10px 0 10px;
  position: relative;
}
.parchment-title::before,
.parchment-title::after{
  content:"";
  width: 120px;
  height: 2px;
  background: rgba(180,137,68,.95);
  position:absolute;
  top: 55%;
}
.parchment-title::before{ left: 34px; }
.parchment-title::after{ right: 34px; }

.legend{
  display:flex;
  justify-content:center;
  gap: 14px;
  flex-wrap:wrap;
  color: rgba(59,31,15,.78);
  font-weight: 800;
  margin: 0 0 12px;
}
.legend span{display:inline-flex; align-items:center; gap:8px;}
.dot{width:10px;height:10px;border-radius:999px;display:inline-block;}
.dot--classic{background:var(--green);}
.dot--premiere{background:var(--gold2);}
.dot--late{background:var(--red);}

/* ===== Programmliste (wie vorher) ===== */
.program-list{
  list-style:none;
  display:flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 6px 12px;
}
.program-item{
  display:grid;
  grid-template-columns: 140px 1fr 220px;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(90,51,22,.18);
  box-shadow: 0 10px 22px rgba(0,0,0,.10);
}
.program-time{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 900;
  color: #5a3316;
  white-space: nowrap;
  padding-top: 2px;
}
/* Zusatz: Datum unter Uhrzeit */
.program-time .pt-time{
  display:block;
}

.program-time .pt-date{
  display:block;
  font-weight: 700;
  font-size: 12px;
  opacity: .75;
  margin-top: 4px;
  white-space: nowrap;
}
.program-main{ min-width:0; }
.program-title{
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 900;
  color: #3b1f0f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}
.program-meta{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.meta-pill{
  display:inline-flex;
  gap: 6px;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(90,51,22,.18);
  font-size: 13px;
  color: rgba(59,31,15,.88);
}
.meta-pill strong{ color:#3b1f0f; font-weight: 900; }
.program-desc{
  color: rgba(59,31,15,.85);
  font-style: italic;
  line-height: 1.45;
}
.program-actions{
  display:flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.favorite-btn{
  width: 100%;
  display:flex;
  justify-content:center;
  align-items:center;
  gap: 10px;
  border-radius: 10px;
  padding: 10px 12px;
  background: linear-gradient(#fff2c9, #f1b94a);
  border: 1px solid rgba(90,51,22,.35);
  color: #3b1f0f;
  font-weight: 950;
  cursor:pointer;
  box-shadow: 0 8px 16px rgba(0,0,0,.16);
}
.favorite-btn.is-favorite{
  background: linear-gradient(#ffe9b8, #f1b94a);
  border-color: rgba(180,83,9,.55);
}
.favorite-btn .icon{ font-size: 18px; line-height:1; }
.age-badge{
  font-size: 13px;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(90,51,22,.18);
  color: #3b1f0f;
}
.empty{
  padding: 16px 12px;
  text-align:center;
  color: rgba(59,31,15,.75);
  font-weight: 800;
}

/* ================= SIDEBAR ================= */
.sidebar{
  position: sticky;
  top: 18px;
  display:flex;
  flex-direction: column;
  gap: 14px;
}
.sidecard{ padding: 14px; position: relative; }
.sidecard__title{
  font-family: Georgia, "Times New Roman", serif;
  color: #5a3316;
  font-size: 24px;
  font-weight: 900;
  border-bottom: 1px solid rgba(90,51,22,.18);
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.sidecard__badge{
  position: static;
  display:inline-block;
  margin: 8px 0 10px;
  background: linear-gradient(#fff2c9, #f1b94a);
  border: 1px solid rgba(90,51,22,.35);
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 950;
  color: #3b1f0f;
}
.highlight{ padding-top: 0; }
.hl-title{ font-weight: 950; margin-bottom: 6px; color:#3b1f0f; }
.hl-meta{ color: rgba(59,31,15,.85); margin-bottom: 8px; font-weight:700; }
.hl-desc{ color: rgba(59,31,15,.85); margin-bottom: 10px; }
.hl-foot{ color: rgba(59,31,15,.70); font-style: italic; }
.about p{ color: rgba(59,31,15,.85); margin-bottom: 10px; }
.about .hint{ color: rgba(59,31,15,.70); }

/* ================= FOOTER ================= */
.footer{
  margin-top: 10px;
  border-top: 1px solid rgba(0,0,0,.08);
  background: #f9fafb;
}
.footer__inner{
  max-width:1100px;
  margin:0 auto;
  padding: 16px 18px;
  display:flex;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.links{ display:flex; gap: 14px; flex-wrap: wrap; }
.links a{ text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.note{ color: var(--muted); font-weight:700; }

/* ================= RESPONSIVE ================= */
@media (max-width: 980px){
  .page{ grid-template-columns: 1fr; }
  .sidebar{ position: static; }
  .program-item{ grid-template-columns: 1fr; }
  .program-actions{
    flex-direction: row;
    justify-content: space-between;
    align-items:center;
  }
  .favorite-btn{ width:auto; }
}
@media (max-width: 720px){
  .filters__row{ grid-template-columns: 1fr; }
  .scroll-bar__inner{ gap: 10px; }
  .scroll-btn{ min-width: 110px; padding: 10px 12px; }
}


/* =========================================================
   PATCH: Responsive HERO (Variante A) + Mobile Scroll-Fix
   + Kontakt-Textarea Styling
   ========================================================= */

/* HERO: Desktop-Bild (breit) */
.hero{
  height: clamp(220px, 32vh, 420px); /* etwas besser für Mobile */
}
.hero__bg{
  background:
    linear-gradient(to bottom, rgba(0,0,0,.28), rgba(0,0,0,.06)),
    url("../img/hero-desktop.webp");
  background-size: cover;
  background-position: 50% 42%;
}

/* Logo auf kleineren Screens etwas kleiner */
.hero__logo{
  width: min(920px, 92vw);
}

/* MOBILE: eigenes Hochkant-Bild */
@media (max-width: 640px){
  .hero{
    height: 360px; /* mehr Höhe für Mobile-Hero */
  }
  .hero__bg{
    background:
      linear-gradient(to bottom, rgba(0,0,0,.30), rgba(0,0,0,.08)),
      url("../img/hero-mobile.webp");
    background-size: cover;
    background-position: center 25%;
    transform: scale(1.02);
  }
  .hero__inner{
    align-items: flex-end;
    padding: 14px 12px;
  }
  .hero__logo{
    width: min(520px, 92vw);
  }
}

/* Scrollbar: Buttons dürfen umbrechen (für Impressum/Datenschutz/Kontakt Navi) */
@media (max-width: 720px){
  .scroll-bar__inner{
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Falls Scroll-Buttons dekorative ::before/::after Linien haben:
   Auf Mobile mittig neben dem Text ausrichten (Bug: Linie über dem Wort) */
@media (max-width: 640px){
  .scroll-btn::before,
  .scroll-btn::after{
    top: 50% !important;
    transform: translateY(-50%) !important;
  }
}

/* Textarea im gleichen Stil wie Inputs (Kontakt-Seite) */
.field textarea,
textarea.field-textarea{
  width:100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(90,51,22,.25);
  background: rgba(255,255,255,.86);
  outline:none;
  resize: vertical;
  font-family: inherit;
}
.field textarea:focus,
textarea.field-textarea:focus{
  border-color: rgba(180,83,9,.55);
  box-shadow: 0 0 0 2px rgba(245,158,11,.18);
}

/* =========================================
   Mobile Fix: Parchment-Titel (z.B. TV-Programm)
   - verhindert "zu breit"
   - verhindert Linien durch Text
   ========================================= */

.parchment-title{
  /* erlaubt Umbruch statt Überlauf */
  white-space: normal;
  text-wrap: balance;           /* moderne Browser */
  overflow-wrap: anywhere;      /* Notfall: bricht auch lange Wörter */
  hyphens: auto;                /* Trennungen, wenn Sprache DE gesetzt ist */
}

/* Mobile: Fontgröße dynamisch + Linien weg, wenn es eng wird */
@media (max-width: 640px){
  .parchment-title{
    /* macht den Titel automatisch kleiner je nach Screen */
    font-size: clamp(22px, 7vw, 34px);
    line-height: 1.05;
    padding-inline: 10px;
  }

  /* Linien kürzer und exakt zentriert */
  .parchment-title::before,
  .parchment-title::after{
    top: 50% !important;
    transform: translateY(-50%);
    width: clamp(18px, 10vw, 56px);
  }

  .parchment-title::before{ left: 8px !important; }
  .parchment-title::after{ right: 8px !important; }
}

/* Sehr kleine Geräte: Linien komplett aus, damit nie was durchläuft */
@media (max-width: 420px){
  .parchment-title::before,
  .parchment-title::after{
    display: none !important;
  }
}

/* =========================
   Globales Text-Raster
   ========================= */

.parchment{
  line-height: 1.65;
}

/* Absätze */
.parchment p{
  margin: 0 0 1.1em 0;
}

/* Überschriften in Papierkarten */
.parchment h2,
.parchment h3{
  margin-top: 1.9em;
  margin-bottom: .6em;
  line-height: 1.25;
}

/* erste Überschrift in einer Karte nicht nach unten schieben */
.parchment h2:first-child,
.parchment h3:first-child{
  margin-top: 0;
}

/* Listen */
.parchment ul{
  margin: .5em 0 1.2em 1.1em;
}

.parchment li{
  margin-bottom: .45em;
}