/* ============================================================
   REPORT — LIGHT TEMPLATE
   Faithful port of rstudio/tufte (tufte-css + et-book), self-hosted.
   House additions are marked [HOUSE]: (1) a slight section rule,
   (2) a single amber signal colour for the one number that matters.
   Everything else follows tufte to the letter.
   ============================================================ */

/* ---- et-book (self-hosted, from edwardtufte/tufte-css) ---- */
@font-face { font-family:"et-book";
  src:url("fonts/et-book/et-book-roman-line-figures.woff") format("woff");
  font-weight:normal; font-style:normal; font-display:swap; }
@font-face { font-family:"et-book";
  src:url("fonts/et-book/et-book-display-italic-old-style-figures.woff") format("woff");
  font-weight:normal; font-style:italic; font-display:swap; }
@font-face { font-family:"et-book";
  src:url("fonts/et-book/et-book-bold-line-figures.woff") format("woff");
  font-weight:bold; font-style:normal; font-display:swap; }
@font-face { font-family:"et-book-roman-old-style";
  src:url("fonts/et-book/et-book-roman-old-style-figures.woff") format("woff");
  font-weight:normal; font-style:normal; font-display:swap; }

/* ---- core ---- */
html { font-size:15px; }
body { width:87.5%; margin-left:auto; margin-right:auto; padding-left:12.5%;
  font-family:et-book, Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
  background-color:#fffff8; color:#111; max-width:1400px;
  counter-reset:sidenote-counter; -webkit-font-smoothing:antialiased; }

.numeral, .sidenote-number { font-family:et-book-roman-old-style; }

/* ---- headings ---- */
h1.title { font-weight:400; font-style:normal; margin-top:4rem; margin-bottom:1.5rem;
  font-size:3.2rem; line-height:1; }
h1 { font-weight:400; margin-top:2.1rem; margin-bottom:0; font-size:2.2rem; line-height:1; }
h2 { font-weight:400; font-size:1.7rem; margin-top:2rem; margin-bottom:0; line-height:1; }
h3.subtitle { font-weight:400; font-style:italic; margin-top:1rem; margin-bottom:1rem;
  font-size:1.8rem; display:block; line-height:1; }
h4.author, h4.date { font-size:1.4rem; font-weight:400; margin:1rem 0; line-height:1; color:#333; }

/* ---- text blocks ---- */
article { position:relative; padding:3rem 0; }
section { padding-top:1.2rem; padding-bottom:1.2rem; }
p, ol, ul { font-size:1.4rem; }
p { line-height:2rem; margin-top:1.4rem; margin-bottom:1.4rem; padding-right:0; vertical-align:baseline; }
ol, ul { width:45%; -webkit-padding-start:5%; }
li { padding:0.5rem 0; }
blockquote { font-size:1.4rem; }
blockquote p, blockquote footer { width:50%; }
blockquote footer { font-size:1.1rem; text-align:right; }

/* [HOUSE] a slight rule between sections — warm, faint, sits on #fffff8 */
section + section { border-top:1px solid #e4dfce; }

/* ---- tables (tufte: horizontal rules only) ---- */
p, footer, table, hr { width:55%; }
table { border-top:2px solid #111; border-bottom:2px solid #111; font-size:1.1rem;
  border-collapse:collapse; margin:1.4rem 0; font-variant-numeric:tabular-nums; }
th { border-bottom:1px solid #111; font-weight:400; text-align:right; padding:.35rem .9rem;
  font-style:italic; white-space:nowrap; }
th:first-child { text-align:left; font-style:normal; }
td { text-align:right; padding:.3rem .9rem; white-space:nowrap; vertical-align:baseline; }
td:first-child { text-align:left; }
tbody tr:last-child td { }
caption, p.caption { text-align:left; font-size:1.1rem; margin-bottom:.4rem; }
/* wide financial tables break the 55% measure */
table.fullwidth { width:90%; max-width:90%; }
div.fullwidth, table.fullwidth { max-width:90%; }
.fullwidth { max-width:90%; clear:both; }
table table, li p { width:auto; }

/* subject row + median footer helpers */
tr.subject td { font-weight:bold; }
tfoot td { border-top:1px solid #111; color:#555; font-style:italic; }

/* ---- links: underline that clears descenders (tufte) ---- */
a:link, a:visited { color:inherit; }
a:link { text-decoration:none;
  background:linear-gradient(#fffff8,#fffff8), linear-gradient(#fffff8,#fffff8), linear-gradient(#333,#333);
  background-size:0.05em 1px, 0.05em 1px, 1px 1px;
  background-repeat:no-repeat, no-repeat, repeat-x;
  text-shadow:0.03em 0 #fffff8,-0.03em 0 #fffff8,0 0.03em #fffff8,0 -0.03em #fffff8,0.06em 0 #fffff8,-0.06em 0 #fffff8,0.09em 0 #fffff8,-0.09em 0 #fffff8,0.12em 0 #fffff8,-0.12em 0 #fffff8,0.15em 0 #fffff8,-0.15em 0 #fffff8;
  background-position:0% 93%,100% 93%,0% 93%; }

/* ---- sidenotes / margin notes (tufte) ---- */
img { max-width:100%; }
.marginnote img { display:block; }
.sidenote, .marginnote { float:right; clear:right; margin-right:-60%; width:50%;
  margin-top:0.3rem; margin-bottom:0; font-size:1.1rem; line-height:1.3; vertical-align:baseline; position:relative; }
.sidenote-number { counter-increment:sidenote-counter; }
.sidenote-number:after { content:counter(sidenote-counter); font-family:et-book-roman-old-style;
  font-size:1rem; top:-0.5rem; left:0.1rem; position:relative; vertical-align:baseline; }
.sidenote:before { content:counter(sidenote-counter) " "; font-family:et-book-roman-old-style;
  font-size:1rem; top:-0.5rem; position:relative; vertical-align:baseline; }
input.margin-toggle { display:none; }
label.sidenote-number { display:inline; }
label.margin-toggle:not(.sidenote-number) { display:none; }

/* ---- misc tufte idioms ---- */
span.newthought { font-variant:small-caps; font-size:1.2em; }
.sans { font-family:"Gill Sans","Gill Sans MT",Calibri,sans-serif; letter-spacing:.03em; }
code, pre > code { font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:1rem; }

/* [HOUSE] single amber signal — the one number/verdict that matters. Colour-blind-safe dark amber. */
.signal { color:#8a5d0f; }
.verdict { font-style:italic; }

@media (max-width:760px) {
  p, footer, ol, ul, table, hr { width:90%; }
  table.fullwidth, .fullwidth { max-width:100%; }
  .sidenote, .marginnote { display:none; }
  label.margin-toggle:not(.sidenote-number) { display:inline; }
}
