/* Comments section — #602, ported 1-for-1 from
   sites/coaches/sabrina-lott/prototype-blog-comments.html, VARIANT 3 (collapsed),
   which Kevin approved and froze on 2026-08-18.

   Every rule ABOVE the "PORT ADDITIONS" banner is copied byte-for-byte from the
   prototype's <style> block — 168 rule-lines, machine-verified with a zero diff.
   The prototype-only `.cm-note` annotation block is the only thing dropped — it
   exists to explain the prototype to a human, not to style the page.

   Below the banner are THREE commented additions — six rules in total — that the
   prototype has no equivalent for: the <details>/<summary> normalizer (4 rules,
   5 declarations), `.cm-error`, and `.cm-spaced`. None of them affects the
   byte-equivalence of the ported block above.

   Shipped INTO THE CLOUDFLARE MANIFEST at css/pages/comments.css, exactly like
   #598's 404 stylesheet, and never committed to racemob-hosted-sites: nothing in
   this build writes to the static repo, which is #594's keystone property. The
   post page links it root-absolute.

   The custom properties it reads (--plum, --plum-muted, --plum-soft,
   --purple-soft, --cyan-soft, --purple-deep, --purple-warm, --peach-glow,
   --gradient-cta, --shadow-purple, --shadow-soft) are the SITE's tokens from its
   own base.css — the same ones prototype-blog.css uses. NOTE: like error_page.css,
   this file is invisible to spec/architecture/design_token_resolution_spec.rb,
   because it ships through the manifest rather than through Sprockets. */

.cm { max-width: 760px; margin: 0 auto; padding-top: 8px; }

/* the hairline that separates the post from the conversation */
.cm-rule {
  height: 1px;
  margin: 56px 0 40px;
  background: linear-gradient(90deg, rgba(200,0,255,0.22), rgba(0,251,255,0.18), transparent);
}

.cm-head { margin-bottom: 28px; }
.cm-head h2 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--plum);
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.cm-head p { color: var(--plum-muted); font-size: 15px; margin: 0; line-height: 1.6; }
.cm-count {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--plum-muted);
  letter-spacing: 0.02em;
}

/* ---------- the list ---------- */
.cm-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 48px; }

.cm-item { display: flex; gap: 16px; padding: 22px 0; border-top: 1px solid rgba(45,27,61,0.07); }
.cm-item:first-child { border-top: none; }

.cm-avatar {
  flex: 0 0 44px;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; font-weight: 700;
  color: var(--plum);
  background: linear-gradient(135deg, var(--purple-soft), var(--cyan-soft));
  border: 1px solid rgba(200,0,255,0.12);
  user-select: none;
}
.cm-item.is-author .cm-avatar {
  background: var(--gradient-cta);
  color: #fff;
  border-color: transparent;
}

.cm-body { flex: 1; min-width: 0; }
.cm-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; font-weight: 600;
  color: var(--plum);
  text-decoration: none;
}
a.cm-name:hover { color: var(--purple-deep); text-decoration: underline; }
a.cm-name::after {
  content: "\f35d";
  font-family: "Font Awesome 6 Free"; font-weight: 900;
  font-size: 9px; margin-left: 5px;
  color: var(--plum-muted); opacity: 0.55;
  vertical-align: 1px;
}
.cm-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: #fff; background: var(--gradient-cta);
  vertical-align: 2px;
}
.cm-when { font-size: 13px; color: var(--plum-muted); margin-left: 10px; }
.cm-text {
  margin: 8px 0 0;
  color: var(--plum-soft);
  font-size: 16px; line-height: 1.7;
  white-space: pre-line;      /* body is plain text — no HTML, no auto-linking */
  overflow-wrap: anywhere;
}

/* ---------- the form ---------- */
.cm-form {
  padding: 32px;
  border-radius: 24px;
  background: var(--peach-glow);
  border: 1px solid rgba(200,0,255,0.08);
}
.cm-form.is-plain { background: transparent; border: none; padding: 0; }
.cm-form h3 {
  font-family: 'Fraunces', serif;
  font-size: 22px; font-weight: 600;
  color: var(--plum); margin: 0 0 6px;
}
.cm-form .cm-lede { color: var(--plum-muted); font-size: 15px; line-height: 1.6; margin: 0 0 22px; }

