/* postmaar base styles.
   Channel themes override the custom properties below via /c/:slug/theme.css. */

:root {
  --pm-bg: #0c0b14;
  --pm-fg: #eef0f6;
  --pm-muted: #9c9ab5;
  --pm-accent: #8b7cff;
  --pm-surface: #16151f;
  --pm-border: #262436;
  --pm-radius: 14px;
  --pm-max-width: 1000px;

  /* brand ramp used by the front page */
  --grape: #7c5cff;
  --pink: #ff4d93;
  --sun: #ffb020;
  --mint: #2ee6a8;
  --sky: #46b8ff;
  --pm-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --danger: #ff6b6b;
  --ok: #4ade80;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--pm-bg);
  color: var(--pm-fg);
  font-family: var(--pm-font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

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

h1, h2, h3 { line-height: 1.2; margin: 1.6em 0 0.5em; }
h1 { font-size: 1.65rem; margin-top: 0.6em; }
h2 { font-size: 1.15rem; }

main {
  max-width: var(--pm-max-width);
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
}

/* ---------------------------------------------------------------- top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--pm-border);
  background: var(--pm-surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 700; letter-spacing: -0.02em; color: var(--pm-fg); }
.topbar nav { display: flex; gap: 1rem; flex: 1; font-size: 0.95rem; }
.who { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; }
.me { color: var(--pm-muted); }

.cta {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: var(--pm-radius);
  background: var(--pm-accent);
  color: #0b0d11;
  font-weight: 600;
}
.cta:hover { text-decoration: none; filter: brightness(1.1); }

/* ------------------------------------------------------------------ forms */
.stack { display: flex; flex-direction: column; gap: 0.9rem; }

label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--pm-muted); }

input, textarea, select, button {
  font: inherit;
  font-size: 0.95rem;
  color: var(--pm-fg);
  background: var(--pm-bg);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  padding: 0.55rem 0.7rem;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--pm-accent);
  outline-offset: 1px;
}
textarea { resize: vertical; }

button { cursor: pointer; background: var(--pm-surface); }
button:hover { border-color: var(--pm-accent); }
button.primary { background: var(--pm-accent); color: #0b0d11; font-weight: 600; border: none; }
button:disabled { opacity: 0.5; cursor: progress; }

button.link {
  background: none;
  border: none;
  padding: 0;
  color: var(--pm-accent);
  font-size: 0.9rem;
}
button.link.danger { color: var(--danger); }
form.inline { display: inline; }
label.check { flex-direction: row; align-items: center; gap: 0.5rem; }
label.check input { width: auto; }

/* ----------------------------------------------------------------- layout */
.narrow { max-width: 560px; }
.hero { padding: 1.5rem 0 0.5rem; }
.hero h1 { font-size: 2rem; letter-spacing: -0.02em; }

.muted { color: var(--pm-muted); }
.empty { color: var(--pm-muted); font-style: italic; }
.hint { font-size: 0.8rem; color: var(--pm-muted); margin: 0; }

.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--pm-border);
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--pm-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.warn { color: #fbbf24; border-color: #fbbf24; }

.callout {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--pm-border);
  border-left: 3px solid var(--pm-accent);
  border-radius: var(--pm-radius);
  background: var(--pm-surface);
  font-size: 0.9rem;
}
.callout.warn { border-left-color: #fbbf24; }
.callout.ok { border-left-color: var(--ok); }

.flash {
  max-width: var(--pm-max-width);
  margin: 0.8rem auto 0;
  padding: 0.6rem 0.9rem;
  border-radius: var(--pm-radius);
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  font-size: 0.9rem;
}

pre.codes {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  background: var(--pm-bg);
  padding: 0.6rem;
  border-radius: var(--pm-radius);
  overflow-x: auto;
  user-select: all;
}

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; font-size: 0.9rem; }
dl.facts dt { color: var(--pm-muted); }
dl.facts dd { margin: 0; }

