/*
 * Forum – Frontend
 *
 * Die Farben kommen aus dem Theme: Schrift erbt ihre Farbe, Flächen bleiben
 * durchsichtig, Linien sind ein neutrales Grau. Die Darstellungsgröße stellen
 * Sie im Adminbereich ein – sie sitzt als Klasse am äußeren Rahmen.
 */

.fo {
    --fo-line: rgba(128, 128, 128, .28);
    --fo-soft: rgba(128, 128, 128, .09);
    --fo-softer: rgba(128, 128, 128, .05);
    --fo-accent: var(--rs-accent, var(--accent, #2563eb));
    --fo-radius: 12px;

    color: inherit;
    font-size: 15px;
    line-height: 1.6;
}

.fo-klein  { font-size: 13.5px; }
.fo-normal { font-size: 15px; }
.fo-gross  { font-size: 17px; }

.fo * { box-sizing: border-box; }

.fo-sr {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------------------------------- Überschriften */

.fo-title {
    margin: 0 0 12px;
    font-size: 1.3em;
    font-weight: 700;
    color: inherit;
    line-height: 1.3;
}

.fo-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: .85em;
}

.fo-crumbs a { color: var(--fo-accent); text-decoration: none; }
.fo-crumbs a:hover { text-decoration: underline; }
.fo-crumb-sep { opacity: .5; }

.fo-free { margin: 0 0 18px; }
.fo-free > :first-child { margin-top: 0; }
.fo-free > :last-child { margin-bottom: 0; }

/* -------------------------------------------------------------- Gruppen */

.fo-group { margin: 0 0 22px; }

.fo-group-title {
    margin: 0 0 8px;
    font-size: 1.1em;
    font-weight: 700;
    color: inherit;
}

.fo-group-title a { color: inherit; text-decoration: none; }
.fo-group-title a:hover { color: var(--fo-accent); }

.fo-group-text { margin: 0 0 10px; font-size: .88em; opacity: .8; }

/* --------------------------------------------------------------- Listen */

.fo-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--fo-line);
    border-radius: var(--fo-radius);
    overflow: hidden;
}

.fo-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 13px 15px;
    border-top: 1px solid var(--fo-line);
}

.fo-row:first-child { border-top: 0; }
.fo-row:nth-child(odd) { background: var(--fo-softer); }

.fo-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--fo-soft);
    opacity: .85;
}

.fo-icon img { width: 26px; height: 26px; object-fit: contain; border-radius: 5px; }

.fo-row-main { flex: 1 1 240px; min-width: 0; }

.fo-row-title {
    display: inline-block;
    color: inherit;
    text-decoration: none;
    font-weight: 700;
    line-height: 1.35;
}

.fo-row-title:hover { color: var(--fo-accent); }

.fo-row-text { margin: 3px 0 0; font-size: .85em; opacity: .8; }
.fo-row-sub { margin: 4px 0 0; font-size: .82em; }
.fo-row-sub a { color: var(--fo-accent); text-decoration: none; }
.fo-row-sub a:hover { text-decoration: underline; }

.fo-row-count {
    flex: 0 0 auto;
    display: flex;
    gap: 14px;
    font-size: .82em;
    opacity: .85;
    white-space: nowrap;
}

.fo-row-count strong { font-variant-numeric: tabular-nums; }

.fo-row-last {
    flex: 0 1 220px;
    min-width: 0;
    font-size: .84em;
}

.fo-row-last a { color: inherit; text-decoration: none; font-weight: 600; }
.fo-row-last a:hover { color: var(--fo-accent); }

.fo-meta { display: block; opacity: .75; font-size: .92em; }
.fo-soft { opacity: .7; }

.fo-tag {
    display: inline-block;
    margin-right: 7px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(47, 158, 68, .16);
    color: #2b8a3e;
    font-size: .72em;
    font-weight: 700;
    vertical-align: middle;
}

.fo-tag-off { background: rgba(128, 128, 128, .2); color: inherit; }

/* ------------------------------------------------------------- Leisten */

.fo-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin: 0 0 14px;
}

.fo-bar form { margin: 0; display: inline-flex; gap: 6px; align-items: center; }

