/* ==========================================================================
   Wohnen im Kern – Wohnbaugenossenschaft Erschwil
   ========================================================================== */

@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/jost-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/jost-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --green-900: #26301f;
  --green-800: #38452f;
  --green-700: #4a5c40;
  --green-600: #5b6e57;   /* Logo-Grün */
  --green-500: #6f8268;
  --green-100: #e8ecdf;
  --green-050: #f2f4ec;
  --cream:     #faf9f5;
  --white:     #ffffff;
  --terra:     #9c5c40;   /* Dachziegel-Akzent */
  --terra-dark:#82492f;
  --text:      #2c332a;
  --text-soft: #5c655a;
  --line:      #dde2d4;
  --shadow:    0 2px 24px rgba(43, 56, 36, .10);
  --radius:    14px;
  --header-h:  76px;
  --font: 'Jost', 'Avenir Next', 'Century Gothic', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  font-family: var(--font);
  font-size: 1.075rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--green-700); }
a:hover { color: var(--green-900); }

h1, h2, h3, h4 { line-height: 1.2; color: var(--green-900); font-weight: 600; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 249, 245, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); gap: 24px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { height: 46px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text .b1 { font-weight: 600; font-size: 1.1rem; color: var(--green-800); letter-spacing: .02em; }
.brand-text .b2 { font-size: .8rem; color: var(--text-soft); letter-spacing: .04em; }

.main-nav ul { display: flex; gap: 6px; list-style: none; }
.main-nav a {
  display: block; padding: 9px 15px; text-decoration: none;
  color: var(--green-800); font-weight: 500; font-size: 1rem;
  border-radius: 999px; transition: background .18s, color .18s;
  white-space: nowrap;
}
.main-nav a:hover { background: var(--green-100); color: var(--green-900); }
.main-nav a.active { background: var(--green-600); color: var(--white); }

.search-toggle {
  display: grid; place-items: center; flex-shrink: 0;
  width: 46px; height: 46px; border-radius: 10px; border: 0;
  background: none; color: var(--green-800); cursor: pointer;
  transition: background .18s;
}
.search-toggle svg { width: 21px; height: 21px; }
.search-toggle:hover { background: var(--green-100); }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0;
}
.nav-toggle:hover { background: var(--green-100); }
.nav-toggle span {
  display: block; width: 24px; height: 2px; margin: 5px auto;
  background: var(--green-800); border-radius: 2px; transition: transform .25s, opacity .25s;
}
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: var(--cream); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  body.nav-open .main-nav { max-height: 420px; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 10px 16px 18px; }
  .main-nav a { padding: 13px 16px; font-size: 1.08rem; border-radius: 10px; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { position: relative; color: var(--white); overflow: hidden; }
.hero picture, .hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(30, 40, 24, .30) 0%, rgba(30, 40, 24, .62) 100%);
}
.hero-inner {
  position: relative; z-index: 1; text-align: center;
  padding: clamp(90px, 16vw, 190px) 24px;
  max-width: 860px; margin: 0 auto;
}
.hero h1 {
  color: var(--white); font-size: clamp(2rem, 5.4vw, 3.4rem);
  font-weight: 600; letter-spacing: .01em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}
.hero p {
  margin-top: 18px; font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 400; text-shadow: 0 1px 12px rgba(0, 0, 0, .4);
}
.hero-cta { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Sub-page hero (schmaler Balken) */
.page-head { background: var(--green-800); color: var(--white); }
.page-head-inner { padding: clamp(44px, 7vw, 72px) 24px; }
.page-head h1 { color: var(--white); font-size: clamp(1.9rem, 4.5vw, 2.7rem); }
.page-head p { margin-top: 10px; max-width: 640px; color: #d9e0cf; font-size: 1.1rem; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block; padding: 13px 28px; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: 1.02rem;
  transition: transform .15s, background .18s, box-shadow .18s;
  border: 2px solid transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--green-600); color: var(--white); box-shadow: 0 4px 16px rgba(43, 56, 36, .25); }
