/* Wezzet communities (/forum). Uses the site tokens from site.css + skin.css. */
.forum { max-width: 980px; margin: 0 auto; }
.forum [hidden] { display: none !important; }
.fm-hero { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end; justify-content: space-between; padding: 40px 0 8px; }
.fm-hero h1 { font-size: clamp(2.6rem, 6vw, 4rem); margin: 0 0 10px; }
.fm-label { font: 700 .74rem/1 var(--font-sans, inherit) !important; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); margin: 30px 0 12px !important; }
.fm-h { font-size: 1.5rem !important; margin: 0 !important; }

textarea {
  width: 100%; min-height: 120px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  font: inherit; color: var(--ink); background: var(--bg); resize: vertical;
}
textarea:focus { border-color: var(--accent); outline: none; }
.fm-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.fm-compose { display: grid; gap: 14px; padding: 20px; margin: 16px 0 8px; }
.compose { display: grid; gap: 14px; margin: 18px 0 20px; }
.fm-compose .actions, .compose .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rules { font-size: .88rem; color: var(--ink-soft); margin: 0; }

/* search + chips */
.fm-search { position: relative; margin-top: 18px; }
.fm-search svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--ink-soft); pointer-events: none; }
.fm-search input { padding-left: 40px !important; border-radius: 12px !important; background: var(--surface) !important; }
.fm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink) !important; text-decoration: none; font-weight: 600; font-size: .9rem; }
.fm-chip:hover { border-color: var(--accent); }
.fm-chip .fm-av { width: 26px; height: 26px; border-radius: 50%; }
.fm-chip .fm-av svg { width: 14px; height: 14px; }

/* community avatar */
.fm-av { --h: 262; flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-weight: 750; font-size: 1.2rem; color: hsl(var(--h) 60% 34%); background: hsl(var(--h) 70% 92%); }
.fm-av svg { width: 24px; height: 24px; }
:root[data-theme="dark"] .fm-av { color: hsl(var(--h) 80% 80%); background: hsl(var(--h) 30% 22%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fm-av { color: hsl(var(--h) 80% 80%); background: hsl(var(--h) 30% 22%); } }

/* community grid */
.fm-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.fm-comm { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.fm-comm:hover { border-color: var(--tint-line, var(--line-strong)); transform: translateY(-2px); box-shadow: var(--shadow); }
.fm-comm .fm-av { grid-row: span 2; }
.fm-comm a.fm-name { font-weight: 700; font-size: 1.05rem; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.fm-comm a.fm-name::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.fm-comm p { margin: 0; color: var(--ink-soft); font-size: .92rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fm-comm .fm-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: .85rem; color: var(--ink-soft); }
.fm-join { position: relative; z-index: 1; min-height: 32px !important; padding: 0 14px !important; font-size: .86rem !important; border-radius: 999px !important; }
.fm-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--tint); color: var(--accent); font-size: .7rem; font-weight: 700; letter-spacing: .03em; vertical-align: 2px; }

/* community header */
.fm-banner { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center; padding: 26px 22px 22px; margin: 6px 0 4px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
.fm-banner::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 64px; background: linear-gradient(100deg, hsl(var(--h, 262) 70% 60% / .22), hsl(calc(var(--h, 262) + 40) 70% 60% / .10)); pointer-events: none; }
.fm-banner > * { position: relative; }
.fm-banner .fm-av { width: 72px; height: 72px; border-radius: 20px; font-size: 1.8rem; border: 4px solid var(--surface); }
.fm-banner .fm-av svg { width: 34px; height: 34px; }
.fm-banner h1 { font-size: clamp(2rem, 4.6vw, 2.8rem) !important; margin: 0 !important; overflow-wrap: anywhere; }
.fm-banner .fm-about { grid-column: 1 / -1; margin: 8px 0 0; color: var(--ink-soft); max-width: 70ch; }
.fm-banner .fm-stats { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 12px; font-size: .9rem; color: var(--ink-soft); }
.fm-banner .fm-stats b { color: var(--ink); }
.fm-banner .fm-act { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fm-banner .fm-act .btn { min-height: 40px; border-radius: 999px; }

/* tabs */
.fm-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 4px; }
.fm-tabs button { appearance: none; border: 0; background: none; font: inherit; font-weight: 650; font-size: 1rem; color: var(--ink-soft); padding: 12px 16px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.fm-tabs button:hover { color: var(--ink); }
.fm-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.fm-tabs .n { font-weight: 500; font-size: .85rem; margin-left: 4px; opacity: .8; }

.bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 16px 0 8px; }
.fm-feed-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 30px; }
.fm-feed-head .fm-label { margin: 0 !important; }

