/* ============================================================
   STARISE COMMUNITY — forum-thread.css (Phase 1 UI + Phase 2B-2)
   ------------------------------------------------------------
   Page styles for the discussion page (/forum/t/:slug) and the create
   forms (/forum/new, /forum/communities/new). Builds on the sf-thread,
   sf-reply, sf-composer, sf-gate and sf-suggest classes in css/forum.css
   and uses only its --sf-* tokens.
   ============================================================ */

/* ---------- Discussion ---------- */
.sf-crumbs .sf-crumb-sep { width: 16px; height: 16px; color: var(--sf-ink-3); }
.sf-thread-top { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 14px; }
.sf-thread > h1:first-child { margin-top: 0; }
.sf-jump {
    display: inline-flex; align-items: center; gap: 6px; min-height: var(--sf-tap);
    font-weight: 750; text-decoration: none;
}
.sf-jump:hover { text-decoration: underline; }
.sf-jump .sf-icon { width: 18px; height: 18px; }
/* Byline: avatar + name = one link, >= 44px tall (negative margin keeps the 40px rhythm). */
.sf-byline { gap: 4px 12px; }
.sf-byline-link {
    display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%;
    min-height: var(--sf-tap); margin: -2px 0; padding-right: 8px; border-radius: var(--sf-pill);
    color: var(--sf-ink) !important; font-weight: 750; line-height: 1.3; text-decoration: none;
}
.sf-byline-link--sm { margin: -6px 0; }
.sf-byline-user { min-width: 0; overflow-wrap: anywhere; }
.sf-byline-link:hover .sf-byline-user { text-decoration: underline; }
.sf-byline-meta {
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px;
    flex: 1 1 0%; min-width: min(100%, 150px); line-height: 1.3;
}
.sf-byline time { color: var(--sf-ink-3); font-size: 0.95rem; }

/* ---------- Replies ---------- */
.sf-replies-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.sf-replies-head h2 { font-size: 1.4rem; }
.sf-reply .sf-gallery { max-width: 560px; }
.sf-reply-child-to { margin-top: 8px; font-size: 0.95rem; }
.sf-reply-child-to a { font-weight: 700; text-decoration: none; }
.sf-reply-child-to a:hover { text-decoration: underline; }
.sf-local-tag { margin-top: 12px; white-space: normal; line-height: 1.3; padding: 6px 12px; }
.sf-reply-children .sf-reply.is-answer { box-shadow: inset 3px 0 0 var(--sf-emerald); padding-left: 14px; }
/* Phase 2B-2: a deleted reply kept for its replies, a deleted account, "Edited" */
.sf-reply--deleted { padding-bottom: 14px; }
.sf-reply-deleted { display: flex; align-items: center; gap: 8px; min-height: var(--sf-tap); color: var(--sf-ink-3); font-weight: 650; }
.sf-reply-deleted .sf-icon { width: 18px; height: 18px; }
.sf-byline-link--gone { color: var(--sf-ink-3) !important; }
.sf-byline-link--gone:hover .sf-byline-user { text-decoration: none; }
.sf-edited { color: var(--sf-ink-3); font-size: 0.9rem; font-weight: 600; }
.sf-edit-form .sf-input { width: 100%; }

/* Landing on #reply-<id>: a brief highlight, no motion beyond a colour fade. */
.sf-reply { transition: background-color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease; }
.sf-page .sf-reply:focus-visible { box-shadow: var(--sf-shadow); border-radius: var(--sf-radius-lg); }
.sf-page .sf-reply.is-answer:focus-visible { box-shadow: inset 4px 0 0 var(--sf-emerald), var(--sf-shadow); }
.sf-page .sf-reply-children .sf-reply:focus-visible { box-shadow: none; border-radius: 0; }
.sf-page .sf-reply-children .sf-reply.is-answer:focus-visible { box-shadow: inset 3px 0 0 var(--sf-emerald); }
.sf-page .sf-reply.is-target { background: var(--sf-emerald-soft); border-color: var(--sf-emerald); }
.sf-page .sf-reply-children .sf-reply.is-target { background: var(--sf-emerald-soft); box-shadow: 0 0 0 8px var(--sf-emerald-soft); border-radius: 4px; }
.sf-page .sf-reply-children .sf-reply.is-answer.is-target { box-shadow: inset 3px 0 0 var(--sf-emerald), 0 0 0 8px var(--sf-emerald-soft); }
@media (max-width: 599px) {
    .sf-page .sf-reply.sf-card:focus-visible { border-radius: var(--sf-radius); }
}
@media (prefers-reduced-motion: reduce) { .sf-reply { transition: none; } }

/* ---------- Composer ---------- */
.sf-composer-head h2 { font-size: 1.25rem; }
.sf-composer-head label { cursor: pointer; }
.sf-composer-picker { flex: 1 1 auto; min-width: 0; }
.sf-composer .sf-imgpick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sf-composer .sf-imgpick-item { width: 96px; height: 96px; aspect-ratio: auto; }
.sf-composer .sf-imgpick-item--up { height: auto; align-self: flex-start; }
.sf-composer .sf-imgpick--upload { align-items: flex-start; }
.sf-composer .sf-imgpick-add {
    position: relative; aspect-ratio: auto; flex-direction: row; gap: 8px;
    min-height: var(--sf-tap); padding: 0 18px;
    border: 1.5px solid var(--sf-line-strong); border-radius: var(--sf-pill);
}
.sf-composer .sf-imgpick-add .sf-icon { width: 20px; height: 20px; }
.sf-inline-composer {
    display: grid; gap: 12px; margin: 10px 0 8px; padding: 16px;
    border-radius: var(--sf-radius); background: var(--sf-surface-2);
}
.sf-inline-composer .sf-textarea { min-height: 110px; }

