/*
 * Durvog.com — forum & composer
 *
 * Loaded on top of durvog.css, only on the pages that need it. Everything here
 * builds on the same tokens; nothing redefines a colour.
 */

/* ----------------------------------------------------------- wide layout */

/* The forum reads as a feed, so it gets more room than the article pages and
   wider rails to match. */
.layout--forum { grid-template-columns: 290px minmax(0, 1fr) 330px; gap: 1.5rem; }
.layout--forum .thread__excerpt { font-size: .92rem; }

@media (max-width: 1400px) {
    .layout--forum { grid-template-columns: 260px minmax(0, 1fr) 300px; gap: 1.25rem; }
}

/* ------------------------------------------------------------ forum hero */

.forum-hero {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 340px;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--green-50), var(--surface) 60%);
    border: 1px solid var(--green-100);
    border-radius: var(--radius-lg);
}
.forum-hero h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.02em; margin-bottom: .5rem; }
.forum-hero p { margin: 0; color: var(--ink-2); font-size: .98rem; }
.forum-hero__art { display: grid; place-items: center; }
.forum-hero__art svg { width: 100%; max-width: 200px; height: auto; }

.guest-card {
    background: var(--surface);
    border: 1px solid var(--green-100);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}
.guest-card__head { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: .5rem; }
.guest-card__tick {
    width: 30px; height: 30px; border-radius: 999px; flex: none;
    background: var(--green-100); color: var(--green-700);
    display: grid; place-items: center; font-size: .85rem;
}
.guest-card h3 { margin: 0; font-size: 1rem; }
.guest-card p { margin: 0 0 .75rem; font-size: .85rem; color: var(--muted); }

/* ------------------------------------------------------------ board rail */

.board-rail .count {
    margin-inline-start: auto;
    font-size: .78rem;
    color: var(--muted);
    background: var(--line-soft);
    border-radius: 999px;
    padding: 0 .45rem;
    font-weight: 700;
}
.board-rail a.is-active .count { background: var(--green-100); color: var(--green-800); }
.board-rail a i { width: 18px; text-align: center; color: var(--muted); }
.board-rail a.is-active i, .board-rail a:hover i { color: var(--green-700); }

.side-cta {
    text-align: center;
    padding: 1.25rem 1rem;
    background: var(--green-50);
    border: 1px solid var(--green-100);
    border-radius: var(--radius);
}
.side-cta i { font-size: 1.6rem; color: var(--green-600); }
.side-cta h3 { margin: .5rem 0 .35rem; font-size: 1rem; }
.side-cta p { font-size: .85rem; color: var(--muted); margin-bottom: .9rem; }

.pull-quote {
    text-align: center;
    padding: 1.5rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.pull-quote i { color: var(--green-100); font-size: 1.5rem; }
.pull-quote p { font-size: 1.02rem; font-weight: 600; color: var(--ink); line-height: 1.6; margin: .5rem 0 .75rem; }
.pull-quote hr { border: 0; border-top: 2px solid var(--green-100); width: 48px; margin: 0 auto; }

/* --------------------------------------------------------- forum threads */

/* The feed card, laid out the way Reddit lays one out: votes in a column on
   the left, then the post, then a row of actions under the image. */
.thread {
    display: flex;
    gap: .5rem;
    padding: .9rem 1rem .6rem .5rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: border-color .12s ease;
}
.thread + .thread { margin-top: .85rem; }
.thread:hover { border-color: var(--green-100); }
.thread__body { flex: 1; min-width: 0; }

/* The rail itself is styled in durvog.css (.vote--rail); a thread only says
   how loud the arrows are here, because they carry the feed's colour. */
.thread > .vote--rail .vote__btn--up { color: var(--green-600); }
.thread > .vote--rail .vote__btn--down { color: var(--red-600); }

.thread__meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .8rem; }
.thread__board {
    display: inline-flex; align-items: center; gap: .35rem;
    font-weight: 700; color: var(--ink-2);
}
.thread__board:hover { color: var(--green-700); }
.thread__by { color: var(--muted); }

.thread__title { font-size: 1.12rem; font-weight: 700; margin: .35rem 0 .25rem; line-height: 1.45; }
.thread__title a { color: var(--ink); }
.thread__title a:hover { color: var(--green-700); }

.thread__excerpt { font-size: .92rem; color: var(--ink-2); margin: 0; line-height: 1.65; }

