/* Praxis Schwarting – Variante B
   Blau #2A63A1 (aus der bisherigen Seite), Text dunkelgrau, Systemschriften (keine externen Server). */

:root {
  --blue: #2A63A1;
  --blue-dark: #1E4B7D;
  --navy: #163A66;
  --ink: #3a3f45;
  --muted: #5b6672;
  --tint: #EEF3FA;
  --line: #dce3ec;
  --bg: #fafbfd;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.65 var(--sans); color: var(--ink); background: var(--bg); }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid #f5b800; outline-offset: 2px; }
img { max-width: 100%; height: auto; }
code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }

.skip { position: absolute; left: -999px; top: 0; background: #fff; color: var(--blue); padding: 10px 16px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.layout { display: flex; align-items: stretch; min-height: 100vh; }
.side { flex: 0 0 280px; background: var(--blue); color: #fff; }
.side-inner { position: sticky; top: 0; padding: 40px 20px; display: flex; flex-direction: column; gap: 28px; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.brand { padding: 0 14px; line-height: 1.25; }
.brand-pre { display: block; font-size: 13px; opacity: .92; }
.brand-name { color: #fff; font: 500 24px/1.25 var(--serif); text-decoration: none; }
.brand-name:hover { color: #fff; text-decoration: underline; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 14px; border-radius: 12px; color: #fff; text-decoration: none; font-size: 17px; }
.nav a:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.nav a.active { background: #fff; color: var(--blue); font-weight: 600; }
.nav-toggle { display: none; }
.insta { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; color: #fff; margin-left: 8px; }
.insta:hover { color: #fff; opacity: .85; }

/* ---------- Kopfbild ---------- */
.hero { position: relative; background: #c9daee; }
.hero img { display: block; width: 100%; height: 250px; object-fit: cover; object-position: center 45%; }
.hero-card { position: absolute; left: 32px; top: 24px; background: rgba(250, 251, 253, .96); border-left: 8px solid var(--blue); border-radius: 4px 12px 12px 4px; padding: 12px 24px 12px 18px; box-shadow: 0 2px 14px rgba(0, 0, 0, .12); max-width: calc(100% - 48px); }
.hero-name { font: 500 26px/1.2 var(--serif); color: var(--ink); }
.hero-role { font-size: 15px; color: var(--muted); }

/* ---------- Inhalt ---------- */
.page { flex: 1 0 auto; padding: 56px 56px 48px; width: 100%; max-width: 1000px; }
.page-title { font: 600 40px/1.15 var(--serif); color: var(--blue); margin: 0 0 24px; }
.content { max-width: 760px; font-size: 18px; }
.content::after { content: ""; display: block; clear: both; }
.content h2, .content h3, .content h4 { color: var(--blue); font-family: var(--sans); font-weight: 600; line-height: 1.3; margin: 1.6em 0 .4em; }
.content h2 { font-size: 24px; }
.content h3 { font-size: 20px; }
.content h4 { font-size: 18px; }
.content > :first-child { margin-top: 0; }
.content p { margin: 0 0 1em; }
.content ul, .content ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.content li { margin-bottom: .45em; }
.content li::marker { color: var(--blue); }
.content blockquote { margin: 1.2em 0; padding: .2em 1.2em; border-left: 4px solid var(--blue); color: var(--muted); }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.content img { border-radius: 12px; }
.content .img-left { float: left; clear: left; margin: 4px 28px 16px 0; max-width: min(42%, 320px); }
.content .img-right { float: right; clear: right; margin: 4px 0 16px 28px; max-width: min(42%, 320px); }
.content .img-full { display: block; float: none; clear: both; width: 100%; margin: 1.2em 0; }
/* Absatz, der nur ein Bild enthält: Überschrift darunter beginnt auf Höhe des Bildes */
.content p:has(> img:only-child) { margin: 0; }
.content p:has(> img:only-child) + h2,
.content p:has(> img:only-child) + h3 { margin-top: 0; }
.content mark.todo { background: #ffe58a; color: #3a2e00; padding: 0 3px; border-radius: 3px; }
.content a.knopf { display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px; border-radius: 12px; background: var(--blue); color: #fff; text-decoration: none; font-weight: 600; }
.content a.knopf:hover { background: var(--blue-dark); color: #fff; }
.content a[target="_blank"]::after { content: "\2197"; content: "\2197" / " (öffnet in neuem Fenster)"; display: inline-block; margin-left: .15em; font-size: .85em; text-decoration: none; }

/* ---------- Kacheln: Aufzählung mit class="kacheln"; eine Überschrift direkt davor wird Teil des Feldes ---------- */
.content ul.kacheln { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; clear: both; margin: 1.6em 0; padding: 32px; background: var(--tint); border-radius: 20px; }
.content h2:has(+ ul.kacheln) { clear: both; margin: 2em 0 0; padding: 34px 32px 0; background: var(--tint); border-radius: 20px 20px 0 0; font: 600 26px/1.3 var(--serif); color: #1F2A37; }
.content h2:has(+ ul.kacheln) + ul.kacheln { margin-top: 0; padding-top: 22px; border-radius: 0 0 20px 20px; }
.content ul.kacheln li { position: relative; margin: 0; padding: 18px; background: #fff; border-radius: 14px; font-size: 16px; font-weight: 500; line-height: 1.45; hyphens: manual; overflow-wrap: anywhere; }
.content ul.kacheln li::marker { content: ""; }
.content ul.kacheln li:has(> a) { padding-right: 44px; background: var(--blue); transition: background-color .15s; }
.content ul.kacheln li:has(> a):hover { background: var(--blue-dark); }
.content ul.kacheln li:has(> a)::after { content: "\2192"; position: absolute; right: 18px; top: 18px; color: #fff; font-weight: 600; }
.content ul.kacheln li > a, .content ul.kacheln li > a:hover { color: #fff; font-weight: 600; text-decoration: none; }
.content ul.kacheln li > a::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.content ul.kacheln li > a:focus-visible { outline: none; }
.content ul.kacheln li:has(> a:focus-visible) { outline: 3px solid #f5b800; outline-offset: 2px; }
.editing .content ul.kacheln li > a::after { display: none; }

.foot { border-top: 1px solid var(--line); background: #f2f4f7; padding: 22px 56px; font-size: 15px; color: #3b4654; }
.foot a { color: #3b4654; }

/* ---------- Schlichte Seiten (Login, Verwaltung, 404) ---------- */
body.plain { background: var(--tint); }
.box { max-width: 520px; margin: 48px auto; background: #fff; border-radius: 16px; padding: 32px 36px; box-shadow: 0 2px 14px rgba(22, 58, 102, .08); }
.box.wide { max-width: 820px; }
.box h1 { font: 600 32px/1.2 var(--serif); color: var(--blue); margin: 0 0 16px; }
.box h2 { font: 600 22px/1.3 var(--serif); color: var(--navy); margin: 0 0 8px; }
.box h3 { font-size: 17px; margin: 24px 0 8px; }
.box section { padding: 28px 0; border-top: 1px solid var(--line); }
.box section:first-of-type { margin-top: 20px; }
.small { font-size: 14px; color: var(--muted); }
label { display: block; font-weight: 600; margin: 16px 0 6px; font-size: 15px; }
input[type=text], input[type=password], input[type=url], input[type=file] { width: 100%; min-height: 46px; padding: 9px 12px; border: 1px solid #aeb9c6; border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
.msg { padding: 12px 16px; border-radius: 10px; margin: 12px 0; }
.msg-ok { background: #e3f3e6; color: #1d4a27; }
.msg-err { background: #fde7e7; color: #7a1c1c; }
.msg-warn { background: #fff1c2; color: #4a3800; }
.thumb { max-width: 100%; border-radius: 10px; }
.checks { width: 100%; border-collapse: collapse; font-size: 15px; }
.checks th, .checks td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.checks th { font-weight: 600; width: 40%; }

/* ---------- Schaltflächen ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; font: 600 16px var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--blue-dark); color: #fff; }
.btn[disabled] { opacity: .4; cursor: default; }
.btn-small { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: #e6eefa; color: var(--navy); }
.btn-ghost { background: transparent; color: #fff; border: 1px solid #9DB8D9; }
.btn-ghost:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.btn-light-border { background: #fff; color: var(--navy); border: 1px solid #aeb9c6; }
.btn-light-border:hover { background: #eef3fa; color: var(--navy); }
.btn-danger { background: #a12b2b; }
.btn-danger:hover { background: #7f1f1f; }
.inline { display: inline; }

/* ---------- Pflegeleiste & Bearbeitung ---------- */
.adminbar { background: var(--navy); color: #fff; padding: 6px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; }
.adminbar-state { margin-right: auto; }
.adminbar-status { min-width: 8em; }
.adminbar-status.is-error { color: #ffd1d1; font-weight: 600; }
.adminbar .btn { min-height: 44px; padding: 0 16px; font-size: 15px; }

.editing .content { outline: 2px dashed var(--blue); outline-offset: 12px; min-height: 8em; }
.editing .page-title { outline: 2px dashed var(--blue); outline-offset: 8px; }
.editing .content img { cursor: pointer; outline: 2px solid transparent; }
.editing .content img:hover { outline-color: var(--blue); }
.etoolbar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; margin: 0 0 36px; background: var(--navy); border-radius: 12px; }
.etoolbar button { min-height: 44px; min-width: 44px; padding: 0 12px; border: 1px solid #9DB8D9; border-radius: 8px; background: transparent; color: #fff; font: 600 15px var(--sans); cursor: pointer; }
.etoolbar button:hover { background: rgba(255, 255, 255, .16); }
.etoolbar .sep { width: 1px; align-self: stretch; background: #4d6c93; margin: 4px 4px; }
.etoolbar .grow { flex: 1 1 auto; }
.etoolbar .primary { background: #fff; color: var(--navy); border-color: #fff; }
.etoolbar .primary:hover { background: #e6eefa; }

dialog.imgdlg { border: 0; border-radius: 16px; padding: 24px 28px; max-width: 480px; width: calc(100% - 32px); box-shadow: 0 10px 40px rgba(0, 0, 0, .3); color: var(--ink); }
dialog.imgdlg::backdrop { background: rgba(22, 58, 102, .5); }
dialog.imgdlg h2 { margin: 0 0 8px; font: 600 22px var(--serif); color: var(--navy); }
dialog.imgdlg fieldset { border: 0; padding: 0; margin: 14px 0 0; }
dialog.imgdlg legend { font-weight: 600; font-size: 15px; padding: 0; margin-bottom: 4px; }
dialog.imgdlg .opt { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 400; margin: 0; font-size: 16px; }
dialog.imgdlg .opt input { width: 22px; height: 22px; margin: 0; }
dialog.imgdlg .btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- Verwaltungslisten ---------- */
.menu-admin { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.menu-admin li { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 12px; background: #f6f8fb; border-radius: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.row input[type=text] { width: auto; flex: 1 1 200px; }
.chk { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; min-height: 44px; }
.chk input { width: 22px; height: 22px; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .side { flex: none; }
  .side-inner { position: static; padding: 14px 18px; gap: 10px; }
  .brand { padding: 0; }
  .js .nav-toggle { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid #9DB8D9; border-radius: 10px; background: transparent; color: #fff; font: 600 16px var(--sans); cursor: pointer; align-self: flex-start; }
  .js .nav { display: none; }
  .js .nav.open { display: block; }
  .insta { margin-left: 0; }
  .hero img { height: 170px; }
  .hero-card { left: 12px; top: 12px; padding: 8px 14px 8px 12px; border-left-width: 6px; }
  .hero-name { font-size: 20px; }
  .hero-role { font-size: 13px; }
  .page { padding: 32px 20px 36px; }
  .page-title { font-size: 32px; }
  .content .img-left, .content .img-right { float: none; display: block; max-width: 100%; margin: 0 0 1em; }
  .content ul.kacheln { padding: 20px 16px 24px; }
  .content h2:has(+ ul.kacheln) { padding: 24px 16px 0; font-size: 23px; }
  .foot { padding: 18px 20px; }
  .box { margin: 16px; padding: 24px 20px; }
}

@media (prefers-reduced-motion: no-preference) {
  .nav a, .btn { transition: background-color .15s; }
}

@media print {
  .side, .adminbar, .hero-card, .nav-toggle { display: none; }
  .layout { display: block; }
  .hero img { height: 120px; }
}
