/* Tech-Port Forenarchiv */
:root {
  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --text: #1a222c;
  --muted: #5a6676;
  --border: #dbe1e8;
  --accent: #0068b5;
  --accent-hover: #004f8a;
  --brand: #0099ff;
  --button-bg: #0068b5;
  --button-text: #ffffff;
  --header: #171e26;
  --quote: #eef3f8;
  --best: #e7f6ec;
  --best-border: #2e9b57;
  --todo: #fff3bf;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151c;
    --surface: #18202a;
    --surface-2: #1e2834;
    --text: #e4e9ef;
    --muted: #9aa6b4;
    --border: #2a3644;
    --accent: #5cb8ff;
    --accent-hover: #8fcdff;
    --button-bg: #1f7fd0;
    --quote: #1f2935;
    --best: #15291d;
    --best-border: #3fae68;
    --todo: #4a3f12;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 16px; }
.muted { color: var(--muted); font-size: .9rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; color: #000; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* Kopf und Fuß ---------------------------------------------------------------------------- */
.site-header { background: var(--header); color: #fff; padding-top: env(safe-area-inset-top, 0px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; }
.brand-logo { height: 34px; width: auto; }
.brand-logo-small { display: none; height: 36px; width: auto; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { color: #dfe6ee; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.site-nav a:hover { background: #26313d; color: #fff; }
.archive-bar { background: #0b4f86; color: #f2f8ff; font-size: .92rem; padding: 8px 0; }
.archive-bar a { color: #fff; font-weight: 600; }
.site-footer { margin-top: 48px; background: var(--header); color: #b9c4d0; padding: 32px 0 calc(32px + env(safe-area-inset-bottom, 0px)); font-size: .92rem; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.site-footer h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: #8b98a7; margin-bottom: 8px; }
.site-footer nav a { display: block; color: #dfe6ee; text-decoration: none; padding: 2px 0; }
.site-footer nav a:hover { text-decoration: underline; }
.footer-logo { height: 24px; width: auto; margin-bottom: 8px; }
@media (max-width: 640px) {
  .brand-logo { display: none; }
  .brand-logo-small { display: block; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-inner > div:first-child { grid-column: 1 / -1; }
}

/* Allgemeine Bausteine --------------------------------------------------------------------- */
main { padding-top: 24px; }
.page-head { margin: 8px 0 24px; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 70ch; margin: 0 0 .6em; }
.section-title { font-size: 1.25rem; margin: 32px 0 12px; }
.breadcrumbs { font-size: .9rem; color: var(--muted); margin-bottom: 8px; }
.breadcrumbs a { color: var(--muted); }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px;
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button:hover { border-color: var(--accent); color: var(--accent); }
.button-primary { background: var(--button-bg); border-color: var(--button-bg); color: var(--button-text); }
.button-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.label {
  display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); margin-right: 4px;
}
.label-blue { background: #e3f0fc; border-color: #b8d8f5; color: #0b5394; }
.label-green { background: #e3f5e9; border-color: #b4e0c3; color: #1d6b3b; }
.label-orange { background: #fdf0e1; border-color: #f2d1a8; color: #8a4b08; }
.label-red { background: #fde6e6; border-color: #f3baba; color: #9b1c1c; }
.label-brown { background: #f3ece4; border-color: #dcc8b4; color: #6b4a2b; }
@media (prefers-color-scheme: dark) {
  .label-blue { background: #12314d; border-color: #1f4f7a; color: #a9d4ff; }
  .label-green { background: #143322; border-color: #22553a; color: #a6e3bd; }
  .label-orange { background: #3d2a12; border-color: #64441b; color: #f5c98f; }
  .label-red { background: #3f1a1a; border-color: #6b2a2a; color: #f6b1b1; }
  .label-brown { background: #33281e; border-color: #574533; color: #e1c9ad; }
}
.tag { display: inline-block; font-size: .85rem; color: var(--muted); margin-right: 10px; }

/* Startseite ------------------------------------------------------------------------------- */
.hero {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(20px, 4vw, 36px); box-shadow: var(--shadow);
}
.hero .lead { color: var(--text); }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 0; }
.stats-row div {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; text-align: center; box-shadow: var(--shadow);
}
.stats-row strong { display: block; font-size: 1.5rem; }
.stats-row span { color: var(--muted); font-size: .9rem; }
.search-inline { display: flex; gap: 8px; margin: 8px 0 20px; }
.search-inline input {
  flex: 1; min-width: 0; min-height: 42px; padding: 8px 12px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
.category { margin-bottom: 20px; }
.category-title {
  font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  margin: 0 0 8px;
}
.board-list, .thread-list {
  list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.board-row, .thread-item {
  display: flex; gap: 16px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--border);
}
.board-row:first-child, .thread-item:first-child { border-top: 0; }
.board-main, .thread-main { flex: 1; min-width: 0; }
.board-title, .thread-title { font-weight: 600; font-size: 1.02rem; text-decoration: none; overflow-wrap: anywhere; }
.board-title:hover, .thread-title:hover { text-decoration: underline; }
.board-desc, .board-subs { margin: 2px 0 0; font-size: .9rem; color: var(--muted); }
.board-subs a { color: var(--muted); }
.thread-labels:not(:empty) { margin-top: 4px; }
.thread-sub { font-size: .88rem; color: var(--muted); }
.thread-excerpt { margin: 4px 0 0; font-size: .9rem; color: var(--muted); }
.board-stats, .thread-stats { display: flex; gap: 16px; margin: 0; text-align: center; flex-shrink: 0; }
.board-stats dt, .thread-stats dt { font-size: .75rem; color: var(--muted); order: 2; }
.board-stats dd, .thread-stats dd { margin: 0; font-weight: 600; }
.board-stats div, .thread-stats div { display: flex; flex-direction: column; min-width: 64px; }
.thread-last { font-size: .82rem; color: var(--muted); width: 170px; flex-shrink: 0; }
.thread-last span { color: var(--text); }
.thread-item.is-pinned { background: var(--surface-2); }
@media (max-width: 720px) {
  .board-row, .thread-item { flex-wrap: wrap; gap: 6px 16px; }
  .board-stats, .thread-stats { text-align: left; }
  .board-stats div, .thread-stats div { flex-direction: row; gap: 4px; min-width: 0; align-items: baseline; }
  .board-stats dt, .thread-stats dt { order: 2; }
  .thread-last { display: none; }
}

/* Thema und Beiträge ---------------------------------------------------------------------- */
.thread-meta { color: var(--muted); margin: 0; }
.tags { margin: 6px 0 0; }
.posts { display: flex; flex-direction: column; gap: 16px; }
.post {
  display: grid; grid-template-columns: 190px minmax(0, 1fr); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); scroll-margin-top: 12px;
}
.post:target { outline: 2px solid var(--brand); }
.post.is-best { border-color: var(--best-border); }
.author { padding: 16px; border-right: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius) 0 0 var(--radius); text-align: center; }
.author-info { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 8px; }
.author-name { font-weight: 700; overflow-wrap: anywhere; }
.author-title { font-size: .85rem; color: var(--muted); }
.author-level { font-size: .75rem; font-weight: 600; color: var(--accent); }
.author-stats { margin: 10px 0 0; font-size: .8rem; width: 100%; }
.author-stats div { display: flex; justify-content: space-between; gap: 8px; }
.author-stats dt { color: var(--muted); }
.author-stats dd { margin: 0; font-weight: 600; }
.author-since { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.trophies { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 8px; }
.trophy { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); font-size: 14px; line-height: 1; }
.trophy-img { padding: 2px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; display: inline-block; vertical-align: middle; }
.avatar-initial { display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.6rem; }
.av-h0 { background: #b03a3a; } .av-h1 { background: #b0642a; } .av-h2 { background: #8a7a12; }
.av-h3 { background: #4f8a1f; } .av-h4 { background: #1f8a4a; } .av-h5 { background: #1a8580; }
.av-h6 { background: #1b6fa8; } .av-h7 { background: #2d4fb0; } .av-h8 { background: #5b3db3; }
.av-h9 { background: #8a3aa8; } .av-h10 { background: #a83a7c; } .av-h11 { background: #5d6b78; }
.post-main { padding: 14px 20px 18px; min-width: 0; }
.post-meta { display: flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.post-anchor { margin-left: auto; color: var(--muted); text-decoration: none; }
.badge-best { color: var(--best-border); font-weight: 700; }
.post.is-best .post-main { background: linear-gradient(var(--best), transparent 80px); border-radius: 0 var(--radius) var(--radius) 0; }
@media (max-width: 720px) {
  .post { grid-template-columns: 1fr; }
  .author {
    display: flex; align-items: center; gap: 12px; text-align: left; border-right: 0; border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0; padding: 10px 14px;
  }
  .author .avatar { width: 44px; height: 44px; font-size: 1.1rem; flex-shrink: 0; }
  .author-info { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0; }
  .author-stats, .trophies { display: none; }
  .post-main { padding: 12px 14px 16px; }
  .post.is-best .post-main { border-radius: 0 0 var(--radius) var(--radius); }
}

/* Beitragsinhalt */
.post-body, .prose { overflow-wrap: anywhere; }
.post-body > :first-child { margin-top: 0; }
.post-body p { margin: 0; }
.prose p { margin: 0 0 .75em; }
.post-body ul, .post-body ol, .post-body table, .post-body blockquote, .post-body pre { margin-top: .4em; margin-bottom: .6em; }
.post-body h3, .post-body h4, .post-body h5 { margin: 1.1em 0 .4em; }
.post-body h3 { font-size: 1.2rem; } .post-body h4 { font-size: 1.08rem; } .post-body h5 { font-size: 1rem; }
.post-body img, .prose img { border-radius: 4px; }
.post-body img.smiley { width: 20px; height: 20px; vertical-align: -4px; border-radius: 0; }
.post-body table { border-collapse: collapse; margin: 0 0 1em; display: block; overflow-x: auto; max-width: 100%; }
.post-body td, .post-body th { border: 1px solid var(--border); padding: 4px 8px; vertical-align: top; }
.text-center { text-align: center; } .text-right { text-align: right; } .text-justify { text-align: justify; }
.quote { margin: 0 0 1em; padding: 10px 14px; background: var(--quote); border-left: 4px solid var(--brand); border-radius: 6px; }
.quote-head { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.quote-link { text-decoration: none; margin-left: 4px; }
.quote > :last-child { margin-bottom: 0; }
.spoiler { margin: 0 0 1em; padding: 8px 12px; border: 1px dashed var(--border); border-radius: 6px; }
.spoiler summary { cursor: pointer; font-weight: 600; }
.box { padding: 10px 14px; border-radius: 6px; margin: 0 0 1em; border: 1px solid var(--border); background: var(--surface-2); }
.box-info { border-color: #9cc7ee; } .box-warn { border-color: #e9c46a; } .box-error { border-color: #e48f8f; } .box-success { border-color: #8fd1a6; }
pre.code { background: #0f1720; color: #e4e9ef; padding: 12px; border-radius: 6px; overflow-x: auto; font-size: .88rem; line-height: 1.45; }
kbd { font-family: ui-monospace, monospace; font-size: .85em; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-2); }
.mention { font-weight: 600; }
.img-missing {
  display: inline-block; padding: 6px 10px; margin: 2px 0; font-size: .82rem; color: var(--muted);
  border: 1px dashed var(--border); border-radius: 6px;
}
figure.attach { margin: 0 0 1em; }
figure.attach-left { float: left; margin-right: 16px; max-width: 50%; }
figure.attach-right { float: right; margin-left: 16px; max-width: 50%; }
.post-body::after { content: ""; display: table; clear: both; }
.video-card {
  display: flex; flex-direction: column; max-width: 480px; margin: 0 0 1em; text-decoration: none; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2);
}
.video-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 0; }
.video-title { padding: 8px 12px 0; font-weight: 600; }
.video-note { padding: 0 12px 8px; font-size: .78rem; color: var(--muted); }
.gallery { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.gallery img { width: 160px; height: 120px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.files { padding-left: 1.2em; margin: 12px 0 0; }
.edit-note { font-size: .8rem; color: var(--muted); margin: 14px 0 0; font-style: italic; }
.reactions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.reaction {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .82rem;
  background: var(--surface-2); border: 1px solid var(--border);
}
.reaction img { width: 18px; height: 18px; }
.reaction-count { font-weight: 700; }
.reaction-names { color: var(--muted); }
.signature {
  margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--muted);
  max-height: 160px; overflow: hidden;
}
.signature p { margin: 0 0 .3em; }
.signature img { max-height: 80px; width: auto; }

.poll { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; background: var(--surface-2); }
.poll-q { font-size: 1rem; }
.poll ul { list-style: none; padding: 0; margin: 0 0 6px; }
.poll li { display: grid; grid-template-columns: minmax(0, 1fr) 140px 6.5em; gap: 10px; align-items: center; padding: 3px 0; }
.poll progress { width: 100%; height: 10px; accent-color: var(--brand); }
.poll-num { font-size: .85rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 520px) { .poll li { grid-template-columns: 1fr auto; } .poll progress { grid-column: 1 / -1; grid-row: 2; } }

.cta-box {
  margin: 28px 0 0; padding: 20px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); border-left: 4px solid var(--brand); box-shadow: var(--shadow);
}
.cta-box h2 { font-size: 1.2rem; }
.cta-box p { margin: 0; max-width: 70ch; }

/* Gruppen-Seite --------------------------------------------------------------------------- */
.community-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 16px; }
.community-card {
  display: flex; flex-direction: column; gap: 6px; padding: 0 0 16px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.community-card:hover { border-color: var(--accent); color: var(--text); }
.community-card img { width: 100%; aspect-ratio: 1640 / 856; object-fit: cover; border-radius: 0; }
.community-card.is-primary { border-color: var(--brand); }
.community-name { font-weight: 700; font-size: 1.1rem; padding: 10px 16px 0; }
.community-text { padding: 0 16px; color: var(--muted); font-size: .92rem; }
.community-go { padding: 0 16px; margin-top: auto; color: var(--accent); font-weight: 600; font-size: .92rem; }

.prose { max-width: 75ch; }
.prose h2 { font-size: 1.2rem; margin-top: 1.4em; }
.prose h3 { font-size: 1.05rem; margin-top: 1.2em; }
.prose img.media-image { display: block; margin: 8px 0; }
.todo { background: var(--todo); padding: 10px 14px; border-radius: 6px; font-weight: 600; }
.similar { margin-top: 8px; }

/* Startseite: Facebook-Gruppen ------------------------------------------------------------ */
.landing-intro { margin: 8px 0 20px; }
.landing-intro h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); }
.groups { margin-bottom: 40px; }
.group-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.group-image { display: block; background: #fff; }
.group-image img { display: block; width: 100%; height: auto; aspect-ratio: 1640 / 856; border-radius: 0; }
.group-body { padding: 16px 20px 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; flex: 1; }
.group-body p { margin: 0; color: var(--muted); }
.group-body > .button { margin-top: auto; }
.group-name { font-size: 1.35rem; margin: 0; }
.group-kicker { font-size: .8rem !important; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--accent) !important; }
.group-featured { display: grid; grid-template-columns: 3fr 2fr; margin-bottom: 16px; border-color: var(--brand); }
.group-featured .group-body { justify-content: center; padding: 24px 28px; }
.group-featured .group-name { font-size: 1.7rem; }
.group-featured .group-body p:not(.group-kicker) { font-size: 1.05rem; color: var(--text); }
.group-featured .cta-row { margin-top: 8px; }
.group-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 12px; }
.button-large { min-height: 48px; padding: 10px 20px; font-size: 1.05rem; }
@media (max-width: 860px) {
  .group-featured { grid-template-columns: 1fr; }
  .group-featured .group-body { padding: 16px 20px 20px; }
}
@media (max-width: 640px) { .group-pair { grid-template-columns: 1fr; } }

.archive-teaser {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 24px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.archive-teaser h2 { font-size: 1.35rem; }
.archive-teaser p { color: var(--muted); margin: 0 0 12px; }
.archive-teaser-list h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.archive-teaser-list ul { margin: 0; padding-left: 1.1em; }
.archive-teaser-list li { margin: 4px 0; }
@media (max-width: 760px) { .archive-teaser { grid-template-columns: 1fr; padding: 18px; } }
.footer-inner { grid-template-columns: 2fr 1fr 1fr 1fr; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr 1fr; } .footer-inner > div:first-child { grid-column: 1 / -1; } }

/* Hinweis: Löschung anfragen */
.privacy-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 0 0 20px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.privacy-note p { margin: 0; flex: 1 1 320px; font-size: .95rem; }
.privacy-note-small { margin-top: 16px; background: transparent; border-style: dashed; }
.privacy-note-small p { color: var(--muted); font-size: .9rem; }
.privacy-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.privacy-actions .muted { font-size: .82rem; }
.privacy-note-end { margin: 32px 0 0; }