/* The image sits under the text, full width, the way a feed shows one. */
/* A fixed frame rather than letting the image set its own height: a tiny or
   oddly-shaped upload would otherwise render as a sliver across the card. */
.thread__shot {
    display: block; margin-top: .7rem; border-radius: var(--radius-sm);
    overflow: hidden; border: 1px solid var(--line); background: var(--line-soft);
    aspect-ratio: 16 / 9; max-height: 420px;
}
.thread__shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Icons below, in a row, like Reddit's action bar. */
.thread__bar { display: flex; align-items: center; gap: .1rem; flex-wrap: wrap; margin-top: .5rem; }
.thread__bar form { display: inline-flex; }
.thread__bar .act { font-weight: 600; font-size: .82rem; padding: .35rem .6rem; border-radius: 8px; }

/* ------------------------------------------------------------- composer */

.composer { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }

.editor-wrap { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.editor-wrap:focus-within { outline: 2px solid var(--green-500); outline-offset: 1px; border-color: transparent; }

.editor-toolbar {
    display: flex; align-items: center; gap: .15rem; flex-wrap: wrap;
    padding: .35rem .4rem; border-bottom: 1px solid var(--line-soft); background: var(--line-soft);
}
.editor-tool {
    border: 0; background: none; cursor: pointer; color: var(--ink-2);
    width: 32px; height: 30px; border-radius: 7px; font-size: .88rem;
    display: grid; place-items: center;
}
.editor-tool:hover { background: var(--surface); color: var(--green-700); }
.editor-tool.is-on { background: var(--surface); color: var(--green-700); box-shadow: var(--shadow); }
.editor-toolbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 .3rem; }
.editor-toolbar .hint { margin-inline-start: auto; font-size: .75rem; color: var(--muted); padding-inline-end: .4rem; }

.editor {
    min-height: 200px; padding: .85rem; font-size: .95rem; line-height: 1.75;
    outline: 0; overflow-wrap: anywhere;
}
.editor:empty::before { content: attr(data-placeholder); color: var(--muted); }
.editor a { color: var(--green-600); text-decoration: underline; }
.editor p { margin: 0 0 .6rem; }
.editor ul, .editor ol { margin: 0 0 .6rem; padding-inline-start: 1.3rem; }

/* -------------------------------------------------------------- uploads */

