/* =============================================================================
   donors.css — the campaign-money desk's own sheet (labs 561)

   Tokens only. Every colour here is a var() that assets/css/site.css defines
   and assets/css/dark.css redefines, so this one file serves both editions.
   A literal colour in this file is a bug in the dark edition that the paper
   edition cannot show you.

   Class names are all prefixed dn-. Nothing here says a party, "for" or
   "against" in a hue: a party is TEXT as the FEC prints it, support and
   opposition are words, and the one drawing (the bar beside a line of
   receipts) is a length with its figure printed beside it. The status hues
   (--free, --unsure, --taken) are the house's for "live / not live / no
   answer" and each line says the same thing in words.

   Phones first: one column under 620px, every control at least 44px tall,
   nothing scrolls sideways.
   ========================================================================== */

/* hidden means hidden: the house sheet has no rule for [hidden], and a class that sets display would show the element */
[class*="dn-"][hidden] { display: none !important; }
.dn-stack { display: grid; gap: .8rem; }

/* ------------------------------------------------------------- the pickers */
.dn-pick { display: flex; flex-wrap: wrap; gap: .9rem 1rem; align-items: flex-end; margin: 0; }
.dn-f { flex: 1 1 11rem; min-width: 0; }
.dn-f--cycle { flex: 0 1 10.5rem; }
.dn-f--wide { flex: 2 1 15rem; }
.dn-f .field { display: block; width: 100%; min-height: 2.75rem; }
.dn-f select.field { padding-right: 2rem; }
.dn-f .lbl { display: block; margin-bottom: .45rem; }
.dn-f .seg__b { min-height: 2.75rem; padding-left: 1rem; padding-right: 1rem; }
.dn-btn { min-height: 2.75rem; }
/* A PRESSED SWITCH KEEPS ITS WORDS. The dark sheet's hover rule (html[data-dark] .seg__b:hover: ink on whatever is
   there) outranks the house's rule for a pressed button (ink ground, paper words), so a pressed button under the pointer
   was ink on ink — and on a phone the pointer stays where the finger last tapped, so the button just pressed went blank.
   Tokens only, so this is right in both editions; it outranks that rule by its classes, not by its place in the file. */
.dn-f .seg .seg__b[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.dn-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.dn-f .seg__b:focus-visible,
.dn-btn:focus-visible,
.dn-link:focus-visible,
.dn-out:focus-visible,
.dn-side:focus-visible,
.dn-h:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dn-h:focus { outline: none; }

/* ------------------------------------------------------ the status lines
   One box, one sentence, never empty. The state is the first words (live /
   not live / reading / no answer); the rule down the side repeats it. */
.dn-wire {
    margin: 0;
    font-size: .86rem; line-height: 1.55;
    color: var(--ink-77);
    padding: .7rem .9rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--ink-55);
    border-radius: 9px;
    background: var(--paper);
    overflow-wrap: anywhere;
}
.dn-wire b { color: var(--ink); }
.dn-wire a, .dn-mail { display: inline-block; padding: .8rem .1rem; margin: -.8rem 0; color: var(--ink); }
.dn-wire[data-state="ok"]    { border-left-color: var(--free); }
.dn-wire[data-state="stale"] { border-left-color: var(--unsure); }
.dn-wire[data-state="none"]  { border-left-color: var(--unsure); }
.dn-wire[data-state="err"]   { border-left-color: var(--taken); }
.dn-wire:focus { outline: none; }
.dn-wire:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dn-link {
    font: inherit; font-weight: 600; color: var(--ink);
    background: none; border: 0; cursor: pointer;
    text-decoration: underline; text-underline-offset: .18em;
    display: inline-block; padding: .7rem .45rem; margin: -.7rem 0;
    min-height: 2.75rem;
}
.dn-count { margin: 0; font-size: .84rem; color: var(--ink-77); line-height: 1.5; }
.dn-note { margin: 0; font-size: .84rem; line-height: 1.55; color: var(--ink-77); overflow-wrap: anywhere; }
.dn-acts { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; }
.dn-out {
    display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .2rem;
    color: var(--ink); font-size: .88rem; font-weight: 600; text-underline-offset: .18em;
}
.dn-racehead { display: grid; gap: .5rem; }
.dn-h { margin: 0; font-size: 1.25rem; font-weight: 700; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }

/* ------------------------------------------------------------ a candidate */
.dn-cands, .dn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.dn-card {
    border: 1px solid var(--line); border-radius: 12px; background: var(--paper);
    padding: 1rem 1.05rem; display: grid; gap: .8rem; min-width: 0;
}
.dn-card__top { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: flex-start; justify-content: space-between; }
.dn-card__who { min-width: 0; flex: 1 1 14rem; }
.dn-name { margin: 0; font-size: 1.08rem; font-weight: 700; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }
.dn-sub { margin: .15rem 0 0; font-size: .84rem; line-height: 1.5; color: var(--ink-77); overflow-wrap: anywhere; }
.dn-id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; color: var(--ink-77); }
.dn-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem 1rem; margin: 0; }
.dn-fig { min-width: 0; margin: 0; }
.dn-fig dt { font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-55); }
.dn-fig dd { margin: .15rem 0 0; font-size: 1.02rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dn-cover { margin: 0; font-size: .84rem; line-height: 1.5; color: var(--ink-77); }
.dn-cover b { color: var(--ink); }

/* the lines of receipts: a name, a figure, a share, and a length that repeats the share */
.dn-split { display: grid; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.dn-split__h { margin: 0; font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-55); }
.dn-line {
    display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 7.5rem 3.6rem; gap: .2rem .8rem; align-items: center;
    font-size: .86rem; color: var(--ink-77); font-variant-numeric: tabular-nums;
}
.dn-line__n { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.dn-line__bar { height: .5rem; border-radius: 3px; background: var(--line); overflow: hidden; }
.dn-line__bar i { display: block; height: 100%; min-width: 1px; background: var(--ink); border-radius: 3px; }
.dn-line__v { text-align: right; color: var(--ink); font-weight: 600; }
.dn-line__p { text-align: right; }

/* independent expenditures: two sums in words, then who */
.dn-ie { display: grid; gap: .35rem; }
.dn-ie__sum { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--ink-77); }
.dn-ie__sum b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dn-tag {
    display: inline-block; font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--ink); border: 1px solid var(--ink-55); border-radius: 999px; padding: .12rem .5rem; white-space: nowrap;
}
.dn-tag--o { border-style: dashed; }
.dn-more { font-size: .86rem; color: var(--ink-77); }
.dn-more > summary { cursor: pointer; min-height: 2.75rem; display: flex; align-items: center; color: var(--ink); font-weight: 600; }
.dn-more > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dn-rows { list-style: none; margin: .2rem 0 0; padding: 0; display: grid; gap: .3rem; }
.dn-rows li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .2rem .7rem; align-items: baseline; font-variant-numeric: tabular-nums; }
.dn-rows li span { min-width: 0; overflow-wrap: anywhere; }
.dn-rows li b { color: var(--ink); text-align: right; }

