/* Agrar-SDB — neutrales, modernes Design-System
   Palette: gedämpftes Grün + Anthrazit + Weiß. Keine Fremd-Bibliotheken. */

:root {
  --green:      #3f7d20;
  --green-dark: #2f5f18;
  --green-soft: #eef4e8;
  --ink:        #1f2733;
  --ink-soft:   #4a5563;
  --line:       #e2e6e0;
  --bg:         #f6f8f4;
  --card:       #ffffff;
  --danger:     #c0392b;
  --focus:      #1d6fb8;
  --radius:     10px;
  --shadow:     0 1px 2px rgba(31,39,51,.06), 0 4px 16px rgba(31,39,51,.06);
  --wrap:       1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

img { max-width: 100%; height: auto; }

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand .mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  background: var(--green-soft); border-radius: 9px; color: var(--green-dark);
}
.brand .mark svg { width: 24px; height: 24px; }
.brand .name { font-weight: 800; font-size: 1.35rem; letter-spacing: -.01em; }
.brand .name b { color: var(--green-dark); font-weight: 800; }
.brand .tag { display: block; font-size: .72rem; font-weight: 500; color: var(--ink-soft); letter-spacing: .02em; margin-top: -2px; }

/* ---------- Navigation ---------- */
.nav-toggle {
  display: none; align-items: center; gap: .5rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: .5rem .8rem; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }

.mainnav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .15rem; flex-wrap: wrap; }
.mainnav a {
  display: block; padding: .5rem .8rem; border-radius: 8px;
  text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .95rem;
}
.mainnav a:hover { background: var(--green-soft); color: var(--green-dark); }
.mainnav a[aria-current="page"] { background: var(--green); color: #fff; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .mainnav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--card); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .mainnav.open { display: block; }
  .mainnav ul { flex-direction: column; padding: .5rem 16px 1rem; gap: .1rem; max-width: var(--wrap); margin-inline: auto; }
  .mainnav a { padding: .7rem .8rem; }
}

/* ---------- Layout ---------- */
main { padding: 2rem 0 3rem; }
.page-head { margin: 0 0 1.5rem; }
.page-head h1 { font-size: clamp(1.5rem, 4.5vw, 1.9rem); line-height: 1.2; margin: 0 0 .4rem; letter-spacing: -.02em; overflow-wrap: break-word; hyphens: auto; }
.page-head p.lead { font-size: 1.05rem; color: var(--ink-soft); margin: 0; max-width: 65ch; }

h1, h2, h3 { overflow-wrap: break-word; }
body { overflow-x: hidden; }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
}
.card h2 { margin-top: 0; }

h2 { font-size: 1.3rem; letter-spacing: -.01em; }

/* ---------- Suche (iframe) ---------- */
.search-frame { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); padding:10px }
.search-frame iframe { display: block; width: 100%; height: 700px; border: 0; }
@media (max-width: 860px) { .search-frame iframe { height: 560px; } }

/* ---------- Partner-Teaser / Grids ---------- */
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .8rem; }
.logo-grid a {
  display: grid; place-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: .8rem; min-height: 84px;
  transition: border-color .15s, box-shadow .15s;
}
.logo-grid a:hover { border-color: var(--green); box-shadow: var(--shadow); }
.logo-grid picture { display: inline-flex; align-items: center; justify-content: center; }
.logo-grid img { max-height: 56px; width: auto; }
.logo-grid .logo-text { font-weight: 700; color: var(--ink); text-decoration: none; text-align: center; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--green); color: #fff; text-decoration: none;
  padding: .65rem 1.1rem; border-radius: 8px; font-weight: 700; border: 0; cursor: pointer;
}
.btn:hover { background: var(--green-dark); color: #fff; }
.btn.secondary { background: var(--card); color: var(--green-dark); border: 1px solid var(--line); }

/* ---------- Teilnehmer-Liste ---------- */
.tn-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.tn-search { flex: 1 1 260px; min-width: 0; position: relative; }
@media (max-width: 560px) {
  .tn-toolbar { flex-direction: column; align-items: stretch; }
  .tn-search { flex: 0 0 auto; }
  .tn-list { grid-template-columns: 1fr; }
}
.tn-search input {
  width: 100%; padding: .7rem .9rem .7rem 2.4rem; font: inherit;
  border: 1px solid var(--line); border-radius: 9px; background: var(--card);
}
.tn-search svg { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-soft); }
.tn-filter { display: inline-flex; gap: .4rem; align-items: center; font-size: .9rem; color: var(--ink-soft); }
.tn-count { font-size: .9rem; color: var(--ink-soft); }

.tn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .6rem; }
.tn-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 9px;
  padding: .8rem .9rem; display: flex; gap: .6rem; align-items: flex-start;
}
.tn-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: .45rem; flex: 0 0 10px; }
.tn-dot.on { background: var(--green); }
.tn-dot.off { background: #c9ccc6; }
.tn-item > span { min-width: 0; overflow-wrap: anywhere; }
.tn-item .n { font-weight: 700; }
.tn-item .a { font-size: .9rem; color: var(--ink-soft); }
.tn-item a.n { text-decoration: none; }
.tn-item a.n:hover { text-decoration: underline; }
.tn-empty { padding: 2rem; text-align: center; color: var(--ink-soft); }

/* ---------- Content / Listen ---------- */
.content p { max-width: 72ch; }
.content ol, .content ul { max-width: 72ch; }
.doc-links { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .35rem; }
.doc-links li a {
  display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink);
}
.doc-links li a:hover { border-color: var(--green); color: var(--green-dark); }
.doc-links svg { width: 18px; height: 18px; color: var(--danger); flex: 0 0 18px; }

/* ---------- Formular ---------- */
.form-grid { display: grid; gap: 1rem; max-width: 560px; }
.form-grid label { font-weight: 600; display: block; margin-bottom: .3rem; }
.form-grid input[type=text], .form-grid input[type=email], .form-grid textarea {
  width: 100%; padding: .65rem .8rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: var(--card);
}
.form-grid textarea { min-height: 140px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 2fr; gap: .8rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.checkbox-row { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; color: var(--ink-soft); }
.hp { position: absolute; left: -9999px; }  /* Honeypot */
.alert { padding: .9rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert.ok { background: var(--green-soft); color: var(--green-dark); border: 1px solid #cfe0c0; }
.alert.err { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c0; }

/* ---------- App-Seite ---------- */
.app-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-top: 1.5rem; max-width: 820px; }
.app-shots picture { display: block; }
.app-shots img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.app-cta { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--card);
  padding: 1.5rem 0; margin-top: 2rem; font-size: .9rem; color: var(--ink-soft);
}
.footer-row { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; justify-content: space-between; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--green-dark); }
