/* TSR Intelligence — site styles
   Navy palette carried over from the books. Mobile-first, no framework,
   no external fonts, no tracking. One file, no build step. */

:root {
  --navy:        #1F3864;
  --navy-mid:    #2E5394;
  --navy-light:  #e8eef6;
  --gold:        #C9A227;
  --ink:         #14171c;
  --ink-soft:    #4a5260;
  --rule:        #d8dee7;
  --paper:       #ffffff;
  --paper-alt:   #f7f9fc;
  --measure:     34rem;
  --wide:        68rem;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: Calibri, Carlito, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, h3 { color: var(--navy); line-height: 1.25; font-weight: 600; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.6rem); margin: 0 0 .6rem; letter-spacing: -.01em; }
h2 { font-size: clamp(1.3rem, 3vw, 1.65rem); margin: 2.5rem 0 .75rem; }
h3 { font-size: 1.1rem; margin: 1.75rem 0 .4rem; }
p  { margin: 0 0 1.1rem; }
a  { color: var(--navy-mid); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--navy); }
img { max-width: 100%; height: auto; }

.wrap { width: min(100% - 2.5rem, var(--wide)); margin-inline: auto; }
.prose { max-width: var(--measure); }
/* when .prose sits on the page container, constrain the children, not the container */
.wrap.prose { max-width: var(--wide); }
.wrap.prose > * { max-width: var(--measure); }
.lede { font-size: 1.15rem; color: var(--ink-soft); }

/* ---------- skip link + header ---------- */
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--navy);
  color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: 0; }

.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  align-items: baseline; justify-content: space-between; padding: 1rem 0;
}
.brand {
  font-weight: 700; font-size: 1.05rem; color: var(--navy);
  text-decoration: none; letter-spacing: .02em;
}
.brand span { display: block; font-weight: 400; font-size: .8rem; color: var(--ink-soft); letter-spacing: .04em; }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; color: var(--ink-soft); font-size: .95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--navy); text-decoration: underline; }

