/* The comment block on file, folder and episode pages.
 *
 * Its own file, linked only by pages that carry the block, so the homepage,
 * the 404 and the requests page do not pay for it. Deliberately plain: it
 * sits inside a 2015 stylesheet that styles bare elements, so everything here
 * is class-scoped and nothing is a bare `input` or `div` rule.
 *
 * Not fingerprinted with a query string like the legacy sheets, which carry
 * `?16` by hand -- this one takes the `?v=` token of the directory it is in,
 * so editing it is enough. It must not take /talk's token: that one is the
 * mtime of static/talk, which an edit here does not move.
 */

/* The block is included inside the content column, so it takes that column's
   width and needs no cap of its own. It is deliberately not placed after the
   layout: the desktop document closes its three columns with floats and never
   clears them, so a block that follows them starts level with the breadcrumb
   and runs the height of the page -- the heading's red background showing
   through behind the crumbs while its own text sits at the bottom.

   The 3px gutter is `.menu`'s, so the heading lines up with the `.:: Other
   qualities` bar above it rather than sitting a few pixels wide of it. */
.cmts { margin: 6px 0 10px; padding: 0 3px; }

.cmt {
  padding: 7px 8px;
  margin-bottom: 6px;
  background: #fff;
  border: 1px solid #e4e4e4;
  border-radius: 5px;
}

.cmt--reply {
  margin: 6px 0 0 14px;
  background: #fafafa;
}

.cmt__who { font-weight: bold; color: #090; font-size: 13px; }
.cmt__body { color: #464646; overflow-wrap: anywhere; }
.cmt__none, .cmt__note { color: #777; font-size: 13px; padding: 4px 0; }
.cmt__more { padding: 4px 0; }

/* The thread this page's comments live in, at the top of the block and
   styled as the way through rather than as a footnote: the conversation is
   on /talk, and five comments and a box are the sample of it shown here. */
.cmt__all { margin: 0 0 8px; }
.cmt__all a {
  display: block;
  padding: 9px 12px;
  border: 1px solid #e64545;
  border-radius: 7px;
  background: #fff3f3;
  color: #bf3d3d;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
}
.cmt__all a:hover { background: #e64545; color: #fff; }

/* The box is closed until it is asked for. `display: block` drops the
   disclosure triangle in Chrome and Firefox; Safari needs its own marker
   turned off as well. */
.cmt__add { max-width: 480px; margin: 8px auto 0; }
.cmt__add > summary {
  display: block;
  padding: 9px 18px;
  border: 1px solid #e64545;
  border-radius: 7px;
  background: #e64545;
  color: #fff;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
}
.cmt__add > summary::-webkit-details-marker { display: none; }
.cmt__add > summary:hover { background: #bf3d3d; border-color: #bf3d3d; }
.cmt__add > summary:focus-visible { outline: 2px solid #1d1a1a; outline-offset: 2px; }
/* Open, the summary is no longer the thing to press -- the submit button is. */
.cmt__add[open] > summary {
  background: #fff;
  color: #bf3d3d;
}

/* The width cap and the centring are the disclosure's, since the form is
   only ever inside one. The fields below are the block, so they need no
   width of their own. */
.cmt__form { margin-top: 6px; }

/* Every declaration here exists to beat a bare-element rule in
   ws_cream_nocache.css, which fills inputs pink (#fad2d2) and inks them red
   (#e63c3c) site-wide. The palette is /talk's, which is where this form
   posts. `font-size` has a floor of 1rem because iOS zooms the page in on a
   field whose text is smaller than that. */
.cmt__form input[type=text], .cmt__form textarea {
  display: block;
  width: 100%;
  padding: 9px 11px;
  margin: 4px 0;
  border: 1px solid #dccfcf;
  border-radius: 7px;
  background: #fff;
  color: #1d1a1a;
  font: inherit;
  font-size: max(1rem, 1em);
  box-sizing: border-box;
}

.cmt__form ::placeholder { color: #6f6666; opacity: 1; }

/* `height`, because `textarea:focus { height: 260px }` in the legacy sheet
   makes the box leap to 260px the moment it is clicked and snap back on
   blur. `auto` hands the height back to the `rows` attribute, and a height
   the visitor sets by dragging the resize grip is inline, so it still wins
   over both. */
.cmt__form textarea { min-height: 96px; resize: vertical; }
.cmt__form textarea:focus { height: auto; }

/* Replaces the 10px red glow `input:hover, input:focus` paints on every
   field on the site. */
.cmt__form input:hover, .cmt__form input:focus,
.cmt__form textarea:hover, .cmt__form textarea:focus {
  box-shadow: none;
}
.cmt__form input[type=text]:focus, .cmt__form textarea:focus {
  outline: 0;
  border-color: #e64545;
  box-shadow: 0 0 0 3px rgba(230, 69, 69, 0.15);
}

.cmt__form input[type=submit] {
  padding: 9px 18px;
  margin: 0;
  border: 1px solid #e64545;
  border-radius: 7px;
  background: #e64545;
  color: #fff;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}
.cmt__form input[type=submit]:hover {
  background: #bf3d3d;
  border-color: #bf3d3d;
  box-shadow: none;
}
.cmt__form input[type=submit]:focus-visible {
  outline: 2px solid #1d1a1a;
  outline-offset: 2px;
}

.cmt__form .form__error { color: #b3261e; font-size: 13px; }
