/* Messaging pages (messaging app): the message lists of every box -- the site admins'
   Inbox/Sent and each user's Inbox/Sent -- the message cards of every conversation page
   (a user's, the admins', the admins' reported-conversation view), and the forms of
   /contact/, compose and reply. Linked by each of those templates through
   messaging/_messagingAssets.html. */

/* ---------- message lists ---------- */

/* every column but Subject hugs its content */
.messageListTable th,
.messageListTable td {
    width: 1px;
    white-space: nowrap;
    padding-left: 9px;
    padding-right: 9px;
}
.messageListTable th.messageListSubject,
.messageListTable td.messageListSubject {
    width: 100%;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* whole-cell links to the message's page, deliberately NOT styled as links;
   display:block makes the full cell area clickable */
.messageListTable a.rowLink {
    color: inherit;
    text-decoration: none;
    display: block;
}
/* the subject's line is cut with an ellipsis at the column's edge (the text sits in the
   block-level row link, so the cut has to be on the link, not only on the cell) */
.messageListTable td.messageListSubject a.rowLink {
    overflow: hidden;
    text-overflow: ellipsis;
}
/* the start of the line's message after its subject, muted (boxes.makeExcerpt) */
.messageListExcerpt {
    color: #8f897b;
    font-weight: normal;
}
/* a subject whose line follows up a message its sender already wrote in the conversation
   (UserMessageQuerySet.withFollowUpFlag): the email "reply" mark, muted, before it --
   deliberately not the conversation page's down-and-right reply arrow (.messageCardArrow),
   which in a date-sorted list would seem to point at the line above, nor a leading "...",
   which reads as a subject cut off like the column's long ones */
.messageListFollowUp {
    color: #8f897b;
    margin-right: 0.3em;
}

/* ---- a narrow screen (a phone): every list line wraps instead of running off the page ----
   The table's columns hug their content and only the subject gives way, so on a phone the
   date, names and status filled the width and pushed the subject (and the page) past the
   right edge. Below Bootstrap's md breakpoint a line becomes a wrapped row of its cells --
   tick, star, date, names, status -- with the subject on a full-width line of its own under
   them, and the headers a row of sort links. Rows paint their own stripes, since the cells'
   (Bootstrap paints a table's stripes on the cells) would leave gaps between them. */
@media (max-width: 767.98px) {
    .messageListTable,
    .messageListTable thead,
    .messageListTable tbody {
        display: block;
        width: 100%;
    }
    .messageListTable tr {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        column-gap: 2px;
        background-color: var(--bs-table-bg);
        border-bottom: 1px solid var(--bs-border-color);
    }
    .messageListTable th,
    .messageListTable td {
        display: block;
        width: auto;
        border: 0;
        padding: 3px 5px;
        background: transparent;
        box-shadow: none;
    }
    .messageListTable th.messageListSubject,
    .messageListTable td.messageListSubject {
        order: 1;
        flex: 1 1 100%;
        max-width: 100%;
        min-width: 0;
    }
    .messageListTable td.messageListStar {
        padding-right: 8px;
    }
    .messageListTable.table-striped > tbody > tr:nth-of-type(odd),
    .messageListTable > tbody > tr.messageListBand {
        background-image: linear-gradient(var(--bs-table-striped-bg), var(--bs-table-striped-bg));
    }
    .messageListTable.table-hover > tbody > tr:hover {
        background-image: linear-gradient(var(--bs-table-hover-bg), var(--bs-table-hover-bg));
    }
}

/* ---- a THREADED list (boxes.py "Threaded lists") ---- */
/* the filter bar's Threaded switch, level with the small inputs beside it, red when on */
.messageListThreadSwitch {
    display: flex;
    align-items: center;
    gap: 0.35em;
    min-height: calc(1.5em + 0.5rem + 2px);              /* a form-control-sm's height */
    margin-bottom: 0;
}
.messageListThreadSwitch .form-check-input {
    margin-top: 0;
    cursor: pointer;
    border-color: #b9b09a;
}
.messageListThreadSwitch .form-check-input:checked {
    background-color: var(--nyn-stamp, #A63A2B);
    border-color: var(--nyn-stamp, #A63A2B);
}
.messageListThreadSwitch .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(166, 58, 43, 0.25);
}
.messageListThreadSwitch .form-check-label {
    cursor: pointer;
}
/* the "Collapse all" / "Expand all" link after the switch, level with it */
.messageListCollapseAll {
    display: flex;
    align-items: center;
    min-height: calc(1.5em + 0.5rem + 2px);              /* a form-control-sm's height */
}
/* the (?) help button last on the filter bar (messaging/_boxHelp.html), level with the inputs */
.messageListHelp {
    display: flex;
    align-items: center;
    min-height: calc(1.5em + 0.5rem + 2px);
}
.messageListHelpButton {
    border: 0;
    background: none;
    padding: 0 0.15rem;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--nyn-stamp, #A63A2B);
    cursor: pointer;
}
.messageListHelpButton:hover,
.messageListHelpButton:focus-visible {
    color: #7d2a1f;
}
/* under the filter bar: a +word that is no keyword, words past the cap (search.py) */
.messageListSearchNote {
    margin: -0.5rem 0 0.75rem;
    font-size: 0.875rem;
    color: var(--bs-secondary-color, #6c757d);
}
/* the help popup's text */
.messageHelp .modal-title {
    font-size: 1.25rem;
}
.messageHelp h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.1rem 0 0.4rem;
}
.messageHelp .modal-body > :first-child {
    margin-top: 0;
}
/* an admin page's own part of the help, first and set apart from the help every box shares */
.messageHelpExtra {
    background: #f6f1e4;
    border-left: 3px solid var(--nyn-stamp, #A63A2B);
    padding: 0.6rem 0.9rem 0.1rem;
    margin-bottom: 1rem;
}
.messageHelpExtra h3 {
    margin-top: 0;
}
.messageHelpSearchTable {
    width: auto;
    max-width: 100%;
}
.messageHelpSearchTable code {
    white-space: nowrap;
}
/* each conversation's lines share a shade, alternating like the flat list's stripes (which
   a folded conversation's hidden lines would throw out of step) */
.messageListTable > tbody > tr.messageListBand > * {
    --bs-table-color-type: var(--bs-table-striped-color);
    --bs-table-bg-type: var(--bs-table-striped-bg);
}
/* the subject cell (_threadedCell.html): a reply indented one step per level under the line
   it answers -- capped by boxes at cards.MAX_REPLY_INDENT levels, and here at a quarter of
   the column, which only bites on a phone -- after its arrow; a conversation's first line
   leads with its toggle, or an empty slot as wide, so the first lines' subjects align */
.messageListThread {
    display: flex;
    align-items: baseline;
    min-width: 0;
    padding-left: min(calc(var(--thread-indent, 0) * 1.25rem), 25%);
}
.messageListThread > a.rowLink {
    flex: 1 1 auto;
    min-width: 0;
}
.messageListTwisty,
.messageListTwistySpace {
    flex: none;
    width: 2.2rem;
}
.messageListTwisty {
    border: 0;
    background: none;
    padding: 0;
    text-align: left;
    font-size: 0.8rem;
    line-height: 1;
    color: #6e6857;
    cursor: pointer;
}
.messageListTwisty:hover,
.messageListTwisty:focus-visible {
    color: #17150f;
}
/* the Subject header's collapse/expand-all: just the caret */
.messageListTwisty--all {
    width: auto;
    margin-right: 0.4em;
}
.messageListThreadCount {
    margin-left: 2px;
    font-variant-numeric: tabular-nums;
}
.messageListThreadCount--unread {
    font-weight: 700;
    color: var(--nyn-stamp, #A63A2B);
}
.messageListThreadArrow {
    flex: none;
    margin-right: 0.3em;
    color: #8f897b;
}

/* the viewer's "important" star (_starButton.html): a bare icon button, hollow and muted,
   gold while starred; on a list line (its own narrow first column) and at the start of a
   conversation card's head (inside a little form of its own, kept in the line) */
.messageListTable th.messageListStar,
.messageListTable td.messageListStar {
    width: 1%;
    padding-left: 2px;
    padding-right: 2px;
    text-align: center;
}
.messageStarForm {
    display: inline;
}
.messageStar {
    border: 0;
    background: none;
    padding: 0 2px;
    line-height: 1;
    font-size: 1rem;
    color: #a39d8c;
    cursor: pointer;
    vertical-align: baseline;
}
.messageStar:hover,
.messageStar:focus-visible {
    color: #d4a017;
}
.messageStar--on,
.messageStar--on:hover {
    color: #d4a017;
}
.messageCardHead .messageStar {
    margin-right: 4px;
}
/* User Message Admin's read-only star (cells/_partyStars.html): a party starred the line's
   message; the gold of a starred button, but an icon, not a button */
.messageStarReadOnly {
    color: #d4a017;
}

/* every box and conversation page: tabs on the left, a box's buttons (compose, the other
   mailbox) on the right -- still right-aligned when a narrow window wraps them onto their
   own line */
.messageListToolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: flex-end;
    margin-bottom: 14px;
}
/* the Inbox | Sent | Archive - Inbox | Archive - Sent [| Message] tabs (_messageTabs.html): compact folder tabs with a
   firm outline (Bootstrap's default is 40px tall, outlined in a #dee2e6 that all but
   vanishes on the paper ground). Inactive tabs are manila and sit on the baseline rule; the
   active one is the page's own paper, red-topped, and opens into the page below it.
   Bootstrap 5.3's nav variables do most of it; .nav-tabs.messageTabs outranks Bootstrap's
   own .nav-tabs rules whichever sheet loads last. */
.nav-tabs.messageTabs {
    flex: 1 1 auto;
    gap: 3px;
    --bs-nav-link-padding-y: 4px;
    --bs-nav-link-padding-x: 14px;
    --bs-nav-link-font-size: 14px;
    --bs-nav-link-color: #4a463c;
    --bs-nav-link-hover-color: #17150f;
    --bs-nav-tabs-border-color: #6e6a60;                 /* the baseline rule: --nyn-smoke */
    --bs-nav-tabs-border-radius: 4px;
    --bs-nav-tabs-link-hover-border-color: #8f897b #8f897b #6e6a60;
    --bs-nav-tabs-link-active-color: #17150f;
    --bs-nav-tabs-link-active-bg: var(--nyn-page-bg, #F1EEE6);
    --bs-nav-tabs-link-active-border-color: #6e6a60 #6e6a60 var(--nyn-page-bg, #F1EEE6);
}
.nav-tabs.messageTabs .nav-link {
    background: var(--nyn-manila, #E9E2CF);
    border-color: #b9b09a #b9b09a #6e6a60;               /* bottom edge = the baseline rule */
}
.nav-tabs.messageTabs .nav-link:hover {
    background: #ded5bd;
}
.nav-tabs.messageTabs .nav-link.active {
    background: var(--nyn-page-bg, #F1EEE6);
    border-color: var(--bs-nav-tabs-link-active-border-color);
    box-shadow: inset 0 3px 0 var(--nyn-stamp, #A63A2B);
    font-weight: 600;
}
.messageListToolbar .messageListButtons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
}
/* the user boxes' filter inputs on the paper ground */
.messageListFilter--paper .form-control,
.messageListFilter--paper .form-select {
    background: #fbf8f0;
    border-color: #b9b09a;
}

/* ---------- message cards (messaging/_messageCard.html) ---------- */

.messageCards {
    max-width: 50rem;
}
/* Every card stands off the paper page ground (--nyn-page-bg #F1EEE6) by its EDGE -- a firm
   1px border and a slight lift -- not by its fill alone: the two fills used to be manila and
   #f1ecdc, and the second sat within a shade of the page. The other party's messages are
   manila; the viewer's own are a near-white paper, lighter than the page where the manila is
   darker, so the two voices read apart AND both read as cards. */
.messageCard {
    background: var(--nyn-manila, #E9E2CF);
    border: 1px solid #c4b896;
    box-shadow: 0 1px 2px rgba(23, 21, 15, 0.10);
    color: #2d2a20;
    padding: 14px 20px 16px;
    margin-bottom: 12px;
    /* a card is the target of #msg-<pk> links: clear the sticky navbar when scrolled to */
    scroll-margin-top: 5rem;
}
/* the linked-to card is marked; box-shadow rather than a border because Bootstrap's
   .border utility is !important (the lift is restated: one box-shadow replaces the other).
   --nyn-stamp is the site red. */
.messageCard:target {
    box-shadow: inset 6px 0 0 var(--nyn-stamp), 0 1px 2px rgba(23, 21, 15, 0.10);
}
/* the viewer's own side of the conversation: near-white paper with a lighter edge */
.messageCard--mine {
    background: #fdfbf6;
    border-color: #d3c9b0;
}
/* a reply sits under the message it answers (cards.threadOrder), indented one step per
   level -- capped at cards.MAX_REPLY_INDENT levels so a long back-and-forth does not
   staircase off the page, AND at a quarter of the column's width, which only bites on a
   narrow screen (5 levels are ~17% of the 50rem desktop column but ~40% of a phone's) --
   with a return arrow in the gutter the indent leaves */
.messageCard--reply {
    position: relative;
    margin-left: min(calc(var(--reply-indent, 1) * 1.75rem), 25%);
}
.messageCardArrow {
    position: absolute;
    left: -1.45rem;
    top: 13px;
    font-size: 1.05rem;
    line-height: 1;
    color: #8f897b;
}
/* a reported message, in the admins' moderation view */
.messageCard--flagged {
    outline: 2px solid var(--nyn-stamp);
}
.messageCardHead {
    font-size: 13px;
    color: #6e6857;
    margin-bottom: 8px;
}
.messageCardHead b {
    color: #17150f;
}
.messageCardHead a {
    color: inherit;
}
/* an account's name (_accountLink.html: it opens the profile popup) -- in a card head, a
   report's quote, the report list: plain until hovered, in its surroundings' colour */
a.messageCardWho {
    color: inherit;
    text-decoration: none;
}
a.messageCardWho:hover {
    text-decoration: underline;
}
/* the two shaded insets inside a card, one layout in two colours (each kind's own rules follow):
   a REPORT's quote of the message it reports (.messageCardQuote, _messageCard.html) and, on
   the admins' read-only views, a reported message's reports (.messageReportBlock,
   _messageReports.html) -- each indented under the text above it with a firm rule at its left */
.messageCardQuote,
.messageReportBlock {
    margin: 12px 0 2px 1.75rem;
    padding: 10px 14px 12px;
    border-left: 4px solid;
    color: #2d2a20;
}
.messageCardQuoteHead,
.messageReportBlockHead {
    font-size: 13px;
    margin-bottom: 6px;
}
.messageCardQuoteHead a,
.messageReportBlockHead a {
    color: inherit;
}
/* every text a card shows -- the message, a quoted message, a report -- keeps its line breaks */
.messageCardBody,
.messageCardQuoteBody,
.messageReportBlockBody {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
/* a reported message's reports: amber, a colour no message wears (the red is the reported
   content's, .messageCardQuote), so a report never reads as part of the conversation */
.messageReportBlock {
    background: #fbefc8;
    border-left-color: #c58b0c;
}
.messageReportBlockHead {
    color: #6b4a00;
}
/* "REPORT #N" in the subject label's type: small Oswald capitals */
.messageReportBlockHead a.messageReportBlockLabel {
    font-family: 'Oswald', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
/* quoted "> " lines in a message's text (messaging/quoting.py; a card's Quote button writes
   them): set off by a muted rule, like an email quote -- deliberately not the red or amber of
   a report's quote and evidence, which mark something else */
.messageCardQuoted {
    margin: 4px 0 8px;
    padding: 2px 0 2px 12px;
    border-left: 3px solid #b9b09a;
    color: #6e6857;
}
/* a card the viewer had not read yet: the inbox's own "Unread" yellow */
.messageCardNew {
    margin-right: 4px;
    vertical-align: 1px;
}
/* the head's Quote button, at its right end; quiet until hovered, like the head's links */
.messageCardQuoteButton {
    float: right;
    margin-left: 12px;
    padding: 0;
    border: 0;
    background: none;
    color: #6e6857;
    font-size: 13px;
    cursor: pointer;
}
.messageCardQuoteButton:hover,
.messageCardQuoteButton:focus-visible {
    color: #17150f;
    text-decoration: underline;
}
/* a report's quote of the message it reports (_messageCard.html; its layout is the insets'
   above): shaded the site red, with a firm red rule at its left, so it can never be read as
   part of the report itself */
.messageCardQuote {
    background: #f6e1db;
    border-left-color: var(--nyn-stamp, #A63A2B);
}
.messageCardQuoteHead {
    color: #7b1d2a;
}
/* the moderation views' permanent delete of one message, right-aligned at the card's foot */
.messageCardDelete {
    margin-top: 10px;
    text-align: right;
}
.messageCardReport {
    margin-top: 10px;
    font-size: 13px;
}
/* right-aligned, out of the reading line: reporting is a rare step (the form, once
   opened, still reads left to right) */
.messageCardReport summary {
    color: #6e6857;
    cursor: pointer;
    text-align: right;
}
.messageCardReport textarea {
    margin: 6px 0;
    background: #fbf8f0;
    border-color: #b9b09a;
}

/* a conversation page's "Subject: ..." line (_conversationPage.html), under its tabs: the
   page's headline after the banner, so a size up from body text */
.conversationSubject {
    margin-bottom: 14px;
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.3;
    color: #17150f;
    overflow-wrap: anywhere;
}
/* the label in the banner eyebrow's type: small Oswald capitals */
.conversationSubjectLabel {
    font-family: 'Oswald', 'Helvetica Neue', sans-serif;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6e6857;
    margin-right: 4px;
}
/* the admins' details table at the foot of their conversation page */
.conversationDetails {
    max-width: 50rem;
}

/* conversation-level actions (archive, mark unread, delete, block) above a conversation */
.conversationActions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}
.conversationActions form {
    margin: 0;
}

/* ---------- the forms (contact, compose, reply) ---------- */

/* "Your unsent draft was restored. Discard it" (messages.js), above the form's Send button */
.messageDraftNote {
    margin: 0 0 10px;
    font-size: 13px;
    color: #6e6857;
}
.messageDraftDiscard {
    border: 0;
    background: none;
    padding: 0;
    color: var(--nyn-stamp, #A63A2B);
    text-decoration: underline;
    cursor: pointer;
}

/* crispy stars every required field's label; not needed on these short forms */
.entranceTiles .asteriskField {
    display: none;
}
/* (the contact form's honeypot is hidden by contact.html's own inline style, so a
   stylesheet that fails to load can never show it to a person) */
/* every conversation page (the skeleton's reply tile): the tile spans the conversation's width */
.messageReply {
    max-width: 50rem;
}
/* "Reply AGAIN to ...": the viewer already sent the newest message (viewerSentLast) */
.entranceTileHead .messageReplyAgain {
    color: #7b1d2a;                                      /* dark burgundy */
}
.messageReply .entranceTiles {
    max-width: none;
    margin-top: 18px;
}
