/* =========================================================
   Neu in Emmen – Prototyp v2
   CD Gemeinde Emmen: Primär Schwarz · Akzent Violett P2117 #535b99
   Webschrift Montserrat
   Prinzip: viel Weissraum, flache Flächen, Typografie trägt.
   ========================================================= */

:root {
  --ink: #161616;
  --paper: #ffffff;
  --mist: #f3f3f6;
  --line: #e1e1e7;
  --muted: #5d5e66;
  --violett: #535b99;
  --violett-tief: #3d4377;
  --violett-hell: #e9eaf4;
  --tuerkis: #00aba3;

  /* alte Namen, werden vom Kommentar-Modus genutzt */
  --schwarz: var(--ink);
  --weiss: var(--paper);
  --violett-dunkel: var(--violett-tief);
  --grau-100: var(--mist);
  --grau-300: var(--line);
  --grau-600: var(--muted);

  --header-h: 72px;
  --radius: 4px;
  --radius-sm: 4px;
  --wrap: 1320px;
  --gutter: clamp(20px, 4vw, 56px);
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 10px 30px rgba(20,20,40,.08);
  --ease: cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 72px); }
body {
  margin: 0;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
p, figure { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--tuerkis); outline-offset: 3px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.btn {
  display: inline-block; background: var(--ink); color: var(--paper);
  padding: 15px 22px; border-radius: var(--radius); border: 0;
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: background .2s;
}
.btn:hover { background: var(--violett-tief); }
.btn--light { background: var(--paper); color: var(--ink); }
.btn--light:hover { background: var(--violett-hell); }
.text-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-weight: 600; color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px;
  text-decoration-color: var(--violett);
}
.text-link:hover { color: var(--violett); }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Prototyp-Leiste ---------- */
.proto-bar { background: var(--mist); font-size: 13px; color: var(--muted); }
.proto-bar__inner { display: flex; justify-content: space-between; gap: 12px; padding-top: 7px; padding-bottom: 7px; flex-wrap: wrap; }
.proto-toggle { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font-weight: 600; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--paper); }
.site-header__inner { display: flex; align-items: center; gap: 36px; height: var(--header-h); }
.brand { font-weight: 800; font-size: 19px; text-decoration: none; letter-spacing: -.01em; }
.main-nav { display: flex; gap: 32px; margin-left: auto; font-size: 15px; font-weight: 500; }
.main-nav a { text-decoration: none; color: var(--muted); }
.main-nav a:hover { color: var(--ink); }
.logo img { width: 112px; height: auto; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(48px, 8vw, 120px); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 48px; align-items: end; }
.hero h1 {
  font-size: clamp(46px, 7.4vw, 118px); font-weight: 800;
  line-height: .96; letter-spacing: -.04em;
}
.hero h1 span { display: block; color: var(--violett); }
.hero__aside { padding-bottom: 10px; font-size: 18px; color: var(--muted); max-width: 34ch; }
.hero__slogan { margin-top: 18px; color: var(--ink); font-weight: 600; font-size: 15px; }
.hero__collage { display: none; }
.hero__image { margin-top: clamp(40px, 6vw, 88px); }
.hero__image img { width: 100%; height: clamp(300px, 58vh, 640px); object-fit: cover; object-position: center 45%; }

/* ---------- Filterleiste ---------- */
.filterbar {
  position: sticky; top: var(--header-h); z-index: 47;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.filterbar__inner { display: flex; align-items: center; gap: 32px; }
.tabs {
  display: flex; gap: 24px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0;
}
.tabs.is-overflow { mask-image: linear-gradient(90deg, #000 90%, transparent); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; background: none; border: 0; cursor: pointer;
  padding: 22px 0 19px; font-size: 15px; font-weight: 600; color: var(--muted);
  border-bottom: 3px solid transparent; white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--ink); }
.tab[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--violett); }
.tab__n { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 4px; vertical-align: super; }
.search { position: relative; flex: none; width: 170px; }
.search input {
  width: 100%; font: inherit; font-size: 15px; padding: 8px 28px 8px 0;
  border: 0; border-bottom: 1.5px solid var(--line); background: transparent; border-radius: 0;
}
.search input:focus { outline: none; border-bottom-color: var(--violett); }
.search input::-webkit-search-cancel-button { display: none; }
.search svg { position: absolute; right: 0; top: 50%; translate: 0 -50%; width: 19px; height: 19px; fill: none; stroke: var(--ink); stroke-width: 1.8; pointer-events: none; }

