/* Die Stimme – Styles: 1 Grundlagen · 2 Kopf/Fuß · 3 Inhalte · 4 Beitrag & Rechtstexte · 5 Suche · 6 Redaktion */

/* ---------- 1 Grundlagen ---------- */
/* Nur der Buchstabe „i“ (U+0069) kommt in Fettschrift aus einer ähnlichen Schrift mit deutlich abgesetztem Punkt – sonst wirkt er wie ein großes „I“. Alles andere bleibt Helvetica. Normalschrift bleibt unverändert. */
@font-face { font-family: 'Helvetica-i'; font-weight: 700; unicode-range: U+0069; size-adjust: 104%;
  src: local('Segoe UI Bold'), local('SegoeUI-Bold'), local('Verdana Bold'), local('Verdana-Bold'), local('Trebuchet MS Bold'), local('Arial Bold'); }
@font-face { font-family: 'Helvetica-i'; font-weight: 400; unicode-range: U+0069;
  src: local('Helvetica'), local('Arial'), local('Liberation Sans'); }
:root {
  --bg: #f7f3ea; --panel: #fffdf8; --ink: #171412; --muted: #706960; --line: #ded4c4; --soft: #efe8da;
  --accent: #c9182b; --accent-dark: #8f0f1e; --accent-ink: #ffffff; --focus: #2563eb;
  --sans: "Helvetica-i", Helvetica, "Helvetica Neue", Arial, sans-serif;
  --radius: 24px; --shadow: 0 24px 80px rgba(45, 32, 21, .10);
  --page: min(1180px, 100% - 2.25rem);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a, button, input, select, textarea, label { touch-action: manipulation; } /* kein Doppeltipp-Zoom, keine Wartezeit beim Tippen */
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.5 var(--sans); letter-spacing: .012em; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
main { padding-bottom: 4rem; min-height: 70vh; }
.wrap { width: var(--page); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .6rem 1.1rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-weight: 600; font-size: .95rem; line-height: 1.1; cursor: pointer; transition: border-color .15s, color .15s, transform .15s; }
.btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fffafa; }
.btn.primary:hover { color: #fff; transform: translateY(-1px); background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.danger { background: #8b1e1e; border-color: #8b1e1e; color: #fff; }
.btn.danger:hover { background: #6e1414; color: #fff; }
.btn.small { padding: .4rem .85rem; font-size: .85rem; }
.btn svg { width: 1.05em; height: 1.05em; }
.btn:disabled { opacity: .5; cursor: default; }

.field { padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); width: 100%; transition: border-color .15s; }
.field:focus { border-color: var(--ink); outline: none; }

/* ---------- 2 Kopf & Fuß ---------- */
.site-head { position: sticky; top: 0; z-index: 20; background: rgba(247, 243, 234, .9); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(201, 24, 43, .16); }
.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.5rem; width: var(--page); margin-inline: auto; padding-block: .5rem; }
.bar .nav { grid-column: 1; justify-self: start; }
.bar .brand { grid-column: 2; }
.bar .nav-right { grid-column: 3; justify-self: end; }
.brand-logo { height: clamp(56px, 6.5vw, 76px); width: auto; }
.nav { display: flex; gap: .2rem; }
.nav a { padding: .5rem .9rem; border-radius: 999px; color: var(--muted); font-size: .96rem; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--accent-dark); font-weight: 700; }

