/* aicopyright.ai — Copyright Law in the Age of AI
   Simplicity and readability. One serif, one measure, one accent. */

:root {
  --bg: #fcfbf8;
  --bg-inset: #f3f1ec;
  --text: #1c1c1c;
  --muted: #5d5b56;
  --rule: #d8d4cb;
  --accent: #1f3f66;
  --accent-hover: #0f2745;
  --font: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "Charter", Georgia, "Times New Roman", serif;
  --font-ui: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --measure: 40rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17181b;
    --bg-inset: #1f2125;
    --text: #e6e2da;
    --muted: #a09c94;
    --rule: #34363c;
    --accent: #9dbde6;
    --accent-hover: #c2d7f2;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { font-size: 112.5%; }            /* 18px */
@media (min-width: 900px) { html { font-size: 118.75%; } }  /* 19px */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--accent-hover); }

.skip { position: absolute; left: -999px; top: 0; background: var(--bg); padding: .5rem 1rem; }
.skip:focus { left: 1rem; z-index: 10; }

/* ---------- header / nav ---------- */
.site-header {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 2rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.site-name { text-decoration: none; color: var(--text); display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; }
.site-name-title { font-size: 1.05rem; font-weight: 600; letter-spacing: .005em; }
.site-name-author { font-size: .85rem; color: var(--muted); }
.site-nav { display: flex; flex-wrap: wrap; gap: 1.25rem; font-family: var(--font-ui); }
.site-nav a { text-decoration: none; color: var(--muted); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; }
.site-nav a:hover { color: var(--text); }
@media (max-width: 640px) {
  .site-header { padding: .9rem 1rem; gap: .4rem 1rem; }
  .site-name-author { display: none; }
  .site-nav { gap: .9rem; }
  .site-nav a { font-size: .7rem; letter-spacing: .08em; }
}

/* ---------- generic page ---------- */
.page-main { max-width: var(--measure); margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.page-main.wide { max-width: 56rem; }
.page-header h1 { font-size: 2rem; line-height: 1.2; font-weight: 600; margin: 0 0 .5rem; letter-spacing: -.005em; }
.page-subtitle { color: var(--muted); margin: 0 0 1.5rem; font-size: 1.05rem; }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; }
h2 { font-size: 1.45rem; margin: 2.4em 0 .6em; }
h3 { font-size: 1.15rem; margin: 2em 0 .5em; }
h4 { font-size: 1.05rem; margin: 2em 0 .6em; font-style: italic; }
h4 em { font-style: normal; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: .3em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
img { max-width: 100%; height: auto; }
table { border-collapse: collapse; margin: 1.5rem 0; font-size: .95rem; }
th, td { border: 1px solid var(--rule); padding: .4em .8em; vertical-align: top; text-align: left; }
th { background: var(--bg-inset); }
.table-wrap, .chapter-main table { display: block; overflow-x: auto; max-width: 100%; }
sup { line-height: 0; }
.smallcaps { font-variant: small-caps; letter-spacing: .02em; }
.underline { text-decoration: underline; text-underline-offset: .15em; }
blockquote { margin: 1.2em 0 1.2em 1.6em; padding: 0; color: inherit; }
blockquote blockquote { margin-left: 1.4em; }

/* ---------- chapter layout ---------- */
.chapter-layout { display: grid; grid-template-columns: 1fr; max-width: 78rem; margin: 0 auto; }
.chapter-main { padding: 2rem 1.25rem 4rem; min-width: 0; }
.chapter-main > article { max-width: var(--measure); margin: 0 auto; }
.chapter-aside { padding: 1.25rem 1.25rem 0; }

@media (min-width: 1080px) {
  .chapter-layout { grid-template-columns: 17rem minmax(0, 1fr); gap: 2rem; }
  .chapter-aside { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 2.4rem 0 2rem 1.5rem; }
  .outline summary { display: none; }
  .outline { border: 0; padding: 0; }
}

.outline { border: 1px solid var(--rule); border-radius: 4px; padding: .5rem .9rem; font-family: var(--font-ui); }
.outline summary { cursor: pointer; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: .3rem 0; }
.outline-nav { font-size: .82rem; line-height: 1.4; }
.outline-nav > ul { padding-left: 0; margin: .6rem 0 0; }
.outline-nav ul { list-style: none; padding-left: .9rem; margin: 0; }
.outline-nav li { margin: 0 0 .45em; }
.outline-nav a { color: var(--muted); text-decoration: none; display: block; }
.outline-nav a:hover { color: var(--text); }
.outline-nav > ul > li > a { color: var(--text); }
.outline-nav ul ul ul a { font-style: italic; }
.outline-nav ul ul ul a em { font-style: normal; }

.chapter-header { margin-bottom: 2.5rem; }
.chapter-kicker { font-family: var(--font-ui); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .6rem; }
.chapter-kicker a { color: inherit; text-decoration: none; }
.chapter-header h1 { font-size: 2.1rem; margin: 0 0 .6rem; letter-spacing: -.008em; }
.chapter-meta { color: var(--muted); font-size: .9rem; margin: 0; }

/* Extracted opinions */
.case, .case-center, .case-footnote {
  border-left: 3px solid var(--rule);
  padding-left: 1.2rem;
  margin: 0;
}
.case p:last-child, .case-center p:last-child, .case-footnote p:last-child { margin-bottom: 1em; }
.case-center { text-align: center; padding-right: 1.2rem; }
.case-center p { font-weight: 600; font-size: .95rem; letter-spacing: .02em; }
.case-footnote { font-size: .88rem; color: var(--muted); }
.case blockquote { margin-left: 1.4em; }

/* Editorial notes */
.notes { background: var(--bg-inset); padding: .9rem 1.1rem; border-radius: 4px; margin: 1.2em 0; }
.notes p:last-child { margin-bottom: 0; }

/* Figures */
.figure { margin: 1.8rem 0; text-align: center; }
.figure img { display: inline-block; margin: 0 .5rem .5rem 0; }
.figure img:last-child { margin-right: 0; }
.caption { text-align: center; font-size: .88rem; color: var(--muted); margin: 1.5rem 0 -1.2rem; }
.caption p { margin: 0; }
.image-description { text-align: center; font-size: .88rem; color: var(--muted); margin: -1rem auto 1.8rem; max-width: 34em; line-height: 1.45; }
.image-description p { margin: 0; }

/* Footnotes (pandoc) */
.footnotes { font-size: .88rem; color: var(--muted); margin-top: 3rem; }
.footnotes hr { margin: 0 0 1rem; }
.footnotes ol { padding-left: 1.4em; }
.footnote-back { text-decoration: none; margin-left: .3em; }

/* Chapter footer */
.chapter-footer { margin-top: 3.5rem; border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.cite { background: var(--bg-inset); padding: .9rem 1.1rem; border-radius: 4px; font-size: .9rem; }
.cite-heading { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .4rem; font-family: var(--font-ui); }
.cite p { margin: 0; }
.pager { display: flex; justify-content: space-between; gap: 1.5rem; margin-top: 2rem; font-family: var(--font-ui); }
.pager a { text-decoration: none; max-width: 48%; }
.pager-next { text-align: right; margin-left: auto; }
.pager-label { display: block; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pager-title { display: block; font-size: 1rem; line-height: 1.3; }

/* ---------- home ---------- */
.home-title { padding: 3.5rem 0 2rem; border-bottom: 1px solid var(--rule); margin-bottom: 2.5rem; }
.home-title h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.08; margin: 0 0 .6rem; letter-spacing: -.012em; font-weight: 600; }
.home-title .byline { font-size: 1.25rem; margin: 0 0 .2rem; }
.home-title .edition { color: var(--muted); margin: 0 0 1.6rem; font-size: 1rem; }
.home-lede { font-size: 1.15rem; max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.6rem 0 0; }
.button {
  display: inline-block; padding: .45em .85em; border: 1px solid var(--accent); border-radius: 4px;
  text-decoration: none; font-family: var(--font-ui); font-size: .85rem; color: var(--accent); white-space: nowrap;
}
.button.primary { background: var(--accent); color: var(--bg); }
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--bg); }
.home h2 { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-family: var(--font-ui); margin: 2.8rem 0 1rem; font-weight: 600; }
.home h2:first-of-type { margin-top: 0; }
.chapter-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.chapter-list li { display: grid; grid-template-columns: 2.4rem 1fr; gap: .4rem; margin: 0; padding: .35rem 0; border-bottom: 1px solid var(--rule); }
.chapter-list li:last-child { border-bottom: 0; }
.chapter-list .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.chapter-list a { text-decoration: none; color: var(--text); }
.chapter-list a:hover { color: var(--accent); text-decoration: underline; }
.part-heading { font-size: 1rem !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--text) !important; margin: 2rem 0 .5rem !important; }
.paths { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 0 0 1rem; }
@media (min-width: 640px) { .paths { grid-template-columns: repeat(3, 1fr); } }
.path { border: 1px solid var(--rule); border-radius: 4px; padding: .9rem 1rem; text-decoration: none; color: var(--text); display: block; }
.path:hover { border-color: var(--accent); }
.path .num { display: block; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-family: var(--font-ui); margin-bottom: .3rem; }
.path .name { display: block; font-weight: 600; line-height: 1.3; margin-bottom: .35rem; }
.path .blurb { display: block; font-size: .9rem; color: var(--muted); line-height: 1.45; }

