
/* ── REED London: CSS Injector stylesheet ── */

:root {
  --reed-margin-col: 11em;
  --reed-gap: 1.25em;
  --reed-note-color: #6b4f2a;
  --reed-link-color: #1a5276;
  --reed-rule: #ccc;
  --reed-commentary-bg: #f7f5f2;
  --reed-commentary-border: #ccc;
  --reed-record-bg: #fdfcf8;
  --reed-record-accent: #8a6d3b;
}

/* Record: two-column grid — left margin col + main text col */
.reed-record {
  display: grid;
  grid-template-columns: var(--reed-margin-col) 1fr;
  gap: 0 var(--reed-gap);
  align-items: start;
  margin: 1.5em 0;
  padding: 1em 1em 1em 0;
  border-top: 2px solid var(--reed-record-accent);
  background: var(--reed-record-bg);
}

/* Right-margin variant: flip column order via RTL direction trick */
.reed-record.reed-record-right {
  grid-template-columns: 1fr var(--reed-margin-col);
  direction: rtl;
}
.reed-record.reed-record-right > * {
  direction: ltr;
}

/* Headings always span full width */
.reed-record h1,
.reed-record h2,
.reed-record h3,
.reed-record h4,
.reed-record h5,
.reed-record h6 {
  grid-column: 1 / -1;
}

/* Items that should span both columns */
.reed-span-full {
  grid-column: 1 / -1;
}

/* Marginal note cell */
.reed-marginal {
  font-size: .8em;
  color: var(--reed-note-color);
  text-align: right;
  border-right: 2px solid var(--reed-note-color);
  padding-right: .5em;
  line-height: 1.4;
  margin: 0;
}

.reed-marginal-empty {
  margin: 0;
  padding: 0;
}

/* Main text cell — serif to signal primary source */
.reed-text {
  font-family: "Palatino Linotype", Georgia, "Times New Roman", serif;
  font-size: 1em;
  line-height: 1.65;
  margin: 0 0 .5em;
}

/* Labels (folio refs etc) */
.reed-label {
  font-size: .85em;
  letter-spacing: .03em;
  color: #777;
  margin-bottom: .25em;
}

/* Gap / omission markers */
.reed-gap-block {
  text-align: left;
  color: #bbb;
  font-size: .85em;
  font-style: italic;
  margin: .2em 0;
  grid-column: 1 / -1;
}

.reed-gap {
  color: #999;
  font-style: italic;
}

/* Editorial marks */
.reed-expan-letters { font-style: italic; }
.reed-damage { text-decoration: underline dotted #999; }
.reed-add { vertical-align: super; font-size: .8em; }

/* Named entity links */
.reed-persname,
.reed-placename {
  color: var(--reed-link-color);
  text-decoration: none;
  border-bottom: 1px dotted var(--reed-link-color);
}
.reed-persname:hover,
.reed-placename:hover {
  background: #eef4f8;
}

/* Textual note superscript markers */
.reed-note-ref a {
  color: #b35900;
  font-weight: bold;
  text-decoration: none;
}
.reed-note-ref a:hover { text-decoration: underline; }

/* Commentary boxes — quieter than the record text */
.reed-record .reed-commentary {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  box-sizing: border-box;
  display: block !important;
  float: none !important;
  margin: 1em 0 0;
  padding: .5em .8em;
  background: var(--reed-commentary-bg);
  border-left: 2px solid var(--reed-commentary-border);
  font-size: .85em;
  color: #555;
}
.reed-commentary p { margin: .4em 0; }
.reed-commentary-heading {
  font-size: .8em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #8a6d3b;
  margin: 0 0 .4em;
}

/* Account tables — ledger style, not data grid */
.reed-table {
  border-collapse: collapse;
  width: 95%;
  margin: .5em 0 .5em 1em;
  font-size: .95em;
  font-family: "Palatino Linotype", Georgia, "Times New Roman", serif;
  border: 1px solid #ddd;
}

.reed-table td {
  border: none;
  border-bottom: 1px solid #eee;
  padding: .3em .6em;
  vertical-align: top;
}

.reed-table tr:last-child td {
  border-bottom: none;
}

.reed-table td:last-child {
  text-align: right;
  white-space: nowrap;
  width: 1%;
  color: #666;
  border-left: 1px solid #eee;
}

/* Textual notes section at foot of page */
.reed-textual-notes {
  margin-top: 2.5em;
  padding-top: 1em;
  border-top: 2px solid var(--reed-rule);
  font-size: .92em;
}
.reed-textual-notes li { margin-bottom: .5em; }
.reed-back-ref { text-decoration: none; margin-left: .3em; }

/* Narrow screens: collapse margin column */
@media (max-width: 40em) {
  .reed-record {
    grid-template-columns: 1fr;
  }
  .reed-marginal {
    text-align: left;
    border-right: none;
    border-left: 2px solid var(--reed-note-color);
    padding-right: 0;
    padding-left: .5em;
  }
  .reed-marginal-empty { display: none; }
}
}