.btn-primary:hover { background: var(--green-700); color: var(--white); }
.btn-ghost { border-color: rgba(255, 255, 255, .75); color: var(--white); }
.btn-ghost:hover { background: rgba(255, 255, 255, .14); color: var(--white); }
.btn-outline { border-color: var(--green-600); color: var(--green-700); }
.btn-outline:hover { background: var(--green-100); color: var(--green-900); }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding: clamp(56px, 9vw, 96px) 0; }
.section.alt { background: var(--green-050); }
.section-title { font-size: clamp(1.6rem, 3.6vw, 2.2rem); margin-bottom: 12px; }
.section-lead { color: var(--text-soft); max-width: 720px; margin-bottom: 40px; font-size: 1.12rem; }
.center { text-align: center; }
.center .section-lead { margin-left: auto; margin-right: auto; }

.eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--terra);
  margin-bottom: 10px;
}

/* --------------------------------------------------------------------------
   Cards & Grids
   -------------------------------------------------------------------------- */
.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 30px; display: flex; flex-direction: column; gap: 10px;
}
.card h3 { font-size: 1.28rem; }
.card .date {
  font-size: .85rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--terra);
}
.card p { color: var(--text-soft); }
.card .more { margin-top: auto; padding-top: 8px; font-weight: 600; text-decoration: none; }

/* Feature-Liste mit Häkchen */
.features { list-style: none; display: grid; gap: 14px; }
.features li { display: flex; gap: 14px; align-items: flex-start; }
.features .tick {
  flex-shrink: 0; width: 28px; height: 28px; margin-top: 2px;
  border-radius: 50%; background: var(--green-100);
  display: grid; place-items: center; color: var(--green-700);
}
.features .tick svg { width: 15px; height: 15px; }

/* Split: Bild + Text */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.split .img-frame { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

figure.framed { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--white); border: 1px solid var(--line); }
figure.framed figcaption { padding: 14px 20px; font-size: .95rem; color: var(--text-soft); border-top: 1px solid var(--line); }

/* --------------------------------------------------------------------------
   Zahlen / Statistiken
   -------------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
@media (max-width: 800px) { .stats { grid-template-columns: 1fr; } }
.stat {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px 30px; text-align: center;
}
.stat .num { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 700; color: var(--green-700); }
.stat .lbl { color: var(--text-soft); margin-top: 4px; }

.stats.people { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stats.people .num { font-size: 1.3rem; }

/* Barometer */
.barometer { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; }
.barometer .bar-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.barometer .bar-head strong { font-size: 1.1rem; }
.barometer .bar-head span { color: var(--text-soft); font-size: .95rem; }
.bar-track { height: 22px; border-radius: 999px; background: var(--green-100); overflow: hidden; }
.bar-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--green-600), var(--green-500));
  transition: width 1.4s cubic-bezier(.25, .7, .3, 1);
}

/* --------------------------------------------------------------------------
   Zeitplan / Timeline
   -------------------------------------------------------------------------- */
.timeline { list-style: none; position: relative; margin-top: 20px; }
.timeline::before {
  content: ''; position: absolute; left: 11px; top: 6px; bottom: 6px;
  width: 2px; background: var(--green-100);
}
.timeline li { position: relative; padding: 0 0 30px 46px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .dot {
  position: absolute; left: 0; top: 4px; width: 24px; height: 24px;
  border-radius: 50%; background: var(--white); border: 2px solid var(--green-600);
  display: grid; place-items: center;
}
.timeline .dot::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--green-600); }
.timeline li.done .dot { background: var(--green-600); }
.timeline li.done .dot::after { background: var(--white); }
.timeline .year { font-weight: 700; color: var(--terra); font-size: .95rem; letter-spacing: .06em; }
.timeline h3 { font-size: 1.15rem; margin: 2px 0 4px; }
.timeline p { color: var(--text-soft); font-size: 1rem; }

/* --------------------------------------------------------------------------
   Downloads & Kontakt
   -------------------------------------------------------------------------- */
.dl-list { list-style: none; display: grid; gap: 12px; }
.dl-list a {
  display: flex; align-items: center; gap: 16px;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 20px; text-decoration: none; color: var(--text);
  transition: border-color .18s, box-shadow .18s, transform .15s;
}
.dl-list a:hover { border-color: var(--green-500); box-shadow: var(--shadow); transform: translateY(-1px); }
.dl-list .ico {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px;
  background: var(--green-100); color: var(--green-700);
  display: grid; place-items: center;
}
.dl-list .ico svg { width: 20px; height: 20px; }
.dl-list .t { font-weight: 600; }
.dl-list .s { font-size: .88rem; color: var(--text-soft); }

