/* Resolutions — the document view and its margin comments.

   A plain stylesheet rather than Tailwind utilities in the markup: this is
   one self-contained screen with a lot of state (highlighted / pending /
   set-aside / active), and states like that read far better as named
   classes than as long strings of utilities repeated in three templates.
   Same reasoning (and same shape) as static/manage/manage.css and
   static/pageedit/editor.css.

   Colours are the site's own brand variables where they exist, each with a
   literal fallback so this file still looks right if it is ever loaded
   before the Tailwind build. */

:root {
  --rz-ink: var(--color-prh-ink, #0b1220);
  --rz-mute: var(--color-prh-mute, #5a6b80);
  --rz-line: var(--color-prh-line, #e6e9ef);
  --rz-bg: var(--color-prh-bg, #f7f9fc);
  --rz-blue: var(--color-prh-blue-2, #3b82f6);
  --rz-blue-dark: var(--color-prh-blue, #1e40af);
  /* Google Docs' highlight yellow is the reference here on purpose — it is
     the colour people already read as "there's a comment on this". */
  --rz-highlight: #fdeeb6;
  --rz-highlight-strong: #f7d774;
  --rz-pending: #b45309;
  --rz-pending-bg: #fff7ed;
}

/* --- layout ----------------------------------------------------------- */

.rz-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 21rem;
  gap: 1.75rem;
  align-items: start;
}

/* Below the breakpoint the margin stops being a margin: cards drop into a
   plain list under the document (doc.js stops positioning them, too). */
@media (max-width: 1023px) {
  .rz-shell { grid-template-columns: minmax(0, 1fr); }
}

.rz-doc {
  background: #fff;
  border: 1px solid var(--rz-line);
  border-radius: 1rem;
  padding: 2.25rem 2.5rem 2.75rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 8px rgba(15, 23, 42, 0.06);
}

@media (max-width: 640px) {
  .rz-doc { padding: 1.5rem 1.25rem 2rem; }
}

.rz-doc-head {
  border-bottom: 1px solid var(--rz-line);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.rz-kind {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rz-blue-dark);
  background: #eff6ff;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
}

.rz-docmeta {
  font-size: 0.8rem;
  color: var(--rz-mute);
  margin: 0;
}

/* --- the document text ------------------------------------------------ */

.rz-block {
  /* pre-wrap keeps the document's own line breaks, and — the part that
     matters — keeps every character the reader sees at exactly the offset
     the server stored it at, which is what comment anchors are measured in. */
  white-space: pre-wrap;
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--rz-ink);
  margin: 0 0 1.15rem;
}

.rz-block--heading {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.5;
  margin: 2rem 0 0.85rem;
}

.rz-block:first-child { margin-top: 0; }

.rz-mark {
  background: var(--rz-highlight);
  color: inherit;
  border-radius: 2px;
  padding: 0.05em 0;
  cursor: pointer;
  transition: background 0.15s ease;
}

.rz-mark:hover,
.rz-mark.is-active {
  background: var(--rz-highlight-strong);
}

/* A highlight nobody but its author and the owner can see yet: dashed,
   so it never reads as part of the published document. */
.rz-mark--pending {
  background: transparent;
  border-bottom: 2px dashed var(--rz-pending);
}

.rz-mark--pending:hover,
.rz-mark--pending.is-active {
  background: var(--rz-pending-bg);
}

/* The live selection while a comment is being written. */
.rz-mark--draft {
  background: var(--rz-highlight-strong);
  border-radius: 2px;
}

/* --- the "add a comment" bubble --------------------------------------- */

.rz-bubble {
  position: absolute;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--rz-line);
  background: #fff;
  color: var(--rz-ink);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08), 0 8px 20px rgba(15, 23, 42, 0.12);
}

.rz-bubble:hover { border-color: var(--rz-blue); color: var(--rz-blue-dark); }
.rz-bubble[hidden] { display: none; }

/* --- the margin ------------------------------------------------------- */

.rz-rail { position: relative; }

.rz-rail-head {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rz-mute);
  margin: 0 0 0.75rem;
}

.rz-card {
  background: #fff;
  border: 1px solid var(--rz-line);
  border-radius: 0.85rem;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 10px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

/* Once doc.js has lined the cards up with their highlights, they are
   positioned rather than stacked — the class is added by the script, so
   with JavaScript off the cards stay a readable list. */
.rz-rail.is-positioned .rz-card {
  position: absolute;
  left: 0;
  right: 0;
  margin-bottom: 0;
}

.rz-card.is-active {
  border-color: var(--rz-blue);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.18), 0 10px 24px rgba(15, 23, 42, 0.10);
}

.rz-card--pending {
  border-left: 3px solid var(--rz-pending);
  background: var(--rz-pending-bg);
}

.rz-card--rejected {
  opacity: 0.72;
  background: var(--rz-bg);
}

.rz-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.rz-card-who {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--rz-ink);
}

.rz-card-when { font-size: 0.7rem; color: var(--rz-mute); }

.rz-card-quote {
  font-size: 0.75rem;
  color: var(--rz-mute);
  border-left: 2px solid var(--rz-highlight-strong);
  padding-left: 0.55rem;
  margin: 0 0 0.45rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rz-card-body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--rz-ink);
  white-space: pre-wrap;
  margin: 0;
}

