/* NF Accessibility — Phase 2 (Nov 17, 2026). Owned by the nf-accessibility mu-plugin.
   Sections: 1 toolbar · 2 typography guarantees · 3 text-size levels ·
   4 high contrast · 5 dark mode · 6 reader mode · 7 focus visibility.
   Nov 17 fix pass: section 3 (text size) and section 5 (dark mode) rewritten —
   see the notes inside each section. */

/* ---------- 1. Toolbar ---------- */
.nf-a11y-bar {
  background: #00305a;
  color: #ffffff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 16px;
  font-size: 15px;
  line-height: 1.4;
  position: relative;
  z-index: 999;
}
.nf-a11y-label { font-weight: 700; }
.nf-a11y-group { display: inline-flex; align-items: center; gap: 6px; }
.nf-a11y-group-label { margin-right: 2px; }
.nf-a11y-btn {
  background: #ffffff;
  color: #00305a;
  border: 2px solid #ffffff;
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  min-height: 40px;
  min-width: 44px;
  padding: 6px 12px;
  cursor: pointer;
}
.nf-a11y-btn:hover { background: #e8eef4; }
.nf-a11y-btn[aria-pressed="true"] { background: #f5b200; border-color: #f5b200; color: #001b36; }

/* ---------- 2. Typography guarantees (always on) ----------
   Live theme measured Nov 17, 2026: body 16px / line-height 30px (1.875),
   primary text #212529 on white = 15.4:1. These rules pin the floor so a
   future theme change cannot silently regress below the standard. */
body { font-size: 16px; }
.page-content-single { color: #212529; text-align: left; }
.page-content-single p,
.page-content-single li { line-height: 1.65; text-align: left; }

/* ---------- 3. Text-size levels (A- = 100% standard, A = 112.5%, A+ = 125%) ----------
   FIX (Nov 17, 2026): the first version only resized <body>, but the
   Newsup/Newscrest theme sets explicit px font sizes on headings (34/32/28/
   24/20/16), paragraphs, card text and meta lines, so almost nothing visible
   inherited the body change and the buttons appeared dead. The rules below
   restate the theme's own base sizes scaled x1.125 / x1.25, with !important,
   on the elements readers actually read. The toolbar's own text is pinned at
   15px so the controls never grow or shrink themselves. */
.nf-a11y-bar, .nf-a11y-btn { font-size: 15px !important; }

html.nf-ts112 body { font-size: 18px !important; }
html.nf-ts125 body { font-size: 20px !important; }

html.nf-ts112 .page-content-single p,
html.nf-ts112 .page-content-single li,
html.nf-ts112 .mg-blog-post p,
html.nf-ts112 .mg-content p,
html.nf-ts112 .mg-blog-meta,
html.nf-ts112 .mg-blog-date,
html.nf-ts112 td,
html.nf-ts112 th { font-size: 18px !important; }
html.nf-ts125 .page-content-single p,
html.nf-ts125 .page-content-single li,
html.nf-ts125 .mg-blog-post p,
html.nf-ts125 .mg-content p,
html.nf-ts125 .mg-blog-meta,
html.nf-ts125 .mg-blog-date,
html.nf-ts125 td,
html.nf-ts125 th { font-size: 20px !important; }

html.nf-ts112 h1, html.nf-ts112 .h1 { font-size: 38px !important; }
html.nf-ts112 h2, html.nf-ts112 .h2 { font-size: 36px !important; }
html.nf-ts112 h3, html.nf-ts112 .h3 { font-size: 32px !important; }
html.nf-ts112 h4, html.nf-ts112 .h4 { font-size: 27px !important; }
html.nf-ts112 h5, html.nf-ts112 .h5 { font-size: 23px !important; }
html.nf-ts112 h6, html.nf-ts112 .h6 { font-size: 18px !important; }
html.nf-ts125 h1, html.nf-ts125 .h1 { font-size: 43px !important; }
html.nf-ts125 h2, html.nf-ts125 .h2 { font-size: 40px !important; }
html.nf-ts125 h3, html.nf-ts125 .h3 { font-size: 35px !important; }
html.nf-ts125 h4, html.nf-ts125 .h4 { font-size: 30px !important; }
html.nf-ts125 h5, html.nf-ts125 .h5 { font-size: 25px !important; }
html.nf-ts125 h6, html.nf-ts125 .h6 { font-size: 20px !important; }

/* ---------- 4. High contrast ---------- */
html.nf-contrast body { background: #ffffff !important; color: #000000 !important; }
html.nf-contrast .page-content-single,
html.nf-contrast .mg-blog-post,
html.nf-contrast .card,
html.nf-contrast .widget,
html.nf-contrast main,
html.nf-contrast article { background: #ffffff !important; color: #000000 !important; }
html.nf-contrast h1, html.nf-contrast h2, html.nf-contrast h3,
html.nf-contrast h4, html.nf-contrast h5, html.nf-contrast h6 { color: #000000 !important; }
html.nf-contrast a { color: #0033cc !important; text-decoration: underline !important; }
html.nf-contrast .nf-a11y-bar { background: #000000; }
html.nf-contrast .nf-a11y-btn { border-color: #ffffff; }

/* ---------- 5. Dark mode ----------
   FIX (Nov 17, 2026): the first version darkened only the body text color and
   a handful of content boxes, so the header, navigation, page wrappers, post
   cards, sidebar and footer kept their light theme backgrounds — the page
   read as light with pale text. The rules below cover every structural layer
   of the Newsup/Newscrest layout. background-color is used throughout (never
   the background shorthand) so photo cards that carry a background image keep
   their photo — no image is inverted, filtered, or hidden. */
html.nf-dark,
html.nf-dark body { background-color: #121212 !important; color: #f2f2f2 !important; }

/* Page wrappers + main content column */
html.nf-dark .wrapper,
html.nf-dark main,
html.nf-dark #content,
html.nf-dark .single-class,
html.nf-dark .mg-blog-post-box { background-color: #121212 !important; color: #f2f2f2 !important; }

/* Header + navigation */
html.nf-dark header,
html.nf-dark .mg-headwidget,
html.nf-dark .mg-standhead,
html.nf-dark .mg-nav-widget-area,
html.nf-dark .mg-nav-widget-area-back,
html.nf-dark .mg-menu-full,
html.nf-dark .navbar-wp,
html.nf-dark .nf-topbar-links,
html.nf-dark .nf-banner-strip { background-color: #1d1d1d !important; color: #f2f2f2 !important; }
html.nf-dark .navbar-wp .navbar-nav > li > a,
html.nf-dark .navbar-brand,
html.nf-dark .nf-topbar-links a { color: #f2f2f2 !important; }
html.nf-dark .dropdown-menu { background-color: #1d1d1d !important; border-color: #333333 !important; }
html.nf-dark .dropdown-menu > li > a,
html.nf-dark .dropdown-item { color: #f2f2f2 !important; }
html.nf-dark .dropdown-menu > li > a:hover,
html.nf-dark .dropdown-item:hover,
html.nf-dark .dropdown-item:focus { background-color: #2a2a2a !important; }

/* Article body + post cards / listings */
html.nf-dark .page-content-single,
html.nf-dark .mg-blog-post,
html.nf-dark .mg-blog-inner,
html.nf-dark .mg-content,
html.nf-dark .mg-sec-top-post,
html.nf-dark .mg-editor-post,
html.nf-dark .mg-latest-post-item,
html.nf-dark .card,
html.nf-dark article,
html.nf-dark .modal-content { background-color: #1d1d1d !important; color: #f2f2f2 !important; border-color: #333333 !important; }

/* Sidebar + widgets */
html.nf-dark aside,
html.nf-dark .mg-sidebar,
html.nf-dark .sidebar-sticky,
html.nf-dark #secondary,
html.nf-dark .widget-area,
html.nf-dark .mg-widget,
html.nf-dark .widget { background-color: #1d1d1d !important; color: #f2f2f2 !important; border-color: #333333 !important; }

/* Footer (the theme footer carries a background photo under an overlay;
   the overlay is darkened so footer text stays on a dark ground) */
html.nf-dark footer,
html.nf-dark .footer,
html.nf-dark .mg-footer-copyright,
html.nf-dark .mg-footer-bottom-area { background-color: #121212 !important; color: #f2f2f2 !important; }
html.nf-dark footer .overlay { background-color: rgba(18, 18, 18, 0.94) !important; }

/* Headings, links, muted/meta text */
html.nf-dark h1, html.nf-dark h2, html.nf-dark h3,
html.nf-dark h4, html.nf-dark h5, html.nf-dark h6 { color: #ffffff !important; }
html.nf-dark a { color: #9ecbff !important; }
html.nf-dark .mg-blog-meta,
html.nf-dark .mg-blog-date,
html.nf-dark .auth,
html.nf-dark small,
html.nf-dark .text-muted { color: #c9c9c9 !important; }

/* Tables */
html.nf-dark table,
html.nf-dark th,
html.nf-dark td { background-color: #1d1d1d !important; color: #f2f2f2 !important; border-color: #333333 !important; }

/* Forms */
html.nf-dark input,
html.nf-dark select,
html.nf-dark textarea,
html.nf-dark .form-control { background-color: #1d1d1d !important; color: #f2f2f2 !important; border-color: #555555 !important; }

/* Pagination + rules */
html.nf-dark .page-numbers,
html.nf-dark .pagination .page-link { background-color: #1d1d1d !important; color: #f2f2f2 !important; border-color: #333333 !important; }
html.nf-dark hr { border-color: #333333 !important; }

/* The toolbar keeps its own navy identity — readable, never inverted */
html.nf-dark .nf-a11y-bar { background-color: #00305a !important; color: #ffffff !important; }

/* ---------- 6. Reader mode (single articles: one readable column) ---------- */
html.nf-reader.single .sidebar-sticky,
html.nf-reader.single .mg-sidebar,
html.nf-reader.single aside { display: none !important; }
html.nf-reader.single main#content .col-lg-9,
html.nf-reader.single main#content .col-md-8 {
  flex: 0 0 100%;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  float: none;
}

/* ---------- 7. Visible focus ---------- */
.nf-a11y-btn:focus-visible { outline: 3px solid #f5b200; outline-offset: 2px; }
:focus-visible { outline: 3px solid #00305a; outline-offset: 1px; }
html.nf-dark :focus-visible, html.nf-contrast :focus-visible { outline-color: #f5b200; }
