/* Linkseite – Mobile first. Farben kommen als CSS-Variablen aus _theme.html */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 132px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 Roboto, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
}
img { max-width: 100%; display: block; }
a { color: var(--link); }
[hidden] { display: none !important; }
.wrap {
  width: 100%; max-width: 1180px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
}

/* ---------- Kopf ---------- */
/* weißer Kopf mit grüner Schrift (angelehnt an st.georgen.at) */
.masthead {
  position: relative; background: var(--surface); color: var(--text);
  padding-top: env(safe-area-inset-top); box-shadow: 0 1px 0 var(--line);
}
.masthead-inner { padding-top: 18px; padding-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.brand-logo { width: 60px; height: 60px; object-fit: contain; flex: none; }
.kicker {
  margin: 0; font: 400 clamp(.78rem, 3.2vw, 1rem)/1.15 "Montserrat", "Maven Pro", Roboto, system-ui, sans-serif;
  letter-spacing: .12em; text-transform: uppercase;
}
.site-title {
  margin: 1px 0 0; color: var(--title, var(--primary));
  font: 700 clamp(1.3rem, 6vw, 2.2rem)/1.08 "Montserrat", "Maven Pro", Roboto, system-ui, sans-serif;
  letter-spacing: .01em; text-transform: uppercase; text-wrap: balance;
}
.hero { position: relative; height: clamp(130px, 34vw, 360px); background: var(--primary-dark); overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.lead { background: var(--primary); color: var(--on-primary); border-bottom: 4px solid var(--accent); }
.lead p { margin: 0; padding: 14px 0 15px; max-width: 52rem; font-size: 1.02rem; text-wrap: pretty; }
.masthead-small .masthead-inner { padding-top: 12px; padding-bottom: 12px; }
.masthead-small .brand-logo { width: 44px; height: 44px; }
.masthead-small .site-title { font-size: clamp(1.05rem, 4.5vw, 1.45rem); }

/* ---------- Leiste: Suche + Bereiche (klebt oben) ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.toolbar-inner { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; padding-bottom: 10px; }
.search { position: relative; display: block; }
.search svg {
  position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%);
  fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; pointer-events: none;
}
.search input {
  width: 100%; height: 46px; padding: 0 14px 0 44px; font: inherit; font-size: 16px; /* 16px: kein Zoom auf iOS */
  color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  -webkit-appearance: none; appearance: none; outline: none; transition: border-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 0 -16px; padding: 2px 16px; overscroll-behavior-x: contain;
}
.chips::-webkit-scrollbar { display: none; }
.chips a {
  flex: none; display: inline-flex; align-items: center; min-height: 38px;
  padding: 0 14px; border-radius: 999px; font-size: .92rem; font-weight: 600; white-space: nowrap;
  text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  transition: background .15s, color .15s, border-color .15s;
}
.chips a.active, .chips a:active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* ---------- Inhalt ---------- */
.main { flex: 1; padding-top: 22px; padding-bottom: 40px; }
.narrow { max-width: 780px; }
.notice {
  border-radius: 12px; padding: 12px 16px; margin-bottom: 22px; border-left: 5px solid var(--primary);
  background: var(--primary-soft);
}
.notice-warnung { border-left-color: #d08a00; background: color-mix(in srgb, #f0b429 20%, var(--surface)); }
.notice p { margin: .2em 0; }
.intro { margin-bottom: 26px; font-size: 1.05rem; }
.section { margin-bottom: 34px; }
.section-head { margin-bottom: 14px; }
.section-title {
  display: inline-block; margin: 0; padding: 5px 12px 4px;
  font: 700 1.05rem/1.25 "Maven Pro", Roboto, system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase;
  background: var(--primary); color: var(--on-primary); border-radius: 3px;
}
.section-desc { margin: 8px 0 0; color: var(--muted); font-size: .95rem; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- Karten ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); color: var(--text); text-decoration: none;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  -webkit-tap-highlight-color: transparent;
}
.card:active { transform: scale(.985); }
.card:focus-visible, .btn-link:focus-visible, .chips a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.card-media { position: relative; aspect-ratio: 1.91 / 1; background: var(--surface-2); overflow: hidden; }
.card-media > img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  background:
    radial-gradient(circle at 25% 20%, color-mix(in srgb, var(--accent) 35%, transparent) 0, transparent 55%),
    linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}