/* ---------- Rail ---------- */
.sf-related { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sf-related a {
    display: grid; gap: 2px; min-height: var(--sf-tap); margin: 0 -12px; padding: 10px 12px;
    border-radius: 12px; color: var(--sf-ink) !important; text-decoration: none;
}
.sf-related a:hover { background: var(--sf-surface-2); }
.sf-related a:hover .sf-related-title { text-decoration: underline; }
.sf-related-title { font-weight: 700; line-height: 1.35; }
.sf-related small { color: var(--sf-ink-3); font-size: 0.95rem; font-weight: 600; }

/* ---------- Not found ---------- */
.sf-notfound h1 { font-size: 1.6rem; }
.sf-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }

/* ---------- Create forms ---------- */
.sf-create { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.sf-create .sf-card-pad { padding: 26px 28px; }
.sf-create-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.sf-create [data-sf-status]:empty { display: none; }
.sf-textarea--short { min-height: 104px; }
.sf-suggest a span { flex: 1 1 auto; min-width: 0; }
.sf-errsum ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.sf-errsum a { color: var(--sf-danger); font-weight: 700; text-decoration: underline; }
.sf-page .sf-errsum:focus-visible, .sf-page .sf-outcome:focus-visible { border-radius: var(--sf-radius); }

/* Type of post: two large radio cards */
.sf-typecards { border: 0; margin: 0; padding: 0; min-width: 0; }
.sf-typecards legend { padding: 0; margin-bottom: 8px; }
.sf-typecards-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sf-typecard {
    display: flex; align-items: center; gap: 14px; min-height: 88px; padding: 16px 18px;
    border: 1.5px solid var(--sf-line-strong); border-radius: var(--sf-radius);
    background: var(--sf-surface); cursor: pointer;
}
.sf-typecard:hover { border-color: var(--sf-ink-3); }
.sf-typecard:has(input:checked) { border-color: var(--sf-emerald); background: var(--sf-emerald-soft); box-shadow: inset 0 0 0 1px var(--sf-emerald); }
.sf-typecard:has(input:focus-visible) { box-shadow: var(--sf-focus); }
.sf-typecard input {
    order: 3; flex: 0 0 auto; width: 24px; height: 24px; margin: 0 0 0 auto;
    accent-color: var(--sf-emerald); cursor: pointer;
}
.sf-page .sf-typecard input:focus-visible { box-shadow: none; }
.sf-typecard-text { display: grid; gap: 2px; min-width: 0; }
.sf-typecard-text strong { font-family: var(--sf-font-head); font-size: 1.12rem; letter-spacing: -0.01em; }
.sf-typecard-text small { color: var(--sf-ink-3); font-size: 0.95rem; font-weight: 600; }

/* Community request: search first, then the review steps */
.sf-csearch { display: grid; gap: 14px; }
.sf-csearch h2, .sf-review h2 { font-size: 1.25rem; }
.sf-cresults li { flex-wrap: wrap; gap: 10px 12px; padding: 8px 0; border-top: 1px solid var(--sf-line); }
.sf-cresults li:first-child { border-top: 0; }
.sf-cresult-name { flex: 1 1 150px; min-width: 0; display: grid; }
.sf-cresult-name strong { font-weight: 750; overflow-wrap: anywhere; }
.sf-cresult-name small { color: var(--sf-ink-3); font-size: 0.9rem; font-weight: 600; }
.sf-cresult-actions { display: flex; gap: 8px; margin-left: auto; }
.sf-cresults-none { color: var(--sf-ink-3); font-weight: 650; }
.sf-review { display: grid; gap: 16px; padding-bottom: 22px; border-bottom: 1px solid var(--sf-line); }
.sf-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sf-steps li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sf-steps li:not(:last-child)::after { content: ""; flex: 1 1 auto; height: 2px; min-width: 12px; background: var(--sf-line); }
.sf-steps h3 { font-size: 1.05rem; }
.sf-step-n {
    flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--sf-line-strong); background: var(--sf-surface); color: var(--sf-ink-2);
    font-weight: 800; font-size: 0.95rem;
}
.sf-steps li[aria-current="step"] .sf-step-n { background: var(--sf-emerald); border-color: var(--sf-emerald); color: var(--sf-surface); }

@media (max-width: 599px) {
    .sf-create .sf-card-pad { padding: 20px 18px; }
    .sf-typecards-grid { grid-template-columns: 1fr; }
    .sf-steps li { flex-direction: column; align-items: center; gap: 6px; text-align: center; }
    .sf-steps li:not(:last-child)::after { display: none; }
    .sf-cresult-actions { width: 100%; justify-content: flex-end; }
}
