/* Mittenwell Community */

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/source-serif-4-var.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/inter-var.woff2") format("woff2");
}

:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --surface-2: #f4efe6;
  --ink: #23201c;
  --ink-2: #4a453e;
  --muted: #6b645a;
  --line: #e7dfd2;
  --line-2: #d8cdbb;
  --brand: #1e5b57;
  --brand-dark: #154340;
  --brand-tint: #e5f0ee;
  --accent: #c8691c;
  --green: #2e6b3a;
  --green-tint: #edf6ee;
  --radius: 10px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wrap: 1100px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; text-underline-offset: .15em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2 { font-family: var(--serif); line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; margin: 0 0 .4rem; font-weight: 700; }
h2 { font-size: 1.25rem; margin: 2rem 0 .8rem; font-weight: 650; }
p { margin: 0 0 .9em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--ink); color: #fff; padding: .5rem .9rem; border-radius: 6px; }
.skip-link:focus { top: 1rem; color: #fff; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 1rem; padding-top: .7rem; padding-bottom: .7rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); flex-shrink: 0; }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand svg { width: 32px; height: 32px; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; letter-spacing: -.02em; }
.brand-sub { font-size: .95rem; color: var(--muted); padding-left: .5rem; border-left: 1px solid var(--line-2); }
.header-search { flex: 1; max-width: 22rem; margin-left: auto; }
.header-search input, .search-form input { width: 100%; font: inherit; padding: .45rem .7rem .45rem 2.1rem; border: 1px solid var(--line-2); border-radius: 6px; color: var(--ink);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b645a' stroke-width='2'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E") no-repeat .65rem center / 1rem; }
.header-actions { display: flex; gap: .5rem; }
.forum-nav { display: flex; gap: 1.4rem; font-size: .93rem; padding-bottom: .55rem; overflow-x: auto; }
.forum-nav a { color: var(--ink-2); padding-bottom: .3rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.forum-nav a:hover { color: var(--ink); text-decoration: none; border-bottom-color: var(--line-2); }
.forum-nav a[aria-current] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.btn { display: inline-block; font: inherit; font-weight: 600; padding: .6rem 1.1rem; border-radius: 6px; border: 1px solid transparent; cursor: pointer; text-align: center; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--ink-2); color: var(--ink); }
.btn-small { padding: .38rem .8rem; font-size: .88rem; }

.breadcrumbs { font-size: .85rem; padding-top: 1rem; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; gap: .4rem; }
.breadcrumbs li + li::before { content: "/"; color: var(--line-2); margin-right: .4rem; }
.breadcrumbs a { color: var(--muted); }
.main { padding-top: 1.2rem; padding-bottom: 3rem; min-height: 60vh; }

/* topic lists */
.list-controls { display: flex; justify-content: flex-end; margin-bottom: .6rem; }
.topic-list, .category-list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.topic-list th, .category-list th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--muted); padding: .55rem .8rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.topic-list td, .category-list td { padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.topic-list tr:last-child td, .category-list tr:last-child td { border-bottom: 0; }
.col-topic { width: 60%; }
.col-num { text-align: center; color: var(--muted); font-size: .9rem; white-space: nowrap; width: 5.5rem; }
.topic-list th.col-num { text-align: center; }
.col-posters { white-space: nowrap; }
.col-posters a + a { margin-left: -6px; }
.col-posters .avatar { width: 26px; height: 26px; font-size: .75rem; border: 2px solid var(--surface); }
.topic-title { color: var(--ink); font-weight: 550; font-size: 1rem; }
.topic-title:visited { color: #6a5f73; }
.topic-meta { margin-top: .2rem; font-size: .82rem; color: var(--muted); display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.cat-badge { display: inline-flex; align-items: center; gap: .35rem; color: var(--ink-2); font-size: .82rem; }
.cat-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 2px; }
.cat-dot-large { width: .9rem; height: .9rem; margin-right: .5rem; vertical-align: .05em; }
.solved-mark { color: var(--green); font-weight: 700; }
.more { margin-top: 1rem; text-align: center; }

.category-head { margin-bottom: 1rem; }
.category-head p { color: var(--ink-2); margin: 0; }
.cat-cell { border-left: 4px solid; width: 52%; }
.cat-name { font-weight: 650; color: var(--ink); font-size: 1rem; }
.cat-cell p { margin: .2rem 0 0; color: var(--muted); font-size: .88rem; }
.cat-latest { font-size: .88rem; line-height: 1.7; }
.cat-latest time { color: var(--muted); font-size: .8rem; }

/* avatars */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; font-weight: 600; font-size: 1.05rem; flex-shrink: 0; }
.avatar-large { width: 96px; height: 96px; font-size: 2.4rem; }
.role-badge { display: inline-block; font-family: var(--sans); font-size: .72rem; font-weight: 600; color: var(--brand); background: var(--brand-tint); padding: .05rem .4rem; border-radius: 4px; vertical-align: .15em; }

/* topics */
.topic-head { border-bottom: 1px solid var(--line); padding-bottom: .9rem; margin-bottom: .5rem; }
.topic-head h1 { font-size: 1.6rem; }
.topic-body { max-width: 52rem; }
.post { display: flex; gap: .9rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.post.is-target { background: #fff8ec; box-shadow: -1rem 0 0 #fff8ec, 1rem 0 0 #fff8ec; }
.post-main { flex: 1; min-width: 0; }
.post-header { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .35rem; }
.post-author { font-weight: 650; color: var(--ink-2); }
.post-date { margin-left: auto; color: var(--muted); font-size: .85rem; }
.post-text { font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.post-text p { margin: 0 0 .8em; }
.post-text a.mention { background: var(--surface-2); padding: 0 .2em; border-radius: 3px; color: var(--ink-2); font-weight: 550; }
.post-actions { display: flex; justify-content: flex-end; gap: 1rem; font-size: .85rem; color: var(--muted); }
.post-actions a { color: var(--muted); display: inline-flex; align-items: center; gap: .3rem; }
.post-like svg { width: 16px; height: 16px; }
.is-solution { background: var(--green-tint); box-shadow: -1rem 0 0 var(--green-tint), 1rem 0 0 var(--green-tint); }
.solution-label { font-size: .8rem; font-weight: 650; color: var(--green); margin: 0 0 .3rem; }
.topic-map { display: flex; flex-wrap: wrap; gap: 1.6rem; margin-top: .9rem; padding: .7rem .9rem; background: var(--surface-2); border-radius: 8px; font-size: .82rem; color: var(--muted); }
.topic-map > div { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; }
.topic-map .avatar { width: 20px; height: 20px; font-size: .65rem; display: inline-flex; vertical-align: middle; }
.map-label { font-size: .75rem; }
.map-num { font-size: 1.05rem; font-weight: 600; color: var(--ink-2); }
.accepted-answer { margin-top: .9rem; padding: .7rem .9rem; border: 1px solid #cfe3d3; background: var(--green-tint); border-radius: 8px; font-size: .9rem; }
.accepted-answer p { margin: 0 0 .3rem; }
.accepted-excerpt { color: var(--ink-2); }
.topic-footer { display: flex; align-items: center; gap: 1rem; margin: 1.4rem 0 0; flex-wrap: wrap; }
.topic-footer p { margin: 0; color: var(--muted); }
.suggested { margin-top: 2.5rem; }

/* profiles */
.profile { display: flex; gap: 1.4rem; align-items: flex-start; padding: 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
.profile h1 { font-family: var(--sans); font-size: 1.5rem; }
.profile-bio { font-size: 1rem; }
.profile-facts, .profile-cats { color: var(--muted); font-size: .9rem; margin-bottom: .3rem; }

/* search */
.search-form { display: flex; gap: .5rem; max-width: 36rem; margin: .5rem 0 1rem; }
.search-count { color: var(--muted); }
.search-results { list-style: none; padding: 0; margin: 0; max-width: 46rem; }
.search-results li { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.search-excerpt { margin: .35rem 0 0; color: var(--ink-2); font-size: .92rem; }

/* pages */
.auth-box { max-width: 30rem; margin: 1.5rem auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.auth-form { display: flex; flex-direction: column; gap: .4rem; margin: 1rem 0; }
.auth-form label { font-size: .88rem; font-weight: 600; color: var(--ink-2); margin-top: .4rem; }
.auth-form input { font: inherit; padding: .55rem .7rem; border: 1px solid var(--line-2); border-radius: 6px; }
.auth-form .btn { margin-top: .8rem; }
.auth-alt, .auth-fine { font-size: .9rem; color: var(--muted); }
.prose { max-width: 42rem; font-size: 1rem; }
.mod-list { list-style: none; padding: 0; }
.mod-list li { margin-bottom: .5rem; }
.mod-list .avatar { width: 26px; height: 26px; font-size: .75rem; vertical-align: middle; margin-right: .3rem; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); font-size: .85rem; color: var(--muted); }
.footer-inner { padding-top: 1.3rem; padding-bottom: 1.6rem; }
.footer-inner p { max-width: 46rem; }
.footer-links a { margin-right: 1rem; color: var(--ink-2); }

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; }
  .header-search { order: 3; max-width: none; flex-basis: 100%; }
  .brand-sub { display: none; }
  .header-actions { margin-left: auto; }
  .col-posters, .topic-list .col-num:nth-child(4) { display: none; }
  .col-topic { width: auto; }
  .post { gap: .6rem; }
  .post-avatar .avatar { width: 34px; height: 34px; font-size: .9rem; }
  .category-list th:last-child, .cat-latest { display: none; }
  .profile { flex-direction: column; }
}
