/* NATIONFORTH v13: scoped reader fixes. Loaded after the existing publication design. */
:root { --reader-text-size:20px; }
[hidden] { display:none !important; }
.sr-only { position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important; }
:focus-visible { outline:3px solid #34649c;outline-offset:4px; }
body.modal-open { overflow:hidden;overscroll-behavior:none; }
main, .article-body, .article-aside, .masthead-logo, .masthead-actions, .category-copy, .footer-column { min-width:0; }
.article-body p,.article-dek,.category-copy h2,.hero-copy h1,.search-result strong { overflow-wrap:anywhere; }
/* One source of truth for visibility: the native dialog's open attribute. */
dialog:not([open]) { display:none!important; }
dialog[open] { display:block; }
dialog::backdrop { background:rgba(5,22,42,.58); }
#subscribeModal,#searchModal,#readerPreferences {
  position:fixed!important;inset:0!important;margin:auto!important;
  width:min(560px,calc(100vw - 32px))!important;max-width:calc(100vw - 32px)!important;
  height:fit-content!important;max-height:calc(100dvh - 32px)!important;
  border:1px solid #d9e1ea!important;border-top:4px solid #aa172a!important;
  border-radius:14px!important;padding:0!important;background:#fff!important;
  color:#0b2445;overflow:auto!important;box-sizing:border-box;
  box-shadow:0 28px 90px rgba(0,0,0,.25);overscroll-behavior:contain;
  z-index:1000!important;align-items:unset!important;justify-content:unset!important;
}
#searchModal { width:min(760px,calc(100vw - 32px))!important; }
#subscribeModal .subscribe-panel,#searchModal .search-panel,.preferences-panel {
  position:relative!important;inset:auto!important;transform:none!important;
  margin:0!important;width:100%!important;max-width:none!important;height:auto!important;
  border:0!important;border-radius:0!important;box-shadow:none!important;
  padding:34px 30px 26px!important;box-sizing:border-box;
}
#subscribeModal .subscribe-logo { display:block;width:58px!important;height:58px!important;object-fit:contain;margin:0 auto 16px; }
#subscribeModal h2 { font-size:clamp(25px,5vw,33px);line-height:1.15;margin:10px 0 14px; }
#subscribeModal p { font-size:14px;line-height:1.6; }
.subscribe-close,.search-close,.preferences-close {
  position:absolute!important;right:10px!important;top:8px!important;width:44px!important;height:44px!important;
  min-width:44px!important;min-height:44px!important;padding:0!important;border:0!important;border-radius:8px!important;
  display:grid!important;place-items:center!important;background:#fff!important;color:#0b2445!important;
  font:30px/1 Arial,sans-serif!important;cursor:pointer;z-index:2;
}
.subscribe-close:hover,.search-close:hover,.preferences-close:hover { background:#edf2f8!important; }
#searchModal .search-panel-top { padding-right:38px; }
#subscribeModal .subscribe-modal-form { display:flex;gap:0;margin-top:20px; }
#subscribeModal .subscribe-modal-form input,#searchModal input { min-width:0;font-size:16px; }
#subscribeModal .subscribe-modal-form button { flex-shrink:0;min-height:46px; }
.prompt-choice {
  display:flex!important;align-items:flex-start;justify-content:flex-start;gap:11px;
  margin:18px 0 0!important;padding:13px 14px!important;border:1px solid #d6e0eb;
  border-radius:8px;background:#f6f8fb;text-align:left!important;
  font:600 14px/1.5 var(--nf-sans,system-ui,sans-serif)!important;color:#183554;cursor:pointer;
}
.prompt-choice input[type=checkbox] { appearance:auto!important;display:block!important;position:static!important;opacity:1!important;width:20px!important;height:20px!important;min-width:20px!important;margin:0!important;padding:0!important;accent-color:#102e54;cursor:pointer; }
.prompt-choice span { flex:1; }
.prompt-save-status { font:12px/1.5 var(--nf-sans,system-ui,sans-serif)!important;color:#36506d;min-height:0;margin:7px 0!important;text-align:left; }
.prompt-save-status:empty { display:none; }
.subscribe-choice-row { margin-top:8px; }
.subscribe-not-now { min-height:44px;font-size:13px;padding:10px 22px; }
#subscribeModal .subscribe-note { display:block;font-size:11px;line-height:1.5; }
.preferences-panel h2 { font:700 29px/1.2 Georgia,serif;margin:14px 30px 15px 0; }
.preferences-panel>p { font:14px/1.6 var(--nf-sans,system-ui,sans-serif);color:#516378; }
.preferences-panel>.primary-button { min-height:44px;border:0;cursor:pointer;margin-top:12px; }
.footer-preferences { font:inherit;font-size:12px;color:inherit;background:none;border:0;padding:0;text-align:left;cursor:pointer;min-height:36px;display:block; }
.footer-preferences:hover { text-decoration:underline; }
/* Mobile drawer: no animated second X; just one close button inside the dialog. */
#mobileDrawer {
  position:fixed!important;inset:0 0 0 auto!important;top:0!important;
  width:min(420px,calc(100vw - 12px))!important;max-width:calc(100vw - 12px)!important;
  height:100dvh!important;max-height:100dvh!important;margin:0!important;
  padding:0!important;border:0!important;border-left:1px solid #d6dee9!important;
  border-radius:0!important;background:#fff!important;overflow:auto!important;
  box-sizing:border-box;overscroll-behavior:contain;z-index:1000!important;
  box-shadow:-16px 0 65px rgba(7,30,61,.18);
}
#mobileDrawer .mobile-drawer-inner { max-width:none;margin:0;padding:18px 18px calc(24px + env(safe-area-inset-bottom))!important; }
#mobileDrawer .mobile-drawer-head { position:sticky;top:-18px;padding:14px 0;background:#fff;z-index:2; }
#mobileDrawer .mobile-brand { flex:1;min-width:0; }
#mobileDrawer .mobile-brand img { width:100%;max-width:260px; }
#mobileDrawerClose { width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;border-radius:8px!important; }
#mobileDrawer .mobile-nav-grid a,#mobileDrawer .mobile-nav-grid button { min-height:48px;font:650 14px/1.4 var(--nf-sans,system-ui,sans-serif);display:flex;align-items:center;box-sizing:border-box;overflow-wrap:anywhere; }
.mobile-menu-toggle span,.mobile-menu-toggle.open span { transform:none!important;opacity:1!important; }
#mobileMenuToggle { width:44px;min-width:44px;height:44px; }
/* Header controls cannot squeeze into each other on intermediate widths. */
.v5-header .masthead-actions { gap:10px!important; }
.v5-header .v5-icon-button,.v5-header .v5-subscribe,.v5-header .language-control { flex-shrink:0; }
.v5-primary-nav .primary-nav-inner { gap:0; }
.v5-primary-nav a { white-space:nowrap; }
.v5-primary-nav a::after { display:none!important; }
.v5-primary-nav a.active { border-bottom:2px solid var(--nf-red,#ba1930); }
/* One sticky column, two ordinary blocks: never competing sticky boxes. */
.article-aside { align-self:start;position:sticky!important;top:80px!important;display:flex;flex-direction:column;gap:24px;padding-top:24px; }
.article-aside .aside-box { position:static!important;top:auto!important;inset:auto!important;transform:none!important;margin:0!important;float:none!important;width:100%;box-sizing:border-box; }
.article-aside .aside-box+.aside-box { margin-top:0!important; }
.article-aside .aside-box h3 { line-height:1.25; }
.article-aside .aside-box p { line-height:1.6; }
.article-body>p { font-size:var(--reader-text-size)!important;line-height:1.75!important; }
.article-body .article-sources { overflow-wrap:anywhere; }
.article-tools { display:flex;flex-wrap:wrap;gap:7px; }
.article-tools button,.article-tools>a { min-height:40px; }
.reader-size-controls { display:inline-flex;gap:0;align-items:center; }
.reader-size-controls button { min-width:38px;min-height:40px;border-radius:0;font:700 13px Georgia,serif; }
.reader-size-controls button:first-child { border-radius:6px 0 0 6px; }
.reader-size-controls button:last-child { border-radius:0 6px 6px 0; }
.reader-size-controls button:disabled { opacity:.4;cursor:default; }
.reader-toast { position:fixed;left:50%;bottom:calc(20px + env(safe-area-inset-bottom));transform:translateX(-50%);background:#0b274b;color:#fff;padding:13px 18px;border-radius:9px;max-width:min(560px,calc(100vw - 32px));width:max-content;font:13px/1.5 var(--nf-sans,system-ui,sans-serif);box-shadow:0 10px 32px rgba(0,0,0,.22);z-index:1100;box-sizing:border-box; }
.search-results { min-height:72px; }
.search-results[aria-busy=true],#railStories[aria-busy=true] { opacity:.65; }
.search-count { font:12px/1.5 var(--nf-sans,system-ui,sans-serif);color:#516378; }
.search-result { overflow-wrap:anywhere; }
.form-status { font:12px/1.5 var(--nf-sans,system-ui,sans-serif); }
.footer-newsletter-form .form-status { grid-column:1/-1;flex-basis:100%; }
.photo-unavailable { object-fit:contain!important;object-position:center!important;background:#f3f6fa!important;padding:24px;box-sizing:border-box; }
.reading-progress { pointer-events:none; }
.section-switcher { overscroll-behavior-x:contain; }
@media (max-width:1200px) and (min-width:851px) {
  .v5-primary-nav a { padding-left:9px!important;padding-right:9px!important;font-size:11px!important; }
  .v5-primary-nav .more-toggle { padding-left:9px!important;padding-right:9px!important; }
}
@media (max-width:1020px) and (min-width:851px) {
  .v5-header .v5-icon-button { width:44px!important;min-width:44px!important;padding:0!important; }
  .v5-header .v5-icon-button .icon-label { display:none!important; }
  .v5-primary-nav .primary-nav-inner { overflow-x:auto;scrollbar-width:thin; }
  .v5-primary-nav .more-wrap { position:static; }
  .v5-primary-nav .more-menu { position:fixed;top:150px;right:20px;left:auto; }
}
@media (max-width:850px) {
  .v5-header .v5-masthead-row { grid-template-columns:minmax(0,1fr) auto!important; }
  .v5-header .masthead-actions { gap:7px!important; }
  .v5-header .v5-icon-button { width:40px!important;min-width:40px!important;padding:0!important; }
  .v5-header .v5-icon-button .icon-label { display:none!important; }
  .article-aside { position:static!important;top:auto!important;padding-top:12px; }
  .article-layout { grid-template-columns:minmax(0,1fr)!important; }
  .article-meta-row { align-items:flex-start;gap:14px;flex-wrap:wrap; }
  .article-tools button,.article-tools>a { min-height:44px; }
  input[type=email],input[type=search],.contact-form input,.contact-form textarea { font-size:16px!important; }
  .article-header h1 { overflow-wrap:anywhere; }
}
@media (max-width:580px) {
  #subscribeModal,#searchModal,#readerPreferences { max-height:calc(100dvh - 24px)!important;width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important; }
  #subscribeModal .subscribe-panel,#searchModal .search-panel,.preferences-panel { padding:28px 20px 22px!important; }
  .v5-header .v5-subscribe { display:none!important; }
  .v5-header .v5-masthead-row { gap:8px!important; }
  .masthead-logo img { min-width:0; }
  .article-body>p { line-height:1.7!important; }
  .contact-form .form-row { grid-template-columns:minmax(0,1fr); }
  .article-tools { gap:6px; }
  .footer-newsletter-inner { display:block!important; }
  .footer-newsletter-form { margin-top:20px;width:100%; }
}
@media (max-width:380px) {
  .v5-header .language-current { display:none!important; }
  .v5-header .v5-language-toggle { min-width:42px!important;padding:8px!important; }
  .v5-header .masthead-actions { gap:5px!important; }
  .v5-header .v5-icon-button { width:36px!important;min-width:36px!important; }
  #subscribeModal .subscribe-modal-form { flex-direction:column;gap:8px; }
  #subscribeModal .subscribe-modal-form button { width:100%; }
  #mobileDrawer .mobile-nav-grid { grid-template-columns:1fr; }
  #siteSearchForm { display:flex;flex-direction:column;gap:8px; }
  #siteSearchForm input,#siteSearchForm button { width:100%;box-sizing:border-box;min-height:44px; }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto!important; } *,*::before,*::after { animation-duration:.01ms!important;transition-duration:.01ms!important; } }
@media print { dialog,.reader-toast,.back-to-top,.reader-size-controls { display:none!important; } body.modal-open { overflow:visible!important; } .article-body>p { font-size:12pt!important; } }
/* Reduce wasted space above the article and keep language/share controls on one line. */
.article-page { padding-top:0!important; }
.article-header { padding-top:30px!important; }
.article-header h1 { font-size:clamp(38px,4.6vw,64px);line-height:1.04; }
.article-breadcrumb { margin-top:12px; }
.article-tools>a { display:inline-flex;align-items:center;gap:6px;white-space:nowrap; }
@media(max-width:580px) { .article-header { padding-top:18px!important; }.article-header h1 { font-size:38px;line-height:1.08; }.article-breadcrumb { margin-top:6px;margin-bottom:18px; } }
/* Prevent min-content widths in the news rail from stretching narrow phones. */
.right-rail>* { min-width:0;max-width:100%; }
#railStories { min-width:0; }
.rail-story { grid-template-columns:23px minmax(0,1fr); }
.rail-story>span { min-width:0; }
.rail-story strong { white-space:normal;overflow-wrap:anywhere; }
.info-hero h1,.contact-hero h1 { overflow-wrap:anywhere;font-size:clamp(32px,6vw,52px); }
@media(max-width:580px) { .right-rail { grid-template-columns:minmax(0,1fr)!important; } }
/* Legacy mobile CSS hid the entire Trust column, including Reader preferences. */
.v5-footer .footer-column:last-child { display:block; }
@media(max-width:580px) {
  .v5-footer .footer-column:last-child { grid-column:1/-1; }
  .v5-footer .footer-column a,.footer-preferences { min-height:38px;line-height:1.45; }
}
