/* ==========================================================================
   A Broken Promise – accessible version of the policy paper.
   Based on the paper's own scoped styles, restyled to match the site.
   Everything is scoped to #esm-paper so it can't affect other pages.
   ========================================================================== */

#esm-paper {
  --ink: #17202F; --muted: #4A5568; --rule: #C9D3E0; --accent: #16305C; --bg: #fff; --soft: #EAF0F6;
  --head: "Archivo", "Arial Narrow", Arial, sans-serif;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  color: var(--ink); background: var(--bg); font-size: 19px; line-height: 1.65; -webkit-text-size-adjust: 100%;
}
#esm-paper * { box-sizing: border-box; }
#esm-paper a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; overflow-wrap: anywhere; }
#esm-paper a:hover { text-decoration-thickness: 3px; color: #215C26; }
#esm-paper p { margin: 0 0 1em; }
#esm-paper [id] { scroll-margin-top: 100px; }

#esm-paper .esm-skip { position: absolute; left: -9999px; top: auto; }
#esm-paper .esm-skip:focus { position: static; display: inline-block; margin: 8px; padding: 10px 14px; background: #fff; border: 3px solid var(--ink); }

/* Hero */
#esm-paper .esm-hero { background: var(--accent); color: #fff; padding: 48px 24px 44px; position: relative; }
#esm-paper .esm-hero::after { content: ""; position: absolute; left: 0; bottom: 0; width: min(34%, 360px); height: 8px; background: #2B7530; }
#esm-paper .esm-hero-inner { max-width: 1120px; margin: 0 auto; }
#esm-paper .esm-crumb { font-family: var(--head); font-size: 16px; margin: 0 0 18px; color: #C9D6EA; }
#esm-paper .esm-crumb a { color: #fff; }
#esm-paper .esm-kicker { font-family: var(--head); font-size: 17px; font-weight: 700; margin: 0 0 10px; color: #8FD17C; }
#esm-paper h1.esm-title { font-family: var(--head); font-stretch: 66%; font-weight: 850; font-size: clamp(44px, 6.5vw, 76px); line-height: 0.96; margin: 0 0 14px; color: #fff; }
#esm-paper .esm-subtitle { font-size: clamp(20px, 2.2vw, 25px); line-height: 1.4; color: #fff; margin: 0 0 18px; max-width: 720px; }
#esm-paper .esm-meta { font-family: var(--head); font-size: 16px; color: #C9D6EA; margin: 0 0 26px; line-height: 1.6; }
#esm-paper .esm-meta strong { color: #fff; }
#esm-paper .esm-actions { display: flex; flex-wrap: wrap; gap: 12px; }
#esm-paper .esm-btn {
  font-family: var(--head); font-size: 17px; font-weight: 700; display: inline-flex; align-items: center; min-height: 48px;
  padding: 12px 18px; border: 2px solid #fff; border-radius: 4px; text-decoration: none; color: #fff; background: transparent;
}
#esm-paper .esm-btn.primary { background: #2B7530; border-color: #2B7530; color: #fff; }
#esm-paper .esm-btn:hover { background: #fff; color: var(--accent); text-decoration: none; }
#esm-paper .esm-btn.primary:hover { background: #215C26; border-color: #215C26; color: #fff; }
#esm-paper .esm-hero a:focus-visible { outline: 3px solid #8FD17C; outline-offset: 3px; box-shadow: none; }

/* Layout: contents sidebar + text */
#esm-paper .esm-layout { max-width: 1168px; margin: 0 auto; padding: 48px 24px 80px; display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 56px; }
#esm-paper .esm-toc { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 116px); overflow: auto; font-family: var(--head); font-size: 15.5px; line-height: 1.35; padding-right: 8px; }
#esm-paper .esm-toc-title { font-family: var(--head); font-weight: 800; font-stretch: 80%; font-size: 22px; margin: 0 0 12px; color: var(--accent); }
#esm-paper .esm-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule); }
#esm-paper .esm-toc li { margin: 0; }
#esm-paper .esm-toc a { display: block; padding: 6px 0 6px 14px; color: var(--ink); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; }
#esm-paper .esm-toc a:hover { color: var(--accent); border-left-color: #2B7530; text-decoration: underline; }
#esm-paper .esm-toc a[aria-current] { color: var(--accent); font-weight: 700; border-left: 4px solid #2B7530; padding-left: 12px; }
#esm-paper .esm-body { max-width: 760px; }
#esm-paper .esm-ch { margin: 0 0 56px; }