.fallback img {
  width: 30%; max-width: 76px; aspect-ratio: 1; object-fit: contain;
  background: #fff; border-radius: 18%; padding: 8%; box-shadow: 0 4px 18px rgba(0,0,0,.22);
}
.fallback .letter { font: 700 clamp(2rem, 9vw, 3.2rem)/1 "Montserrat", Roboto, system-ui, sans-serif; color: var(--on-primary); opacity: .92; }
.badge {
  position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em;
  background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 6px rgba(0,0,0,.18);
}
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.card-title { margin: 0; font-size: 1.08rem; line-height: 1.3; font-weight: 700; text-wrap: balance; }
.card-desc {
  margin: 0; color: var(--muted); font-size: .94rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-domain {
  margin-top: auto; padding-top: 6px; display: flex; align-items: center; gap: 6px;
  font-size: .82rem; color: var(--link); font-weight: 600; min-width: 0; overflow-wrap: anywhere;
}
.card-domain img { width: 16px; height: 16px; border-radius: 3px; flex: none; }

/* kompakt: kleines Bild links */
.card-kompakt { flex-direction: row; align-items: stretch; min-height: 96px; }
.card-kompakt .card-media { flex: none; width: 104px; aspect-ratio: auto; }
.card-kompakt .fallback img { width: 46%; }
.card-kompakt .fallback .letter { font-size: 2rem; }
.card-kompakt .badge { top: 6px; left: 6px; font-size: .68rem; padding: 2px 7px; }
.card-kompakt .card-body { padding: 12px 14px; gap: 3px; min-width: 0; }
.card-kompakt .card-title { font-size: 1rem; }
.card-kompakt .card-desc { -webkit-line-clamp: 2; font-size: .9rem; }

/* Schaltflächen */
.buttons { display: grid; gap: 10px; grid-template-columns: 1fr; }
.btn-link {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px 10px 16px;
  background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s, box-shadow .18s; -webkit-tap-highlight-color: transparent;
}
.btn-link:active { transform: scale(.985); }
.btn-link > img { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; flex: none; background: #fff; padding: 3px; border: 1px solid var(--line); }
.btn-link > span:not(.badge) { flex: 1; min-width: 0; }
.btn-link .badge { position: static; box-shadow: none; flex: none; }
.btn-link .arrow { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--primary); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

@media (hover: hover) {
  .card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 12px 28px rgba(20,40,30,.14); border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
  .card:hover .card-media > img { transform: scale(1.04); }
  .btn-link:hover { border-color: var(--primary); transform: translateY(-2px); }
  .chips a:hover { border-color: var(--primary); }
}

/* ---------- Textseiten ---------- */
.back { display: inline-block; margin-bottom: 14px; font-weight: 600; text-decoration: none; }
.prose { overflow-wrap: anywhere; }
.page { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.prose h1 { margin-top: 0; font-size: 1.6rem; line-height: 1.2; }
.prose h2 { font-size: 1.2rem; margin: 1.4em 0 .4em; }
.prose p, .prose ul, .prose ol { margin: .6em 0; }

/* ---------- Fuß ---------- */
.footer {
  background: var(--primary-dark); color: var(--on-primary); font-size: .9rem;
  padding-bottom: env(safe-area-inset-bottom);
}
.footer-inner { display: flex; flex-direction: column; gap: 10px; padding-top: 22px; padding-bottom: 22px; text-align: center; }
.footer p { margin: 0; opacity: .9; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.footer-links a { color: inherit; padding: 6px 0; font-weight: 600; }

/* ---------- größere Bildschirme ---------- */
@media (min-width: 560px) {
  .grid-karten { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-kompakt .card-media { width: 128px; }
}
@media (min-width: 760px) {
  html { scroll-padding-top: 80px; }
  .toolbar-inner { flex-direction: row; align-items: center; }
  .search { flex: 0 0 280px; }
  .chips { margin: 0; padding: 2px 0; }
  .grid-kompakt { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .masthead-inner { padding-top: 22px; padding-bottom: 22px; }
  .brand-logo { width: 84px; height: 84px; }
  .lead p { padding: 18px 0; font-size: 1.1rem; }
  .page { padding: 32px 36px; }
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}
@media (min-width: 1000px) {
  .grid-karten { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-kompakt, .buttons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