.upload-grid { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.upload-thumb {
    position: relative; width: 92px; height: 92px; border-radius: var(--radius-sm);
    overflow: hidden; border: 1px solid var(--line); background: var(--line-soft);
}
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-thumb button {
    position: absolute; top: 3px; right: 3px; width: 22px; height: 22px;
    border: 0; border-radius: 999px; background: rgba(17, 24, 39, .75); color: #fff;
    cursor: pointer; font-size: .7rem; display: grid; place-items: center;
}
.upload-add {
    width: 92px; height: 92px; border: 1px dashed var(--line); border-radius: var(--radius-sm);
    display: grid; place-items: center; gap: .2rem; cursor: pointer; color: var(--muted);
    background: var(--surface); font-size: .78rem; text-align: center;
}
.upload-add:hover { border-color: var(--green-500); color: var(--green-700); background: var(--green-50); }
.upload-add i { font-size: 1.05rem; }

/* ------------------------------------------------------------ tag input */

.tag-input {
    display: flex; flex-wrap: wrap; gap: .35rem; align-items: center;
    padding: .45rem .5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.tag-input:focus-within { outline: 2px solid var(--green-500); outline-offset: 1px; border-color: transparent; }
.tag-input input { border: 0; outline: 0; flex: 1; min-width: 120px; padding: .2rem; font: inherit; font-size: .9rem; }
.tag-chip {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .2rem .3rem .2rem .6rem; border-radius: 999px;
    background: var(--green-50); border: 1px solid var(--tag-line); color: var(--green-700);
    font-size: .82rem; font-weight: 600;
}
.tag-chip button {
    border: 0; background: none; cursor: pointer; color: var(--green-700);
    width: 18px; height: 18px; border-radius: 999px; font-size: .68rem; display: grid; place-items: center;
}
.tag-chip button:hover { background: var(--green-100); }

.tag-suggest { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.tag-suggest button {
    border: 1px solid var(--line); background: var(--surface); cursor: pointer;
    border-radius: 999px; padding: .2rem .6rem; font: inherit; font-size: .8rem; color: var(--ink-2);
}
.tag-suggest button:hover { border-color: var(--green-500); background: var(--green-50); color: var(--green-700); }

/* --------------------------------------------------------------- drafts */

.draft-row {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem 0; border-bottom: 1px solid var(--line-soft); font-size: .88rem;
}
.draft-row:last-child { border-bottom: 0; }
.draft-row__body { min-width: 0; flex: 1; }
.draft-row b { display: block; color: var(--ink); font-weight: 600; }
.draft-row span { color: var(--muted); font-size: .8rem; }

.composer-foot {
    display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
    padding-top: 1rem; margin-top: 1rem; border-top: 1px solid var(--line-soft);
}
.composer-foot .spacer { margin-inline-start: auto; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 1080px) {
    .forum-hero { grid-template-columns: minmax(0, 1fr); }
    .forum-hero__art { display: none; }
    .composer { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
    .thread { flex-direction: column-reverse; }
    .thread__thumb { width: 100%; height: 160px; }
}

/* ------------------------------------------------------------ post body */

/* What the composer produced, rendered back. The tag list matches
   App\Support\RichText exactly — nothing else can reach this. */
.post-body { margin-top: 1rem; font-size: 1rem; line-height: 1.8; color: var(--ink); }
.post-body p { margin: 0 0 .9rem; }
.post-body p:last-child { margin-bottom: 0; }
.post-body a { color: var(--green-600); text-decoration: underline; }
.post-body ul, .post-body ol { margin: 0 0 .9rem; padding-inline-start: 1.4rem; }
.post-body li { margin-bottom: .3rem; }
.post-body u { text-underline-offset: 2px; }

/* ------------------------------------------------------- forum search */

.forum-search {
    display: flex; align-items: center; gap: .5rem;
    padding: .4rem .5rem .4rem .9rem; margin-bottom: 1rem;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 999px; box-shadow: var(--shadow);
}
.forum-search:focus-within { border-color: var(--green-500); }
.forum-search i { color: var(--muted); font-size: .85rem; }
.forum-search input[type=search] {
    flex: 1; border: 0; outline: 0; background: none; font: inherit; font-size: .92rem;
    padding: .35rem 0; color: var(--ink);
}

/* ------------------------------------------------------ infinite feed */

.feed-more { margin: 1rem 0; text-align: center; }
.feed-more__spinner, .feed-more__end {
    display: block; padding: .9rem; font-size: .9rem; color: var(--muted);
}
.feed-more__end { border-top: 1px solid var(--line-soft); }

/* ------------------------------------------------- inline feed comments */

/* The top reply, shown under the post so the feed carries some of the
   conversation rather than only a link to it. */
.thread__top {
    display: flex; gap: .55rem; align-items: flex-start;
    margin-top: .6rem; padding: .6rem .7rem;
    background: var(--line-soft); border-radius: var(--radius-sm);
}
.thread__top .avatar { width: 28px; height: 28px; font-size: .78rem; }
.thread__top b { font-size: .85rem; color: var(--ink-2); }
.thread__top p { margin: .15rem 0 .2rem; font-size: .88rem; line-height: 1.6; }

/* Commenting without leaving the feed. */
.thread__say { display: flex; align-items: center; gap: .5rem; margin-top: .6rem; }
.thread__say .avatar { width: 30px; height: 30px; font-size: .8rem; }
.thread__say input[type=text] {
    flex: 1; height: 36px; padding: 0 .85rem;
    border: 1px solid var(--line); border-radius: 999px;
    background: var(--surface); font: inherit; font-size: .88rem; color: var(--ink);
}
.thread__say input[type=text]:focus { outline: 2px solid var(--green-500); outline-offset: 1px; border-color: transparent; }
.thread__say button { flex: none; border-radius: 999px; width: 36px; height: 36px; padding: 0; }

@media (max-width: 520px) {
    .thread { padding: .75rem .75rem .5rem .25rem; }
    .thread > .vote--rail { width: 34px; }
    .thread__bar .act { padding: .35rem .45rem; font-size: .78rem; }
}

/* ============================================================== mobile ==== */

/*
 * On a narrow screen the shared `.layout__aside` rule hides both rails. For
 * the forum that would take the board navigation away entirely, which is the
 * one thing a phone reader needs most — so the forum overrides it and
 * rearranges instead of hiding:
 *
 *   boards  → a horizontal strip of chips above the feed
 *   feed    → full width
 *   info    → below the feed, where it is still reachable but out of the way
 */
@media (max-width: 1080px) {
    .layout--forum {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .layout--forum .forum-rail {
        display: block;
        position: static;
        max-height: none;
        overflow: visible;
        width: 100%;
    }

    .layout--forum .forum-rail--left { order: -1; }
    .layout--forum .forum-rail--right { order: 10; }

    /* The board list becomes a scrolling strip rather than a tall column. */
    .layout--forum .board-rail {
        display: flex;
        flex-direction: row;
        gap: .4rem;
        overflow-x: auto;
        padding: .5rem !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .layout--forum .board-rail::-webkit-scrollbar { display: none; }
    .layout--forum .board-rail a {
        flex: none;
        border: 1px solid var(--line);
        border-radius: 999px;
        padding: .4rem .8rem;
        white-space: nowrap;
        font-size: .88rem;
    }
    .layout--forum .board-rail a.is-active { border-color: var(--green-500); }
    .layout--forum .board-rail .count { margin-inline-start: .35rem; }

    /* The "start a discussion" button is the one thing that should stay big. */
    .layout--forum .forum-rail--left .btn--lg { width: 100%; }
}

@media (max-width: 620px) {
    .forum-hero { padding: 1rem; gap: 1rem; border-radius: var(--radius); }
    .forum-hero h1 { font-size: 1.35rem; }
    .forum-hero p { font-size: .9rem; }

    .thread { padding: .7rem .7rem .5rem .2rem; gap: .35rem; }
    .thread > .vote--rail { width: 32px; }
    .thread > .vote--rail .vote__btn { width: 28px; height: 26px; font-size: .95rem; }
    .thread__title { font-size: 1rem; }
    .thread__excerpt { font-size: .88rem; }
    .thread__meta { font-size: .75rem; }

    /* The action row scrolls sideways rather than wrapping into two lines. */
    .thread__bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .thread__bar::-webkit-scrollbar { display: none; }
    .thread__bar .act { flex: none; }

    .reacts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .reacts::-webkit-scrollbar { display: none; }
    .react { flex: none; }

    .composer { gap: 1rem; }
    .editor { min-height: 160px; }
    .editor-toolbar .hint { display: none; }
    .upload-add, .upload-thumb { width: 76px; height: 76px; }

    .forum-search { padding-inline-start: .7rem; }
    .forum-search .btn { padding-inline: .6rem; }
}

/* --------------------------------------------------- hero feature points */

/*
 * One line, four promises.
 *
 * Colour choice: a single brand green on the icons and plain dark text for
 * the words. Four different colours here would read as decoration; one accent
 * reads as a system — and it leaves red free to mean "urgent" everywhere else
 * on the site, which is the only job red should have.
 */
.hero-points {
    list-style: none; margin: .9rem 0 0; padding: 0;
    display: flex; align-items: center; gap: .55rem;
    white-space: nowrap; overflow-x: auto;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.hero-points::-webkit-scrollbar { display: none; }

.hero-points li {
    display: inline-flex; align-items: center; gap: .4rem; flex: none;
    font-size: .88rem; font-weight: 600; color: var(--ink-2);
}
.hero-points i { color: var(--green-600); font-size: .85rem; }

/* A separator between items, never after the last. */
.hero-points li + li::before {
    content: '';
    width: 4px; height: 4px; border-radius: 999px;
    background: var(--line); margin-inline-end: .55rem;
}

@media (max-width: 620px) {
    .hero-points { gap: .45rem; }
    .hero-points li { font-size: .8rem; }
    .hero-points li + li::before { margin-inline-end: .45rem; }
}

/* -------------------------------------------------------- ghush.xyz link */

/*
 * The sibling platform, in its own dark livery.
 *
 * Deliberately not a green button: a second green button beside "Create
 * Account" would read as another Durvog action, and a visitor would click it
 * expecting to stay here. The blueprint also asks that Ghush.xyz never
 * dominate a Durvog page, so it stays quieter than the signup beneath it.
 */
.btn-ghush {
    display: flex; align-items: center; gap: .6rem;
    width: 100%; margin-bottom: .5rem;
    padding: .55rem .8rem; border-radius: 10px;
    background: linear-gradient(135deg, #0f172a, #14532d);
    color: #e2e8f0; font-size: .8rem; line-height: 1.4;
    transition: transform .12s ease, box-shadow .12s ease;
}
.btn-ghush:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); color: #fff; }
.btn-ghush b { display: block; color: #fff; font-size: .92rem; letter-spacing: -.01em; }
.btn-ghush span { flex: 1; min-width: 0; }
.btn-ghush i { flex: none; opacity: .7; font-size: .8rem; }
