/* ============================================================================
   ARTICLE SIDEBAR — the configurable blocks (Admin > Website > Article Sidebar)

   article-sidebar.css already styles the rail itself and the shared item
   primitives (.pub-aside, __block, __h, __list, __item, __link, __thumb,
   __itembody, __itemtitle, __itemmeta, __more, __nlicon). THIS file adds the
   blocks that had no stylesheet at all: Categories, Archive, the newsletter
   signup card and the membership call to action — every _Sb* partial pointed at
   a "sidebar.css" that was never written, so those blocks rendered unstyled.

   Token-driven only, so the rail follows the light/dark flip and any palette
   change. Layer: page-type, loaded after public.css / components.css.
   ============================================================================ */

/* ---------- Categories + Archive -------------------------------------------
   One list primitive for both: a label on the left, a count chip on the right.
   They are the same shape, so they share a class rather than each inventing one. */
.pub-sbcats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }

.pub-sbcats__item + .pub-sbcats__item { border-top: 1px solid var(--pub-line); }

.pub-sbcats__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    text-decoration: none;
    color: var(--pub-ink);
    font-size: 0.88rem;
    transition: color .15s ease;
}
.pub-sbcats__link:hover { color: var(--pub-accent-ink); }
.pub-sbcats__link:hover .pub-sbcats__count { border-color: currentColor; }

.pub-sbcats__name { min-width: 0; overflow-wrap: anywhere; }

/* The count is secondary information, so it is outlined rather than filled -
   a filled chip here competed with the membership button lower down the rail. */
.pub-sbcats__count {
    flex: none;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    padding: 4px 8px;
    border: 1px solid var(--pub-line);
    border-radius: 50px;
    color: var(--pub-mut);
    font-variant-numeric: tabular-nums;
    transition: border-color .15s ease;
}

/* ---------- Membership call to action --------------------------------------
   The one block in the rail that asks for something, so it is the only one with
   a tinted ground. Everything else stays a plain card. */
.pub-sbcta { text-align: center; }

.pub-sbcta__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: var(--pub-soft);
    color: var(--pub-accent-ink);
}
.pub-sbcta__icon svg { width: 20px; height: 20px; }

.pub-sbcta__h { margin-bottom: 6px; }

.pub-sbcta__lead {
    margin: 0 0 14px;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--pub-mut);
}

/* Full width inside a narrow rail: a half-width button in a 300px column reads
   as an afterthought. */
.pub-sbcta__btn { width: 100%; justify-content: center; }

/* ---------- Newsletter signup card ------------------------------------------
   The shared _NewsletterSignup partial is built for a WIDE page: a 720px box, a
   centred intro and the fields laid out as a horizontal row. Dropped into a 300px
   rail that fell apart, and one inherited rule broke it badly.

   THE 200px FIELDS. components.css sets `.pub-nlform .pub-field { flex: 1 1 200px }`
   so the fields can share a row. The moment the form is switched to a COLUMN,
   flex-basis stops meaning width and starts meaning HEIGHT - so every field became
   200px tall and the card grew a dead white gap between the consent box and the
   button. Changing the direction is not enough; the basis has to be released too.

   The block is matched to the membership CTA beside it: centred intro, full-width
   controls, one full-width action. */
.pub-aside__block--nl .pub-nl { max-width: none; margin: 0; }

.pub-aside__block--nl .pub-nlform {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}
/* Release the row basis - see the note above. */
.pub-aside__block--nl .pub-nlform .pub-field,
.pub-aside__block--nl .pub-nlform__consent,
.pub-aside__block--nl .pub-nlform__btn,
.pub-aside__block--nl .pub-nlform .pub-alert { flex: 0 0 auto; width: 100%; }

/* Heading in the rail's own scale, not the wide page's 20px one. */
.pub-aside__block--nl .pub-nl__intro { text-align: center; margin-bottom: 14px; }
.pub-aside__block--nl .pub-nl__h { font-size: 1.02rem; line-height: 1.25; }
/* Same face and weight as every other heading in the rail. .pub-nl__h is not a
   .pub-aside__h, so it does not pick the rail heading rule up on its own and was
   rendering in the body face at a different size from its neighbours. */
body.dma4-interior .pub-aside__block--nl .pub-nl__h {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    font-weight: 600;
    color: var(--dark);
}
.pub-aside__block--nl .pub-nl__lead { font-size: 0.82rem; line-height: 1.55; margin: 5px 0 0; max-width: none; }

.pub-aside__block--nl .pub-field { margin: 0; }
.pub-aside__block--nl .pub-field label { font-size: 0.76rem; }
.pub-aside__block--nl .pub-field input[type="email"],
.pub-aside__block--nl .pub-field input[type="text"] { width: 100%; }

/* The consent line is a checkbox beside its wording, not a stacked field. */
.pub-aside__block--nl .pub-nlform__consent label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.76rem;
    line-height: 1.45;
}
.pub-aside__block--nl .pub-nlform__consent input { flex: none; margin-top: 2px; }

.pub-aside__block--nl .pub-nlform__btn { justify-content: center; }

/* The honeypot must take no space in a column layout either. */
.pub-aside__block--nl .pub-hp {
    position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden;
}

/* ---------- V4 interior corrections -----------------------------------------
   home-v4.css resets `margin:0;padding:0` on `.dma3d *` and that reset loads
   AFTER the single-class rules above, so lists and headings inside the rail lose
   their rhythm. body.dma4-interior is (0,2,x) and wins it back - the same device
   interior-v4.css already uses for the form primitives. */
body.dma4-interior .pub-sbcats__link { padding: 9px 0; }
body.dma4-interior .pub-sbcta__lead { margin: 0 0 14px; }
body.dma4-interior .pub-sbcta__icon { margin-bottom: 10px; }
body.dma4-interior .pub-aside__block--nl .pub-nlform { gap: 12px; }

/* The rail's own cards, in V4's rounder, softer register. */
body.dma4-interior .pub-aside__block {
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 20px;
}
body.dma4-interior .pub-aside__h {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    font-weight: 600;          /* matches the News & Knowledge card headings */
    color: var(--dark);
    margin: 0 0 12px;
}
body.dma4-interior .pub-sbcats__item + .pub-sbcats__item { border-top-color: var(--border); }
body.dma4-interior .pub-sbcats__count { border-color: var(--border); }
