/* Ward Edition issue typography (public show page only).
 *
 * Formerly the <style> block of the now-retired standalone
 * layouts/ward_edition.html.erb (Ahmed, 2026-08-16 ruling: index + show join
 * the normal site layout so the header/footer render like every other page).
 * Every rule here is scoped under .ward-edition-issue -- the root wrapper on
 * ward_editions/show.html.erb -- because this file loads globally (like
 * blog.css / playbook.css) and the original class names (.box, .card,
 * .footer, .lead...) are generic enough to clobber unrelated pages if left
 * unscoped. Screen rules below are the prototype's exact values, reproduced
 * byte-for-byte; only the selectors changed.
 */
.ward-edition-issue {
  --ink: #1c1c1c;
  --sub: #555;
  --line: #d9d5cc;
  --clem: #d9480f;
  font-family: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  line-height: 1.42;
  max-width: 190mm;
  margin: 0 auto;
  padding: 18px 16px 40px;
  background: #fff;
}
.ward-edition-issue a { color: var(--clem); text-decoration: none; font-weight: 600; }
.ward-edition-issue a:hover { text-decoration: underline; }
.ward-edition-issue .masthead { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1.5px solid var(--ink); padding-bottom: 9px; }
.ward-edition-issue .cards { margin-bottom: 14px; }
.ward-edition-issue .masthead .kicker { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--sub); margin: 0 0 1px; }
.ward-edition-issue .masthead h1 { font-size: 23px; font-weight: 600; margin: 0; line-height: 1.1; }
.ward-edition-issue .masthead .wardmeta { font-size: 12.5px; color: var(--sub); margin-top: 1px; }
.ward-edition-issue .masthead .right { text-align: right; font-size: 12px; color: var(--sub); flex-shrink: 0; padding-left: 14px; }
.ward-edition-issue .masthead .right .domain { display: block; font-size: 14px; }
.ward-edition-issue .coverage { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--sub); padding: 6px 0 0; }
.ward-edition-issue .coverage b { color: var(--ink); }
/* Founder round-4, item 5: no more rounded box borders per section -- a
   section is now just its label sitting tight above its own content, with
   a wider gap and a hairline rule marking where the NEXT section starts
   (border-top lives on .seclabel, not .box, so the rule only ever appears
   between two sections, never above the very first one). */
.ward-edition-issue .seclabel {
  font-size: 10.5px; letter-spacing: .11em; color: #e57a45; text-transform: uppercase;
  font-weight: 600; margin: 0; padding: 22px 0 4px; border-top: 1px solid var(--line);
}
/* Section 1's .seclabel is the one right after the masthead's .coverage row
   -- always true regardless of whether a flash box rendered above the
   masthead, unlike :first-of-type (which matches by tag name, not class,
   so the masthead's own <div>s would have beaten it). No hairline there:
   the masthead's own border-bottom already separates it from Section 1. */