/* ------------------------------------------------------------ the lists */
.dn-row {
    border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
    padding: .8rem 1rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem 1.2rem; min-width: 0;
}
.dn-row__k { grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .7rem; font-size: .76rem; color: var(--ink-55); font-variant-numeric: tabular-nums; }
.dn-row__t { grid-column: 1; margin: 0; font-size: .98rem; font-weight: 600; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
.dn-row__d { grid-column: 1; margin: 0; font-size: .86rem; line-height: 1.5; color: var(--ink-77); overflow-wrap: anywhere; }
.dn-row__r { grid-column: 2; grid-row: 1 / span 3; align-self: center; text-align: right; display: grid; gap: .15rem; font-size: .84rem; color: var(--ink-77); font-variant-numeric: tabular-nums; }
.dn-row__r b { font-size: 1rem; color: var(--ink); }
.dn-row__a { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .2rem .9rem; align-items: center; }
.dn-items { grid-column: 1 / -1; list-style: none; margin: .2rem 0 0; padding: 0; display: grid; gap: .3rem; }
.dn-items li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .2rem .7rem; align-items: baseline; font-size: .86rem; color: var(--ink-77); font-variant-numeric: tabular-nums; }
.dn-items li span { min-width: 0; overflow-wrap: anywhere; }
.dn-items li b { color: var(--ink); text-align: right; }
.dn-n { font-size: .76rem; font-weight: 700; color: var(--ink-55); font-variant-numeric: tabular-nums; min-width: 1.6rem; }

/* ----------------------------------------------------------- the candidate */
.dn-cand { display: grid; gap: 1rem; }
.dn-comm { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.dn-comm li { font-size: .9rem; line-height: 1.5; color: var(--ink-77); overflow-wrap: anywhere; }
.dn-comm a { color: var(--ink); font-weight: 600; display: inline-block; padding: .8rem 0; margin: -.4rem 0; }

/* ------------------------------------------------------- beside this desk */
.dn-beside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: 1.4rem; }
.dn-side {
    display: grid; gap: .2rem; padding: .9rem 1rem; min-height: 2.75rem;
    border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); text-decoration: none;
    transition: border-color .2s var(--ease);
}
.dn-side:hover { border-color: var(--ink); }
.dn-side span { font-size: .88rem; color: var(--ink-77); }

/* ------------------------------------------------------------------ method */
.dn-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem 3rem; margin-top: 1.6rem; }
.dn-cols p, .dn-cols li { font-size: .95rem; line-height: 1.65; color: var(--ink-77); }
.dn-cols p { margin: 0 0 .9rem; }
.dn-cols a { color: var(--ink); }
.dn-cols p a { display: inline-block; padding: .7rem 0; margin: -.7rem 0; min-width: 2.75rem; }
.dn-cols code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; overflow-wrap: anywhere; }
.dn-h3 { margin: 1.4rem 0 .5rem; font-size: 1.02rem; font-weight: 700; color: var(--ink); }
.dn-h3:first-child { margin-top: 0; }
.dn-ul { margin: 0 0 .9rem; padding-left: 1.1rem; }
.dn-ul li { margin: 0 0 .45rem; }

@media (max-width: 820px) {
    .dn-cols, .dn-beside { grid-template-columns: minmax(0, 1fr); }
    .dn-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dn-line { grid-template-columns: minmax(0, 1fr) 7.5rem 3.6rem; }
    .dn-line__bar { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 620px) {
    .dn-f, .dn-f--wide, .dn-f--cycle { flex: 1 1 100%; }
    .dn-pick .dn-btn, .dn-acts .btn { flex: 1 1 100%; }
    .dn-card { padding: .85rem .85rem; }
    .dn-row { grid-template-columns: minmax(0, 1fr); padding: .8rem .85rem; }
    .dn-row__r { grid-column: 1; grid-row: auto; text-align: left; display: flex; flex-wrap: wrap; gap: .1rem .7rem; align-items: baseline; }
    .dn-line { grid-template-columns: minmax(0, 1fr) auto 3.2rem; font-size: .84rem; }
    .dn-rows li, .dn-items li { grid-template-columns: auto minmax(0, 1fr); }
    .dn-rows li b, .dn-items li b { grid-column: 2; text-align: left; }
    .dn-f .seg { display: grid; grid-template-columns: 1fr; }
    .dn-f .seg__b { text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .dn-side { transition: none; } }
