:root {
  --bg: #FFFDF9;
  --deep: #4A3328;
  --on-deep: #FFF8EF;
  --ink: #3A2F28;
  --muted: #6B5B4F;
  --hero: #F1E6D8;
  --panel: #D8C0A8;
  --warm: #F7F0E6;
  --script: #8A5A3B;
  --foot-bg: #4A3328;
  --foot-ink: #F1E6D8;
  --f-head: 'Josefin Sans', 'Century Gothic', 'Segoe UI', system-ui, sans-serif;
  --f-body: 'Mulish', 'Segoe UI', system-ui, sans-serif;
  --f-script: 'Allura', 'Brush Script MT', cursive;
  --pl: max(16px, env(safe-area-inset-left, 0px), calc((100% - 1000px) / 2));
  --pr: max(16px, env(safe-area-inset-right, 0px), calc((100% - 1000px) / 2));
  --plw: max(16px, env(safe-area-inset-left, 0px), calc((100% - 1280px) / 2));
  --prw: max(16px, env(safe-area-inset-right, 0px), calc((100% - 1280px) / 2));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E1511; --deep: #E6CDB4; --on-deep: #1E1511; --ink: #F5EBDD; --muted: #CDBBA8;
    --hero: #2B1E17; --panel: #3D2B20; --warm: #261A14; --script: #E0B48C;
    --foot-bg: #150E0A; --foot-ink: #E6CDB4; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1E1511; --deep: #E6CDB4; --on-deep: #1E1511; --ink: #F5EBDD; --muted: #CDBBA8;
  --hero: #2B1E17; --panel: #3D2B20; --warm: #261A14; --script: #E0B48C;
  --foot-bg: #150E0A; --foot-ink: #E6CDB4; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 17px; line-height: 1.65; }
h1, h2, h3 { font-family: var(--f-head); color: var(--deep); line-height: 1.2; margin: 0; }
a { color: var(--deep); text-underline-offset: 3px; }
a:focus-visible { outline: 3px solid var(--deep); outline-offset: 3px; }

/* Kopfzeile (wie fraublomberg.de) */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 44px; padding: 20px var(--prw) 20px var(--plw); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--deep); }
.logo { width: 56px; height: 56px; display: block; border-radius: 50%; object-fit: cover; border: 3px solid var(--deep); background: var(--hero); }
.brand-name { font-family: var(--f-head); font-weight: 400; font-size: 1.45rem; letter-spacing: .04em; color: var(--ink); }
.nav { display: flex; flex-wrap: wrap; gap: 6px 30px; }
.nav a { font-family: var(--f-head); font-weight: 600; font-size: 1.05rem; letter-spacing: .08em; color: var(--deep); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--deep); }
@media (max-width: 720px) { .top { gap: 10px 24px; } }
@media (any-pointer: coarse) { .nav a { position: relative; } .nav a::before { content: ""; position: absolute; inset: -12px -8px; } }
@media (hover: none) { .nav a:hover { border-bottom-color: transparent; } }

.hero { display: grid; grid-template-columns: 1fr 1fr; }
.hero-text { background: var(--hero); padding: 64px 32px 64px var(--pl); display: flex; flex-direction: column; justify-content: center; }
.hero-text h1 { font-family: var(--f-script); font-weight: 400; font-size: clamp(3.6rem, 9vw, 6rem); color: var(--script); line-height: 1.05; }
.lead { font-size: 1.15rem; max-width: 34ch; margin: 14px 0 0; }
.hero-fig { background: var(--panel); display: grid; place-items: center; padding: 40px var(--pr) 40px 32px; }
.hero-fig img { width: min(100%, 280px); height: auto; border: 8px solid #FFFFFF; display: block; }

.levels { padding: 56px var(--pr) 64px var(--pl); }
.levels h2 { font-size: 1.7rem; }
.levels > p { margin: 8px 0 28px; color: var(--muted); max-width: 60ch; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { display: flex; flex-direction: column; }
.card-top { background: var(--panel); min-height: 110px; display: flex; align-items: center; justify-content: center; }
.card-top span { font-family: var(--f-head); font-weight: 700; font-size: 2.1rem; color: var(--deep); letter-spacing: .02em; }
.card-body { background: var(--warm); padding: 18px 20px 22px; flex: 1; }
.card-body h3 { font-size: 1.2rem; }
.card-body p { margin: 6px 0 14px; color: var(--muted); font-size: .98rem; }
.pill { display: inline-block; background: var(--deep); color: var(--on-deep); font-family: var(--f-head); font-weight: 600; font-size: .85rem; padding: 4px 14px; }

footer { background: var(--foot-bg); color: var(--foot-ink); padding: 22px var(--pr) 26px var(--pl); font-size: .95rem; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
footer a { color: var(--foot-ink); }

@media (max-width: 860px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .hero-text { padding: 40px var(--pr) 36px var(--pl); }
  .hero-fig { padding: 32px var(--pr) 32px var(--pl); }
}
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }
a.card { text-decoration: none; color: inherit; }
a.card:hover .card-top, a.card:focus-visible .card-top { background: var(--hero); }
a.card:focus-visible { outline: 3px solid var(--deep); outline-offset: 3px; }
.btn { display: inline-block; background: var(--deep); color: var(--on-deep); font-family: var(--f-head); font-weight: 600; font-size: .95rem; padding: 8px 20px; }
.back { display: inline-block; font-family: var(--f-head); font-weight: 600; margin: 0 0 14px; padding: 6px 0; }
.sub-head { background: var(--hero); padding: 44px var(--pr) 40px var(--pl); }
.sub-head h1 { font-size: clamp(2rem, 5vw, 3rem); }
.sub-head .lead { max-width: 60ch; }
.sub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .sub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .sub-grid { grid-template-columns: 1fr; } }

/* ===== iPad 11 Zoll (quer) und Navigation ===== */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; display: flex; flex-direction: column; }
.top { padding-top: 12px; padding-bottom: 12px; }
.logo { width: 52px; height: 52px; }