.ward-edition-issue .coverage + .seclabel { border-top: none; padding-top: 22px; }
.ward-edition-issue h2 { font-size: 17px; margin: 0 0 5px; }
.ward-edition-issue p { margin: 4px 0; font-size: 13.5px; }
.ward-edition-issue .lead { font-size: 14.5px; }
.ward-edition-issue .grouplbl { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--sub); margin: 8px 0 4px; }
.ward-edition-issue .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 9px; margin: 4px 0 2px; }
.ward-edition-issue .card { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; text-align: center; }
.ward-edition-issue .card b { display: block; font-size: 26px; line-height: 1.1; }
.ward-edition-issue .card span { font-size: 11.5px; color: var(--sub); }
.ward-edition-issue .bar-row { display: flex; align-items: center; gap: 9px; margin: 5px 0; font-size: 12.5px; }
.ward-edition-issue .bar-row .lbl { width: 158px; flex-shrink: 0; text-align: right; color: #444; }
.ward-edition-issue .bar-row .bar { height: 14px; border-radius: 3px; background: #3f3f3f; min-width: 3px; }
.ward-edition-issue .bar-row .n { color: var(--sub); font-size: 12px; }
.ward-edition-issue .box { background: transparent; border: none; border-radius: 0; padding: 2px 0 22px; margin: 0; }
.ward-edition-issue .verify { background: #f2efe8; font-size: 10.5px; padding: 1px 5px; border-radius: 4px; color: #6c6250; }
.ward-edition-issue .cta { margin: 7px 0 0; font-size: 13.5px; }
.ward-edition-issue .footer { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 8px; font-size: 13px; color: var(--sub); line-height: 1.4; }
.ward-edition-issue .footer .curated { color: var(--ink); }
.ward-edition-issue .footer p { font-size: 13px; }

/* "One fix, on the record" dated chain (Founder round-4, item 6b). */
.ward-edition-issue .chain { color: var(--sub); }

/* Share + Print row (Founder round-4, item 3) -- data-print-hide (wrapped.css)
   keeps both buttons out of the printed page. */
.ward-edition-issue .share-row { display: flex; gap: 8px; margin: 18px 0 4px; }
.ward-edition-issue .share-btn {
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
  font-size: 12.5px; font-weight: 600; color: var(--ink); cursor: pointer;
}
.ward-edition-issue .share-btn:hover { border-color: var(--clem); color: var(--clem); }

/* Cross-link to this ward's Street Wrapped share card (Founder round-4,
   item 7a) -- small thumbnail + caption, screen only. */
.ward-edition-issue .ward-card-teaser { margin: 10px 0; }
.ward-edition-issue .ward-card-teaser a {
  display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 12.5px;
}
.ward-edition-issue .ward-card-teaser-img {
  width: 54px; height: auto; border-radius: 6px; border: 1px solid var(--line); flex-shrink: 0;
}

/* Print QR (Founder round-4, item 4) -- the QR's own <svg> plus a small
   centered label layered on top (see WardEditionQrCode#markup). Only ever
   rendered inside .print-only, so no @media print guard needed here. */
.ward-edition-issue .qr { position: relative; width: 100px; height: 100px; display: inline-block; margin-top: 6px; }
.ward-edition-issue .qr svg { width: 100%; height: 100%; display: block; }
.ward-edition-issue .qr-label {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #fff; padding: 2px 5px; font-size: 8px; font-weight: 700; color: var(--ink); border-radius: 3px;
}

/* The sign-in gate (additive, not part of the prototype): the invite box for
   a signed-out visitor, and the inline add-email / consent cards for a
   signed-in reader (Ahmed, 2026-08-16 ruling). */
.ward-edition-issue .gate { border: 1px solid var(--line); border-radius: 9px; padding: 14px 16px; margin: 10px 0; background: #f2efe8; }
.ward-edition-issue .gate p { margin: 4px 0; }
.ward-edition-issue .gate-open { background: var(--clem); color: #fff; border: none; border-radius: 6px; padding: 8px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; margin-top: 6px; }
.ward-edition-issue .gate-modal { background: #fff; border-radius: 10px; padding: 22px; max-width: 380px; width: 100%; }
.ward-edition-issue .gate-modal h3 { margin: 0 0 6px; font-size: 16px; }
.ward-edition-issue .gate-modal p { font-size: 12.5px; color: var(--sub); margin: 0 0 12px; }
.ward-edition-issue .gate-modal label { display: block; font-size: 12px; font-weight: 600; margin: 10px 0 3px; }
.ward-edition-issue .gate-modal input[type="text"],
.ward-edition-issue .gate-modal input[type="email"] {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13.5px;
}
.ward-edition-issue .gate-modal .consent { font-size: 11px; color: var(--sub); margin-top: 10px; }
.ward-edition-issue .gate-modal .actions { display: flex; gap: 8px; margin-top: 14px; }
.ward-edition-issue .gate-modal .submit { background: var(--clem); color: #fff; border: none; border-radius: 6px; padding: 8px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.ward-edition-issue .gate-error { color: #b91c1c; font-size: 12px; margin-top: 6px; }

/* Print-only content (the "Get next week's issue" box): invisible on screen,
   shown only inside @media print below. */
.ward-edition-issue .print-only { display: none; }

@media print {
  @page { size: A4; margin: 11mm 11mm 13mm; }
  /* Founder round-4, item 5: base print body font bumped +1px (12 -> 13ish)
     for legibility on paper; every print size below scales with it. The
     A4 two-page target and the existing Section 5 page-break stay as they
     were -- this is a font-size change, not a layout change. */
  .ward-edition-issue { font-size: 13px; max-width: 100%; margin: 0; padding: 0; }
  .ward-edition-issue p { font-size: 12.5px; }
  .ward-edition-issue .lead { font-size: 13.5px; }
  .ward-edition-issue .card b { font-size: 23px; }
  .ward-edition-issue h2 { font-size: 15.5px; }
  .ward-edition-issue .seclabel { padding: 10px 0 4px; }
  .ward-edition-issue .coverage + .seclabel { padding-top: 10px; }
  .ward-edition-issue .box { padding: 2px 0 10px; page-break-inside: avoid; break-inside: avoid; }
  .ward-edition-issue .footer { font-size: 11.5px; }
  .ward-edition-issue a { color: var(--clem) !important; }
  .ward-edition-issue .gate, .ward-edition-issue .gate-modal { display: none !important; }
  .ward-edition-issue .print-only { display: block; }

  /* Section 5 ("Know your ward") opens a fresh sheet: page 1 = sections 1-4,
     page 2 = sections 5-7 + the "Get next week's issue" box. */
  .ward-edition-issue .section5-start { page-break-before: always; break-before: page; }

  /* Hide the site's own chrome so a printed issue is just the issue -- the
     edition keeps its own masthead/footer regardless (Founder round-2
     feedback). Scoped to body:has(.ward-edition-issue) so this print rule
     never touches any other page's printout; everything here is a direct
     child of <body> or of the mobile-menu wrapper (see
     layouts/application.html.erb), never nested inside .ward-edition-issue
     itself. */
  body:has(.ward-edition-issue) > div[data-controller="mobile-menu"] > *:not(main),
  body:has(.ward-edition-issue) > nav,
  body:has(.ward-edition-issue) > footer,
  body:has(.ward-edition-issue) [data-controller="pwa-install-banner"],
  body:has(.ward-edition-issue) #rui-flash-container {
    display: none !important;
  }

  /* The app shell is a fixed-viewport flex column (body min-h-screen, main
     flex-1 overflow-hidden) built for on-screen scrolling, not multi-page
     print. Left alone, overflow-hidden would clip everything past page 1. */
  body:has(.ward-edition-issue) { display: block !important; min-height: 0 !important; }
  body:has(.ward-edition-issue) > div[data-controller="mobile-menu"] { display: block !important; }
  body:has(.ward-edition-issue) main { display: block !important; overflow: visible !important; height: auto !important; }
}
