/*
  Accessible Bible Companion: public pages.
  No scripts, no web fonts, no cookies, no outside requests.
  Colors are the app's own tokens (AccessibleBibleCompanion/DesignSystem/ABCTheme.swift),
  with its light, dark and Increase Contrast values. Body text is at least 7:1 in every mode.
*/

:root {
  color-scheme: light dark;
  --page: #F8F3EA;
  --surface: #FFFDF8;
  --raised: #EFE6D6;
  --ink: #1E1A15;
  --ink-soft: #4A4137;
  --accent: #0E5B53;
  --accent-soft: #DCEBE6;
  --stroke: #786B59;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #16130F;
    --surface: #221E19;
    --raised: #2C2721;
    --ink: #F3EDE3;
    --ink-soft: #D2C8B9;
    --accent: #86D4C6;
    --accent-soft: #1E3A35;
    --stroke: #8E8372;
  }
}

@media (prefers-contrast: more) {
  :root {
    --page: #FFFFFF;
    --surface: #FFFFFF;
    --raised: #F1EBE0;
    --ink: #000000;
    --ink-soft: #1E1A15;
    --accent: #00423B;
    --accent-soft: #D2E6E0;
    --stroke: #3A3128;
  }
}

@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root {
    --page: #000000;
    --surface: #14110E;
    --raised: #221E19;
    --ink: #FFFFFF;
    --ink-soft: #F1EAE0;
    --accent: #A8EFE3;
    --accent-soft: #16322D;
    --stroke: #D9CFC0;
  }
}

/* Nothing on these pages moves. */
*, *::before, *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* On iPhone and iPad, follow the person's own text size setting (Dynamic Type). */
@supports (font: -apple-system-body) {
  html { font: -apple-system-body; }
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.25rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.wrap {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Skip link: hidden until it has keyboard focus. */
.skip {
  position: absolute;
  left: 1rem;
  top: -10rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 12px;
  font-weight: 700;
  z-index: 10;
}
.skip:focus { top: 1rem; }

/* Header: the app's "eyebrow" name above a large serif title, as on its Home screen. */
header.site {
  border-bottom: 2px solid var(--stroke);
  padding: 1.25rem 0 0.75rem;
}
.brand {
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
}
.brand a {
  color: var(--accent);
  text-decoration: none;
}
.brand a:hover, .brand a:focus-visible { text-decoration: underline; }

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}
nav a {
  display: inline-block;
  min-height: 2.75rem;
  padding: 0.5rem 0.1rem;
  box-sizing: border-box;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}
nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration-thickness: 0.22em;
}

main { padding-bottom: 2.5rem; }

h1, h2, h3 {
  font-family: var(--serif);
  line-height: 1.2;
  hyphens: auto;
  overflow-wrap: break-word;
}
h1 { font-size: 2.4rem; margin: 1.5rem 0 0.75rem; }
h2 { font-size: 1.75rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.4rem; margin: 1.75rem 0 0.5rem; }

p, ul, ol, dl { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: 0.5rem; }
li > ul { margin-top: 0.5rem; }

.lede {
  font-size: 1.45rem;
  line-height: 1.5;
  color: var(--ink);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 0.18em; }

a:focus-visible, .table-scroll:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

strong { font-weight: 700; }

/* Boxes: "In short" summaries, the in-app notice, and the review draft note. */
.summary, .notice, .draft {
  border: 2px solid var(--stroke);
  border-radius: 18px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--raised);
}
.summary h2, .notice h2, .notice h3 {
  margin-top: 0.25rem;
}
.summary a, .notice a, .draft a { color: var(--ink); }
.notice {
  background: var(--surface);
  border-width: 3px;
}
.notice .notice-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0.25rem 0 0.75rem;
}
.draft {
  border-style: dashed;
  font-size: 1.1rem;
}

/* Blanks the owner or counsel must fill. Shown with brackets and a dashed line, not by color alone. */
.blank {
  background: var(--accent-soft);
  border-bottom: 2px dashed var(--ink);
  padding: 0 0.15em;
}

/* Definition lists for "what" and "how long". */
dl dt {
  font-weight: 700;
  margin-top: 1rem;
}
dl dd {
  margin: 0.25rem 0 0;
}

/* Tables: only the accessibility results. Scroll sideways inside their own box at high zoom. */
.table-scroll {
  overflow-x: auto;
  border: 2px solid var(--stroke);
  border-radius: 12px;
  margin: 1rem 0 1.5rem;
  background: var(--surface);
}
/* The task-by-feature table may use more of a wide screen than the reading column. */
.table-scroll.wide {
  width: min(80rem, 100vw - 3rem);
  margin-left: calc(50% - min(40rem, 50vw - 1.5rem));
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 1.05rem;
  line-height: 1.4;
}
caption {
  text-align: left;
  font-weight: 700;
  padding: 0.75rem 0.75rem 0.5rem;
  font-family: var(--serif);
  font-size: 1.2rem;
}
th, td {
  border: 1px solid var(--stroke);
  padding: 0.5rem 0.6rem;
  text-align: left;
  vertical-align: top;
}
thead th {
  background: var(--raised);
  min-width: 6rem;
}
tbody th {
  min-width: 10rem;
  font-weight: 600;
}

footer.site {
  border-top: 2px solid var(--stroke);
  padding: 1.25rem 0 2rem;
  color: var(--ink-soft);
  font-size: 1.1rem;
}
footer.site a { color: var(--ink-soft); }

/* Action links & compact callout cards (zero scripts, >=44px touch targets). */
.action-list {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0 1.5rem;
}
.action-list li {
  margin-bottom: 0.75rem;
}
.cta-link {
  display: inline-block;
  min-height: 2.75rem;
  padding: 0.65rem 1.1rem;
  box-sizing: border-box;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
.cta-link.primary {
  background: var(--accent);
  color: var(--page);
  border-color: var(--accent);
}
.cta-link:hover {
  text-decoration-thickness: 0.18em;
}

@media (forced-colors: active) {
  .summary, .notice, .draft, .table-scroll, .cta-link, th, td { border-color: CanvasText; }
  .blank { border-bottom-color: CanvasText; }
}

@media print {
  .skip, nav, .draft { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; }
}