.fo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    border: 1px solid var(--fo-line);
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: .86em;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.fo-btn:hover { border-color: var(--fo-accent); color: var(--fo-accent); }

.fo-btn-primary {
    background: var(--fo-accent);
    border-color: var(--fo-accent);
    color: #fff;
}

.fo-btn-primary:hover { color: #fff; filter: brightness(1.08); }

.fo-btn-small { padding: 5px 11px; font-size: .78em; }

.fo-btn-danger:hover { border-color: #e03131; color: #e03131; }

.fo-share {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.fo-share-label { font-size: .82em; opacity: .75; }

.fo-move select {
    padding: 5px 9px;
    border: 1px solid var(--fo-line);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: .8em;
    max-width: 180px;
}

.fo-move select option { color: initial; }

/* ------------------------------------------------------------ Beiträge */

.fo-posts { margin: 0 0 18px; }

.fo-post {
    border: 1px solid var(--fo-line);
    border-radius: var(--fo-radius);
    padding: 14px 16px;
    margin-bottom: 12px;
}

.fo-post.is-first { border-color: var(--fo-accent); }

.fo-post-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 12px;
    margin-bottom: 9px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--fo-line);
}

.fo-post-author { font-weight: 700; }
.fo-post-head .fo-meta { display: inline; font-size: .82em; }

.fo-post-body { overflow-wrap: break-word; }
.fo-post-body > :first-child { margin-top: 0; }
.fo-post-body > :last-child { margin-bottom: 0; }
.fo-post-body img { max-width: 100%; height: auto; border-radius: 8px; }
.fo-post-body blockquote {
    margin: 10px 0;
    padding: 6px 14px;
    border-left: 3px solid var(--fo-line);
    opacity: .9;
}
.fo-post-body pre {
    white-space: pre-wrap;
    background: var(--fo-soft);
    padding: 10px 12px;
    border-radius: 8px;
}
.fo-post-body table { border-collapse: collapse; max-width: 100%; }
.fo-post-body td, .fo-post-body th { border: 1px solid var(--fo-line); padding: 5px 9px; }

.fo-edited { margin: 10px 0 0; font-size: .8em; opacity: .7; }

.fo-post-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--fo-line);
}

.fo-post-foot form { margin: 0; }

/* -------------------------------------------------------------- Anhänge */

.fo-files {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--fo-line);
}

.fo-files-label { font-size: .82em; font-weight: 700; opacity: .8; }

.fo-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 1px solid var(--fo-line);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    font-size: .82em;
}

.fo-file:hover { border-color: var(--fo-accent); color: var(--fo-accent); }

.fo-file-img { padding: 4px; }
.fo-file-img img { display: block; width: 90px; height: 66px; object-fit: cover; border-radius: 5px; }

/* ------------------------------------------------------------ Formulare */

.fo-formbox {
    border: 1px solid var(--fo-line);
    border-radius: var(--fo-radius);
    background: var(--fo-softer);
    padding: 16px 18px;
    margin-top: 18px;
}

.fo-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0 16px;
}

.fo-field { margin-bottom: 13px; }

.fo-field label {
    display: block;
    margin-bottom: 5px;
    font-size: .85em;
    font-weight: 600;
    opacity: .85;
}

.fo-field input[type="text"],
.fo-field input[type="email"],
.fo-field input[type="search"],
.fo-field input[type="file"],
.fo-field textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--fo-line);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: .94em;
    line-height: 1.5;
}

.fo-field textarea { min-height: 130px; resize: vertical; }

.fo-field input:focus,
.fo-field textarea:focus { outline: 2px solid var(--fo-accent); outline-offset: -1px; }

.fo-hint { display: block; margin-top: 5px; font-size: .8em; opacity: .7; }

.fo-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

/* --------------------------------------------------------------- Suche */

.fo-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
}

.fo-search-label { font-size: .85em; font-weight: 600; opacity: .85; }

.fo-search input[type="search"] {
    flex: 1 1 180px;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--fo-line);
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: .9em;
}

/* ---------------------------------------------------------- Statistik */

.fo-stats {
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid var(--fo-line);
    border-radius: var(--fo-radius);
    background: var(--fo-softer);
}

.fo-stats-title { margin: 0 0 8px; font-size: 1em; font-weight: 700; }

