/* firmen-ver-kaufen.de – schlicht, warm, Kennzahlen im Vordergrund */
:root {
  --bg: #fbfaf6;
  --surface: #ffffff;
  --ink: #12110f;
  --ink-2: #4a4740;
  --muted: #7a766c;
  --line: #e8e4d9;
  --accent: #fadd4b;
  --accent-ink: #12110f;
  --accent-soft: #fdf3c4;
  --green: #1f7a4d;
  --green-soft: #e3f3ea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 17, 15, .05), 0 4px 16px rgba(18, 17, 15, .05);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(251, 250, 246, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { font-weight: 800; font-size: 1.15rem; text-decoration: none; letter-spacing: -.02em; white-space: nowrap; }
.logo span { background: var(--accent); padding: 0 .25em; border-radius: 4px; margin: 0 .1em; }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a { text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav a.active { color: var(--ink); }
@media (max-width: 720px) { .nav .hide-sm { display: none; } .site-header .wrap { gap: 12px; } .nav { gap: 14px; } }
@media (max-width: 420px) { .nav .hide-xs { display: none; } .wrap { padding: 0 16px; } }
html, body { overflow-x: hidden; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .7em 1.2em; border-radius: 10px; border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink); font: 700 .95rem var(--font); text-decoration: none; cursor: pointer; transition: transform .08s, box-shadow .15s; }
.btn:hover { box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { box-shadow: 3px 3px 0 var(--accent); }
.btn-sm { padding: .45em .85em; font-size: .85rem; }
.btn-ghost { border-color: var(--line); }
.btn-danger { border-color: #b3261e; color: #b3261e; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; }
.hero h1 { max-width: 15ch; }
.hero h1 mark { background: linear-gradient(transparent 58%, var(--accent) 58%); color: inherit; padding: 0 .05em; }
.hero .lead { font-size: 1.2rem; color: var(--ink-2); max-width: 46ch; }
.searchbar { display: flex; gap: 8px; margin: 28px 0 18px; max-width: 720px; background: var(--surface); border: 1.5px solid var(--ink); border-radius: 14px; padding: 6px; box-shadow: 4px 4px 0 var(--ink); }
.searchbar input, .searchbar select { flex: 1; min-width: 0; border: 0; font: 1rem var(--font); padding: .6em .7em; background: transparent; color: var(--ink); }
.searchbar select { flex: 0 0 auto; max-width: 38%; border-left: 1px solid var(--line); }
.searchbar input:focus, .searchbar select:focus { outline: none; }
@media (max-width: 560px) { .searchbar { flex-wrap: wrap; } .searchbar input { flex-basis: 100%; } .searchbar select { max-width: none; flex: 1; border-left: 0; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: .35em; padding: .4em .8em; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: .9rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.chip:hover, .chip.active { border-color: var(--ink); color: var(--ink); }
.chip .n { color: var(--muted); font-weight: 500; }
.stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 30px; color: var(--ink-2); font-size: .95rem; }
.stats b { display: block; font-size: 1.5rem; color: var(--ink); letter-spacing: -.02em; }

/* ---------- Sections ---------- */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 700; text-decoration: none; white-space: nowrap; }
.section-head a:hover { text-decoration: underline; }

/* Themen-Kacheln */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.theme-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.theme-card:hover { border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.theme-card .icon { flex: 0 0 48px; height: 48px; display: grid; place-items: center; font-size: 1.6rem; background: var(--accent-soft); border-radius: 12px; }
.theme-card h3 { margin: 0 0 .15em; }
.theme-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.4; }
.theme-card .count { display: inline-block; margin-top: .5em; font-size: .8rem; font-weight: 700; color: var(--ink-2); }

/* ---------- Anzeigen-Karten ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.card a.stretched::after { content: ""; position: absolute; inset: 0; }
.card .thumb { position: relative; aspect-ratio: 16 / 8; background: var(--accent-soft); display: grid; place-items: center; font-size: 2.4rem; overflow: hidden; }
.card .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .thumb.t-online-shop, .card .thumb.t-websites-apps { background-color: #e6efff; }
.card .thumb.t-friseur-kosmetik { background-color: #fde7ef; }
.card .thumb.t-gastronomie, .card .thumb.t-hotel-tourismus { background-color: #fdf0dc; }
.card .thumb.t-pflege-gesundheit { background-color: #e3f3ea; }
.card .thumb.t-handwerk-bau, .card .thumb.t-kfz, .card .thumb.t-produktion-industrie { background-color: #eceae4; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.card .meta { display: flex; gap: 8px; align-items: center; font-size: .8rem; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.card h3 { font-size: 1rem; margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card h3 a { text-decoration: none; }
.card .loc { font-size: .85rem; color: var(--ink-2); margin-bottom: 12px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.metrics div { min-width: 0; }
.metrics dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.metrics dd { margin: 0; font-weight: 700; font-size: .85rem; line-height: 1.3; overflow-wrap: anywhere; }
.metrics dd.na { color: var(--muted); font-weight: 500; }
.badge { display: inline-block; padding: .15em .55em; border-radius: 6px; font-size: .72rem; font-weight: 800; letter-spacing: .02em; background: var(--accent); color: var(--accent-ink); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.grey { background: #eceae4; color: var(--ink-2); }

/* ---------- Liste ---------- */
.list-layout { display: grid; grid-template-columns: 250px 1fr; gap: 28px; align-items: start; padding-top: 28px; padding-bottom: 60px; }
@media (max-width: 900px) { .list-layout { grid-template-columns: minmax(0, 1fr); } }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: sticky; top: 84px; }
@media (max-width: 900px) { .filters { position: static; margin-top: 10px; } .region-chips { display: none; } }
.filter-box > summary { list-style: none; width: 100%; }
.filter-box > summary::-webkit-details-marker { display: none; }
@media (min-width: 901px) { .filter-box > summary { display: none; } }
.filters label { display: block; font-size: .8rem; font-weight: 700; margin: 12px 0 4px; color: var(--ink-2); }
.filters label:first-child { margin-top: 0; }
.filters .check { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: .9rem; margin-top: 14px; }
.filters .btn { width: 100%; margin-top: 16px; }
input[type=text], input[type=email], input[type=tel], input[type=search], input[type=url], input[type=number], select, textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: .6em .75em; font: 1rem var(--font); background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(250, 221, 75, .5); }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.list-head h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin: 0; }
.theme-intro { max-width: 70ch; color: var(--ink-2); margin: 8px 0 0; }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 28px; align-items: center; }
.empty { padding: 48px 20px; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- Detail ---------- */
.detail { display: grid; grid-template-columns: 1fr 340px; gap: 32px; padding-top: 28px; padding-bottom: 40px; align-items: start; }
@media (max-width: 900px) { .detail { grid-template-columns: minmax(0, 1fr); } }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.detail h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 18px 0 24px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kpi dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.kpi dd { margin: 2px 0 0; font-weight: 800; font-size: 1.05rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-bottom: 24px; }
.gallery img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; width: 100%; background: var(--line); }
.prose { white-space: pre-line; color: var(--ink-2); font-size: 1.02rem; }
.facts { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .95rem; }
.facts th, .facts td { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts th { width: 40%; color: var(--muted); font-weight: 600; padding-right: 12px; }
.sidebox { background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 20px; box-shadow: 4px 4px 0 var(--ink); position: sticky; top: 84px; }
.sidebox .price { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.sidebox .btn { width: 100%; margin-top: 12px; }
.contact-out { margin-top: 12px; padding: 12px; background: var(--accent-soft); border-radius: 10px; font-weight: 700; word-break: break-all; }
.contact-out a { display: block; }
.notice { padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); border: 1px solid #f1d978; margin-bottom: 18px; }
.notice.green { background: var(--green-soft); border-color: #bfe3cf; }
.notice.red { background: #fde8e7; border-color: #f2bdb9; }

/* ---------- Formular ---------- */
.form-page { max-width: 820px; padding: 36px 20px 60px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0 32px; }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }
.steps div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: .9rem; color: var(--ink-2); }
.steps b { display: block; color: var(--ink); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 20px; margin: 0 0 18px; }
legend { font-weight: 800; padding: 0 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .row, .row3 { grid-template-columns: 1fr; } }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 4px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.field .err { font-size: .85rem; color: #b3261e; margin-top: 4px; font-weight: 600; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: #b3261e; }
textarea { min-height: 200px; resize: vertical; }
.field .consent { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; font-weight: 400; }
.consent input { margin-top: 4px; }
.hp { position: absolute; left: -9999px; }
.manage-link { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; padding: 12px; background: #fff; border: 1.5px dashed var(--ink); border-radius: 10px; word-break: break-all; }

/* ---------- CTA / Footer ---------- */
.cta { background: var(--ink); color: #fff; border-radius: 20px; padding: 40px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center; }
.cta h2 { color: #fff; }
.cta p { color: #cfcac0; margin: 0; }
.cta ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; color: #e8e4d9; }
.cta li::before { content: "✓ "; color: var(--accent); font-weight: 800; }
@media (max-width: 760px) { .cta { grid-template-columns: 1fr; padding: 28px; } }
.seo-text { columns: 2 320px; column-gap: 40px; color: var(--ink-2); font-size: .95rem; }
.seo-text h3 { break-after: avoid; margin-top: .4em; }
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 36px 0; color: var(--muted); font-size: .9rem; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
@media (max-width: 720px) { .site-footer .cols { grid-template-columns: 1fr; } }
.site-footer a { text-decoration: none; color: var(--ink-2); display: block; padding: 2px 0; }
.site-footer a:hover { color: var(--ink); }
.site-footer h4 { color: var(--ink); margin: 0 0 8px; font-size: .9rem; }

/* ---------- Admin ---------- */
.admin table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .9rem; }
.admin th, .admin td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin .actions form { margin: 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot.ok { background: #2e9e5b; } .dot.warn { background: #e6b800; } .dot.broken { background: #d93025; }
.contact-img { display: block; max-width: 100%; height: auto; }
.ad { margin: 24px 0; min-height: 120px; }
.ad-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