.rz-card-state {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 0.55rem;
  color: var(--rz-pending);
}

.rz-card-state--rejected { color: var(--rz-mute); }
.rz-card-note { font-size: 0.72rem; color: var(--rz-mute); margin: 0.4rem 0 0; }

.rz-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.rz-btn {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--rz-line);
  background: #fff;
  color: var(--rz-ink);
  cursor: pointer;
}

.rz-btn:hover { border-color: var(--rz-blue); color: var(--rz-blue-dark); }
.rz-btn:disabled { opacity: 0.55; cursor: default; }
.rz-btn--primary { background: var(--rz-ink); border-color: var(--rz-ink); color: #fff; }
.rz-btn--primary:hover { background: var(--rz-blue-dark); border-color: var(--rz-blue-dark); color: #fff; }

.rz-textarea {
  width: 100%;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  border: 1px solid var(--rz-line);
  border-radius: 0.6rem;
  padding: 0.55rem 0.65rem;
  resize: vertical;
  min-height: 5rem;
  background: #fff;
  color: var(--rz-ink);
}

.rz-textarea:focus { outline: 2px solid var(--rz-blue); outline-offset: 1px; }

.rz-error {
  font-size: 0.78rem;
  color: #b91c1c;
  margin: 0.45rem 0 0;
}

.rz-empty {
  font-size: 0.82rem;
  color: var(--rz-mute);
  background: var(--rz-bg);
  border: 1px dashed var(--rz-line);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  margin: 0;
}

/* --- roles panel ------------------------------------------------------ */

.rz-panel {
  background: #fff;
  border: 1px solid var(--rz-line);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 8px rgba(15, 23, 42, 0.06);
}

.rz-panel h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--rz-ink);
  margin: 0 0 0.75rem;
}

.rz-people { list-style: none; margin: 0 0 1rem; padding: 0; }

.rz-people li {
  font-size: 0.88rem;
  color: var(--rz-ink);
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--rz-line);
}

.rz-people li:last-child { border-bottom: 0; }
.rz-role { font-size: 0.72rem; color: var(--rz-mute); }

.rz-applied {
  font-size: 0.82rem;
  color: var(--rz-pending);
  background: var(--rz-pending-bg);
  border: 1px solid #fed7aa;
  border-radius: 0.6rem;
  padding: 0.6rem 0.75rem;
  margin: 0 0 0.6rem;
}

.rz-applyrow { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

/* --- the discussion below the document --------------------------------

   Full width, under the document, and visibly not the margin: the margin
   beside the text is reserved for members marking up particular wording,
   so this is where background and general debate go. */

.rz-thread {
  max-width: 52rem;
  margin: 0;
  padding-top: 0.5rem;
}

.rz-thread-head {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--rz-ink);
  margin: 0 0 0.25rem;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.rz-thread-waiting {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rz-pending);
  background: var(--rz-pending-bg);
  border: 1px solid #fed7aa;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}

.rz-thread-sub {
  font-size: 0.85rem;
  color: var(--rz-mute);
  margin: 0 0 1.25rem;
}

.rz-post {
  background: #fff;
  border: 1px solid var(--rz-line);
  border-radius: 0.9rem;
  padding: 1rem 1.25rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 10px rgba(15, 23, 42, 0.05);
}

/* Sourced background reads as a document, not as somebody's opinion. */
.rz-post--record {
  background: var(--rz-bg);
  border-left: 3px solid var(--rz-blue);
}

.rz-post--pending { border-left: 3px solid var(--rz-pending); background: var(--rz-pending-bg); }
.rz-post--rejected { opacity: 0.72; background: var(--rz-bg); }
.rz-post--compose { margin-top: 1.5rem; }

.rz-post-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.rz-post-who { font-size: 0.9rem; font-weight: 800; color: var(--rz-ink); }

.rz-post-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--rz-blue-dark);
  background: #eff6ff;
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
}

.rz-post-body { font-size: 0.95rem; line-height: 1.65; color: var(--rz-ink); }
.rz-post-body p { margin: 0 0 0.75rem; }
.rz-post-body p:last-child { margin-bottom: 0; }

.rz-post-source {
  font-size: 0.78rem;
  color: var(--rz-mute);
  margin: 0.7rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--rz-line);
}

.rz-post-source a { color: var(--rz-blue-dark); }

.rz-post-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--rz-ink);
  margin-bottom: 0.45rem;
}

/* --- amendment marks ---------------------------------------------------

   An amendment says two things about a passage: this language is being
   added, and this language is being removed. NALC's own published
   amendments use bold for the first and strikethrough for the second, so
   the page does too -- shown, never merely described, because language
   proposed for deletion otherwise reads as though it still stands. */

.rz-new {
  text-decoration: none;
  font-weight: 800;
  color: var(--rz-blue-dark);
  background: #eff6ff;
  border-radius: 2px;
  padding: 0.05em 0.12em;
}

.rz-cut {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: #b91c1c;
  color: var(--rz-mute);
}

/* The key that explains the two, above the document. */
.rz-key {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-size: 0.78rem;
  color: var(--rz-mute);
  margin: 0 0 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rz-line);
}
