/* American Literature I: Readings. The Roget Daily period-book design, with a dark mode.
   Fonts: EB Garamond 12 by Octavio Pardo (SIL Open Font License, fonts/OFL.txt). */
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/eb-garamond-regular.woff2) format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/eb-garamond-italic.woff2) format("woff2"); }
/* The two reader-chosen faces (fonts/FONTS.txt). A browser downloads one only when a reader picks it. */
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/atkinson-regular.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/atkinson-regular-ext.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/atkinson-italic.woff2) format("woff2"); }
@font-face { font-family: "OpenDyslexic"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/opendyslexic-regular.woff2) format("woff2"); }
@font-face { font-family: "OpenDyslexic"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/opendyslexic-italic.woff2) format("woff2"); }

:root {
  --paper: #fbfaf5; --paper-2: #f3f0e7; --card: #ffffff;
  --ink: #2a2119; --rubric: #8a1c1c; --muted: #5a4d3b; --rule: #d6cdb7;
  --mark: #f4e9c8;
  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --measure: 38rem;
  --size: 1.1875rem;   /* the body text size at the default step; A−/A+ scale the root instead */
  --text: var(--serif);
  --scale: 1;
  --lead: 1.6;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1a1714; --paper-2: #24201b; --card: #211d19;
    --ink: #e9e2d3; --rubric: #eb9a8c; --muted: #b8ab93; --rule: #413a30;
    --mark: #3a3122;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1a1714; --paper-2: #24201b; --card: #211d19;
  --ink: #e9e2d3; --rubric: #eb9a8c; --muted: #b8ab93; --rule: #413a30;
  --mark: #3a3122;
  color-scheme: dark;
}
:root { --zoom: 1; }
:root[data-size="0"] { --zoom: 0.84; }
:root[data-size="1"] { --zoom: 0.92; }
:root[data-size="3"] { --zoom: 1.11; }
:root[data-size="4"] { --zoom: 1.26; }
:root[data-size="5"] { --zoom: 1.45; }
html { font-size: calc(100% * var(--zoom)); }   /* A− and A+ scale every rem on the page; the header is set in px and stays put */
/* Atkinson and OpenDyslexic are larger than Garamond at the same size, so they are set a little smaller */
:root[data-font="sans"] { --text: "Atkinson Hyperlegible", system-ui, sans-serif; --scale: 0.92; --lead: 1.65; }
:root[data-font="dyslexic"] { --text: "OpenDyslexic", "Atkinson Hyperlegible", system-ui, sans-serif; --scale: 0.86; --lead: 1.75; }
:root[data-font] body { font-synthesis: small-caps; font-variant-numeric: normal; }

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 calc(var(--size) * var(--scale))/var(--lead) var(--text); font-variant-numeric: oldstyle-nums; background: var(--paper); color: var(--ink); font-synthesis: none; }
a { color: var(--rubric); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--rubric); outline-offset: 2px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--paper); padding: 0.5rem 0.75rem; border: 1px solid var(--rubric); z-index: 20; }
.skip:focus { top: 1rem; }