/* Brotkrumenpfad: immer horizontal */
.crumbs { margin: 0 0 6px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0 10px; font-family: var(--f-head); font-size: 1rem; color: var(--muted); }
.crumbs li { display: inline-flex; align-items: center; margin: 0; padding: 0; }
.crumbs li + li::before { content: "\203A"; margin-right: 10px; color: var(--muted); }
.crumbs a { font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }

/* Unterseiten */
.sub-head { padding-top: 4px; padding-bottom: 14px; }
.sub-head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.sub-head .lead { margin: 4px 0 0; max-width: 80ch; }
.page { padding: 18px var(--pr) 24px var(--pl); flex: 1; }

/* Banner mit Bild */
.sub-head.with-img { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.sub-head .banner-img { height: 132px; width: auto; flex: none; border: 6px solid #FFFFFF; display: block; }
@media (max-width: 720px) { .sub-head .banner-img { height: 84px; border-width: 4px; } }

/* Themenliste untereinander */
.topic-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.topic-list a { display: grid; grid-template-columns: 76px 1fr auto; align-items: stretch; background: var(--warm); color: inherit; text-decoration: none; min-height: 56px; }
.topic-list .num { background: var(--panel); display: flex; align-items: center; justify-content: center; font-family: var(--f-head); font-weight: 700; font-size: 1.4rem; color: var(--deep); }
.topic-list .txt { padding: 8px 18px; display: flex; flex-direction: column; justify-content: center; }
.topic-list .txt strong { font-family: var(--f-head); font-size: 1.15rem; color: var(--deep); line-height: 1.25; }
.topic-list .txt span { color: var(--muted); font-size: .93rem; line-height: 1.35; }
.topic-list .go { align-self: center; margin-right: 16px; }
.topic-list a:hover .num, .topic-list a:focus-visible .num { background: var(--hero); }
.topic-list a:focus-visible { outline: 3px solid var(--deep); outline-offset: 3px; }

/* Themenseite: einfache Liste */
.topic-list.wide a, .topic-list.wide .row { grid-template-columns: 150px 1fr auto; }
.topic-list.wide .num { font-size: 1.25rem; padding: 0 8px; text-align: center; }
.topic-list .row { display: grid; grid-template-columns: 76px 1fr auto; align-items: stretch; background: var(--warm); min-height: 56px; }
.topic-list .row .pill { align-self: center; margin-right: 16px; }

@media (max-width: 720px) { .topic-list a, .topic-list.wide a, .topic-list.wide .row { grid-template-columns: 96px 1fr; } .topic-list .go, .topic-list .row .pill { display: none; } }

/* Startseite: iPad quer, ohne Scrollen */
@media (min-width: 900px) and (orientation: landscape) {
  .home main { display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; grid-template-rows: 1fr; }
  .home .hero { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 0; }
  .home .hero-text { padding: 28px 28px 22px var(--plw); }
  .home .hero-text h1 { font-size: clamp(3.4rem, 6vw, 4.6rem); }
  .home .lead { margin-top: 8px; }
  .home .hero-fig { position: relative; padding: 0; min-height: 0; }
  .home .hero-fig img { position: absolute; inset: 20px; margin: auto; width: auto; height: auto; max-width: calc(100% - 40px); max-height: calc(100% - 40px); border-width: 8px; }
  .home .levels { padding: 24px var(--prw) 24px 32px; display: flex; flex-direction: column; min-height: 0; }
  .home .levels h2 { font-size: 1.5rem; }
  .home .levels > p { margin: 4px 0 16px; font-size: .97rem; }
  .home .grid { flex: 1; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 12px; }
  .home .card { flex-direction: row; }
  .home .card-top { min-height: 0; width: 70px; flex: none; }
  .home .card-top span { font-size: 1.5rem; }
  .home .card-body { padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; }
  .home .card-body h3 { font-size: 1.02rem; }
  .home .card-body p { margin: 2px 0 6px; font-size: .86rem; line-height: 1.35; }
  .home .pill, .home .btn { align-self: flex-start; font-size: .82rem; padding: 3px 12px; }
}
@media (any-pointer: coarse) { .btn, .pill { min-height: 0; } }
