
/* ===== theme vars (dark default) ===== */
:root{
  --bg: #0e0e0e;
  --panel: #141414;
  --ink: #e6e6e6;
  --muted: #a8a8a8;
  --rule: #2a2a2a;

  --link-hover-bg: #e6e6e6;
  --link-hover-ink: #0e0e0e;
}

/* light mode */
:root.light{
  --bg: #e7d6b6;
  --panel: #f2e7d2;
  --ink: #111;
  --muted: #333;
  --rule: #111;

  --link-hover-bg: #111;
  --link-hover-ink: #e7d6b6;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  padding: 48px 18px;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.45;
}

/* ===== left-column layout ===== */
.center{
  max-width: 680px;         /* a bit wider: this page is dense */
  margin-left: 16%;
  margin-right: auto;
  text-align: left;
}

/* mobile: center the column */
@media (max-width: 780px){
  .center{
    margin-left: auto;
    margin-right: auto;
  }
}

/* ===== headings ===== */
h2{
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
}

h3{
  margin: 22px 0 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}

h4{
  margin: 10px 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

/* ===== rules as section dividers ===== */
hr{
  border: 0;
  border-top: 1px solid var(--rule);
  width: 100%;
  margin: 14px 0;
}

/* ===== paragraphs (intro + dropped items) ===== */
p{
  margin: 10px 0 16px;
  max-width: 62ch; /* keeps big paragraphs readable */
  color: var(--ink);
}

p i{ color: var(--muted); }

/* ===== links ===== */
a{
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover,
a:focus-visible{
  background: var(--link-hover-bg);
  color: var(--link-hover-ink);
  text-decoration: none;
  outline: none;
}

/* Back link at bottom */
a[href="index.html"]{
  display: inline-block;
  margin-top: 10px;
  padding: 2px 8px;
  border: 1px solid var(--rule);
  text-decoration: none;
}

a[href="index.html"]:hover,
a[href="index.html"]:focus-visible{
  background: var(--ink);
  color: var(--bg);
}

/* ===== TABLES AS LISTS =====
   Your HTML is many small tables. We make them feel like grouped blocks. */
table{
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 12px;
  background: transparent;
}

/* slight “card” feel for each author block table */
table:has(b i),
table:has(b){
  background: color-mix(in srgb, var(--panel) 60%, transparent);
  border: 1px solid var(--rule);
  padding: 10px 12px;       /* padding works in modern browsers */
  border-radius: 0;         /* keep it austere */
}

/* if :has() isn't supported, it just won’t card-ify — still fine */

td{
  padding: 2px 0;
  white-space: normal; /* wrap long titles */
  vertical-align: top;
}

/* author header rows */
td b i,
td b{
  color: var(--ink);
}

/* soften the "indent bullets" lines */
td:has(> span),
td{
  color: var(--ink);
}

/* preserve your manual indents like &emsp; and ▸ */
td{
  tab-size: 2;
}

/* Make the '▸' subentries look slightly muted */
td:has(> :is(*)):not(:has(b)){
  /* leave most rows normal */
}
td:has(:contains("▸")){ /* not supported; harmless */
}

/* highlight “New!” old-school <font color="red"> without rewriting HTML */
font[color="RED"], font[color="red"]{
  color: #ff4d4d;
  font-weight: 700;
}

/* quotes */
q{
  quotes: "“" "”" "‘" "’";
  color: var(--muted);
}

/* spacing around <br> */
br{ line-height: 1.2; }

/* ===== TOGGLES (MATCHING INDEX + COMMONPLACE) ===== */

#toggles{
  display: inline-flex;
  gap: 10px;
  margin-bottom: 16px;
}

#toggles button{
  all: unset;                 /* critical: wipes browser + legacy styles */
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 4px 10px;
  cursor: pointer;
  line-height: 1.2;
}

#toggles button:hover,
#toggles button:focus-visible{
  background: var(--ink);
  color: var(--bg);
  outline: none;
}