/* image drop */
.fm-drop { position: relative; display: grid; place-items: center; min-height: 150px; padding: 12px; border: 1.5px dashed var(--line-strong); border-radius: 14px; background: var(--bg); color: var(--ink-soft); cursor: pointer; text-align: center; font-weight: 500 !important; }
.fm-drop:hover, .fm-drop.over { border-color: var(--accent); background: var(--tint); }
.fm-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fm-drop img { max-width: 100%; max-height: 320px; border-radius: 10px; }

/* lists: discussion rows and post cards */
.topics, .fm-feed { list-style: none; padding: 0; margin: 0; }
.topic-row { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.topic-row a.title { font-weight: 650; font-size: 1.06rem; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.topic-row a.title:hover { color: var(--accent); }
.preview { color: var(--ink-soft); font-size: .95rem; margin: 2px 0 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { font-size: .86rem; color: var(--ink-soft); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.meta a { color: var(--ink-soft); }
.fm-in { font-weight: 650; color: var(--ink) !important; text-decoration: none; }
.fm-in:hover { color: var(--accent) !important; }
.fm-kind { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; background: var(--tint); color: var(--accent); }

.fm-post { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 16px; margin: 12px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; transition: border-color .15s; }
.fm-post:hover { border-color: var(--tint-line, var(--line-strong)); }
.fm-post a.title { font-weight: 700; font-size: 1.15rem; line-height: 1.3; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.fm-post a.title:hover { color: var(--accent); }
.fm-post .fm-img { display: block; margin-top: 10px; border-radius: 12px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.fm-post .fm-img img { display: block; width: 100%; max-height: 520px; object-fit: contain; }
.fm-post .preview { -webkit-line-clamp: 4; margin-top: 6px; }

.vote { display: flex; flex-direction: column; align-items: center; gap: 0; }
.vote.inline { flex-direction: row; gap: 4px; }
.vote.pin { font-size: .72rem; color: var(--accent); font-weight: 700; padding-top: 4px; }
.vote button { width: 32px; height: 28px; border: 0; background: transparent; cursor: pointer; border-radius: 8px; color: var(--ink-soft); display: grid; place-items: center; padding: 0; }
.vote button:hover { background: var(--tint); color: var(--accent); }
.vote button[aria-pressed="true"] { color: var(--accent); background: var(--tint); }
.vote button svg { width: 16px; height: 16px; }
.vote .score { font-weight: 700; font-size: .98rem; min-width: 2ch; text-align: center; }

/* one post */
.topic-full { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 8px 0 22px; border-bottom: 1px solid var(--line); }
.topic-full h1 { font-size: clamp(1.8rem, 3.6vw, 2.4rem) !important; margin: 6px 0 8px !important; overflow-wrap: anywhere; line-height: 1.1 !important; }
.topic-full .fm-img { margin-top: 14px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.topic-full .fm-img img { display: block; width: 100%; max-height: 80vh; object-fit: contain; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0 0; max-width: 70ch; }
.linkish { background: none !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; font: inherit; color: var(--ink-soft) !important; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: .86rem; min-height: 0 !important; transform: none !important; }
.linkish:hover { color: var(--ink) !important; }
.fm-comments-title { font-family: var(--font-sans, inherit) !important; font-size: 1.1rem !important; font-weight: 700 !important; margin-top: 8px !important; }

.comments { list-style: none; padding: 0; margin: 0; }
.comments .comments { margin-left: 18px; padding-left: 14px; border-left: 2px solid var(--line); }
.comment { padding: 12px 0 4px; }
.comment .head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .9rem; color: var(--ink-soft); }
.comment .head strong { color: var(--ink); }
.comment .text { margin-top: 4px; }
.comment .tools { display: flex; gap: 14px; align-items: center; margin-top: 4px; }
.comment .removed { color: var(--ink-soft); font-style: italic; margin: 4px 0 0; }
.reply-form { margin: 8px 0 4px; display: grid; gap: 8px; max-width: 640px; }
.reply-form textarea { min-height: 80px; }
.empty { color: var(--ink-soft); padding: 28px 0; }
.more { margin: 20px 0; }
.back { display: inline-block; margin: 26px 0 10px; color: var(--ink-soft) !important; text-decoration: none; font-weight: 500; }
.back::before { content: "← "; }
.back:hover { color: var(--accent) !important; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: .95rem; max-width: calc(100% - 32px); }

@media (max-width: 560px) {
  .fm-hero { padding-top: 26px; }
  .fm-banner { padding: 22px 16px 18px; }
  .fm-banner .fm-av { width: 58px; height: 58px; }
  .fm-banner .fm-act { margin-left: 0; width: 100%; }
  .fm-post { grid-template-columns: 36px 1fr; padding: 12px; gap: 8px; }
  .topic-row, .topic-full { grid-template-columns: 36px 1fr; gap: 8px; }
}
