/*
Theme Name: CRM Systemberatung
Author: Klein Marketing
Description: Schlankes eigenes Theme. Keine Page-Builder, keine Fremd-Skripte, Schrift lokal.
Version: 1.1.0
Requires PHP: 8.1
Text Domain: crm
*/

@font-face {
  font-family: 'Inter';
  src: url('assets/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --bg-alt: #f3f6f6;
  --bg-dark: #0d2b2a;
  --text: #15201f;
  --muted: #586866;
  --primary: #0f766e;
  --primary-dark: #0b5953;
  --accent: #f59e0b;
  --border: #dde5e4;
  --radius: 14px;
  --max: 1140px;
  --pad: clamp(1rem, 4vw, 2rem);
  --space: clamp(3.5rem, 9vw, 6.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 1.0625rem; line-height: 1.65; color: var(--text); background: var(--bg); overflow-x: hidden; }
img, svg, video, iframe { max-width: 100%; height: auto; }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 5.5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.narrow { max-width: 760px; }
.section { padding-block: var(--space); }
.section--alt { background: var(--bg-alt); }
.section--dark { background: var(--bg-dark); color: #e8f1f0; }
.section--dark h2, .section--dark h3 { color: #fff; }
.section--dark .muted { color: #a9c2bf; }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .09em; font-size: .78rem; font-weight: 700; color: var(--primary); margin-bottom: .8rem; }
.section--dark .eyebrow { color: var(--accent); }
.lead { font-size: clamp(1.1rem, 2.4vw, 1.25rem); color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.center { text-align: center; }
.center .lead { margin-inline: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .9rem 1.5rem; min-height: 50px; border-radius: 999px; background: var(--primary); color: #fff; font: inherit; font-weight: 650; text-decoration: none; border: 0; cursor: pointer; }
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn--light { background: #fff; color: var(--primary-dark); }
.btn--light:hover { background: #eaf4f3; color: var(--primary-dark); }
.btn--ghost { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary); }
.btn--ghost:hover { background: var(--primary); color: #fff; }

.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.icon { width: 44px; height: 44px; border-radius: 12px; background: #e3f2f0; color: var(--primary); display: grid; place-items: center; margin-bottom: 1rem; font-weight: 800; }

/* Header */
.hdr { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.hdr__in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.logo { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -0.01em; }
.logo__mark { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: .95rem; }
.logo small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; letter-spacing: 0; }
.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 550; }
.nav a:not(.btn):hover { color: var(--primary); }
.nav__toggle { display: none; background: none; border: 0; padding: .5rem; min-width: 46px; min-height: 46px; color: var(--text); cursor: pointer; }
@media (max-width: 820px) {
  .nav__toggle { display: block; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: #fff; border-bottom: 1px solid var(--border); padding: .5rem var(--pad) 1.2rem; }
  .nav.is-open { display: flex; }
  .nav a:not(.btn) { padding: .95rem 0; border-bottom: 1px solid var(--border); }
  .nav .btn { margin-top: 1rem; }
}

/* Hero */
.hero { padding-block: clamp(3.5rem, 10vw, 7rem); background: radial-gradient(1200px 500px at 85% -10%, #d9f0ec 0%, rgba(217,240,236,0) 60%), var(--bg); }
.hero__grid { display: grid; gap: 2.5rem; grid-template-columns: 1.25fr .9fr; align-items: center; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.8rem; }
.hero__proof { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-top: 1.6rem; color: var(--muted); font-size: .95rem; list-style: none; padding: 0; }
.hero__proof li::before { content: '✓ '; color: var(--primary); font-weight: 800; }
.chaos { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 1.4rem; box-shadow: 0 20px 50px -25px rgba(13,43,42,.35); }
.chaos__row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .75rem .9rem; border-radius: 10px; background: var(--bg-alt); margin-bottom: .6rem; font-size: .95rem; }
.chaos__row span:last-child { font-size: .8rem; font-weight: 700; color: #b45309; background: #fef3c7; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
.chaos__arrow { text-align: center; color: var(--primary); font-weight: 800; margin: .3rem 0 .6rem; }
.chaos__crm { padding: .9rem; border-radius: 12px; background: var(--primary); color: #fff; font-weight: 700; text-align: center; }
@media (max-width: 900px) { .hero__grid { grid-template-columns: 1fr; } }

/* Kosten-Botschaft */
.quote { font-size: clamp(1.35rem, 3.4vw, 2rem); font-weight: 750; line-height: 1.3; max-width: 30ch; margin: 0 auto 1rem; }

/* Leistungen */
.services { counter-reset: s; }
.services .card { position: relative; }
.services .card h3 { padding-right: 3.2rem; }
.services .card::before { counter-increment: s; content: '0' counter(s); position: absolute; top: 1.2rem; right: 1.4rem; font-weight: 800; color: #c7dcd9; font-size: 1.6rem; }

/* Systeme */
.systems { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1.5rem; list-style: none; padding: 0; }
.systems li { padding: .55rem 1rem; border-radius: 999px; border: 1px solid #2c5552; color: #e8f1f0; font-weight: 600; font-size: .95rem; }

/* Ablauf */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); counter-reset: st; }
.steps li { counter-increment: st; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; }
.steps li::before { content: counter(st); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; margin-bottom: .8rem; }
.steps strong { display: block; margin-bottom: .3rem; }

/* Zielgruppen */
.audience .card { border-top: 4px solid var(--primary); }

/* Blog */
.posts .card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.posts .card__img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--bg-alt); display: block; }
.posts .card__body { padding: 1.3rem 1.4rem 1.5rem; }
.posts h2, .posts h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.posts h2 a, .posts h3 a { color: var(--text); text-decoration: none; }
.posts h2 a:hover, .posts h3 a:hover { color: var(--primary); }
.meta { font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; font-weight: 650; padding: 1.1rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; min-height: 48px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.4rem; color: var(--primary); }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--muted); padding-bottom: 1rem; margin: 0; }

/* Formulare */
.contact { display: grid; gap: 2.5rem; grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
.form { display: grid; gap: .9rem; background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.25rem, 4vw, 2rem); }
.form label { font-weight: 600; font-size: .92rem; display: grid; gap: .35rem; }
.form input, .form textarea, .form select { width: 100%; font: inherit; padding: .8rem .9rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); min-height: 48px; }
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,118,110,.18); }
.form .hp { position: absolute; left: -9999px; }
.form small { color: var(--muted); font-size: .82rem; }
.form__status { margin: 0; font-weight: 650; }
.form__status.is-error { color: #b42318; }
.form__status.is-ok { color: var(--primary); }
.newsletter { display: flex; flex-wrap: wrap; gap: .6rem; max-width: 560px; margin: 1.5rem auto 0; }
.newsletter input[type=email] { flex: 1 1 240px; font: inherit; padding: .85rem 1rem; border-radius: 999px; border: 0; min-height: 50px; }
.newsletter .hp { position: absolute; left: -9999px; }
.newsletter .form__status { flex-basis: 100%; text-align: center; }
.section--dark .form__status.is-ok { color: #7ee2d6; }

/* Artikel */
.article { padding-block: clamp(2.5rem, 7vw, 4.5rem); }
.article__img { border-radius: var(--radius); margin: 1.5rem 0 2rem; width: 100%; height: auto; }
.prose { font-size: 1.08rem; }
.prose h2 { margin-top: 2em; font-size: clamp(1.4rem, 3.2vw, 1.8rem); }
.prose h3 { margin-top: 1.6em; }
.prose img { border-radius: 10px; height: auto; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1.5em 0; padding: .5em 1.2em; border-left: 4px solid var(--primary); background: var(--bg-alt); border-radius: 0 10px 10px 0; }
.prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: .5rem .7rem; text-align: left; }
.prose .wp-block-image, .prose figure { margin: 1.5em 0; }
.cta-box { margin-top: 3rem; padding: 1.8rem; border-radius: var(--radius); background: var(--bg-dark); color: #e8f1f0; }
.cta-box h3 { color: #fff; }
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 2.5rem; flex-wrap: wrap; }
.pagination .page-numbers { padding: .5rem .9rem; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; min-width: 44px; text-align: center; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Footer */
.ftr { background: var(--bg-dark); color: #a9c2bf; font-size: .95rem; }
.ftr__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-block: 2rem; }
.ftr a { color: #d6e6e4; }
.ftr nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

.screen-reader-text, .visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: .5rem; left: .5rem; width: auto; height: auto; clip: auto; background: #fff; padding: .6rem 1rem; z-index: 100; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Bewegung: Kacheln heben sich beim Drueberfahren leicht an, Abschnitte blenden beim Scrollen ein */
.card, .steps li { transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease; }
.grid .card:hover, .steps li:hover { transform: translateY(-5px) scale(1.015); box-shadow: 0 18px 40px -22px rgba(13,43,42,.45); border-color: #9fcfc8; }
.services .card::before { transition: color .28s ease; }
.services .card:hover::before { color: var(--primary); }
.posts .card__img { transition: transform .45s ease; }
.posts .card:hover .card__img { transform: scale(1.05); }
.btn { transition: background-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgba(15,118,110,.7); }
.js .reveal { opacity: 0; translate: 0 18px; transition: opacity .6s ease, translate .6s ease; }
.js .reveal.is-in { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) {
  .card, .steps li, .btn, .posts .card__img, .js .reveal { transition: none; }
  .grid .card:hover, .steps li:hover, .btn:hover, .posts .card:hover .card__img { transform: none; }
  .js .reveal { opacity: 1; translate: none; }
}

/* Ratgeber mit Seitenleiste: Themen, Schlagwoerter, Archiv */
.blog-layout { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; margin-top: 2rem; }
@media (max-width: 960px) { .blog-layout { grid-template-columns: 1fr; } }
.sidebar { display: grid; gap: 1.25rem; position: sticky; top: 90px; }
@media (max-width: 960px) { .sidebar { position: static; } }
.widget { background: var(--bg-alt); border-radius: var(--radius); padding: 1.3rem 1.4rem; }
.widget h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .8rem; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { display: flex; justify-content: space-between; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .97rem; }
.widget li:last-child { border-bottom: 0; }
.widget li a { color: var(--text); text-decoration: none; }
.widget li a:hover, .widget li.current-cat > a { color: var(--primary); }
.count { color: var(--muted); font-size: .85rem; }
.search-form { display: flex; gap: .4rem; }
.search-form label { flex: 1; }
.search-form .search-field { width: 100%; font: inherit; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: 10px; min-height: 44px; }
.search-form .search-submit { font: inherit; font-weight: 650; border: 0; border-radius: 10px; padding: 0 .9rem; background: var(--primary); color: #fff; cursor: pointer; min-height: 44px; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; padding: 0; margin: 0; }
.chips a { display: inline-block; padding: .3rem .75rem; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--text); font-size: .88rem; text-decoration: none; transition: border-color .2s ease, color .2s ease; }
.chips a:hover { border-color: var(--primary); color: var(--primary); }
.article .chips { margin: .2rem 0 1rem; }
.article .chips a { background: var(--bg-alt); }
.terms { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.terms p { font-weight: 650; margin-bottom: .6rem; }
