/* Readability + small overlap fixes for NDF public pages.
   Linked once per page from <head> (after each page's inline <style>),
   so plain class selectors win on cascade order without !important.
   Goal: comfortable body ~19px, sub copy ~20-21px, eyebrows/labels
   floor ~16-17px. Headings scale proportionally because the inline
   page styles use rem-based clamp() values. */

html { font-size: 19px; }
body { font-size: 1rem; line-height: 1.65; }

/* ---- NAV + HEADER ---- */
.nav-logo, .header-logo { font-size: 1rem; }
.nav-donate, .nav-donate-btn, .btn-add { font-size: 1.1rem; padding: .65rem 1.5rem; }
.nav-links a { font-size: 1.14rem; }
.mob a, .mob-nav a { font-size: 1rem; padding: 1rem 24px; }
.nav-right { gap: .9rem; }

/* ---- EYEBROWS / SMALL LABELS (uppercase tracked) -- floor .88rem (~17px) ---- */
.page-eyebrow,
.section-eyebrow,
.evidence-head-eyebrow,
.story-eyebrow,
.grantee-type,
.grantee-loc,
.cred-tag,
.cred-spons-label,
.cred-rule-tag,
.donate-left-eyebrow,
.donate-tier-eyebrow,
.donate-legal,
.founding-label,
.a2c2-title,
.ev-title,
.ev-plain,
.ev-src,
.f-hd, .f-head,
.f-legal,
.contact-label,
.press-source,
.press-link,
.press-item a,
.resource-link,
.resource-org,
.filter-label,
.stat-label,
.detail-section h4,
.badge,
.apply-tags span,
.intro-strip a,
.hero-foot-note,
.hero-scroll,
label,
.form-group label,
.ndf-modal label,
.ndf-modal .ndf-eyebrow {
  font-size: 1.06rem;
  letter-spacing: .18em;
}
/* Vertical-rl scroll cue is a tiny accent — bump but keep compact */
.hero-scroll { letter-spacing: .2em; }

/* ---- SUB COPY / BODY ---- */
.page-sub { font-size: 1.1rem; line-height: 1.7; }
.section-body { font-size: 1.05rem; }
.hero-sub { font-size: 1.05rem; line-height: 1.65; }

/* ---- BODY COPY IN CARDS / PANELS -- floor 1rem (~19px) ---- */
.story-body, .approach-sub, .a2c2-desc, .ev-desc, .grantee-desc,
.grantees-note, .faq-ans, .faq-q-text, .cred-text, .donate-body,
.founding-body, .ladder-desc, .rung-desc, .about-body p,
.bio-text p, .founder-text p, .bio-panel-text p, .contact-sub,
.reason-desc, .press-title, .resource-desc, .sponsor-desc,
.media-desc, .intro-strip p, .apply-box-left p, .stat-text,
.f-desc {
  font-size: 1rem;
  line-height: 1.7;
}

.contact-val { font-size: 1.05rem; }
.reason-title, .grantee-name { font-size: 1.05rem; }

/* ---- FOOTER ---- */
.f-logo, .f-brand { font-size: 1rem; }
.f-links a, .f-info, .f-info a, .f-contact, .f-contact a { font-size: 1rem; }

/* ---- EMAIL SIGNUP ---- */
.email-h { font-size: 2.2rem; line-height: 1.15; }
.email-sub { font-size: 1rem; line-height: 1.7; }
.email-input { font-size: 1rem; padding: 1rem 1.2rem; }
.email-submit { font-size: 1.1rem; padding: 1rem 1.6rem; }
.email-privacy { font-size: 1.1rem; }

/* ---- BUTTONS ---- */
.btn-gold, .btn-g, .btn-outline-dark, .btn-ghost,
.hero-actions a {
  font-size: 1.14rem;
  padding: 1rem 2.4rem;
}

/* ---- MOBILE DONATE BAR ---- */
.mob-bar a, .mob-donate-bar a { font-size: 1rem; }

/* ---- TRACKER ---- */
.header-title { font-size: 1.14rem; }
.stat-count { font-size: 1.1rem; }
.stat-label { font-size: 1.06rem; }
table { font-size: 1.14rem; }
thead th { font-size: 1.08rem; padding: .9rem 1rem; }
td { padding: .9rem 1rem; }
.cat-badge { font-size: 1.06rem; padding: .3rem .7rem; }
.status-sel { font-size: 1.14rem; }
.note-input { font-size: 1.14rem; }
.td-org { font-size: 1rem; }
.td-org small { font-size: 1.08rem; }
.detail-section p, .detail-section div, .detail-contact, .detail-next { font-size: 1.14rem; }
.search-input { font-size: 1.14rem; }
select { font-size: 1.14rem; }
.filter-count { font-size: 1.1rem; }
.filter-label { font-size: 1.06rem; }
.btn-save { font-size: 1.1rem; }
.btn-email { font-size: 1.08rem; }
.btn-cancel, .btn-save-modal { font-size: 1.1rem; }
thead th.sorted::after { font-size: .98rem; }

