@charset "utf-8";
/* ============================================================
   FILE: /sites/mhl/assets/css/comments.css
   Comment thread and the leave-a-comment form
   (DEV_PLAN §14 step 5)
   ------------------------------------------------------------
   WordPress owns the comments; this only draws them. Markup:
   templates/components/comment_list.php and comment_form.php.

   ⚠ COLOURS ARE A FIRST PASS, like blog_post.css — they route
   through custom properties on .comments, defaulting to the
   site's gold tokens, so a later pass changes them in one place.
   ============================================================ */

/* 2.5.4.2 (DEV_PLAN_Stage3 §4.15, Ben, 21 October 2026; canvas boards "End of the post +
   comments", Ben's picks): still a card each; the border the cool grey of the page's other boxes
   (was the warm #ebe8e1); visitors' avatars in six colours by name; our replies with the van and
   no gold edge; the Author badge and "↩ Reply" in the posts blue (--comment-link); comment text
   16px (15px on phones); the form in a white box, behind a "Leave a comment" button when the post
   has comments. Previous: "comments - v3 (pre-2.5.4.2).css". */
.comments {
  --comment-accent:  var(--mwd-gold-dark, #a8843f);
  --comment-link:    var(--journal-mid, #0861c4);
  --comment-text:    #3f4449;
  --comment-muted:   #6b7076;
  --comment-border:  #e3e6ec;
  --comment-surface: #fff;       /* was off-white #faf9f6 — white boxes on the page background (2.4.1) */
  --comment-radius:  var(--img-border-radius, 7px);

  /* 2.5.4.1 (DEV_PLAN_Stage3 §4.15, Ben, 21 October 2026): no ruled line above the comments, nor
     above the form below — the space and the headings part the blocks. Was padding-top 2.5rem +
     border-top here and padding-top 2rem + border-top on .comment-form-wrap.
     Previous: "comments - v2 (pre-2.5.4.1).css". */
  margin-top: 3.5rem;
  color: var(--comment-text);
}

.comments__heading {
  margin: 0 0 18px;
  color: #20242b;
  font-size: 26px;   /* 2.5.4.2: as Keep reading's heading (was 1.5rem) */
  line-height: 1.25;
}
@media only screen and (max-width: 768px) {
  .comments__heading { margin-bottom: 14px; font-size: 22px; }
}

/* Shown in place of the form where comment_status is 'closed' — 47 live posts. */
.comments__closed {
  color: var(--comment-muted);
  font-style: italic;
  margin: 1.5rem 0 0;
}

/* ------------------------------------------------------------
   The thread
------------------------------------------------------------ */
.comment-list,
.comment__children {
  list-style: none;
  margin: 0;
  padding: 0;
}
/* Nesting indent. Depth is capped at 5 by WpComment, so this can never
   run away however deep the stored comment_parent chain goes.
   2.5.4.3 (Ben, 21 October 2026): a gap between a comment's card and its first reply —
   PADDING-top, not margin, so the line on the left still runs straight down from the card.
   ⚠ It must sit here, after the shared rule above: that rule's padding:0 shorthand would
   otherwise reset it. Previous: "comments - v4 (pre-2.5.4.3).css". */
.comment__children {
  margin-left: 2.5rem;
  padding-top: 1rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--comment-border);
}
@media only screen and (max-width: 600px) {
  .comment__children { margin-left: 0.75rem; padding-left: 0.85rem; }
}

.comment { margin: 0 0 1.5rem; }

.comment__body {
  background: var(--comment-surface);
  border: 1px solid var(--comment-border);
  border-radius: var(--comment-radius);
  padding: 1.15rem 1.35rem 0.75rem;
}

/* Our own replies — comments posted by a logged-in WordPress user. 2.5.4.2: the gold left edge is
   gone; the name ("Ben & Cristina"), the van avatar and the badge mark them now. */

.comment__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

/* Placeholder avatar — the commenter's initial in a disc, drawn here.
   It replaced a Gravatar <img> so no visitor IP goes to a third party;
   comment_list.php's header has the one-element swap to put it back. */
.comment__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: 0 0 auto;

  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  color: var(--avatar-fg, #0b4a99);
  background: var(--avatar-bg, #dbe9fb);
  user-select: none;
}

/* 2.5.4.2: six soft colours, handed to a thread's visitors in the order they appear
   (comment_list.php), each with dark text of the same hue — 6.5:1 or better. Was gold for
   everyone, and our replies a grey disc. */
.comment__avatar--c1 { --avatar-bg: #dbe9fb; --avatar-fg: #0b4a99; }
.comment__avatar--c2 { --avatar-bg: #d9f2e4; --avatar-fg: #166534; }
.comment__avatar--c3 { --avatar-bg: #fdecc8; --avatar-fg: #7a4f10; }
.comment__avatar--c4 { --avatar-bg: #f9dde8; --avatar-fg: #9d174d; }
.comment__avatar--c5 { --avatar-bg: #e4e1fb; --avatar-fg: #3f3297; }
.comment__avatar--c6 { --avatar-bg: #d5f0ec; --avatar-fg: #11605a; }

/* Our replies: the van (Ben's PNG, or the drawn disc until it is on the server). */
.comment__avatar--us { display: block; object-fit: cover; background: none; }

@media only screen and (max-width: 768px) {
  .comment__avatar { width: 36px; height: 36px; font-size: 15px; }
}

.comment__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}

.comment__author {
  color: #20242b;
  font-size: 15.5px;
  font-weight: 600;
}

/* 2.5.4.2: blue, as on the board (Ben: "stay blue") — was white on gold. */
.comment__badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--comment-link);
  background: #e7f0fd;
  border-radius: 4px;
  vertical-align: 2px;
}

.comment__date {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--comment-muted);
}

.comment__text {
  font-size: 16px;
  line-height: 1.7;
  /* Comment text is escaped then nl2br'd, so long unbroken strings —
     a pasted URL — must not push the layout wide. */
  overflow-wrap: break-word;
  word-break: break-word;
}

@media only screen and (max-width: 768px) {
  .comment__author { font-size: 15px; }
  .comment__date   { font-size: 13px; }
  .comment__text   { font-size: 15px; line-height: 1.65; }
}

.comment__actions { margin: 0.6rem 0 0; }

/* ------------------------------------------------------------
   Buttons

   ⚠ NOTE FOR ANYONE WORKING FROM THE OLDER WARNINGS. DEV_PLAN §14
   step 5 and lightbox.css both say "buttons.css styles every
   <button> as the gold .btn with a ► in ::after". That stopped
   being true on 19 September 2026: the bare-element reset was
   removed, core's base.css now only normalises button (box-sizing,
   font, colour, cursor — base.css:261) and the ► belongs to a
   class: core's .btn--arrow, or MHL's main .btn (2.4.1). A <button>
   without .btn gets none, so nothing here needs to opt out.

   What IS still needed is the ordinary browser reset — a <button>
   ships with its own background, border and padding, and the reply
   and cancel controls are meant to read as links.

   The submit button is the site's main .btn (buttons.css) since 2.4.1; it was .btn-box.
------------------------------------------------------------ */
.comment__reply,
.comment-form__cancel {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--comment-accent);
  cursor: pointer;
  text-decoration: underline;
}
.comment__reply:hover,
.comment-form__cancel:hover { text-decoration: none; }

/* 2.5.4.2: Reply is a quiet "↩ Reply" in the posts blue (Ben) — the gold underlined text was
   3.6:1. 36px tall, so it is a fair target on a phone. Cancel reply keeps the rule above (the
   gold text is its own item, next on the list). */
.comment__reply {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  font-size: 14px;
  color: var(--comment-link);
  text-decoration: none;
}
.comment__reply:hover { text-decoration: underline; }
.comment__reply-icon { flex: 0 0 auto; }

/* ------------------------------------------------------------
   The form
------------------------------------------------------------ */
.comment-form-wrap {
  margin-top: 2.5rem;   /* 2.5.4.1: no ruled line above the form (see .comments) */
}

/* When replying, comments.js appends #respond to the <li class="comment"> being answered,
   so the form's parent IS .comment — not an <li> nested inside it. */
.comment > .comment-form-wrap {
  margin-top: 1.25rem;
}

/* 2.5.4.2: the form in a white box, like "Enjoyed this post?". */
.comment-form__panel {
  padding: 24px 26px 26px;
  background: #fff;
  border: 1px solid var(--comment-border);
  border-radius: 12px;
}
@media only screen and (max-width: 600px) {
  .comment-form__panel { padding: 20px 18px 22px; }
}

/* 2.5.4.2: BEHIND A BUTTON. With comments, the section is .is-collapsed: the "Leave a comment"
   button shows and the panel hides — ONLY under .js (set in the layout's <head>), so without
   JavaScript the form is simply there, and nothing flashes on load. comments.js removes
   .is-collapsed. No [hidden] attribute is involved, so the display rules below are safe. */
.comment-form__open { display: none; margin: 0; }
.js .comment-form-wrap.is-collapsed > .comment-form__open  { display: block; }
.js .comment-form-wrap.is-collapsed > .comment-form__panel { display: none; }
.comments .comment-form-wrap.is-collapsed { margin-top: 1.75rem; }
@media only screen and (max-width: 600px) {
  .comment-form__open .btn { display: flex; justify-content: center; width: 100%; }
}

.comment-form__heading { margin: 0 0 4px; color: #20242b; font-size: 21px; line-height: 1.3; }
.comment-form__intro   { color: var(--comment-muted); margin: 0 0 18px; font-size: 15px; }
@media only screen and (max-width: 600px) {
  .comment-form__heading { font-size: 20px; }
  .comment-form__intro   { margin-bottom: 16px; font-size: 14.5px; }
}

/* With no comments the form follows "Be the first to comment" straight away (no gap above). */
.comments__heading + .comment-form-wrap { margin-top: 0; }

/* ⚠ `:not([hidden])` IS NOT DECORATION — READ BEFORE EDITING.
   The HTML `hidden` attribute works by setting `display:none` in the UA stylesheet, and
   ANY author `display` declaration beats it. Writing a bare `.comment-form__replying
   { display:flex }` therefore un-hides the element permanently — which is exactly what
   shipped on 21 September 2026: "Cancel reply" showed on every post page, whether or not
   anyone was replying. Scoping the display to `:not([hidden])` leaves the UA rule to win
   while the attribute is present. Same trap applies to __cover below. */
.comment-form__replying:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--comment-muted);
}

.comment-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media only screen and (max-width: 600px) {
  .comment-form__row { grid-template-columns: 1fr; gap: 1rem; }
}

.comment-form__field {
  display: block;
  margin-bottom: 1.1rem;
}

.comment-form__label {
  display: block;
  color: #20242b;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 5px;
}

/* 2.5.4.2: 16px text (also stops a phone zooming in on focus), 44px fields, a firmer border. */
.comment-form__field input,
.comment-form__field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d5dae3;
  border-radius: var(--comment-radius);
  font: inherit;
  font-size: 16px;
  color: inherit;
  background: #fff;
}
.comment-form__field input { min-height: 44px; }
/* 2.5.4.4 (Ben, 21 October 2026): the focus ring is the posts blue, like the page's other focus
   rings (Keep reading, the gallery's "Show fewer") — it was the gold. Previous:
   "comments - v5 (pre-2.5.4.4).css". */
.comment-form__field input:focus,
.comment-form__field textarea:focus {
  outline: 2px solid var(--comment-link);
  outline-offset: 1px;
}

.comment-form__field textarea { resize: vertical; min-height: 8rem; }

.comment-form__note {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--comment-muted);
}