/* ------------------------------------------------------------------ lists */
table.list { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.list th {
  text-align: left;
  color: var(--pm-muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--pm-border);
  padding: 0.5rem 0.5rem 0.5rem 0;
}
table.list td { padding: 0.5rem 0.5rem 0.5rem 0; border-bottom: 1px solid var(--pm-border); }
table.list tr.open td { background: color-mix(in srgb, var(--pm-accent) 6%, transparent); }

ul.channel-grid { list-style: none; padding: 0; display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.channel-card {
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  padding: 0.8rem;
  background: var(--pm-surface);
}
.channel-name { font-weight: 600; }
.channel-card .muted { display: block; font-size: 0.8rem; }

/* ------------------------------------------------------------------ posts */
.channel-head { border-bottom: 1px solid var(--pm-border); padding-bottom: 0.8rem; margin-bottom: 1.2rem; }

.post-form { margin-bottom: 1.8rem; padding: 0.9rem; background: var(--pm-surface); border: 1px solid var(--pm-border); border-radius: var(--pm-radius); }

.feed { display: flex; flex-direction: column; gap: 1rem; }

.post {
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  padding: 0.85rem;
  background: var(--pm-surface);
}
.post-head { display: flex; flex-direction: column; gap: 0.15rem; }
.post-title { font-weight: 600; }
.post-meta { font-size: 0.78rem; color: var(--pm-muted); }
.post-foot { display: flex; gap: 1rem; margin-top: 0.6rem; font-size: 0.82rem; }

.deleted { color: var(--pm-muted); font-style: italic; font-size: 0.85rem; }

/* Click-to-load embeds: nothing is fetched from a third party until clicked. */
.embed { position: relative; margin-top: 0.7rem; border-radius: var(--pm-radius); overflow: hidden; background: #000; }
.embed img, .embed-fallback { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.embed iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.embed-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  border: 0;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}
.embed-play:hover { background: rgba(0, 0, 0, 0.5); }

.media-link img { display: block; max-width: 100%; border-radius: var(--pm-radius); margin-top: 0.7rem; }

.linkcard {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.7rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  background: var(--pm-bg);
  font-size: 0.85rem;
}
.linkcard-host { color: var(--pm-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.linkcard-url { word-break: break-all; }

/* ------------------------------------------------------------------ admin */
.subnav { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.9rem; padding-bottom: 1rem; border-bottom: 1px solid var(--pm-border); margin-bottom: 1.2rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.7rem; }
.stat {
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  padding: 0.7rem;
  font-size: 0.78rem;
  color: var(--pm-muted);
  background: var(--pm-surface);
}
.stat span { display: block; font-size: 1.5rem; font-weight: 700; color: var(--pm-fg); }

.plugin-card {
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  padding: 0.85rem;
  margin-bottom: 0.8rem;
  background: var(--pm-surface);
}
.plugin-card header { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.plugin-card p { margin: 0.35rem 0; font-size: 0.82rem; }
.plugin-card .row { display: flex; gap: 1rem; margin-top: 0.5rem; flex-wrap: wrap; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.7rem; }

ul.audit { list-style: none; padding: 0; font-size: 0.85rem; }
ul.audit li { padding: 0.3rem 0; border-bottom: 1px solid var(--pm-border); }

/* ----------------------------------------------------------------- footer */
.foot {
  border-top: 1px solid var(--pm-border);
  padding: 1.2rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--pm-muted);
}

.error { color: var(--danger); }

ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 0.15rem 0; font-size: 0.85rem; }

/* Long-form config such as a moderation prompt. */
textarea.prompt-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  min-height: 22rem;
  white-space: pre-wrap;
}

@media (max-width: 560px) {
  .topbar nav { order: 3; flex-basis: 100%; }
  h1 { font-size: 1.4rem; }
}

/* ==========================================================================
   FRONT PAGE
   All artwork is gradients + emoji. No downloaded images: unknown-licence
   photos on a public site are a legal liability, and nothing here costs a
   network request.
   ========================================================================== */

/* Soft colour wash behind everything. Cheap, no image, no request. */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 70vh;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(45% 55% at 18% 10%, rgba(124, 92, 255, 0.28), transparent 70%),
    radial-gradient(40% 50% at 82% 0%, rgba(255, 77, 147, 0.22), transparent 70%),
    radial-gradient(35% 45% at 55% 25%, rgba(70, 184, 255, 0.14), transparent 70%);
  filter: blur(10px);
}

/* ------------------------------------------------------------------ hero */
.hero2 {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
  padding: 2.2rem 0 1rem;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 0.9rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--pm-border);
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.12);
  color: #cfc6ff;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero2 h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.grad-text {
  background: linear-gradient(96deg, var(--pink), var(--sun) 45%, var(--mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 0 0 1.5rem;
  max-width: 34rem;
  color: var(--pm-muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.hero2-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; }

.btn-xl {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  background: linear-gradient(96deg, var(--grape), var(--pink));
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 10px 30px -10px rgba(124, 92, 255, 0.85);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-xl:hover {
  text-decoration: none;
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 16px 36px -12px rgba(255, 77, 147, 0.8);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 0.85rem 1.3rem;
  border: 1px solid var(--pm-border);
  border-radius: 999px;
  color: var(--pm-fg);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-ghost:hover { text-decoration: none; border-color: var(--pm-accent); background: rgba(124, 92, 255, 0.1); }

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin: 1.3rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  color: var(--pm-muted);
}
.trust li::before { content: "✓ "; color: var(--mint); font-weight: 700; }

/* ------------------------------------------------------- hero artwork */
.hero2-art {
  position: relative;
  min-height: 300px;
  display: grid;
  place-items: center;
}

.mini {
  position: absolute;
  width: 46%;
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(2px);
}

.mini-emoji { font-size: 2.6rem; line-height: 1; }
.mini-label {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.mini-play {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.m1 { left: 2%;  top: 16%; transform: rotate(-11deg); background: linear-gradient(150deg, #ff4d93, #ffb020); }
.m2 { left: 30%; top: 2%;  transform: rotate(4deg);   background: linear-gradient(150deg, #46b8ff, #7c5cff); z-index: 2; }
.m3 { left: 58%; top: 22%; transform: rotate(12deg);  background: linear-gradient(150deg, #2ee6a8, #46b8ff); }
.m4 { left: 34%; top: 48%; transform: rotate(-5deg);  background: linear-gradient(150deg, #7c5cff, #ff4d93); z-index: 3; }

@media (prefers-reduced-motion: no-preference) {
  .m1 { animation: float 7s ease-in-out infinite; }
  .m2 { animation: float 6s ease-in-out infinite 0.6s; }
  .m3 { animation: float 8s ease-in-out infinite 1.2s; }
  .m4 { animation: float 6.5s ease-in-out infinite 0.3s; }
  @keyframes float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -9px; }
  }
}

/* -------------------------------------------------------------- sections */
.block { margin: 3rem 0; }

.block-title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  letter-spacing: -0.02em;
}

.block-sub { margin: 0 0 1.2rem; color: var(--pm-muted); font-size: 0.92rem; }

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.block-more { font-size: 0.85rem; white-space: nowrap; }

/* ------------------------------------------------------------- kind cards */
.kind-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.kind {
  position: relative;
  overflow: hidden;
  padding: 1.1rem 1rem 1.15rem;
  border-radius: var(--pm-radius);
  border: 1px solid var(--pm-border);
  background: var(--pm-surface);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.kind:hover { transform: translateY(-3px); }

.kind::after {
  content: "";
  position: absolute;
  inset: auto -30% -60% auto;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 999px;
  opacity: 0.35;
  filter: blur(26px);
}
.k1::after { background: var(--pink); }
.k2::after { background: var(--sun); }
.k3::after { background: var(--sky); }
.k4::after { background: var(--mint); }

.kind-emoji { display: block; font-size: 1.8rem; margin-bottom: 0.5rem; }
.kind strong { display: block; font-size: 1rem; }
.kind em { display: block; margin-top: 0.2rem; font-style: normal; color: var(--pm-muted); font-size: 0.82rem; }

/* ------------------------------------------------------------ board cards */
.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.9rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.board-card {
  border-radius: 16px;
  border: 1px solid var(--pm-border);
  overflow: hidden;
  background: var(--pm-surface);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.board-card:hover { transform: translateY(-3px); border-color: var(--pm-accent); }
.board-card > a { display: block; color: inherit; }
.board-card > a:hover { text-decoration: none; }

.board-cover {
  display: grid;
  place-items: center;
  height: 92px;
  position: relative;
}
.board-emoji { font-size: 2.1rem; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4)); }

.board-body { display: block; padding: 0.8rem 0.9rem 0.95rem; }
.board-body strong { display: block; font-size: 1rem; }
.board-meta { display: block; margin-top: 0.15rem; font-size: 0.76rem; color: var(--pm-muted); }
.board-desc { display: block; margin-top: 0.45rem; font-size: 0.82rem; color: var(--pm-muted); }

/* Deterministic per-channel gradients (chosen by slug hash in home.js). */
.g0 { background: linear-gradient(135deg, #7c5cff, #ff4d93); }
.g1 { background: linear-gradient(135deg, #ff4d93, #ffb020); }
.g2 { background: linear-gradient(135deg, #46b8ff, #2ee6a8); }
.g3 { background: linear-gradient(135deg, #2ee6a8, #46b8ff); }
.g4 { background: linear-gradient(135deg, #ffb020, #ff4d93); }
.g5 { background: linear-gradient(135deg, #7c5cff, #46b8ff); }
.g6 { background: linear-gradient(135deg, #ff4d93, #7c5cff); }
.g7 { background: linear-gradient(135deg, #46b8ff, #7c5cff); }

/* ------------------------------------------------------------- idea cards */
.idea-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.idea {
  padding: 1.1rem;
  border-radius: var(--pm-radius);
  border: 1px dashed var(--pm-border);
  background: rgba(255, 255, 255, 0.02);
}
.idea-emoji { display: block; font-size: 1.7rem; margin-bottom: 0.5rem; }
.idea strong { display: block; }
.idea em { display: block; margin: 0.2rem 0 0.7rem; font-style: normal; font-size: 0.82rem; color: var(--pm-muted); }
.idea a { font-size: 0.85rem; font-weight: 600; }

/* ----------------------------------------------------------------- steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; }

.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
  padding: 1rem;
  border-radius: var(--pm-radius);
  border: 1px solid var(--pm-border);
  background: var(--pm-surface);
}

.step-n {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--grape), var(--pink));
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
}

.steps strong { display: block; font-size: 0.98rem; }
.steps p { margin: 0.2rem 0 0; color: var(--pm-muted); font-size: 0.86rem; }

/* ------------------------------------------------------------ public/priv */
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.9rem; }

.duo-card {
  padding: 1.15rem;
  border-radius: var(--pm-radius);
  border: 1px solid var(--pm-border);
  background: var(--pm-surface);
}
.duo-card h3 { margin: 0.6rem 0 0.3rem; font-size: 1.02rem; }
.duo-card p { margin: 0; color: var(--pm-muted); font-size: 0.86rem; }
.duo-card.open { border-left: 3px solid var(--mint); }
.duo-card.shut { border-left: 3px solid var(--sun); }

/* ------------------------------------------------------------- cta band */
.cta-band {
  margin: 3rem 0 1rem;
  padding: 2.2rem 1.5rem;
  border-radius: 22px;
  text-align: center;
  background:
    radial-gradient(80% 140% at 50% 0%, rgba(124, 92, 255, 0.5), transparent 70%),
    linear-gradient(140deg, #1b1730, #241a2e);
  border: 1px solid var(--pm-border);
}
.cta-band h2 { margin: 0 0 0.5rem; font-size: clamp(1.3rem, 3vw, 1.9rem); letter-spacing: -0.02em; }
.cta-band p { margin: 0 0 1.4rem; color: var(--pm-muted); }

/* --------------------------------------------------------- responsive */
@media (max-width: 780px) {
  .hero2 { grid-template-columns: 1fr; padding-top: 1.2rem; }
  .hero2-art { min-height: 230px; order: -1; }
  .mini { width: 34%; }
  .cta-band { padding: 1.7rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-xl, .kind, .board-card { transition: none; }
}

/* ------------------------------------------------- SVG artwork overrides */
.hero2-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
}

.hero-img {
  display: block;
  width: 100%;
  max-width: 470px;
  height: auto;
  filter: drop-shadow(0 34px 60px rgba(0, 0, 0, 0.55));
}

.kind-ico {
  display: block;
  width: 56px;
  height: 56px;
  margin-bottom: 0.65rem;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}

@media (prefers-reduced-motion: no-preference) {
  .hero-img { animation: bob 9s ease-in-out infinite; }
  @keyframes bob {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -10px; }
  }
}

/* The fixed wash only on the front page, so channel themes stay untouched.
   (A body::before with z-index:-1 would paint behind the opaque body
   background and never be seen - hence background-image on the class.) */
body::before { content: none !important; }

.page-home {
  background-color: var(--pm-bg);
  background-image:
    radial-gradient(48% 55% at 16% 4%, rgba(124, 92, 255, 0.30), transparent 68%),
    radial-gradient(42% 50% at 84% -4%, rgba(255, 77, 147, 0.24), transparent 68%),
    radial-gradient(38% 46% at 56% 18%, rgba(70, 184, 255, 0.14), transparent 70%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* ---------------------------------------------- front page: visual fixes */
/* Gradient belongs to the cover only - on the whole card it bleeds under the
   title/description and makes them unreadable. */
.board-card { background: var(--pm-surface); }
.board-cover { height: 104px; }

.board-mono {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

/* Feed media: a 16:9 block at full width was swallowing the whole viewport. */
.embed { max-height: 340px; }
.embed img,
.embed iframe,
.embed-fallback {
  max-height: 340px;
  object-fit: cover;
}

.media-link img { max-height: 420px; object-fit: cover; }

/* Keep the hero on three lines without an awkward wrap. */
.hero2 h1 { font-size: clamp(2rem, 4.6vw, 3rem); }

/* Compact "load" bar for providers with no thumbnail. */
.embed-compact {
  max-height: none;
  height: auto;
  background: var(--pm-bg);
  border: 1px dashed var(--pm-border);
}
.embed-compact .embed-play {
  position: static;
  justify-content: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  background: transparent;
  color: var(--pm-fg);
  font-size: 0.85rem;
  font-weight: 600;
}
.embed-compact .embed-play:hover { background: rgba(124, 92, 255, 0.10); }

.embed-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--pm-accent);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.18);
}

/* Tighter media so the feed does not swallow the page. */
.embed { max-height: 300px; }
.embed img, .embed iframe, .embed-fallback { max-height: 300px; }

/* Never crop someone's GIF or thumbnail: letterbox instead. */
.embed img { object-fit: contain; background: #000; }
.media-link img { object-fit: contain; }

/* ------------------------------------------------------- appearance tokens */
/* Fallbacks for tokens introduced by the theme system. theme.json and the
   customizer override these through /theme/tokens.css. */
:root {
  --pm-accent-2: #ff4d93;
  --pm-radius-lg: 18px;
  --pm-font-head: var(--pm-font);
  --pm-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --pm-gap: 28px;
}

h1, h2, h3, .brand { font-family: var(--pm-font-head); }

.block { margin-top: var(--pm-gap); }

/* Sanitized block content. Only the tags the sanitizer allows are styled. */
.prose { line-height: 1.65; }
.prose p { margin: 0 0 0.9rem; }
.prose h2, .prose h3 { margin: 1.4rem 0 0.5rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: 0.25rem 0; }
.prose code {
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
}
.prose pre {
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  padding: 0.9rem;
  overflow-x: auto;
}
.prose img { max-width: 100%; height: auto; border-radius: var(--pm-radius); }
.prose hr { border: 0; border-top: 1px solid var(--pm-border); margin: 1.5rem 0; }

/* --------------------------------------------------------- appearance admin */
.admin .row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.admin .spacer { flex: 1 1 auto; }

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}
.theme-card {
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  background: var(--pm-surface);
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.theme-card.active { border-color: var(--pm-accent); }
.theme-card header { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.theme-card p { margin: 0; font-size: 0.82rem; }
.theme-card .row { display: flex; gap: 0.8rem; }

.theme-swatch {
  display: flex;
  height: 34px;
  border-radius: calc(var(--pm-radius) - 4px);
  overflow: hidden;
  border: 1px solid var(--pm-border);
}
.theme-swatch .sw { flex: 1 1 0; }

.token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}
.token {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.5rem;
  align-items: center;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
}
.token span { text-transform: capitalize; }
.token input[type="color"] { width: 100%; height: 30px; padding: 0; border: 0; background: none; }
.token select, .token input[type="number"] { width: 100%; }
.token code { grid-column: 1 / -1; font-size: 0.7rem; color: var(--pm-muted); }

.block-card {
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  background: var(--pm-surface);
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.75rem;
}
.block-card.disabled { opacity: 0.65; }
.block-card.broken { border-color: #fbbf24; }
.block-card > header {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}
.block-card > header form { display: inline; }
.block-card details { margin-top: 0.6rem; }
.block-card summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--pm-muted);
}
.block-card details form { margin-top: 0.7rem; }

.theme-card .muted,
.block-card .muted { font-size: 0.78rem; }
