/* ==========================================================================
   ACB Large Print Guidelines -- Starter CSS
   American Council of the Blind, revised 5-6-25
   Supplemented with WCAG 2.2 AA digital rules
   ========================================================================== */

/* --- Base reset & document --- */
html {
  font-size: 100%; /* 16px default; 1pt ≈ 1.333px, so 18pt = 24px = 1.5rem */
}

body {
  /* ACB: Arial, 18pt, not bold */
  font-family: Arial, sans-serif;
  font-size: 1.5rem;            /* 24px -- ACB 18pt (18 × 1.333) */
  font-weight: 400;
  color: #1a1a1a;               /* near-black -- WCAG 7:1 on white */
  background-color: #ffffff;

  /* ACB: flush left, ragged right */
  text-align: left;

  /* WCAG 1.4.12: line-height >= 1.5x font size */
  /* Note: ACB spec says 1.15; 1.5 is WCAG minimum for digital */
  line-height: 1.5;

  /* WCAG 1.4.12: letter-spacing >= 0.12em, word-spacing >= 0.16em */
  letter-spacing: 0.12em;
  word-spacing: 0.16em;

  /* ACB: 1 inch margins (approximated for screen) */
  margin: 0;
  padding: 1rem 1rem;

  /* Line length: 45-80 characters recommended */
  max-width: 70ch;

  /* Hyphenation off -- ACB: no hyphenated words */
  hyphens: none;
  -webkit-hyphens: none;

  /* Single column by default */
  columns: 1;
}

/* --- Headings --- */
/* ACB: headings 22pt bold, flush left */
h1, h2 {
  font-family: Arial, sans-serif;
  font-size: 1.833rem;          /* 29.3px -- ACB 22pt (22 × 1.333) */
  font-weight: 700;
  line-height: 1.5;             /* WCAG 1.4.12 minimum */
  text-align: left;
  text-transform: none;         /* No ALL CAPS */
  margin-top: 1.5em;
  margin-bottom: 1em;
}

/* ACB: subheadings 20pt bold, flush left */
h3, h4, h5, h6 {
  font-family: Arial, sans-serif;
  font-size: 1.667rem;          /* 26.7px -- ACB 20pt (20 × 1.333) */
  font-weight: 700;
  line-height: 1.5;             /* WCAG 1.4.12 minimum */
  text-align: left;
  text-transform: none;
  margin-top: 1.5em;
  margin-bottom: 1em;
}

/* --- Paragraphs --- */
/* ACB: block style, 1 blank line between paragraphs */
p {
  margin-top: 0;
  margin-bottom: 2em;           /* WCAG 1.4.12: paragraph spacing >= 2x font size */
}

/* --- Emphasis --- */
/* ACB says underline only; on web underline = links, so we use a distinct style.
   We apply a thicker underline offset to avoid descender collision and
   differentiate from hyperlinks. */
em, .acb-emphasis {
  font-style: normal;           /* No italics */
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: currentColor;
}

/* ACB: underline for emphasis via <u> element (used in Markdown-to-HTML conversion) */
u {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: currentColor;
  /* No other visual change -- should match .acb-emphasis */
}

/* Ensure emphasis underline looks different from links */
a {
  color: #0055cc;               /* Distinct link color -- 4.8:1 on white */
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

a:hover,
a:focus {
  text-decoration-thickness: 2px;
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* --- Lists --- */
/* ACB: large solid dark bullets, no blank lines between items, hanging indent */
ul {
  list-style-type: disc;
  padding-left: 1.5em;
  margin-top: 0;
  margin-bottom: 2em;
}

ul li {
  margin-bottom: 0;             /* ACB: no blank line between bullet items */
  padding-left: 0.5em;
  font-size: inherit;
}

ul li::marker {
  color: #1a1a1a;
  font-size: 1.2em;             /* Large solid bullet */
}

/* ACB: numbers must match body text size */
ol {
  list-style-type: decimal;
  padding-left: 1.5em;
  margin-top: 0;
  margin-bottom: 2em;
}

ol li {
  margin-bottom: 0;
  padding-left: 0.5em;
  font-size: inherit;
}

/* --- TOC Leader Dots --- */
/* ACB: leader dots connecting entries to page numbers */
.acb-toc-entry {
  display: flex;
  align-items: baseline;
}

.acb-toc-entry .acb-toc-title {
  flex: 1;
  overflow: hidden;
}

.acb-toc-entry .acb-toc-title::after {
  content: " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ";
  letter-spacing: 0.25em;
  color: #666;
}

.acb-toc-entry .acb-toc-page {
  flex-shrink: 0;
  padding-left: 0.5em;
  font-weight: 700;
}

/* --- Page Numbers (for paged media / print) --- */
/* ACB: 18pt Arial bold, lower outer corner */
.acb-page-number {
  font-family: Arial, sans-serif;
  font-size: 1.5rem;            /* ACB 18pt minimum */
  font-weight: 700;
  text-align: right;
}

/* --- Images & Captions --- */
/* ACB: caption pictures with meaningful text */
figure {
  margin: 1.5em 0;
}

figcaption {
  font-family: Arial, sans-serif;
  font-size: 1.5rem;            /* Never below 18pt (24px) */
  margin-top: 0.5em;
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Tables --- */
table {
  border-collapse: collapse;
  width: 100%;
  font-size: inherit;
}

th, td {
  text-align: left;
  padding: 0.5em 0.75em;
  border: 1px solid #666;
}

th {
  font-weight: 700;
}

caption {
  font-family: Arial, sans-serif;
  font-size: 1.5rem;            /* ACB 18pt minimum */
  font-weight: 700;
  text-align: left;
  margin-bottom: 0.5em;
}

/* --- Notes & Citations --- */
/* ACB: always at end of article */
.acb-endnotes {
  margin-top: 3em;
  border-top: 2px solid #1a1a1a;
  padding-top: 1em;
}

/* --- Widows & Orphans (paged media) --- */
p, li {
  orphans: 3;
  widows: 3;
}

/* --- Print Media Overrides --- */
@media print {
  body {
    /* ACB print: revert to 1.15 line spacing for print */
    line-height: 1.15;
    color: #000000;
    background-color: #faf8f0;  /* Off-white / cream */
    max-width: none;
    padding: 0;
  }

  /* Binding margin for bound documents + page numbers */
  @page {
    margin: 1in;
    @bottom-right {
      content: counter(page);
      font-family: Arial, sans-serif;
      font-size: 18pt;
      font-weight: 700;
    }
  }

  @page :left {
    margin-left: 1.5in;         /* Extra binding margin */
  }

  @page :right {
    margin-right: 1in;
  }

  a {
    color: #000000;
    text-decoration: underline;
  }
}
