/* The moderator interface: the pages under /mod (Pages/Mod), the tools it adds to a
   thread, a post, a profile and the header, the report form, and the notes a banned or
   warned member sees.

   The /mod pages wear the owner interface's frame (the "manage" class and its m-* pieces
   in manage.css: forms, confirmations, cards, lines), so the two staff areas look alike.
   Only what is new is here.

   Mobile first: the rules outside a media query lay the page out for a phone; the
   min-width block at the end adds the desktop columns. Everything tapped is at least
   44 px tall, form fields use 16 px text (smaller makes an iPhone zoom the page), and
   nothing here moves or animates.

   Every color, font and corner radius is a custom property from site.css, so a
   community's theme can change them. A value with no variable yet gets one there first.
   Deleted and banned are never said by color alone: the word is always there too. */

/* The header link, with how many reported posts are waiting */
.mod-nav-link { display: inline-flex; align-items: center; gap: 8px; }
.mod-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: var(--radius-round); background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 700;
}

/* A tag that says deleted, banned or in force */
.mod-tag-deleted { background: var(--danger); color: var(--on-danger); }
.forum-button.mod-danger-quiet { color: var(--danger); }

/* A member's ban, and a note from the moderators, at the top of every page they open */
.standing {
  padding: 14px 16px; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius-small);
  background: var(--surface); box-shadow: var(--elev-1); display: flex; flex-direction: column; gap: 8px; overflow-wrap: anywhere;
}
.standing-ban { border-left-color: var(--danger); background: var(--danger-soft); }
.standing-warning { border-left-color: var(--unread); }
.standing-title { margin: 0; font-size: 17px; font-weight: 700; }
.standing-text { margin: 0; }
.standing-message { white-space: pre-line; }
.standing form { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.standing .forum-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* A moderator's tools for a thread: one "Moderate" button in the thread's bar, beside
   Watch and Reply, and the menu it opens (Pages/Mod/_ThreadMenu, js/menu.js). On a phone
   the button is its icon alone. Without JavaScript there is no button, and the tools sit
   in the bar as plain buttons. */
.mod-menu { position: relative; display: flex; }
.list-bar .mod-menu { margin-left: auto; }
.list-bar .mod-menu + .watch-form { margin-left: 0; }
.mod-menu-button { display: none; gap: 8px; padding: 0 12px; }
.mod-menu-button[aria-expanded="true"] { border-color: var(--ink); }
.mod-menu-icon, .mod-menu-caret { flex: none; }
.mod-menu-word { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mod-menu-panel { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mod-menu-line { display: none; }
html.js .mod-menu-button { display: inline-flex; }
html.js .mod-menu-panel:not(.is-open) { display: none; }
html.js .mod-menu-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 10; min-width: 200px; max-width: calc(100vw - 32px);
  flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; padding: 6px;
  border: 1px solid var(--card-line); border-radius: var(--radius-small);
  background: var(--surface-raised); box-shadow: var(--elev-3);
}
html.js .mod-menu-panel .forum-button {
  justify-content: flex-start; width: 100%; min-height: 44px; padding: 0 12px;
  border-color: transparent; border-radius: var(--radius-chip); background: none; box-shadow: none;
  font-size: 15px; font-weight: 500; text-align: left;
}
html.js .mod-menu-panel .forum-button:focus-visible { outline-offset: -2px; }
html.js .mod-menu-line { display: block; height: 1px; margin: 6px 0; background: var(--line); }
@media (hover: hover) {
  html.js .mod-menu-panel .forum-button:hover { border-color: transparent; background: var(--band); box-shadow: none; transform: none; }
}

/* The note on a deleted thread, under its title, with Restore and Move */
.mod-bar {
  padding: 10px 12px; border: 1px solid var(--card-line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--elev-1); display: flex; flex-direction: column; gap: 10px;
}
.mod-bar-deleted { border-left: 4px solid var(--danger); background: var(--danger-soft); }
.mod-bar-note { margin: 0; overflow-wrap: anywhere; }
.mod-bar-buttons { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mod-bar-label { margin-right: 4px; color: var(--label); font-family: var(--font-heading); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

/* A deleted post, as a moderator sees it: marked across the top, its words dimmed */
.post.post-deleted { border-color: var(--danger); }
.post-deleted .post-author { background: var(--danger-soft); }
.post-deleted .post-body { opacity: 0.62; }
.post-deleted-note {
  margin: 12px 0 0; padding: 10px 12px; border-left: 4px solid var(--danger); border-radius: var(--radius-small);
  background: var(--danger-soft); color: var(--ink); font-size: 14px; overflow-wrap: anywhere;
}
.mod-post-form { margin: 0; display: flex; }

/* Waiting for approval (Core/Spam): a post or a thread only its author and the moderators
   see. Marked by the words "Waiting for approval" and a stripe, never by color alone. */
.post.post-held { border-left: 4px solid var(--unread); }
.post-held-note {
  margin: 12px 0 0; padding: 10px 12px; border-left: 4px solid var(--unread); border-radius: var(--radius-small);
  background: var(--surface-raised); color: var(--ink); font-size: 14px; overflow-wrap: anywhere;
}
.mod-bar-held { border-left: 4px solid var(--unread); }

/* The approval queue (/mod/approval): one card per post, its words, and the three answers */
.mod-held-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.mod-held-title > span:first-child { flex: 1 1 240px; min-width: 0; }
.mod-held-who { margin: 0; padding: 12px 16px 0; font-size: 14px; overflow-wrap: anywhere; }
.mod-held-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 16px 16px; }
.mod-held-actions form { margin: 0; display: flex; }
.mod-held-reject { flex: 1 1 280px; gap: 8px; flex-wrap: wrap; }
.mod-held-reject .forum-field { flex: 1 1 160px; min-width: 0; min-height: 44px; font-size: 16px; }
.thread-row.deleted { background: var(--danger-soft); }
.thread-row.deleted .thread-title { color: var(--muted); }

/* The report form a member fills in */
.mod-report-page .compose + .compose { margin-top: 0; }
.mod-quoted .post-body { margin-top: 8px; padding-left: 12px; border-left: 3px solid var(--line); }
.mod-choices { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 4px; }
.mod-choices legend { padding: 0 0 8px; font-size: 17px; font-weight: 700; }
.mod-choice { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-small); cursor: pointer; transition: border-color var(--ease), background-color var(--ease); }
.mod-choice:hover { border-color: var(--control-line); background: var(--surface-alt); }
.mod-choice:has(input:checked) { border-color: var(--accent); background: var(--surface-alt); }
.mod-choice input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.mod-choice input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Split or move posts (/mod/threads/{id}/split): the thread's posts, a tick box each,
   then where they go. On a phone a post is its line of who and when over its first words;
   the whole row is the tick box's label, so it is one big target. */
.mod-split { gap: 22px; }
.mod-pick-list { margin: 0 0 6px; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius-small); overflow: hidden; }
.mod-pick { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line-soft); transition: background-color var(--ease); }
.mod-pick:first-child { border-top: 0; }
.mod-pick:has(input:checked) { background: var(--surface-alt); }
.mod-pick input { flex: none; width: 22px; height: 22px; margin: 11px 0 0; accent-color: var(--accent); }
.mod-pick input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mod-pick-text { flex: 1; min-width: 0; min-height: 44px; display: flex; flex-direction: column; justify-content: center; gap: 2px; cursor: pointer; }
.mod-pick.is-held .mod-pick-text { cursor: default; }
.mod-pick-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 15px; }
.mod-pick-head time { color: var(--muted); font-size: 14px; }
.mod-pick-number { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.mod-pick-excerpt { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.mod-pick.is-deleted .mod-pick-excerpt { text-decoration: line-through; }
.mod-pick-list.is-summary .mod-pick-text { cursor: default; }
.mod-pick-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.mod-split-fields { display: grid; gap: 12px; margin: 4px 0 10px; padding-left: 14px; border-left: 2px solid var(--line-soft); }
.mod-split .m-more { border: 1px solid var(--line); border-radius: var(--radius-small); }
@media (min-width: 768px) {
    .mod-split-fields { grid-template-columns: 3fr 2fr; margin-left: 22px; }
    .mod-split-fields:has(#Target) { grid-template-columns: 1fr; }
}
/* Beside a long list, "where they go" stays in view while the list scrolls. */
@media (min-width: 1024px) {
    .mod-split-side { position: sticky; top: calc(var(--sticky-top, 0px) + 16px); }
    .mod-split-side .mod-split-fields { grid-template-columns: 1fr; }
}

/* The reports queue. On a phone a reported post is a stack of lines. */
.mod-report { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 10px 16px 12px; border-top: 1px solid var(--line-soft); transition: background-color var(--ease); }
.mod-report:hover { background: var(--surface-alt); }
.mod-report:first-child { border-top: 0; }
.mod-report.open { box-shadow: inset 4px 0 0 var(--accent); }
.mod-report-main { position: relative; flex: 1 1 100%; min-width: 0; }
.mod-report-title { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-size: 16px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.mod-report-title:hover { text-decoration: underline; }
.mod-report-why { font-size: 14px; overflow-wrap: anywhere; }
.mod-report-count { flex: 1 1 100%; font-size: 14px; }
.mod-report-when { flex: 1 1 100%; display: flex; gap: 5px; font-size: 13px; }

/* One reported post, a post about to be deleted */
.mod-case-body { padding: 14px 16px; }
/* A note under a report's title (hidden by spam reports), and the links at its foot: they
   wrap onto lines of their own on a phone, with no separator left hanging. */
.mod-case-note { margin: 0; padding: 12px 16px 0; }
.mod-case-foot { display: flex; flex-wrap: wrap; column-gap: 24px; }
.mod-case-body > .muted { margin: 0; }
.m-form .mod-case-body { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-small); }
.m-card-title .tag { margin-left: 8px; }

/* A post's History (Pages/Mod/PostHistory): what it says now, then each earlier version. */
.post-history { margin: 16px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; }
.post-history > li { margin: 0; }
.post-version.is-current { box-shadow: inset 4px 0 0 var(--accent), var(--elev-2); }
.post-version-who { font-size: 14px; overflow-wrap: anywhere; }
.post-version-reason { margin: 8px 0 0; font-size: 14px; font-style: italic; overflow-wrap: anywhere; }
.post-version .post-body { margin-top: 12px; }
.m-card-foot { display: flex; flex-wrap: wrap; gap: 0 24px; }

/* The log, and a member's history */
.mod-log-link { margin-left: 6px; font-size: 14px; white-space: nowrap; }
.mod-log-reason { overflow-wrap: anywhere; }
.mod-inline-form { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.mod-banned, .mod-banned:hover { margin-left: 6px; border-color: var(--danger); background: var(--danger); color: var(--on-danger); }
.mod-ban-now { border-left: 4px solid var(--danger); }
.mod-lengths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.mod-lengths legend { grid-column: 1 / -1; }
.mod-lengths .m-choice { align-items: center; }

/* The moderator's card on a member's profile */
.mod-bar .forum-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* A moderator editing somebody else's post */
.mod-edit-note { margin-bottom: 14px; padding: 12px 14px; border-left: 4px solid var(--ink); border-radius: var(--radius-small); background: var(--surface-alt); }
.mod-edit-note .compose-label { margin-top: 10px; }

/* Tablet and up: the queue's columns side by side, more air. */
@media (min-width: 768px) {
  .mod-report { gap: 8px 20px; padding: 12px 20px; }
  .mod-report-main { flex: 1 1 340px; }
  .mod-report-count { flex: 0 0 190px; }
  .mod-report-when { flex: 0 0 150px; display: block; }
  .mod-report-when span, .mod-report-when time { display: block; }
  .mod-case-body { padding: 16px 20px; }
  .mod-bar { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 10px 16px; }
  .mod-menu-word { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; }
  .mod-lengths { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Clearing parts of a member's profile: each part shows what is there now */
.mod-clear-parts .m-choice > span { min-width: 0; gap: 6px; }
.mod-clear-photo { display: block; }
.mod-clear-text { overflow-wrap: anywhere; color: var(--ink); }
.mod-clear-parts .signature, .mod-profile-parts .signature { margin: 0; padding-top: 0; border-top: 0; }

/* A member's profile on their page in /mod */
.mod-profile-parts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.mod-profile-parts li { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }

/* A member's timeline of notes, warnings and bans (Pages/Mod/Member) */
.mod-note-form { border-bottom: 1px solid var(--line-soft); }
.mod-note-why, p.mod-note-form { margin: 0; padding: 14px 16px; }
.mod-timeline .m-line-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.mod-note-text { white-space: pre-line; overflow-wrap: anywhere; }
.mod-note-actions { display: flex; gap: 16px; }
.mod-note-actions a { display: inline-flex; align-items: center; min-height: 44px; }
.mod-hidden-words { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Who shares an address (Pages/Mod/MemberAddresses): numbered, never shown */
.mod-address-uses { color: var(--muted); }
.mod-address-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.mod-address-name .tag { margin: 0; }
.mod-address-others { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; }
.mod-address-others a { display: inline-flex; align-items: center; min-height: 44px; }

/* A member's moderation page: the Actions menu sits at the end of the name row (Pages/Mod/Member) */
.mod-member-head { flex-wrap: wrap; }
/* A card holding the member menu lets it hang over the cards below: no clipping, and above them. */
.card:has(.mod-menu-end) { overflow: visible; position: relative; z-index: 2; }
.mod-member-name { flex: 1 1 160px; min-width: 0; }
.mod-menu-end { margin-left: auto; align-self: flex-start; }
html.js .mod-menu-end .mod-menu-panel { left: auto; right: 0; }
html.js .mod-actions-button { gap: 6px; }
.mod-member-why { margin: 0; padding: 0 0 4px; }

/* A profile's row of buttons: Send a message, Block and Moderate, on one line at every width (Pages/Members/Profile) */
.profile-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.profile-actions:not(:has(*)) { display: none; } /* nothing in it (its partials leave white space, so not :empty) */
.profile-actions .mod-menu-end { margin-left: 0; align-self: auto; }
.mod-compact { justify-content: center; min-width: 44px; }
.mod-compact .mod-menu-caret { display: none; }
@media (min-width: 768px) {
  .mod-compact .mod-menu-caret { display: block; }
}