.contact-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px 30px;
}
.contact-card .role {
  font-size: .82rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--terra);
}
.contact-card h3 { font-size: 1.25rem; margin: 4px 0 8px; }
.contact-card a.mail { word-break: break-all; }

address { font-style: normal; line-height: 1.7; }

/* --------------------------------------------------------------------------
   Suche
   -------------------------------------------------------------------------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(38, 48, 31, .4);
  display: flex; align-items: flex-start; justify-content: center;
  padding: min(14vh, 120px) 20px 20px;
}
.search-overlay[hidden] { display: none; }
body.search-open { overflow: hidden; }

.search-panel {
  width: 100%; max-width: 620px; background: var(--white);
  border-radius: var(--radius); box-shadow: 0 24px 64px rgba(20, 26, 16, .35);
  overflow: hidden; max-height: 72vh; display: flex; flex-direction: column;
}
.search-input-row {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.search-input-row > svg { width: 20px; height: 20px; color: var(--text-soft); flex-shrink: 0; }
.search-input-row input {
  flex: 1; min-width: 0; border: 0; outline: none; background: none;
  font: inherit; font-size: 1.08rem; color: var(--text);
}
.search-input-row input::placeholder { color: var(--text-soft); }
.search-close {
  flex-shrink: 0; border: 0; background: none; cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  font-size: 1.4rem; line-height: 1; color: var(--text-soft);
}
.search-close:hover { background: var(--green-100); color: var(--green-900); }

.search-meta {
  padding: 10px 20px 0; font-size: .82rem; font-weight: 600;
  letter-spacing: .04em; color: var(--text-soft); flex-shrink: 0;
}

.search-results { list-style: none; overflow-y: auto; padding: 8px; }
.search-results a {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px; border-radius: 10px; text-decoration: none; color: var(--text);
}
.search-results a:hover, .search-results a:focus-visible { background: var(--green-050); }
.sr-badge {
  flex-shrink: 0; margin-top: 2px; font-size: .7rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--terra);
  background: var(--green-050); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 8px;
}
.sr-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sr-title { font-weight: 600; color: var(--green-900); }
.sr-snippet {
  font-size: .92rem; color: var(--text-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-results mark {
  background: rgba(156, 92, 64, .24); color: inherit;
  border-radius: 3px; padding: 0 1px;
}

.search-hint, .search-empty { padding: 30px 20px; text-align: center; color: var(--text-soft); }

/* --------------------------------------------------------------------------
   CTA-Band
   -------------------------------------------------------------------------- */
.cta-band { background: var(--green-800); color: var(--white); text-align: center; }
.cta-band h2 { color: var(--white); font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
.cta-band p { color: #ccd6bf; max-width: 640px; margin: 14px auto 30px; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--green-900); color: #b9c2ae; font-size: .98rem; }
.footer-inner {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px;
  padding: clamp(44px, 7vw, 64px) 24px 36px;
}
@media (max-width: 800px) { .footer-inner { grid-template-columns: 1fr; gap: 28px; } }
.site-footer h4 { color: var(--white); font-size: 1.05rem; margin-bottom: 14px; font-weight: 600; }
.site-footer a { color: #d5dcc9; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.site-footer ul { list-style: none; display: grid; gap: 8px; }
.footer-logo { height: 44px; width: auto; filter: brightness(0) invert(.92); margin-bottom: 14px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: 18px 24px; text-align: center; font-size: .88rem; color: #8d977f;
}

/* --------------------------------------------------------------------------
   Prosa (Impressum)
   -------------------------------------------------------------------------- */
.prose { max-width: 780px; }
.prose h2 { font-size: 1.5rem; margin: 40px 0 12px; }
.prose h3 { font-size: 1.15rem; margin: 26px 0 8px; }
.prose p, .prose ul { margin-bottom: 14px; color: var(--text); }
.prose ul { padding-left: 22px; }

/* Reveal-Animation */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
  .reveal.in { opacity: 1; transform: none; }
}