/* Masthead */
.head { border-bottom: 1px solid var(--rule); padding: 17px 16px 11px; font-size: 16px; line-height: 1.6; }
.head-in { max-width: calc(var(--measure) + 6em); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5em 1.5em; justify-content: space-between; }
.mast { margin: 0; margin-right: auto; text-align: left; font-size: 1.95em; line-height: 1.05; letter-spacing: 0.035em; font-variant-caps: small-caps; }
.mast a { color: var(--ink); text-decoration: none; }
.mast small { display: block; font-size: 0.85em; letter-spacing: 0.06em; color: var(--muted); font-variant-caps: normal; font-style: italic; margin-top: 0.15em; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25em 1em; font-size: 1em; }
.nav > a, .navlink { font: inherit; font-size: 0.8em; letter-spacing: 0.12em; text-decoration: none; display: inline-block; padding: 0.3em 0; min-height: 24px; color: var(--rubric); background: none; border: 0; cursor: pointer; }
.navlink:hover { text-decoration: underline; }
.nav > a[aria-current="page"] { text-decoration: underline; }
.ctls { display: none; align-items: center; gap: 0.35rem; }
.js .ctls { display: inline-flex; }
.ctl { font: inherit; font-size: 0.8em; letter-spacing: 0.1em; color: var(--rubric); background: none; border: 1px solid var(--rule); border-radius: 2px; padding: 0.15em 0.5em; min-height: 28px; min-width: 32px; cursor: pointer; font-variant-numeric: lining-nums; }
.ctl:hover { border-color: var(--rubric); }
.ctl[disabled] { opacity: 0.45; cursor: default; }
#theme { min-width: 5.4em; } #font { min-width: 5.6rem; }
.ic { display: inline-block; width: 0.95em; height: 0.95em; vertical-align: -0.12em; margin-right: 0.35em; }
.ic svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

/* The page */
main { max-width: calc(var(--measure) + 6rem); margin: 0 auto; padding: 1.5rem 1rem 3rem; }
main > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
h1 { font-weight: 400; font-size: 2rem; line-height: 1.2; margin: 0.2rem 0 0.35rem; font-variant-caps: small-caps; letter-spacing: 0.03em; overflow-wrap: break-word; }
h1:focus { outline: none; }
.kicker { margin: 0; font-size: 0.85rem; font-style: italic; color: var(--muted); }
.byline { margin: 0 0 0.2rem; font-size: 1.1rem; }
.byline .life, .byline .year { color: var(--muted); }
.byline.trans { font-size: 0.95rem; font-style: italic; color: var(--muted); }
.srcnote { margin: 0.75rem 0 1rem; padding-top: 0.6rem; border-top: 1px solid var(--rule); font-size: 0.9rem; color: var(--muted); font-style: italic; }
.srcnote a { color: var(--muted); }
.headnote { margin: 0 0 1.25rem; font-size: 1rem; }
.lede { font-size: 1.1rem; }