.footer { border-top: 1px solid var(--line); padding: 1.6rem 0; font-size: .9rem; color: var(--muted); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer nav { display: flex; gap: 1.5rem; }
.footer a:hover { color: var(--accent-dark); }
.foot-text strong { color: var(--ink); }

/* ---------- 3 Inhalte: Überschriften, Filter, Kacheln ---------- */
.banner { display: flex; align-items: flex-start; gap: 1rem; margin-top: 1.6rem; padding: 1.3rem 1.4rem; border-radius: var(--radius); background: var(--panel); border: 1.5px solid var(--accent); }
.banner .tag { display: inline-block; margin-bottom: .6rem; }
.banner strong { display: block; font-size: clamp(1.45rem, 2.3vw, 1.9rem); letter-spacing: -.025em; line-height: 1.05; font-weight: 700; }
.banner p { margin: .5rem 0 0; max-width: 62ch; color: var(--muted); line-height: 1.45; }
.banner-close { flex: none; margin-left: auto; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.banner-close:hover { color: var(--ink); border-color: var(--ink); }
.banner-close svg { width: 1rem; height: 1rem; }
.banner + .section-heading { padding-top: 1.6rem; }
.section-heading { padding: clamp(2.5rem, 6vw, 4.2rem) 0 1.8rem; }
.section-heading h1, .section-heading h2 { margin: 0; font-size: clamp(2.3rem, 5vw, 4.8rem); line-height: .95; letter-spacing: -.035em; font-weight: 700; }
.page-title { font: 700 clamp(2.2rem, 5vw, 3.6rem)/1 var(--sans); letter-spacing: -.035em; margin: 2.5rem 0 1.5rem; }
.actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.4rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; margin-bottom: 1.6rem; }
.toolbar .field { max-width: 300px; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font-size: .88rem; font-weight: 600; padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.chip[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); grid-column: 1 / -1; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.card { position: relative; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .18s, box-shadow .18s, border-color .18s; }
@media (hover: hover) { .card:hover { transform: translateY(-4px); border-color: var(--ink); box-shadow: var(--shadow); } }
.card-img { aspect-ratio: 16 / 9; background: var(--soft); overflow: hidden; display: block; border-bottom: 1px solid var(--line); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { display: flex; flex-direction: column; gap: .5rem; padding: 1.3rem 1.4rem; flex: 1; }
.card h3 { margin: .3rem 0 0; font-size: clamp(1.45rem, 2.3vw, 1.9rem); line-height: 1.05; letter-spacing: -.025em; font-weight: 700; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
p.preview { margin: 0; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin-top: auto; padding-top: 1rem; display: flex; flex-wrap: nowrap; white-space: nowrap; gap: .45rem; color: var(--muted); font-size: .82rem; }
.meta > * { flex: 0 0 auto; }
.meta > * + *::before { content: "•"; margin-right: .45rem; opacity: .5; }
.meta .author { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-weight: 500; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #5d151a); color: #fff; font: 800 4rem var(--sans); }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; position: relative; z-index: 1; }
.tag { font-size: .78rem; font-weight: 700; padding: .2rem .75rem; border-radius: 999px; border: 1px solid transparent; }
.tint-0 { background: #fff1c9; color: #8a5a00; border-color: #f3dc9a; }
.tint-1 { background: #ffe5e4; color: #a01424; border-color: #f6c3c0; }
.tint-2 { background: #e2f3e6; color: #1f6a3a; border-color: #bfe0c8; }
.tint-3 { background: #e4ecfa; color: #25508f; border-color: #c3d4f0; }
.tint-4 { background: #efe5fa; color: #5e2f93; border-color: #d9c6f0; }
.tint-5 { background: #ffe9d6; color: #a14a0a; border-color: #f5cfa8; }
.tint-6 { background: #d9f2f0; color: #146a66; border-color: #aedcd8; }
.tint-7 { background: #fde4f0; color: #a0245e; border-color: #f4bfd8; }
.tint-8 { background: #e6ebd4; color: #4d6013; border-color: #cbd6a6; }
.tint-9 { background: #e3e4f7; color: #35389a; border-color: #c4c6ea; }
a.tag:hover { filter: brightness(.96); }
.tag.type { background: var(--ink); color: #fff; }

/* ---------- 4 Beitrag & Rechtstexte ---------- */
.article { max-width: 740px; margin: 2.5rem auto 0; }
.article h1 { font: 700 clamp(2.2rem, 5.5vw, 3.8rem)/1 var(--sans); letter-spacing: -.035em; margin: 1rem 0; }
.byline { display: flex; flex-wrap: wrap; gap: .2rem .6rem; color: var(--muted); font-size: .92rem; }
.byline > * + *::before { content: "•"; margin-right: .6rem; opacity: .5; }
.byline strong { color: var(--ink); font-weight: 600; }
.lede { font-size: 1.3rem; line-height: 1.45; color: var(--muted); margin: 1.4rem 0; }
.article figure { margin: 2rem 0; }
.article figure img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.article figcaption { font-size: .85rem; color: var(--muted); margin-top: .5rem; }
.prose { font-size: 1.12rem; line-height: 1.75; }
.prose .gap { height: 1.75em; } /* zusätzliche Leerzeile aus dem Editor */
.prose h2 { font: 700 1.6rem/1.2 var(--sans); letter-spacing: -.02em; margin: 2.2rem 0 .5rem; }
.prose h3 { font: 700 1.2rem/1.3 var(--sans); letter-spacing: -.01em; margin: 1.6rem 0 .4rem; }
.prose blockquote { margin: 1.8rem 0; padding: .1rem 0 .1rem 1.2rem; border-left: 3px solid var(--accent); font-size: 1.2rem; color: var(--muted); }
.prose ul { padding-left: 1.4rem; }
.notice { background: #fff1c9; color: #6b4600; border-radius: 12px; padding: .6rem 1rem; margin-bottom: 1rem; font-size: .92rem; }
.back { display: inline-block; margin-bottom: 1rem; color: var(--muted); font-weight: 500; }
.back:hover { color: var(--accent-dark); }
#more-wrap { margin-top: 4rem; }
.section-head h2 { font: 700 clamp(1.8rem, 3.5vw, 2.6rem)/1 var(--sans); letter-spacing: -.035em; margin: 0 0 1.4rem; }

.legal { max-width: 740px; }
.legal h2 { font: 700 1.3rem var(--sans); margin: 2rem 0 .4rem; }

/* ---------- 5 Suche ---------- */
dialog.search { width: min(660px, 100% - 1.5rem); margin: 10vh auto auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 0; background: var(--panel); color: var(--ink); box-shadow: 0 25px 70px rgba(45, 32, 21, .3); }
dialog.search::backdrop { background: rgba(23, 20, 18, .4); backdrop-filter: blur(3px); }
.search-top { display: flex; gap: .6rem; padding: 1rem; border-bottom: 1px solid var(--line); }
.search-top .field { font-size: 1.05rem; max-width: none; min-width: 0; flex: 1; text-overflow: ellipsis; }
#search-close svg { display: none; }
.results { max-height: 55vh; overflow: auto; margin: 0; padding: .5rem; list-style: none; }
.results a { display: grid; grid-template-columns: 72px 1fr; gap: .8rem; padding: .5rem; border-radius: 14px; align-items: center; }
.results a:hover, .results a:focus-visible { background: var(--soft); }
.results img, .results .ph { width: 72px; height: 48px; object-fit: cover; border-radius: 10px; font-size: 1.3rem; }
.results strong { display: block; line-height: 1.25; }
.results small { color: var(--muted); }
.search-hint { padding: 1rem 1.2rem; color: var(--muted); margin: 0; }
.search-foot { padding: .7rem 1.2rem; border-top: 1px solid var(--line); text-align: right; font-size: .9rem; }
.search-foot a { font-weight: 700; color: var(--accent-dark); }

/* ---------- Weitere Bausteine: Symbol-Buttons, Seitenwechsel, Bilder im Text, Platzhalter ---------- */
.btn.icon { padding: .45rem; width: 2.1rem; height: 2.1rem; }
.btn.icon svg { width: 1.1rem; height: 1.1rem; }
.nav-right { display: flex; align-items: center; gap: .5rem; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-top: 2.5rem; }
.pager:empty { display: none; }
.chip:disabled { opacity: .4; cursor: default; }
.chip:disabled:hover { border-color: var(--line); color: var(--muted); }
.foot-text a { text-decoration: underline; text-underline-offset: 3px; }
.prose .inline-fig { margin: 2rem 0; }
.prose .inline-fig img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.prose .inline-fig figcaption { font-size: .85rem; color: var(--muted); margin-top: .5rem; }

/* Skeleton-Platzhalter */
.skeleton .card-img, .sk { background: linear-gradient(90deg, var(--soft) 25%, #f6f0e4 50%, var(--soft) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.skeleton .card-img { border-bottom: 0; }
.card.skeleton:hover { transform: none; border-color: var(--line); box-shadow: none; }
.sk { display: block; border-radius: 999px; height: 1rem; }
.sk-tag { width: 90px; height: 1.4rem; }
.sk-title { height: 1.6rem; width: 90%; border-radius: 10px; }
.sk-h1 { height: 3rem; width: 100%; border-radius: 12px; margin-bottom: .6rem; }
.sk-line { width: 100%; margin-top: .4rem; }
.sk.short { width: 60%; }
.sk-figure { height: 320px; border-radius: var(--radius); margin: 1.5rem 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-head, .footer, dialog { display: none !important; } }


/* ---------- 6 Redaktionsbereich ---------- */
body.admin-mode .footer, body.admin-mode #site-header { display: none; }

/* roter Rahmen mit runden Ecken; die rote Leiste gehört optisch zum Rahmen */
body.admin-mode::before { content: ""; position: fixed; inset: 6px; border-radius: 20px; box-shadow: 0 0 0 100vmax var(--accent); pointer-events: none; z-index: 60; }
.admin-strip { background: var(--accent); color: #fff; text-align: center; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: .55rem 1rem calc(.4rem + 20px); margin-bottom: -20px; }
body.admin-mode .site-head { margin-inline: 6px; border-radius: 20px 20px 0 0; background: var(--bg); backdrop-filter: none; }
.nav button { padding: .5rem .9rem; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: .96rem; cursor: pointer; }
.nav button:hover { color: var(--ink); }
.nav button[aria-current="true"] { color: var(--accent-dark); font-weight: 700; }
.who { color: var(--muted); font-size: .9rem; margin-right: .3rem; }

.admin { padding-top: 1.5rem; }
.admin h1 { font: 700 2rem var(--sans); margin: 0 0 1rem; }
.login { max-width: 420px; margin: 1rem auto; display: grid; gap: .5rem; }
.login label, .form label { font-weight: 600; font-size: .92rem; margin-top: .6rem; display: block; }
.form-error { color: var(--accent); min-height: 1.4em; margin: .2rem 0; font-weight: 600; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.panel h2 { font: 700 1.25rem var(--sans); margin: 0 0 .6rem; }
.hint { font-size: .82rem; color: var(--muted); margin: .1rem 0 0; }

/* Beitragsliste */
.admin .toolbar { gap: .75rem; }
.admin .toolbar .field, .admin .toolbar .btn { height: 2.85rem; padding-block: 0; }
.search-field { position: relative; flex: 1 1 220px; max-width: 320px; }
.search-field .field { padding-left: 2.7rem; }
.search-field svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 1.2rem; height: 1.2rem; color: var(--muted); pointer-events: none; }
.btn.icon-lg { width: 2.85rem; padding-inline: 0; }
.btn.icon-lg svg { width: 1.3rem; height: 1.3rem; }
.admin .toolbar > select.field { flex: 0 0 auto; width: auto; }
.toolbar-end { display: flex; gap: .75rem; margin-left: auto; }
.table-wrap { overflow-x: auto; }
table.posts { width: 100%; border-collapse: collapse; font-size: .95rem; }
.posts th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .5rem; border-bottom: 2px solid var(--ink); }
.posts td { padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.posts td:not(:nth-child(2)) { white-space: nowrap; }
.posts td:last-child, .posts th:last-child { width: 1%; }
.posts .thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--soft); }
.posts .t-title { font-weight: 700; font-size: 1.05rem; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: .35rem; }
.status { font-size: .75rem; font-weight: 700; padding: .1rem .55rem; border-radius: 999px; border: 1px solid var(--line); }
.status.published { background: #d9f2e3; color: #0f5132; border-color: #a9dcbc; }
.status.draft { background: #fff1cc; color: #664d03; border-color: #e6c85a; }

/* Editor und Team */
.form { display: grid; gap: .3rem; }
.form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.form textarea.field { min-height: 340px; resize: vertical; font-size: 1.05rem; line-height: 1.6; }
.form textarea.short { min-height: 90px; font-size: 1rem; }
select.field { width: auto; max-width: 220px; }
.form select.field { width: 100%; max-width: none; }
.toolbar-md { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .3rem; }
.image-box { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.image-box .preview-img { width: 240px; aspect-ratio: 16 / 10; border-radius: 8px; border: 2px dashed var(--line); background: var(--soft); object-fit: cover; display: grid; place-items: center; color: var(--muted); font-size: .85rem; text-align: center; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }
.team-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.team-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
dialog.preview { width: min(980px, 100% - 1.5rem); max-height: 92vh; margin: 4vh auto; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); box-shadow: 0 25px 70px rgba(45, 32, 21, .35); }
dialog.preview::backdrop { background: rgba(23, 20, 18, .5); backdrop-filter: blur(3px); }
.preview-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1.2rem; background: var(--bg); border-bottom: 1px solid var(--line); }
.preview-bar strong { font-size: 1.05rem; }
.preview-body { padding: 1.5rem 1.5rem 2.5rem; }
.preview-body h2.preview-h { font: 700 1.1rem var(--sans); margin: 0 0 .8rem; color: var(--muted); }
.preview-body .grid { grid-template-columns: minmax(0, 340px); margin-bottom: 2.5rem; }
.preview-body .article { margin-top: 0; }
.preview-body .back { display: none; }

#toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translate(-50%, 150%); background: var(--ink); color: var(--bg); padding: .7rem 1.2rem; border-radius: 999px; font-weight: 600; transition: transform .25s; z-index: 50; max-width: calc(100% - 2rem); }
#toast.show { transform: translate(-50%, 0); }
#toast.error { background: var(--accent); color: var(--accent-ink); }
.team-list select.field { height: 2.2rem; padding: 0 .6rem; font-size: .9rem; }
.foot-contact { display: block; margin-top: 1rem; }

/* Nachfrage-Fenster (ersetzt confirm()/prompt()) */
dialog.ask { width: min(460px, 100% - 1.5rem); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); box-shadow: 0 25px 70px rgba(45, 32, 21, .3); }
dialog.ask::backdrop { background: rgba(23, 20, 18, .45); backdrop-filter: blur(3px); }
.ask-box { padding: 1.7rem 1.7rem 1.4rem; display: grid; gap: .8rem; }
.ask-box h2 { margin: 0; font: 700 1.5rem/1.2 var(--sans); letter-spacing: -.02em; }
.ask-box p { margin: 0; color: var(--muted); }
.ask-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; }
.admin-version { margin: auto 0 0; padding: 1rem 0 1.4rem; text-align: center; color: var(--muted); font-size: .8rem; }
body.admin-mode #app > div { min-height: 100vh; display: flex; flex-direction: column; } /* Versionsnummer sitzt ganz unten auf der Seite */
body.admin-mode main { min-height: 0; padding-bottom: 1rem; }
.th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; text-transform: inherit; letter-spacing: inherit; font: inherit; color: inherit; border-radius: 6px; }
.th-sort:hover { color: var(--ink); }
.th-sort:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.th-sort::after { content: "▲▼"; opacity: .3; font-size: .55em; letter-spacing: -.05em; }
th[aria-sort="ascending"] .th-sort::after { content: "▲"; opacity: 1; color: var(--accent-dark); font-size: .6em; }
th[aria-sort="descending"] .th-sort::after { content: "▼"; opacity: 1; color: var(--accent-dark); font-size: .6em; }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--ink); }
.posts td.num { text-align: right; font-variant-numeric: tabular-nums; }
.posts th[data-th="views"] { text-align: right; }
body.admin-mode .nav-right .btn svg { display: none; } /* am Computer Text, auf dem Handy Symbol */
.t-sub, .sort-select { display: none; } /* nur in der Handy-Ansicht der Beitragsliste */

/* ---------- Handy-Ansicht (bis 640 px). Steht ganz unten, damit sie die Grundregeln oben überschreibt. ---------- */
@media (max-width: 640px) {
  /* Raster und Überschriften */
  .grid { grid-template-columns: 1fr; }
  main { padding-bottom: 2rem; }
  .section-heading { padding: 1.6rem 0 1.2rem; }
  .section-heading h1, .section-heading h2 { font-size: 2.1rem; }
  h1, h2, h3 { overflow-wrap: break-word; hyphens: auto; }

  /* Kopfzeile: Tabs links, Logo Mitte, Suche rechts – alles mindestens 44 px hoch (Daumen-tauglich) */
  .bar { width: calc(100% - 1.5rem); gap: .25rem; }
  .brand-logo { height: 52px; }
  .nav a, .nav button { display: inline-flex; align-items: center; min-height: 44px; padding: .4rem .6rem; font-size: .9rem; white-space: nowrap; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; }
  .nav-right .btn .label, #new .label { display: none; }
  .btn.icon { width: 2.75rem; height: 2.75rem; }
  .nav-right .btn { width: 44px; padding-inline: 0; }
  body.admin-mode .nav-right .btn svg { display: block; width: 1.3rem; height: 1.3rem; }

  /* Filter, Tags, Seitenwechsel, Links */
  .toolbar .field { max-width: none; }
  .chip { min-height: 40px; padding-inline: 1rem; }
  .pager .chip { min-width: 44px; min-height: 44px; }
  .tag { padding: .3rem .65rem; font-size: .74rem; }
  .back, .footer nav a { display: inline-flex; align-items: center; min-height: 32px; }
  .footer { padding: .35rem 0; font-size: .8rem; line-height: 1.3; }
  .footer .wrap { flex-direction: column; gap: 0; }
  .foot-contact { margin-top: .15rem; }
  #search-close { width: 2.85rem; padding-inline: 0; height: 2.85rem; }
  #search-close svg { display: block; width: 1.3rem; height: 1.3rem; }
  #search-close .label { display: none; }
  .footer nav { flex-wrap: wrap; gap: 0 1.4rem; }
  .foot-contact a { display: inline-block; padding: .2rem 0; }

  /* Fenster */
  dialog.search { margin-top: .75rem; }
  .results { max-height: 50dvh; }
  dialog.preview { width: calc(100% - .75rem); margin: .4rem auto; max-height: 96dvh; }
  .preview-body { padding: 1rem 1rem 2rem; }
  .ask-box { padding: 1.4rem 1.2rem 1.1rem; }
  .ask-actions .btn { flex: 1 1 auto; }

  /* Redaktion: Hinweisleiste kürzer, Kopf kompakt (Logo oben, darunter Tabs und Buttons in einer Zeile) */
  .admin-strip { font-size: .72rem; padding-top: .45rem; }
  .strip-more, .who { display: none; }
  body.admin-mode .bar { grid-template-columns: 1fr auto; grid-template-areas: "brand brand" "nav right"; gap: .1rem .5rem; justify-items: stretch; }
  body.admin-mode .bar .brand { grid-area: brand; justify-self: center; }
  body.admin-mode .bar .nav { grid-area: nav; justify-self: start; }
  body.admin-mode .bar .nav-right { grid-area: right; justify-self: end; }
  .panel { padding: 1rem; }
  .form-actions .btn { flex: 1 1 auto; }
  .toolbar-md .btn { min-height: 40px; }
  .image-box .preview-img { width: 100%; }
  .team-list li { flex-wrap: wrap; }

  /* Beitragsliste: Suche über die ganze Breite, Filter nebeneinander, Knöpfe rechts */
  .search-field { flex: 1 1 100%; max-width: none; }
  .admin .toolbar > select.field { flex: 1 1 40%; width: auto; min-width: 0; max-width: none; }
  .sort-select { display: block; }
  .toolbar-end { margin-left: 0; width: 100%; justify-content: flex-end; }
  #new { width: 2.85rem; padding-inline: 0; } /* Neuer Beitrag: auf dem Handy nur das Plus-Symbol */

  /* Beitragsliste als Karten statt breiter Tabelle: Bild | Titel, Angaben, Knöpfe – ohne seitliches Scrollen */
  .table-wrap { overflow: visible; }
  table.posts, .posts tbody { display: block; }
  .posts thead { display: none; }
  .posts tr { display: grid; grid-template-columns: 64px 1fr; grid-template-areas: "thumb title" "thumb sub" "thumb actions"; column-gap: .8rem; row-gap: .25rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
  .posts tr:last-child { border-bottom: 0; }
  .posts tr.empty-row { display: block; }
  .posts td { display: block; padding: 0; border: 0; white-space: normal; }
  .posts td:nth-child(1) { grid-area: thumb; }
  .posts td:nth-child(2) { grid-area: title; }
  .posts td:nth-child(n+3):nth-child(-n+7) { display: none; } /* Typ, Autor, Datum, Status, Aufrufe stehen jetzt in .t-sub */
  .posts td:last-child { grid-area: actions; width: auto; }
  .posts .thumb { width: 64px; height: 64px; }
  .t-sub { display: block; color: var(--muted); font-size: .85rem; line-height: 1.5; }
  .row-actions { justify-content: flex-start; gap: .5rem; margin-top: .2rem; }
}