/* The "Email me new posts" tick — 2.4.8.4 (DEV_PLAN_Stage3 §4.1 decision 8). Its own class,
   NOT .comment-form__field, whose input rule above would stretch the box to 100% wide.
   The whole label is the target, so the sentence toggles it too.
   Previous file: "comments - v1 (pre-2.4.8.4).css". */
.comment-form__check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  cursor: pointer;
}
.comment-form__check input {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.15rem 0 0;
  accent-color: var(--mhl-blue, #1657aa);
  cursor: pointer;
}
.comment-form__check input:focus-visible {
  outline: 2px solid var(--comment-link);   /* 2.5.4.4: blue, as the fields above */
  outline-offset: 2px;
}

/* ⚠ HONEYPOT. Hidden in CSS and never with the HTML hidden attribute — a bot reads the
   markup, not the stylesheet, so it fills this in and gives itself away. Kept out of
   the tab order and off-screen rather than display:none, which some bots check for. */
.comment-form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.comment-form__actions { margin: 0.5rem 0 0; }

/* ------------------------------------------------------------
   Loading cover — shown while the comment is in flight

   The SPINNER is core's `.lds-roller` (base.css, which the layout
   already loads), so this is the same one the framework's own
   forms use. The COVER is local: core's equivalent `.form-cover`
   lives in form.css, which the post page does not load and which
   would drag a whole form system's styles in for one overlay —
   lightbox.css draws its own overlay for the same reason.

   ⚠ base.css paints the roller's dots #fff, which is invisible on
   this near-white cover — form.css overrides the colour too.
------------------------------------------------------------ */
.comment-form { position: relative; }

/* ⚠ :not([hidden]) — see the note on __replying above. */
.comment-form__cover:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.comment-form__cover {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border-radius: var(--comment-radius);
}

.comment-form__cover .lds-roller div:after { background: var(--comment-accent); }

/* The roller is 80px square; the form is short when replying, so scale it down
   rather than letting it overflow. */
@media only screen and (max-width: 600px) {
  .comment-form__cover .lds-roller { transform: scale(0.7); }
}

/* Someone who has asked for less motion gets the dimmed cover and the button's
   "Sending…" text, but no spinning. */
@media (prefers-reduced-motion: reduce) {
  .comment-form__cover .lds-roller div { animation: none; }
}

/* Sits ABOVE the form (see comment_form.php), so it needs space beneath it rather
   than above — it is the first thing in the section once a comment is accepted. */
.comment-form__message {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: var(--comment-radius);
  font-size: 0.92rem;
}
.comment-form__message.is-ok {
  background: #eef6ee;
  border: 1px solid #c6e0c6;
  color: #2f5d33;
}
.comment-form__message.is-error {
  background: #fdf0ee;
  border: 1px solid #f0cdc6;
  color: #8a3122;
}

/* "Leave another comment" — shown in place of the form once one has been accepted,
   directly under the message and above the form.
   ⚠ No `display` declaration on purpose: a <p> is block by default, so the `hidden`
   attribute keeps working without a :not([hidden]) guard. See the note on __replying. */
.comment-form__again { margin: 0 0 1.25rem; }

.comment-form__again-btn {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
  font: inherit;
  font-weight: 600;
  color: var(--comment-accent);
  cursor: pointer;
  text-decoration: underline;
}
.comment-form__again-btn:hover { text-decoration: none; }

.comment-form__noscript {
  margin: 1rem 0 0;
  color: var(--comment-muted);
  font-style: italic;
}