#esm-paper .esm-h1 { font-family: var(--head); font-stretch: 78%; font-size: 32px; line-height: 1.15; margin: 0 0 22px; padding-bottom: 10px; border-bottom: 3px solid var(--accent); font-weight: 800; color: var(--accent); }
#esm-paper .esm-h2 { font-family: var(--head); font-size: 22px; font-weight: 700; margin: 34px 0 12px; color: var(--accent); line-height: 1.25; }

/* Numbered paragraphs */
#esm-paper .esm-para { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 0 8px; }
#esm-paper .esm-num { font-family: var(--head); font-size: 15px; font-weight: 600; color: var(--muted); padding-top: 4px; font-variant-numeric: tabular-nums; }
#esm-paper ol.esm-sub { list-style: lower-alpha; margin: -.3em 0 1.2em 60px; padding: 0 0 0 32px; }
#esm-paper ol.esm-sub li { margin: 0 0 .7em; padding-left: 4px; }
#esm-paper ol.esm-sub li::marker { content: "(" counter(list-item, lower-alpha) ")  "; color: var(--muted); font-family: var(--head); }

/* Recommendation boxes */
#esm-paper .esm-rec { border: 2px solid var(--accent); border-top: 8px solid #2B7530; border-radius: 4px; padding: 22px 26px 10px; margin: 28px 0 28px 60px; background: #fff; }
#esm-paper .esm-rec-label { font-family: var(--head); font-size: 16px; font-weight: 700; color: #2B7530; margin-bottom: 4px; }
#esm-paper .esm-rec-title { font-family: var(--head); font-stretch: 78%; font-size: 30px; margin: 0 0 14px; font-weight: 800; color: var(--accent); line-height: 1.1; }
#esm-paper .esm-rec ol.esm-sub { margin-left: 0; }

/* Tables */
#esm-paper .esm-table-wrap { overflow-x: auto; margin: 12px 0 32px; }
#esm-paper .esm-table-wrap:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
#esm-paper table { border-collapse: collapse; width: 100%; font-family: var(--head); font-size: 15.5px; line-height: 1.45; background: #fff; margin: 0; border: 1px solid var(--accent); }
#esm-paper caption { caption-side: top; text-align: left; font-size: 16px; padding: 0 0 8px; color: var(--ink); }
#esm-paper th, #esm-paper td { border: 1px solid var(--rule); padding: 10px 12px; text-align: left; vertical-align: top; }
#esm-paper thead th { border-bottom: 3px solid var(--accent); font-weight: 700; background: var(--soft); color: var(--accent); }
#esm-paper tbody tr:nth-child(even) td { background: #F7F9FC; }

/* Figures */
#esm-paper .esm-fig { margin: 20px 0 32px; }
#esm-paper .esm-fig img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); }
#esm-paper figcaption { font-family: var(--head); font-size: 15.5px; margin-top: 8px; color: var(--ink); }

/* References and notes */
#esm-paper ul.esm-refs { list-style: none; padding: 0; margin: 0 0 24px; font-size: 17px; line-height: 1.5; }
#esm-paper ul.esm-refs li { padding-left: 2em; text-indent: -2em; margin: 0 0 .9em; }
#esm-paper .esm-top { font-family: var(--head); font-size: 17px; margin-top: 40px; }
#esm-paper .esm-note { font-family: var(--head); font-size: 15.5px; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 16px; margin-top: 40px; }

@media (max-width: 960px) {
  #esm-paper .esm-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  #esm-paper .esm-toc { position: static; max-height: none; border: 1px solid var(--rule); border-radius: 4px; padding: 16px; background: var(--soft); }
}
@media (max-width: 640px) {
  #esm-paper { font-size: 18px; }
  #esm-paper .esm-hero { padding: 32px 18px 34px; }
  #esm-paper .esm-layout { padding: 24px 18px 60px; }
  #esm-paper .esm-para { grid-template-columns: minmax(0, 1fr); }
  #esm-paper ol.esm-sub { margin-left: 0; padding-left: 34px; }
  #esm-paper .esm-rec { margin-left: 0; padding: 18px 18px 8px; }
  #esm-paper .esm-h1 { font-size: 28px; }
}
@media print {
  #esm-paper .esm-toc, #esm-paper .esm-actions, #esm-paper .esm-top, #esm-paper .esm-skip, #esm-paper .esm-crumb { display: none; }
  #esm-paper .esm-layout { display: block; padding: 0; }
  #esm-paper .esm-hero { background: none; color: #000; padding: 0 0 16px; }
  #esm-paper .esm-hero::after { display: none; }
  #esm-paper h1.esm-title, #esm-paper .esm-subtitle, #esm-paper .esm-meta, #esm-paper .esm-meta strong, #esm-paper .esm-kicker { color: #000; }
  #esm-paper a { color: var(--ink); }
}