details.toc, details.cite { margin: 0 0 1.25rem; font-size: 0.95rem; }
details.toc summary, details.cite summary { cursor: pointer; color: var(--rubric); min-height: 24px; padding: 0.2rem 0; }
details.toc ol { margin: 0.4rem 0 0; padding-left: 1.5rem; columns: 2 14rem; column-gap: 2rem; }
details.toc li { break-inside: avoid; }
details.toc a { display: inline-block; min-height: 24px; min-width: 24px; padding: 0.1rem 0; }
details.cite { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.mla { padding-left: 2em; text-indent: -2em; margin: 0.6rem 0; overflow-wrap: anywhere; }
.hint { color: var(--muted); font-style: italic; margin: 0.4rem 0; }

/* The text. Paragraph and line numbers sit in a left gutter inside the article. */
.text { position: relative; padding-left: 2.6rem; }
.text p { margin: 0 0 0.85em; position: relative; hyphens: auto; overflow-wrap: break-word; }
.text.prose p + p { text-indent: 0; }
.text h2 { font-weight: 400; font-size: 1.3rem; line-height: 1.3; margin: 2rem 0 0.75rem; font-variant-caps: small-caps; letter-spacing: 0.03em; }
.text h3 { font-weight: 400; font-size: 1.05rem; margin: 1.5rem 0 0.5rem; font-style: italic; color: var(--muted); }
.pn, .ln { position: absolute; left: -2.6rem; width: 2rem; text-align: right; font-size: 0.72rem; line-height: inherit; color: var(--muted); text-decoration: none; font-variant-numeric: lining-nums tabular-nums; padding-top: 0.28em; min-height: 24px; }
.pn:hover, .ln:hover { color: var(--rubric); text-decoration: underline; }
.elide { color: var(--muted); text-align: center; }
.stanza { margin: 0 0 1.1em; }
.l { display: block; position: relative; padding-left: calc(var(--i, 0) * 1.25em + 1.5em); text-indent: -1.5em; }
.l .ln { text-indent: 0; }
.verseq { margin: 0 0 0.85em 1.5em; font-size: 0.95em; }
.vl { display: block; padding-left: calc(var(--i, 0) * 1.25em + 1.5em); text-indent: -1.5em; }
section.poem { margin: 0 0 2.25rem; }
section.poem > h2 { margin-top: 1.5rem; }
:target, .is-target { background: var(--mark); border-radius: 2px; box-shadow: 0 0 0 0.25rem var(--mark); }
h1:target, section.poem:target { background: none; box-shadow: none; }

/* Links out, for texts still under copyright */
.linkout { margin: 1.5rem 0; padding: 1.1rem 1.25rem; background: var(--card); border: 1px solid var(--rule); border-radius: 3px; }
.linkout p { margin: 0 0 0.75rem; }
.linkout p:last-child { margin: 0; }
.btn { display: inline-block; font-size: 0.8rem; letter-spacing: 0.12em; padding: 0.55rem 1rem; min-height: 40px; border: 1px solid var(--rubric); border-radius: 2px; text-decoration: none; }
.btn:hover { background: var(--rubric); color: var(--paper); }
.copy { font: inherit; font-size: 0.75rem; letter-spacing: 0.12em; color: var(--rubric); background: none; border: 1px solid var(--rule); border-radius: 2px; padding: 0.3rem 0.7rem; min-height: 32px; cursor: pointer; }

/* Previous and next */
.turn { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: 1rem; }
.turn a { text-decoration: none; display: inline-block; padding: 0.25rem 0; min-height: 24px; max-width: 48%; }
.turn small { display: block; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.turn a:hover span { text-decoration: underline; }
.turn .next { text-align: right; margin-left: auto; }

/* Contents */
.tools { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; justify-content: space-between; margin: 1.25rem auto 0.5rem; }
.find { flex: 1 1 15rem; }
.find input { font: inherit; font-size: 1rem; width: 100%; padding: 0.45rem 0.6rem; background: var(--card); color: var(--ink); border: 1px solid var(--rule); border-radius: 2px; }
.find input::placeholder { color: var(--muted); font-style: italic; }
.order { display: inline-flex; border: 1px solid var(--rule); border-radius: 2px; }
.order button { font: inherit; font-size: 0.75rem; letter-spacing: 0.12em; background: none; color: var(--rubric); border: 0; padding: 0.4rem 0.7rem; min-height: 34px; cursor: pointer; }
.order button[aria-pressed="true"] { background: var(--rubric); color: var(--paper); }
.found { min-height: 1.4rem; margin: 0.25rem auto; font-size: 0.9rem; font-style: italic; color: var(--muted); }
.unit h2 { font-weight: 400; font-size: 1.35rem; margin: 2rem 0 0.25rem; font-variant-caps: small-caps; letter-spacing: 0.04em; border-bottom: 1px solid var(--rule); padding-bottom: 0.3rem; }
.unit h3 { font-weight: 400; font-size: 1rem; font-style: italic; color: var(--muted); margin: 1rem 0 0.15rem; }
.list { list-style: none; margin: 0 0 0.5rem; padding: 0; }
.list li { padding: 0.15rem 0; }
.list a { display: block; text-decoration: none; padding: 0.3rem 0; min-height: 24px; }
.list .t { color: var(--ink); }
.list a:hover .t { text-decoration: underline; color: var(--rubric); }
.list .a { display: block; font-size: 0.88rem; color: var(--muted); font-style: italic; }
.list li { position: relative; }
.tag { position: absolute; right: 0; top: 0.5rem; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--rule); border-radius: 2px; padding: 0 0.35rem; }
.list .hitline { display: block; font-size: 0.85rem; color: var(--muted); }
.about h2 { font-weight: 400; font-size: 1.3rem; margin: 2rem 0 0.5rem; font-variant-caps: small-caps; letter-spacing: 0.03em; }
.about .list li { padding: 0.35rem 0; border-top: 1px solid var(--rule); }

.foot { border-top: 1px solid var(--rule); padding: 1rem; text-align: center; font-size: 0.85rem; color: var(--muted); font-style: italic; }
.foot p { max-width: var(--measure); margin: 0 auto; }
.foot a { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; border-radius: 3px; font-size: 0.95rem; opacity: 0; pointer-events: none; transition: opacity 0.2s; max-width: calc(100vw - 2rem); }
.toast.on { opacity: 1; }

@media (max-width: 600px) {
  .head { padding: 14px 16px 10px; }
  .mast { font-size: 1.6em; width: 100%; }
  h1 { font-size: 1.65rem; }
  .text { padding-left: 2.1rem; }
  .pn, .ln { left: -2.1rem; width: 1.65rem; }
  .l { padding-left: calc(var(--i, 0) * 0.9em + 1.2em); text-indent: -1.2em; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
@media print {
  :root { --paper: #fff; --paper-2: #fff; --card: #fff; --ink: #000; --rubric: #000; --muted: #333; --rule: #999; --mark: #fff; }
  .head .nav, .skip, .turn, .toast, details.toc, .tools, .foot a { display: none !important; }
  .head { border: 0; padding: 0; }
  main { padding: 0; max-width: none; }
  details.cite { display: block; }
  details.cite > summary { list-style: none; }
  a { color: inherit; text-decoration: none; }
  .text p, .l { break-inside: avoid; }
  .text h2 { break-after: avoid; }
}

/* Notes */
sup.fn { line-height: 0; font-size: 0.7em; }
sup.fn a { text-decoration: none; padding: 0 0.15em; font-variant-numeric: lining-nums; }
.notes { margin-top: 2.5rem; padding-top: 0.75rem; border-top: 1px solid var(--rule); font-size: 0.92rem; }
.notes h2 { margin-top: 0.5rem; }
.notes ol { padding-left: 1.5rem; }
.notes li { margin: 0 0 0.6rem; }
.notes .back { text-decoration: none; display: inline-block; min-width: 24px; min-height: 24px; text-align: center; }
.text p.bq { padding-left: 1.5em; font-size: 0.95em; }
.text p.sig { text-align: right; font-style: italic; margin-top: -0.4em; }
hr.brk { border: 0; text-align: center; margin: 1.5rem 0; } hr.brk::after { content: "*   *   *"; white-space: pre; color: var(--muted); }
.text pre.chart { font: 0.8rem/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--paper-2); padding: 0.75rem 0.9rem; border-radius: 3px; overflow-x: auto; margin: 0 0 1em; max-width: 100%; }
.headnote { margin: 0 0 1.5rem; padding: 0.9rem 1.1rem; background: var(--paper-2); border-left: 3px solid var(--rule); border-radius: 2px; font-size: 1rem; }
.headnote h2 { font-weight: 400; font-size: 1.05rem; margin: 0 0 0.4rem; font-variant-caps: small-caps; letter-spacing: 0.04em; color: var(--muted); }
.headnote p { margin: 0 0 0.6rem; }
.headnote p:last-child { margin: 0; }

/* The side list of readings. Closed by default; JavaScript opens it (and remembers "open" on wide screens). */
.navbtn { display: none !important; }
.js .navbtn { display: inline-block !important; }
.head-in { position: relative; }
.sidenav { display: none; position: fixed; top: 0; left: 0; bottom: 0; width: min(20rem, 88vw); overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper-2); border-right: 1px solid var(--rule); z-index: 30; padding: 0.9rem 1rem 2rem; font-size: 0.95rem; line-height: 1.35; }
html.nav-open .sidenav { display: block; }
.scrim { display: none; position: fixed; inset: 0; background: rgba(20, 16, 12, 0.4); z-index: 25; }
html.nav-open .scrim { display: block; }
.sn-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.4rem; }
.sn-title { margin: 0; font-size: 1.15rem; font-variant-caps: small-caps; letter-spacing: 0.04em; }
.sn-unit { margin: 1.1rem 0 0.3rem; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sidenav ul, .sidenav ol { list-style: none; margin: 0; padding: 0; }
.sidenav li a { display: block; padding: 0.3rem 0.5rem; min-height: 24px; text-decoration: none; color: var(--ink); border-radius: 2px; }
.sidenav li a span { display: block; font-size: 0.8rem; font-style: italic; color: var(--muted); }
.sidenav li a:hover { background: var(--paper); }
.sidenav li a[aria-current="page"] { background: var(--paper); box-shadow: inset 3px 0 0 var(--rubric); }
.sn-toc li a { color: var(--rubric); padding-top: 0.2rem; padding-bottom: 0.2rem; }
@media (min-width: 1180px) {
  html.nav-open body { padding-left: 20rem; }
  html.nav-open .scrim { display: none; }
  .sidenav { width: 20rem; }
}
@media print { .sidenav, .scrim, .navbtn { display: none !important; } html.nav-open body { padding-left: 0; } }
.about ul.plain { padding-left: 1.2rem; } .about ul.plain li { margin: 0 0 0.4rem; }

/* Theme and font menus */
.menu { position: relative; display: inline-block; }
.caret { display: inline-block; width: 0; height: 0; margin-left: 0.45em; vertical-align: 0.15em; border-left: 0.3em solid transparent; border-right: 0.3em solid transparent; border-top: 0.35em solid currentColor; }
.menu-list { position: absolute; right: 0; top: calc(100% + 0.35em); z-index: 40; list-style: none; margin: 0; padding: 0.3em 0; min-width: 16.5em;
  background: var(--card); border: 1px solid var(--rule); border-radius: 3px; box-shadow: 0 6px 20px rgba(20, 16, 12, 0.14); }
.menu-list.flip { right: auto; left: 0; }
.menu-list button { display: flex; align-items: baseline; gap: 0.5em; width: 100%; text-align: left; font: inherit; font-size: 1em; line-height: 1.3; letter-spacing: 0;
  padding: 0.5em 2em 0.5em 0.85em; min-height: 36px; background: none; border: 0; color: var(--ink); cursor: pointer; position: relative; }
.menu-list button small { font-size: 0.78em; color: var(--muted); font-style: italic; }
.menu-list button:hover, .menu-list button:focus-visible { background: var(--paper-2); }
.menu-list button[aria-pressed="true"] { color: var(--rubric); }
.menu-list button[aria-pressed="true"]::after { content: "✓"; position: absolute; right: 0.8rem; }
.menu-list .ic { align-self: center; }
.menu-list .f-serif { font-family: "EB Garamond", Georgia, serif; }
.menu-list .f-sans { font-family: "Atkinson Hyperlegible", system-ui, sans-serif; }
.menu-list .f-dyslexic { font-family: "OpenDyslexic", system-ui, sans-serif; font-size: 0.9em; }
@media print { .menu-list { display: none !important; } }
.menu-list button { white-space: nowrap; }

/* The menu button that opens the side list: four lines, pinned to the page's left edge, outside the header's layout */
.head { position: relative; }
.waffle { position: absolute; left: 10px; top: 0; bottom: 0; margin: auto 0; width: 70px; height: 86px; padding: 14px 10px; border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; }
.waffle svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.waffle:hover, .waffle[aria-expanded="true"] { color: var(--rubric); background: var(--paper-2); }
.head-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5em 1.5em; justify-content: space-between; flex: 1; min-width: 0; }
@media (max-width: 920px) { .head { padding-left: 90px; } }
@media (max-width: 600px) { .waffle { width: 44px; height: 44px; left: 4px; padding: 8px 6px; } .head { padding-left: 54px; } }   /* only where the header would otherwise reach the button */
