/* ==========================================================================
   legal.css — Editorial styling for License & Privacy pages
   Drop this in: <project-root>/assets/legal.css
   Referenced from license.qmd and privacy.qmd via `format.html.css:`
   --------------------------------------------------------------------------
   Designed to be theme-agnostic: relies on Bootstrap utility classes already
   present in Quarto and on a small palette of CSS variables defined below.
   Override the variables in your site-wide _quarto.yml or theme.scss if you
   want different colors.
   ========================================================================== */

:root {
  --legal-accent: #9b1c2e;          /* oxblood */
  --legal-rule: rgba(20, 28, 50, 0.85);
  --legal-muted: rgba(20, 28, 50, 0.55);
  --legal-paper-tint: rgba(165, 130, 80, 0.06);
}

/* ---------- Masthead ---------------------------------------------------- */

.legal-masthead {
  margin: 1.5rem 0 2.5rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--legal-rule);
  border-bottom: 1px solid var(--legal-rule);
  padding-block: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 1.05rem;
  line-height: 1.5;
}

.legal-masthead > p:first-child,
.legal-masthead > :first-child {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0;
}

/* ---------- Section numerals (run-in) ----------------------------------- */

.section-num {
  font-family: var(--bs-font-serif, Georgia), serif;
  font-feature-settings: "onum";
  font-size: 0.78em;
  font-weight: 500;
  color: var(--legal-accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 0.4rem;
}

/* ---------- Small caps -------------------------------------------------- */

.smallcaps {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* ---------- Ornament ---------------------------------------------------- */

.ornament {
  text-align: center;
  letter-spacing: 0.5em;
  color: var(--legal-accent);
  font-size: 1.25rem;
  margin: 2rem 0 2.5rem;
  user-select: none;
}

/* ---------- Pull quote -------------------------------------------------- */

.pullquote {
  font-family: var(--bs-font-serif, Georgia), serif;
  font-size: 1.3em;
  line-height: 1.4;
  font-style: italic;
  font-weight: 400;
  border-left: 3px solid var(--legal-accent);
  padding: 0.25rem 0 0.25rem 1.5rem;
  margin: 2rem 0;
  max-width: 38em;
}

/* ---------- License "card" --------------------------------------------- */

.license-card,
.privacy-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: start;
  margin: 2rem 0 3rem;
  padding: 1.5rem 0;
}

.license-card .license-body,
.privacy-card .privacy-body {
  border-left: 2px solid var(--legal-rule);
  padding: 0.25rem 0 0.25rem 1.5rem;
}

.cc-icons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cc-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-family: var(--bs-font-serif, Georgia), serif;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.zero-mark {
  font-family: var(--bs-font-serif, Georgia), serif;
  font-size: 6rem;
  line-height: 0.85;
  font-weight: 600;
  color: var(--legal-accent);
}

@media (max-width: 600px) {
  .license-card, .privacy-card {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .cc-icons { flex-direction: row; }
  .license-card .license-body,
  .privacy-card .privacy-body {
    border-left: none;
    border-top: 2px solid var(--legal-rule);
    padding: 1rem 0 0;
  }
  .zero-mark { font-size: 4.5rem; }
}

/* ---------- Three pillars (privacy page) -------------------------------- */

.three-pillars {
  margin: 2rem 0 3rem;
  border: 1px solid var(--legal-rule);
}

.three-pillars .pillar {
  padding: 1.5rem;
  border-right: 1px solid var(--legal-rule);
}

.three-pillars .pillar:last-child {
  border-right: none;
}

@media (max-width: 768px) {
  .three-pillars .pillar {
    border-right: none;
    border-bottom: 1px solid var(--legal-rule);
  }
  .three-pillars .pillar:last-child { border-bottom: none; }
}

.three-pillars .pillar h4 {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
}

.three-pillars .pillar p {
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--legal-muted);
}

/* ---------- Runtime cards ----------------------------------------------- */

.runtime-card {
  border: 1px solid var(--legal-rule);
  padding: 1.25rem;
  margin-bottom: 0;
}

.runtime-card .smallcaps {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--legal-accent);
}

.runtime-card.runtime-no .smallcaps {
  color: var(--legal-muted);
}

.runtime-card.runtime-no ul {
  color: var(--legal-muted);
}

.runtime-card ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.95rem;
}

.runtime-card li {
  margin-bottom: 0.4rem;
}

/* ---------- Scholarly link style ---------------------------------------- */

a.scholarly {
  color: var(--legal-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: background 0.15s ease, color 0.15s ease;
}

a.scholarly:hover {
  background: var(--legal-accent);
  color: #fff;
  text-decoration-color: transparent;
}

/* ---------- Definition lists (rights & obligations) --------------------- */

dl {
  margin-top: 1rem;
}

dl dt {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--bs-body-color);
  margin-top: 1rem;
}

dl dd {
  color: var(--legal-muted);
  margin-bottom: 0.75rem;
}

/* ---------- Code blocks for citation templates -------------------------- */

div.sourceCode,
pre.plain,
pre.bibtex,
pre.html {
  background: rgba(20, 28, 50, 0.92);
  color: rgba(245, 240, 225, 0.95);
  padding: 1rem 1.25rem !important;
  border-left: 3px solid var(--legal-accent);
  border-radius: 2px;
  font-size: 0.85rem !important;
  line-height: 1.55;
  overflow-x: auto;
}

/* ---------- Subtle paper tint ------------------------------------------- */

main.content {
  background-image:
    radial-gradient(circle at 15% 20%, var(--legal-paper-tint), transparent 55%),
    radial-gradient(circle at 85% 75%, var(--legal-paper-tint), transparent 55%);
}

/* ---------- Quiet selection color --------------------------------------- */

::selection {
  background: var(--legal-accent);
  color: #fff;
}

/* ---------- Print: inkless, ledger-clean -------------------------------- */

@media print {
  .legal-masthead { border-color: #000; }
  .pullquote { border-left-color: #000; }
  .section-num, a.scholarly { color: #000; }
  .three-pillars, .runtime-card { border-color: #000; }
  a.scholarly:hover { background: transparent; color: #000; }
  div.sourceCode { background: #f5f5f5; color: #000; border-left-color: #000; }
}