/* ---------- Angebote ---------- */
.angebote { padding-bottom: clamp(64px, 8vw, 120px); }
.result-line { padding-top: 48px; color: var(--muted); font-size: 15px; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.result-line:empty { display: none; }
.result-line strong { color: var(--ink); font-weight: 700; }
.result-line .text-link { margin-left: auto; font-size: 15px; }

.group {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 48px;
  padding: clamp(56px, 7vw, 96px) 0; border-top: 1px solid var(--line);
}
.group:first-child { border-top: 0; }
.group__head { position: sticky; top: calc(var(--header-h) + 100px); align-self: start; }
.group__head h2 { font-size: clamp(26px, 2.6vw, 34px); font-weight: 800; letter-spacing: -.02em; }
.group__head p { margin-top: 12px; color: var(--muted); font-size: 16px; max-width: 30ch; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 32px; }
.grid--flat { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-top: 40px; }

.card { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.card__media { aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius); background: var(--mist); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card:hover .card__media img { transform: scale(1.03); }
.card--icon .card__media { background: var(--violett-hell); display: grid; place-items: center; }
.card--icon svg { width: 52px; height: 52px; fill: none; stroke: var(--violett); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.card__body { padding-top: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__title { font-size: 19px; font-weight: 700; letter-spacing: -.01em; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; transition: color .15s; }
.card:hover .card__title { color: var(--violett); }
.card__text { color: var(--muted); font-size: 15.5px; line-height: 1.55; }
.card__source { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 600; color: var(--violett); }
.card:hover .card__source { text-decoration: underline; text-underline-offset: 3px; }
.card__offen { display: none; }
.show-offen .card__offen { display: block; font-size: 13px; font-weight: 600; background: #fff4c2; color: #6b5300; padding: 6px 10px; border-radius: var(--radius); }
.show-offen .card--offen .card__media { outline: 3px solid #f2c200; outline-offset: -3px; }

.empty { padding: 80px 0; display: grid; gap: 20px; justify-items: start; max-width: 520px; font-size: 18px; }

/* ---------- Blöcke (Social, Events) ---------- */
.block { padding: clamp(72px, 9vw, 128px) 0; border-top: 1px solid var(--line); }
.block__grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 48px; }
.block__head h2 { font-size: clamp(26px, 2.6vw, 34px); font-weight: 800; letter-spacing: -.02em; }
.block__head p { margin: 12px 0 20px; color: var(--muted); font-size: 16px; max-width: 30ch; }
.social-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.social-links a { font-weight: 600; text-decoration: underline; text-decoration-color: var(--violett); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.social-links a:hover { color: var(--violett); }

.wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.post img { aspect-ratio: 1; object-fit: cover; width: 100%; border-radius: var(--radius); }
.post figcaption { font-size: 14px; margin-top: 10px; color: var(--ink); }
.post figcaption span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }

.event-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.event { display: grid; grid-template-columns: 200px 1fr auto; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.event time { font-weight: 600; font-size: 15px; }
.event__title { font-weight: 700; font-size: 18px; }
.event__place { color: var(--muted); font-size: 14px; }

.placeholder-note { margin-top: 22px; font-size: 13px; color: var(--muted); }
.placeholder-note::before { content: "Prototyp: "; font-weight: 700; color: var(--tuerkis); }

/* ---------- Mitgestalten ---------- */
.cta { background: var(--violett); color: var(--paper); padding: clamp(72px, 9vw, 128px) 0; }
.cta__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.cta h2 { font-size: clamp(34px, 4.4vw, 64px); font-weight: 800; line-height: 1.02; letter-spacing: -.03em; }
.cta p { margin: 24px 0 32px; font-size: 18px; max-width: 42ch; color: #e3e5f6; }
.cta img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }

/* ---------- Footer ---------- */
.site-footer { padding: 64px 0 80px; font-size: 15px; color: var(--muted); }
.site-footer__grid { display: grid; grid-template-columns: 3fr 3fr 3fr 3fr; gap: 32px; }
.footer-logo { width: 120px; }
.site-footer address { font-style: normal; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.site-footer a { text-decoration: none; color: var(--ink); }
.site-footer a:hover { text-decoration: underline; }


/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--flat { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .main-nav { display: none; }
  .logo { margin-left: auto; }
  .hero__grid, .group, .block__grid, .cta__grid { grid-template-columns: 1fr; gap: 28px; }
  .group__head { position: static; }
  .grid--flat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  :root { --header-h: 60px; }
  body { font-size: 16px; }
  .site-header__inner { gap: 14px; }
  .brand { font-size: 17px; }
  .logo img { width: 88px; }
  .hero { padding-top: 36px; }
  .hero h1 { font-size: 44px; }
  .hero__aside { font-size: 16px; }
  .hero__image img { height: 42vh; min-height: 240px; }
  .filterbar__inner { flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
  .tabs { gap: 22px; padding: 0 var(--gutter); }
  .tab { padding: 16px 0 13px; font-size: 15px; }
  .search { width: auto; margin: 0 var(--gutter) 12px; }
  .group { padding: 48px 0; }
  .grid, .grid--flat { grid-template-columns: 1fr; gap: 28px; padding-top: 0; }
  .grid--flat { padding-top: 28px; }
  .card { flex-direction: row; gap: 16px; align-items: flex-start; }
  .card__media { width: 96px; flex: none; aspect-ratio: 1; }
  .card--icon svg { width: 36px; height: 36px; }
  .card__body { padding-top: 0; gap: 4px; }
  .card__title { font-size: 17px; }
  .card__text { font-size: 14.5px; }
  .result-line { padding-top: 28px; }
  .wall { gap: 14px; }
  .event { grid-template-columns: 1fr; gap: 2px; }
  .site-footer__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}


/* Variante C: Fragen-Block nur dort */
.quiz, .hero__c { display: none; }