/* ---------- contents / cases ---------- */
.toc-chapter { margin: 0 0 1.8rem; }
.toc-chapter h3 { margin: 0 0 .3rem; font-size: 1.1rem; }
.toc-chapter h3 a { text-decoration: none; color: var(--text); }
.toc-chapter h3 a:hover { color: var(--accent); }
.toc-chapter ul { list-style: none; padding-left: 2.2rem; margin: 0; font-size: .95rem; }
.toc-chapter ul ul { padding-left: 1.2rem; }
.toc-chapter li { margin: .15em 0; }
.toc-chapter a { color: var(--muted); text-decoration: none; }
.toc-chapter a:hover { color: var(--accent); text-decoration: underline; }
.toc-chapter .case-name { font-style: italic; }
.toc-chapter .case-name em { font-style: normal; }
.cases-list { list-style: none; padding: 0; margin: 0; }
.cases-list li { padding: .3rem 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 1fr auto; gap: 1rem; }
.cases-list .case-name { font-style: italic; }
.cases-list .case-name em { font-style: normal; }
.cases-list a { text-decoration: none; color: var(--text); }
.cases-list a:hover { color: var(--accent); }
.cases-list .where { color: var(--muted); font-size: .85rem; white-space: nowrap; font-family: var(--font-ui); }
.cases-letter { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 2rem 0 .4rem; font-family: var(--font-ui); }

/* ---------- download / teaching lists ---------- */
.file-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.file-list li { padding: .7rem 0; border-bottom: 1px solid var(--rule); }
.file-list li:last-child { border-bottom: 0; }
.file-list .file-meta { color: var(--muted); font-size: .88rem; display: block; }

/* ---------- search ---------- */
#search { margin-top: .5rem; }
.pagefind-ui { --pagefind-ui-font: var(--font); --pagefind-ui-primary: var(--accent); --pagefind-ui-text: var(--text); --pagefind-ui-background: var(--bg); --pagefind-ui-border: var(--rule); --pagefind-ui-tag: var(--bg-inset); --pagefind-ui-border-radius: 4px; --pagefind-ui-scale: .9; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--rule); margin-top: 2rem; padding: 1.5rem; font-size: .85rem; color: var(--muted); text-align: center; }
.site-footer p { margin: 0 0 .4rem; }

@media print {
  .site-header, .site-footer, .chapter-aside, .pager, .skip { display: none; }
  body { background: #fff; color: #000; }
}