/* ---- LOGIN ---- */
.sub { font-size: 1rem; line-height: 1.7; }
input { font-size: 1rem; }
.footer { font-size: 1.1rem; }

/* ---- LEAD-FORM MODAL ---- */
.ndf-modal h3 { font-size: 1.5rem; }
.ndf-modal p.ndf-sub { font-size: 1rem; }
.ndf-modal input, .ndf-modal select, .ndf-modal textarea { font-size: 1rem; }
.ndf-modal button { font-size: 1.1rem; padding: .95rem 1.8rem; }
.ndf-modal .ndf-msg { font-size: 1rem; }

/* ---- INLINE-STYLE FALLBACK ----
   A handful of elements use inline style="font-size:.NNrem" that would
   otherwise win the cascade. Lift any inline tiny font-size to the
   .9rem floor (~17px). */
[style*="font-size:.5"],
[style*="font-size: .5"],
[style*="font-size:.6"],
[style*="font-size: .6"],
[style*="font-size:.7"],
[style*="font-size: .7"],
[style*="font-size:.8"],
[style*="font-size: .8"] {
  font-size: 1.08rem !important;
}
/* Specific exception: footer logo brand inline ".95rem" already fine. */

/* ---- OVERLAP FIX: floating Sign Out anchor ----
   The link is injected with inline top:18px;right:170px and collides
   with the fixed nav (Donate + hamburger) at tablet/mobile widths.
   Reposition to bottom-right, lift above the mobile donate bar on
   small screens. !important is required to defeat the inline styles
   on the element itself. */
a[href="/api/auth/logout"] {
  top: auto !important;
  bottom: 18px !important;
  right: 18px !important;
  left: auto !important;
  background: rgba(18, 43, 82, .92) !important;
  color: rgba(255, 255, 255, .8) !important;
  font-size: 1.08rem !important;
  padding: .55rem 1rem !important;
  border: 1px solid rgba(255, 255, 255, .25) !important;
  z-index: 996 !important;
}
@media (max-width: 920px) {
  a[href="/api/auth/logout"] { bottom: 74px !important; }
}

/* ---- NARROW-WIDTH FIXES (mobile <=600px) ----
   At ~320-375px, the bumped 19px root + 1rem nav logo + clamp-based
   hero h1 can overflow. Pull the floors down so the logo fits on one
   line and "organizations"/long words wrap cleanly without horizontal
   scroll. */
@media (max-width: 600px) {
  .nav-logo,
  .header-logo {
    font-size: .94rem;
    letter-spacing: .06em;
    max-width: 60vw;
    line-height: 1.2;
  }
  .hero-h1 {
    font-size: clamp(2rem, 8.5vw, 2.8rem) !important;
    line-height: 1.05 !important;
  }
  .page-h1 {
    font-size: clamp(2rem, 8vw, 2.8rem) !important;
    line-height: 1.05 !important;
  }
  .email-h {
    font-size: clamp(1.6rem, 6vw, 2rem) !important;
  }
}
@media (max-width: 380px) {
  .hero-h1 { font-size: clamp(1.85rem, 8vw, 2.4rem) !important; }
  .page-h1 { font-size: clamp(1.85rem, 7.5vw, 2.4rem) !important; }
}

/* ---- OVERLAP FIX: fixed mobile donate bar covering page bottom ----
   .mob-bar / .mob-donate-bar are position:fixed at the bottom on
   mobile (<=920px). Without bottom padding on the document body,
   the last paragraph, footer rows, and donate ladder rows are
   hidden underneath the ~56px bar. Push every page up by the
   bar's height; scroll-padding keeps anchor jumps tidy. */
@media (max-width: 920px) {
  body:has(.mob-bar, .mob-donate-bar) { padding-bottom: 64px; }
  html:has(.mob-bar, .mob-donate-bar) { scroll-padding-bottom: 72px; }
}

/* ---- OVERLAP FIX: donate page giving ladder on narrow screens ----
   .rung uses a 100px + 1fr grid with a 2rem gap. At <=520px the
   1fr column gets squeezed to ~150px and descriptions wrap to 5+
   lines that get clipped by the fixed donate bar. Stack the amount
   above the description on small screens so the copy has full width. */
