/* Stoop base stylesheet. Every color/shape comes from CSS custom properties the
   server injects per space (see internal/config theme derivation), so the same
   markup themes itself to match each host site, light or dark. */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

.wrap { max-width: 48rem; margin-inline: auto; padding-inline: 1.1rem; }

/* Stoop session bar — the slim, pinned top bar carrying Stoop's own wordmark
   and the visitor's session (identity + sign-out, or sign-in). */
.stoop-bar {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  position: sticky; top: 0; z-index: 6;
  backdrop-filter: saturate(1.4) blur(8px);
}
.stoop-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 46px; }
.stoop-mark { color: var(--muted); font-family: var(--font-heading); font-weight: 600; font-size: .92rem; letter-spacing: .01em; }
.stoop-mark:hover { color: var(--accent); text-decoration: none; }
.stoop-session { display: flex; align-items: center; gap: .55rem; }
.stoop-user { color: var(--text); font-size: .9rem; font-weight: 600; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Header (host brand — scrolls away under the pinned Stoop bar) */
.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 56px; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 650; color: var(--text); font-family: var(--font-heading); }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-logo { height: 24px; width: auto; border-radius: 6px; }
.header-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.header-links a { color: var(--muted); font-size: .93rem; }
.header-links a:hover { color: var(--accent); text-decoration: none; }

/* Main */
.stoop { padding-block: 1.4rem 3rem; }
.tagline { color: var(--muted); margin: .2rem 0 1.4rem; font-size: 1.02rem; }

/* Feed */
.feed { display: flex; flex-direction: column; margin-bottom: 1.6rem; }
.post { display: flex; gap: .8rem; padding: .9rem 0; border-bottom: 1px solid var(--border); scroll-margin-top: 60px; }
.post:target { background: var(--surface-2); border-radius: var(--radius); padding-inline: .8rem; margin-inline: -.8rem; border-bottom-color: transparent; }
.avatar { border-radius: 50%; background: var(--surface-2); flex: none; object-fit: cover; }
.avatar.small { width: 24px; height: 24px; }
.post-main { min-width: 0; flex: 1; }
.post-meta { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; font-size: .9rem; }
.post-author { font-weight: 620; color: var(--text); }
.post-time { color: var(--faint); }
.post-time:hover { color: var(--muted); text-decoration: none; }
.reply-ref { color: var(--faint); font-size: .85rem; }
.reply-ref a { color: var(--muted); }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: .25rem 0 .4rem; }
.post-actions { font-size: .85rem; }
.reply-link { color: var(--muted); }
.empty { color: var(--muted); padding: 2.4rem 0; text-align: center; }

/* Composer */
.composer { margin-top: 1rem; }
.composer-form { display: flex; flex-direction: column; gap: .6rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem; }
.reply-banner { font-size: .88rem; color: var(--muted); }
textarea {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: calc(var(--radius) - 4px);
  padding: .6rem .7rem; resize: vertical; width: 100%;
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.posting-as { color: var(--muted); font-size: .9rem; }

button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 999px; padding: .5rem 1.1rem; border: 1px solid transparent;
}
button[type=submit] { background: var(--accent); color: #fff; border: none; }
button[type=submit]:hover { background: var(--accent-hover); }
.linkbtn { background: none; border: none; color: var(--muted); padding: .4rem; font-weight: 500; }
.linkbtn:hover { color: var(--accent); text-decoration: underline; }
.logout-form { margin: 0; display: inline-flex; }

/* Sign-in */
.signin { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .7rem; align-items: flex-start; }
.signin p { margin: 0; color: var(--muted); }
.provider-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn.provider { background: var(--accent); color: #fff; }
.btn.provider:hover { background: var(--accent-hover); text-decoration: none; }
.btn.provider.compact { padding: .32rem .8rem; font-size: .85rem; }
/* Sign-in interstitial (/login) */
.login { padding-block: 3rem; display: flex; justify-content: center; }
.login-card { width: 100%; max-width: 30rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; }
.login-card h1 { margin: 0 0 .5rem; font-size: 1.4rem; }
.login-intro { color: var(--muted); margin: 0 0 1.2rem; }
.login .provider-buttons { flex-direction: column; align-items: stretch; gap: .55rem; }
.login .provider-buttons .btn.provider { text-align: center; }
.login-none { color: var(--muted); margin: 0; }
.login-privacy { color: var(--faint); font-size: .82rem; line-height: 1.55; margin: 1.4rem 0 0; }
.login-back { margin: 1.1rem 0 0; font-size: .9rem; }

.devbar { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn.dev { background: var(--surface-2); color: var(--text); border: 1px dashed var(--border); font-size: .85rem; padding: .35rem .8rem; }
.btn.dev:hover { text-decoration: none; border-color: var(--accent); }

/* Moderator nav bar (below the host header, moderators only) */
.mod-bar { border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.mod-bar .wrap { display: flex; align-items: center; gap: 1rem; min-height: 40px; }
.mod-label { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.mod-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.mod-links a { color: var(--muted); font-size: .9rem; }
.mod-links a:hover { color: var(--accent); text-decoration: none; }
.mod-count { display: inline-block; min-width: 1.1rem; text-align: center; padding: 0 .35rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; }

/* Moderator queue page */
.mod-title { font-size: 1.3rem; margin: .2rem 0 .6rem; }
.mod-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.mod-tabs a { padding: .4rem .7rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.mod-tabs a:hover { color: var(--accent); text-decoration: none; }
.mod-tabs a.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

/* Post states: pins, badges, tombstones, moderator controls */
.post.pinned { background: color-mix(in srgb, var(--accent) 5%, transparent); border-radius: var(--radius); padding-inline: .8rem; margin-inline: -.8rem; }
.badge { font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: .05rem .5rem; }
.badge.pin { color: var(--accent); }
.badge.danger { color: #fff; background: #b3261e; }
.tombstone .post-main { padding: .3rem 0; }
.tombstone-note { color: var(--faint); font-style: italic; margin: 0; font-size: .92rem; }
.mod-reason { color: var(--muted); font-size: .85rem; margin: .1rem 0 .3rem; }
.post-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; font-size: .85rem; }
.inline-form { display: inline-flex; margin: 0; }
.linkbtn.danger { color: #b3261e; }
.linkbtn.danger:hover { color: #8c1d18; }
.modctl { display: inline-flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.mod-delete { display: inline-block; }
.mod-delete summary { cursor: pointer; color: #b3261e; font-weight: 500; list-style: none; }
.mod-delete summary::-webkit-details-marker { display: none; }
.mod-delete form { display: flex; gap: .4rem; align-items: center; margin-top: .4rem; }
.mod-delete input { font: inherit; padding: .3rem .5rem; border: 1px solid var(--border); border-radius: calc(var(--radius) - 6px); background: var(--bg); color: var(--text); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); color: var(--muted); margin-top: 2rem; padding-block: 1.4rem 2.4rem; font-size: .88rem; }
.site-footer .footer-text { margin: 0 0 .4rem; }
.footer-links { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: .4rem; }
.footer-links a { color: var(--muted); }
.footer-mark { color: var(--faint); font-size: .8rem; margin: .3rem 0 0; }
.footer-version { opacity: .75; font-size: .72rem; }