.fo-stats ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    margin: 0;
    padding: 0;
    font-size: .88em;
}

/* ------------------------------------------------------------- Seiten */

.fo-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 14px 0;
    font-size: .85em;
}

.fo-pages-label { opacity: .7; margin-right: 4px; }

.fo-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    padding: 5px 9px;
    border: 1px solid var(--fo-line);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}

.fo-page:hover { border-color: var(--fo-accent); color: var(--fo-accent); }
.fo-page.is-on { background: var(--fo-accent); border-color: var(--fo-accent); color: #fff; }
.fo-page-gap { opacity: .6; padding: 0 2px; }

/* ---------------------------------------------------------- Meldungen */

.fo-note {
    margin: 0 0 14px;
    padding: 11px 14px;
    border: 1px solid var(--fo-line);
    border-radius: 10px;
    font-size: .9em;
}

.fo-note-ok { border-color: rgba(47, 158, 68, .5); background: rgba(47, 158, 68, .10); }
.fo-note-error { border-color: rgba(224, 49, 49, .5); background: rgba(224, 49, 49, .10); }

.fo-empty {
    margin: 0 0 16px;
    padding: 16px;
    border: 1px dashed var(--fo-line);
    border-radius: var(--fo-radius);
    text-align: center;
    font-size: .92em;
    opacity: .85;
}

/* --------------------------------------------------------- Der Editor */

.fo-editor {
    border: 1px solid var(--fo-line);
    border-radius: 8px;
    overflow: hidden;
}

.fo-editor-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding: 7px 8px;
    background: var(--fo-soft);
    border-bottom: 1px solid var(--fo-line);
}

.fo-editor-btn {
    min-width: 30px;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: .82em;
    line-height: 1.3;
    cursor: pointer;
}

.fo-editor-btn:hover { border-color: var(--fo-line); background: var(--fo-softer); }
.fo-editor-btn.is-on { border-color: var(--fo-accent); color: var(--fo-accent); }

.fo-editor-sep { width: 1px; margin: 3px 4px; background: var(--fo-line); }

.fo-editor-area {
    min-height: 150px;
    max-height: 520px;
    overflow-y: auto;
    padding: 12px 14px;
    outline: none;
}

.fo-editor-area:focus { box-shadow: inset 0 0 0 2px var(--fo-accent); }
.fo-editor-area > :first-child { margin-top: 0; }
.fo-editor-area > :last-child { margin-bottom: 0; }
.fo-editor-area img { max-width: 100%; height: auto; }

.fo-editor.is-source .fo-editor-area { display: none; }
.fo-editor textarea.fo-editor-source { display: none; }
.fo-editor.is-source textarea.fo-editor-source {
    display: block;
    width: 100%;
    min-height: 200px;
    border: 0;
    border-radius: 0;
    padding: 12px 14px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: .9em;
}

/* ---------------------------------------------------------- In der Box */

.fo-box-list, .fo-box-rows {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

.fo-box-list li {
    padding: 7px 0;
    border-top: 1px solid rgba(128, 128, 128, .2);
}

.fo-box-list li:first-child { border-top: 0; }
.fo-box-list a { color: inherit; text-decoration: none; font-weight: 600; }
.fo-box-list a:hover { text-decoration: underline; }

.fo-box-meta { display: block; font-size: .82em; opacity: .75; }

.fo-box-rows li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-top: 1px solid rgba(128, 128, 128, .2);
}

.fo-box-rows li:first-child { border-top: 0; }

.fo-box-empty { margin: 0; font-size: 14px; opacity: .8; }

.fo-widget { margin: 0 0 18px; }

/* ------------------------------------------------------------- Schmal */

@media (max-width: 640px) {
    .fo-row { gap: 8px 12px; }
    .fo-row-count { order: 3; }
    .fo-row-last { order: 4; flex: 1 1 100%; }
    .fo-icon { width: 32px; height: 32px; }
    .fo-icon svg { width: 18px; height: 18px; }
}

/* ------------------------------------------------------------- Drucken */

@media print {
    .fo-bar, .fo-formbox, .fo-search, .fo-pages, .fo-post-foot, .fo-crumbs { display: none !important; }
    .fo-post { border-color: #999; break-inside: avoid; }
}