/* ---------- hero ---------- */
.hero { background: var(--navy); color: #fff; padding: clamp(2.5rem, 7vw, 4.5rem) 0; }
.hero h1 { color: #fff; max-width: 22ch; }
.hero p { color: #d5deec; max-width: 52ch; font-size: 1.1rem; }
.hero .eyebrow {
  color: var(--gold); text-transform: uppercase; letter-spacing: .12em;
  font-size: .78rem; font-weight: 600; margin-bottom: .75rem;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block; background: var(--navy); color: #fff; text-decoration: none;
  padding: .7rem 1.3rem; border-radius: 4px; font-weight: 600; font-size: .98rem;
  border: 2px solid var(--navy);
}
.btn:hover { background: var(--navy-mid); border-color: var(--navy-mid); color: #fff; }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn.ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn.light { background: var(--paper); color: var(--navy); border-color: var(--rule); }
.btn.light:hover { background: var(--navy-light); color: var(--navy); }

/* ---------- sections + cards ---------- */
main { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.section-alt { background: var(--paper-alt); border-block: 1px solid var(--rule); }
.grid { display: grid; gap: 1.75rem; grid-template-columns: 1fr; }
@media (min-width: 46rem) { .grid.two { grid-template-columns: 1fr 1fr; } }

.card {
  border: 1px solid var(--rule); border-radius: 6px; padding: 1.5rem;
  background: var(--paper);
}
.card h3 { margin-top: 0; }
/* semantic h2 that should read at h3 size (cards, download blocks) */
.card-title { font-size: 1.1rem; margin: 0 0 .4rem; }
.download .card-title { margin-bottom: .2rem; }
.card p:last-child { margin-bottom: 0; }

.book-card { display: grid; gap: 1.25rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 34rem) { .book-card { grid-template-columns: 130px 1fr; } }
.book-card img { border: 1px solid var(--rule); border-radius: 3px; }
.cover-fallback {
  aspect-ratio: 1 / 1.6; background: var(--navy); color: #fff; border-radius: 3px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 1rem; font-size: .85rem; line-height: 1.35;
}

.meta { font-size: .9rem; color: var(--ink-soft); }
.tag {
  display: inline-block; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--navy-mid); background: var(--navy-light); padding: .18rem .55rem;
  border-radius: 3px; font-weight: 600;
}

/* ---------- resources: download + index ---------- */
.download {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  justify-content: space-between; border: 1px solid var(--rule);
  border-left: 4px solid var(--navy); border-radius: 5px;
  padding: 1.25rem 1.4rem; background: var(--paper-alt); margin-bottom: 1.25rem;
}
.download h3 { margin: 0 0 .2rem; }
.download .meta { margin: 0; }

.search-field { margin: 1.5rem 0 .5rem; }
.search-field label { display: block; font-weight: 600; margin-bottom: .35rem; color: var(--navy); }
.search-field input {
  width: 100%; max-width: 26rem; font: inherit; padding: .65rem .8rem;
  border: 2px solid var(--rule); border-radius: 4px; background: var(--paper);
}
.search-field input:focus { outline: 3px solid var(--navy-light); border-color: var(--navy-mid); }

#index-count { font-size: .9rem; color: var(--ink-soft); margin: .5rem 0 1rem; }

.index-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.index-list li {
  display: flex; flex-wrap: wrap; gap: .3rem 1rem; justify-content: space-between;
  padding: .6rem .2rem; border-bottom: 1px solid var(--rule);
}
.index-list .term { font-weight: 600; }
.index-list .refs { color: var(--ink-soft); font-size: .92rem; }
.index-list .refs em { font-style: normal; color: var(--navy-mid); }

.notice {
  border: 1px solid var(--rule); border-left: 4px solid var(--gold);
  background: #fdfaf0; padding: 1rem 1.2rem; border-radius: 5px; margin: 1.5rem 0;
}
.notice p:last-child { margin-bottom: 0; }

/* ---------- email gate form ---------- */
.gate {
  border: 1px solid var(--rule); border-left: 4px solid var(--navy);
  border-radius: 5px; padding: 1.5rem 1.6rem; background: var(--paper-alt);
  max-width: 34rem; margin: 1.25rem 0 1.5rem;
}
.gate h3 { margin: 0 0 .2rem; }
.gate > .meta { margin: 0 0 1.1rem; }
.gate .field { margin-bottom: 1rem; }
.gate label { display: block; font-weight: 600; color: var(--navy); margin-bottom: .3rem; }
.gate .opt { font-weight: 400; color: var(--ink-soft); }
.gate input[type="text"], .gate input[type="email"] {
  width: 100%; font: inherit; padding: .65rem .8rem;
  border: 2px solid var(--rule); border-radius: 4px; background: var(--paper);
}
.gate input:focus { outline: 3px solid var(--navy-light); border-color: var(--navy-mid); }
.gate .hint { font-size: .88rem; color: var(--ink-soft); margin: .4rem 0 0; }
.gate .check label {
  display: flex; gap: .6rem; align-items: flex-start;
  font-weight: 400; color: var(--ink); cursor: pointer;
}
.gate .check input { margin-top: .3rem; flex: none; width: 1.05rem; height: 1.05rem; }
.gate button { cursor: pointer; font-family: inherit; }
.gate .hp { position: absolute; left: -9999px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule); background: var(--paper-alt);
  padding: 2.5rem 0; margin-top: 3rem; font-size: .92rem; color: var(--ink-soft);
}
.site-footer a { color: var(--ink-soft); }
.site-footer .cols { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .site-footer .cols { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer ul { list-style: none; margin: .4rem 0 0; padding: 0; }
.site-footer li { margin-bottom: .3rem; }
.legal { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); font-size: .85rem; }

/* ---------- accessibility / motion ---------- */
:focus-visible { outline: 3px solid var(--navy-mid); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .site-header, .site-footer, .btn { display: none; } body { color: #000; } }
