/* ==========================================================================
   SimpleMoney Forum — shared styles.
   Extends the site conventions already used by forum/general/index.html:
   the same :root variables, .page-header, main{max-width:900px} and .card.
   Loaded after /css/styles.css, which owns the shared nav bar.
   ========================================================================== */

:root {
    --bg: #f4f6f9;
    --card: #fff;
    --text: #222;
    --muted: #666;
    --accent: #0b6efd;
    --border: #e3e7ee;
    --danger: #e0564a;
    --ok: #1a9e5c;
}

* { box-sizing: border-box }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.page-header {
    background: #fff;
    /* styles.css sets `header { color:#fff }` for the dark nav bar, and this
       banner is also a <header>, so the colour must be restored explicitly or
       the heading renders white on white. */
    color: var(--text);
    padding: 18px;
    border-bottom: 1px solid #ddd;
}

.page-header h1 { margin: 0; font-size: 1.5rem }
.page-header p { margin: .35rem 0 0; color: var(--muted) }

main { max-width: 900px; margin: auto; padding: 20px }

.card {
    background: var(--card);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    margin-bottom: 16px;
    padding: 16px;
}

.card.tight { padding: 12px }

/* ---- generic bits ------------------------------------------------------ */

.muted { color: var(--muted) }
.small { font-size: .85rem }
.row { display: flex; gap: 12px; align-items: flex-start }
.row.center { align-items: center }
.grow { flex: 1; min-width: 0 }
.spacer { margin-left: auto }
.stack > * + * { margin-top: 10px }
.hidden { display: none !important }

a.plain { color: inherit; text-decoration: none }
a.plain:hover { text-decoration: underline }

.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 12px }
.crumbs a { color: var(--muted) }

.btn {
    display: inline-block;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

.btn:hover { background: #f2f5f9 }
.btn[disabled] { opacity: .55; cursor: default }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-primary:hover { background: #0a5fd8 }

.chip {
    display: inline-block;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: .78rem;
    color: var(--muted);
    background: #fff;
    text-decoration: none;
}

.chip.on { background: var(--accent); border-color: var(--accent); color: #fff }

.field {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: .95rem;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}

.field:focus { outline: 2px solid var(--accent); outline-offset: -1px }
textarea.field { resize: vertical; line-height: 1.55 }

.notice { padding: 10px 12px; border-radius: 8px; font-size: .9rem; margin-bottom: 12px }
.notice.err { background: #fdecea; color: #a3271c; border: 1px solid #f5c6c2 }
.notice.ok  { background: #e8f6ee; color: #12673c; border: 1px solid #bfe3cf }

/* Post bodies are inserted as TEXT, never HTML. pre-wrap keeps the author's
   line breaks without needing any markup at all — which is also what makes
   stored XSS impossible here. */
.body-text { white-space: pre-wrap; word-wrap: break-word; line-height: 1.6; margin: 0 }

.avatar {
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    flex: none;
}

/* ---- vote box ---------------------------------------------------------- */

.vote { display: flex; flex-direction: column; align-items: center; gap: 2px; user-select: none; flex: none }
.vote.h { flex-direction: row }

.vote button {
    width: 28px; height: 28px;
    display: grid; place-items: center;
    border: 0; background: none; cursor: pointer;
    border-radius: 6px; color: var(--muted); font-size: .8rem; line-height: 1;
}

.vote button:hover { background: #eef2f7 }
.vote button[disabled] { opacity: .5; cursor: default }
.vote button.up.on { color: var(--accent); background: #e7f0ff }
.vote button.down.on { color: var(--danger); background: rgba(224,86,74,.12) }
.vote .score { font-size: .8rem; font-weight: 700; min-width: 24px; text-align: center }

/* ---- lists ------------------------------------------------------------- */

.thread-title { font-size: 1.02rem; font-weight: 700; margin: 0 0 4px }
.meta { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center }

.sections { display: grid; gap: 12px; grid-template-columns: 1fr 1fr }
@media (max-width: 700px) { .sections { grid-template-columns: 1fr } }

.reply { border-left: 3px solid transparent }
.reply.nested { border-left-color: #cfe0ff }
ul.replies { list-style: none; margin: 0; padding: 0 }
ul.replies ul.replies { margin-left: 14px; margin-top: 8px }

.skeleton { height: 76px; border-radius: 10px; background: #e9edf3; animation: pulse 1.2s ease-in-out infinite }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .55 } }

.imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px }
.imgs img { max-height: 260px; max-width: 100%; border-radius: 8px; border: 1px solid var(--border) }

@media (max-width: 600px) {
    main { padding: 12px }
    .page-header h1 { font-size: 1.2rem }
    .card { padding: 12px }
}
