/* ============================================================
   forum-discover.css — Starise Community discovery pages:
   /forum, /forum/search, /forum/communities, /forum/c/:slug.
   Page styles only; tokens and components come from css/forum.css.
   Class prefix: fd- (forum discover).
   ============================================================ */

.fd-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
.fd-results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }

/* ---------- Search forms ---------- */
.fd-search { display: grid; gap: 8px; min-width: 0; }
.fd-search-row { display: flex; align-items: center; gap: 10px; }
.fd-search-row .sf-search { flex: 1 1 auto; min-width: 0; }
.fd-search-row > .sf-btn { flex: 0 0 auto; }
.fd-search .sf-search input { padding-right: 16px; text-overflow: ellipsis; }
.fd-search .sf-search.has-value input { padding-right: 56px; }
/* one clear button (ours), not the browser's as well */
.fd-search input[type="search"]::-webkit-search-cancel-button,
.fd-search input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.fd-search--page { gap: 14px; }
.fd-search-title label { cursor: pointer; }
@media (max-width: 599px) {
    .fd-search-row { gap: 8px; }
    .fd-search-row > .sf-btn { padding: 0 18px; }
}

/* ---------- Start-a-discussion prompt ---------- */
.fd-prompt-plus {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%; background: var(--sf-black); color: #ffffff;
}
.fd-prompt-img {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: var(--sf-tap); height: var(--sf-tap); border-radius: 50%; color: var(--sf-ink-3);
}
.sf-prompt:hover .fd-prompt-img { color: var(--sf-ink); }

/* ---------- Tabs and toggles: full width on phones ---------- */
@media (max-width: 599px) {
    .fd-tabs, .fd-tabs .sf-seg, .fd-seg { display: flex; width: 100%; }
    .fd-tabs .sf-seg button, .fd-seg button { flex: 1 1 auto; justify-content: center; padding: 0 10px; }
}
@media (max-width: 389px) {
    .fd-tabs .sf-seg { gap: 2px; padding: 3px; }
    .fd-tabs .sf-seg button { padding: 0 7px; }
}

/* ---------- Home ---------- */
/* The right rail is taller than a screen: let it scroll with the page instead of sticking. */
.fd-home .fd-rail-right { position: static; }
.fd-home .sf-railnav ul + ul { margin-top: 2px; }
.fd-rail-name { padding: 8px 0; line-height: 1.25; }
.sf-welcome h2 { overflow-wrap: anywhere; }
.fd-more { gap: 6px; }
.fd-more-wrap { display: flex; justify-content: center; margin-top: 4px; }
.fd-more .sf-icon { width: 18px; height: 18px; }
.fd-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.fd-home .sf-empty h3, .fd-searchpage .sf-empty h3, .fd-communities .sf-empty h3, .fd-community .sf-empty h3 { overflow-wrap: anywhere; }

/* ---------- Communities directory ---------- */
.fd-toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px 20px; }
.fd-toolbar-search { flex: 1 1 340px; }
.fd-toolbar-sort { flex: 0 0 auto; display: grid; gap: 8px; }
@media (max-width: 599px) {
    .fd-toolbar-sort { flex: 1 1 100%; }
    .fd-communities .sf-page-head .sf-btn { width: 100%; }
}
.fd-rules-list li { align-items: flex-start; }
.fd-rules-list h3 { margin-top: 3px; font-size: 1.08rem; line-height: 1.3; }
.fd-rules-list p { margin-top: 2px; font-weight: 400; color: var(--sf-ink-3); }
@media (min-width: 900px) {
    .fd-rules-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 36px; }
}
.fd-rules:focus-visible { border-radius: var(--sf-radius-lg); }

/* ---------- One community ---------- */
.fd-crumbs { font-size: 1rem; }
.fd-crumbs a { gap: 6px; }
.fd-crumbs .sf-icon { width: 18px; height: 18px; }
.fd-chero .sf-chero-title h1 { overflow-wrap: anywhere; }
.fd-chero .sf-chero-desc { margin-top: 8px; }
/* Phones: icon beside the name; description, numbers and buttons full width below. */
@media (max-width: 599px) {
    .fd-chero .sf-chero-top { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 14px; row-gap: 0; }
    .fd-chero .sf-chero-title { display: contents; }
    .fd-chero .sf-chero-title h1 { grid-column: 2; }
    .fd-chero .sf-chero-desc, .fd-chero .sf-chero-meta, .fd-chero .sf-chero-actions { grid-column: 1 / -1; }
    .fd-chero .sf-chero-desc { margin-top: 14px; }
    .fd-chero .sf-chero-actions { margin-top: 16px; }
}
.fd-created { display: flex; align-items: center; gap: 8px; color: var(--sf-ink-3); font-weight: 650; }
.fd-created .sf-icon { width: 18px; height: 18px; }
.fd-notfound .sf-empty h1 { font-size: 1.5rem; }