@media (max-width: 600px) {
  .rung {
    grid-template-columns: 1fr !important;
    gap: .25rem !important;
    padding: 1rem 1.1rem !important;
  }
  .rung-desc { font-size: 1.14rem; line-height: 1.5; }
}

/* ---- OVERLAP FIX: tracker category badges overflowing column ----
   .cat-badge has white-space:nowrap and lives inside .td-cat which
   caps at 140px. Long labels like "DEFENSE CONTRACTOR" overflow
   horizontally into the adjacent market column. Allow wrapping
   inside the cell so badges stay within their column. */
.td-cat .cat-badge,
.td-cat ~ td .cat-badge {
  white-space: normal;
  line-height: 1.25;
}
.td-cat { vertical-align: middle; }

/* ---- OVERLAP FIX: tracker contact column truncation ----
   The contact <input> uses inline max-width:180px which clips
   "VP, Military & Veteran Affairs" mid-word. Drop the inline cap
   so the input fills its cell, and let the cell text wrap. */
.td-notes .note-input { max-width: 100% !important; }
.td-notes { word-break: break-word; }

/* ---- OVERLAP FIX: long emails / URLs wrapping past container ----
   info@dockeryfoundation.org and similar long tokens overflow the
   right edge on narrow screens. Allow them to wrap on word
   boundaries inside contact panels and footer info blocks. */
.contact-val,
.contact-val a,
.f-info,
.f-info a,
.f-contact,
.f-contact a,
.resource-link,
.press-link,
.press-source {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ---- OVERLAP FIX: tracker contact column truncating long titles ----
   The contact column is the first .td-notes cell (the second is
   the freeform notes input). Both share max-width:200px which
   chops "VP, Military & Veteran Affairs" mid-word. Widen both
   columns and let the inputs use their full width. */
.td-notes:first-of-type,
.td-notes { max-width: 260px !important; min-width: 180px; }

/* ---- OVERLAP FIX: tracker header on narrow screens ----
   Header uses flex-wrap so the right-side action buttons drop
   below the title. Without spacing they butt up against the
   logo block. */
@media (max-width: 720px) {
  .header { row-gap: .75rem; }
  .header-right { flex-wrap: wrap; gap: .5rem; }
  .header-right .btn-add,
  .header-right button,
  .header-right a { font-size: 1.08rem; padding: .55rem .9rem; }
}

/* ---- SECOND-PASS FLOORS ----
   The first readability pass missed several selectors that aren't
   explicitly listed above. At a 19px root, raise them to:
   - ~14px (.78rem) for uppercase tracked chrome (eyebrows, tags,
     badges, nav chrome)
   - ~16px (.85rem) for sentence-case small copy (footer notes,
     captions, helper text, bios, ladders)
   Use !important to defeat each page's inline <style> rules that
   share the same single-class specificity. */

/* Uppercase tracked labels still rendering below ~14px */
.hero-tag,
.cred-badge,
.staff-role,
.bio-panel-role,
.advisory-read-bio,
.board-read-bio,
.board-role,
.founding-kicker,
.sponsor-type,
.inkind-item-type,
.nav-signout {
  font-size: .94rem !important;
  letter-spacing: .14em;
}
/* Keep the floating Sign Out anchor in line with the bumped value */
a[href="/api/auth/logout"] { font-size: .94rem !important; }

/* Sentence-case small copy still rendering below ~16px */
.criteria-text,
.criteria-text strong,
.advisory-role,
.board-bio,
.staff-name,
.adv-bio-panel p,
.bio-panel-text p,
.donate-note,
.founding-fine,
.founding-perks li,
.ladder-desc,
.rung-desc,
.founder-photo-caption,
.press-desc,
.email-sub,
.email-privacy {
  font-size: 1.02rem !important;
  line-height: 1.6;
}

/* Tracker scannability: header at ~14px, body cells at ~16px */
.tracker thead th,
thead th { font-size: .94rem !important; }
table { font-size: 1.02rem !important; }
.cat-badge { font-size: .94rem !important; }
.td-org small { font-size: .94rem !important; }
.detail-section p,
.detail-section div,
.detail-contact,
.detail-next,
.note-input,
.search-input,
.status-sel,
select { font-size: 1.02rem !important; }
.detail-section h4,
.filter-label,
.stat-label { font-size: .94rem !important; }
thead th.sorted::after { font-size: .94rem !important; }

/* Mobile: keep nav-signout legible if it ever shows; tighten only
   the uppercase floor on the narrowest screens so labels still fit. */
@media (max-width: 600px) {
  .hero-tag,
  .cred-badge { font-size: .89rem !important; letter-spacing: .16em; }
  .nav-signout { letter-spacing: .12em; }
}