.cm-row { display: flex; gap: 12px; margin-bottom: 12px; }
.cm-row > * { flex: 1; min-width: 0; }

.cm-field label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--plum-muted);
  margin-bottom: 6px;
}
.cm-field .opt { font-weight: 400; text-transform: none; letter-spacing: 0; opacity: 0.8; }
.cm-field input, .cm-field textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid rgba(45,27,61,0.12);
  background: rgba(255,255,255,0.9);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--plum);
}
.cm-field textarea { min-height: 128px; resize: vertical; line-height: 1.6; }
.cm-field input:focus, .cm-field textarea:focus {
  outline: 2px solid var(--purple-warm); outline-offset: 1px; border-color: transparent;
}
.cm-hint { font-size: 12px; color: var(--plum-muted); margin: 6px 0 0; }

.cm-actions { display: flex; align-items: center; gap: 18px; margin-top: 18px; flex-wrap: wrap; }
.cm-submit {
  padding: 14px 32px;
  border: none; border-radius: 100px;
  background: var(--gradient-cta);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-purple);
  transition: transform 0.25s;
}
.cm-submit:hover { transform: translateY(-2px); }

/* Turnstile sits here in production — 08's stack, already allowed by the site CSP */
.cm-turnstile {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(45,27,61,0.2);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px; color: var(--plum-muted);
}

/* collapsed trigger (variant 3) */
.cm-trigger {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  border-radius: 100px;
  border: 1px solid rgba(200,0,255,0.22);
  background: rgba(255,255,255,0.75);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; font-weight: 600;
  color: var(--plum);
  cursor: pointer;
  transition: all 0.25s;
}
.cm-trigger:hover { background: #fff; transform: translateY(-2px); box-shadow: var(--shadow-soft); }

/* posted confirmation — replaces the form in place */
.cm-posted {
  padding: 28px 32px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--purple-soft), var(--cyan-soft));
  border: 1px solid rgba(200,0,255,0.14);
  display: flex; gap: 16px; align-items: flex-start;
}
.cm-posted i { color: var(--purple-deep); font-size: 20px; margin-top: 2px; }
.cm-posted strong {
  display: block;
  font-family: 'Fraunces', serif; font-size: 19px; font-weight: 600;
  color: var(--plum); margin-bottom: 4px;
}
.cm-posted p { margin: 0; color: var(--plum-soft); font-size: 15px; line-height: 1.6; }

@media (max-width: 640px) {
  .cm-row { flex-direction: column; gap: 12px; }
  .cm-form { padding: 24px 20px; }
  .cm-item { gap: 12px; }
}

/* ============================================================
   PORT ADDITIONS — everything above this line is the prototype verbatim.
   ============================================================ */

/* The prototype's collapse is `<div id="cm-collapsed"><button class="cm-trigger">`
   plus a sibling `<div id="cm-expanded" style="display:none">` toggled by an
   onclick. The port uses <details>/<summary> instead: same classes, same rendered
   appearance, but it needs no inline style (banned here) and it still opens with
   JavaScript off.
   These four rules exist only to make a <summary> render like the prototype's
   <button>. `line-height` is NOT decoration: a <button> computes `normal` while a
   <summary> inherits the page's 25.5px, which measured the pill 5.5px taller than
   the frozen prototype (50px → 55.5px) at 640px. Caught by the parity diff. */
.cm-collapse > summary { list-style: none; line-height: normal; }
.cm-collapse > summary::-webkit-details-marker { display: none; }
.cm-collapse > summary::marker { content: ""; }
.cm-collapse[open] > summary { display: none; }

/* Submit error text. The prototype has no error state — its button is a fake that
   navigates. Reuses .cm-hint's scale so it needs no new type decision. */
.cm-error {
  margin: 12px 0 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #b3261e;
}

/* The prototype writes this as `style="margin-bottom:12px"` on the website field.
   Inline styles are banned here, so it is a class; the value is unchanged. */
.cm-spaced { margin-bottom: 12px; }
