:root {
  color-scheme: light dark;
  --background: #fff;
  --foreground: #24231f;
  --muted: #6b6961;
  --accent: #295f75;
  --rule: #d9d6cc;
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--foreground);
  background: var(--background);
}

body {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.16em;
}

a:hover {
  text-decoration-thickness: 0.12em;
}

a[href^="https://sites.google.com/view/allaboutcemsay/"] {
  color: inherit;
  text-decoration-color: currentcolor;
  text-decoration-thickness: 0.045em;
  text-underline-offset: 0.13em;
}

a[href^="https://sites.google.com/view/allaboutcemsay/"]:hover {
  text-decoration-thickness: 0.045em;
}

h1 {
  margin: 0 0 1.25rem;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
}

h2 {
  margin: 2.2rem 0 1rem;
  padding-top: 0;
  border-top: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0;
}

p {
  margin: 0 0 1rem;
}

.intro {
  margin-bottom: 1.25rem;
  font-size: 1rem;
}

.intro p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 650;
}

strong a {
  color: var(--foreground);
  text-decoration-color: var(--rule);
}

.publication {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem 1.5rem;
  margin-bottom: 1.25rem;
}

.publication p {
  margin: 0;
  color: var(--muted);
}

.publication strong {
  color: var(--foreground);
}

.publication-lineage {
  grid-column: 1;
  display: block;
  margin-top: -0.45rem;
  font-size: 0.84rem;
  line-height: 1.4;
}

.publication-lineage-note {
  color: var(--muted);
}

.publication-lineage a {
  text-decoration-color: var(--rule);
}

.publication-inline-links {
  font-size: 0.76rem;
  text-transform: lowercase;
}

.publication-lineage-unit {
  white-space: nowrap;
}

.publication-inline-links a {
  color: inherit;
  text-decoration-color: var(--rule);
}

.publication-links {
  min-width: 3.5rem;
  font-size: 0.76rem;
  line-height: 1.7;
  text-align: right;
  text-transform: lowercase;
}

.publication-links a {
  text-decoration-color: var(--rule);
}

.citation-popover {
  position: fixed;
  z-index: 10;
  box-sizing: border-box;
  width: min(34rem, calc(100vw - 1.5rem));
  padding: 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 0.4rem;
  color: var(--foreground);
  background: var(--background);
  box-shadow: 0 0.65rem 2rem rgb(0 0 0 / 20%);
}

.citation-popover[hidden] {
  display: none;
}

.citation-popover::before,
.citation-popover::after {
  position: absolute;
  left: var(--citation-arrow-left);
  width: 0;
  height: 0;
  border-right: 0.45rem solid transparent;
  border-left: 0.45rem solid transparent;
  content: "";
  transform: translateX(-50%);
}

.citation-popover[data-placement="below"]::before {
  top: -0.5rem;
  border-bottom: 0.5rem solid var(--rule);
}

.citation-popover[data-placement="below"]::after {
  top: -0.43rem;
  border-bottom: 0.5rem solid var(--background);
}

.citation-popover[data-placement="above"]::before {
  bottom: -0.5rem;
  border-top: 0.5rem solid var(--rule);
}

.citation-popover[data-placement="above"]::after {
  bottom: -0.43rem;
  border-top: 0.5rem solid var(--background);
}

.citation-popover textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 13rem;
  margin: 0;
  padding: 0.75rem;
  resize: none;
  border: 1px solid var(--rule);
  border-radius: 0.25rem;
  color: var(--foreground);
  background: var(--background);
  font: 0.78rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
}

h2 ~ p {
  color: var(--muted);
}

h2 ~ p strong,
h2 ~ p strong a {
  color: var(--foreground);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #191a18;
    --foreground: #eceae3;
    --muted: #aaa79d;
    --accent: #8fc5d9;
    --rule: #3a3b37;
  }
}

@media (max-width: 35rem) {
  :root {
    font-size: 15px;
  }

  body {
    padding-top: 2.5rem;
  }

  .publication {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .publication-lineage {
    margin-top: 0.1rem;
  }

  .publication-links {
    text-align: left;
  }

  .publication-links br {
    display: none;
  }

  .publication-links a {
    margin-right: 0.8rem;
  }
}

@media print {
  :root {
    color-scheme: light;
    --background: #fff;
    --foreground: #000;
    --muted: #333;
    --accent: #000;
    --rule: #bbb;
  }

  body {
    padding: 0;
  }
}
