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

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

/* ---------- Replies ---------- */
.mf-replies-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.mf-replies-head h2 { font-size: 1.4rem; }
.mf-reply .mf-gallery { max-width: 560px; }
.mf-reply-child-to { margin-top: 8px; font-size: 0.95rem; }
.mf-reply-child-to a { font-weight: 700; text-decoration: none; }
.mf-reply-child-to a:hover { text-decoration: underline; }
.mf-local-tag { margin-top: 12px; white-space: normal; line-height: 1.3; padding: 6px 12px; }
.mf-reply-children .mf-reply.is-answer { box-shadow: inset 3px 0 0 var(--mf-ok); padding-left: 14px; }

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

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

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

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

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

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

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

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