@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500&family=Vollkorn:ital,wght@0,400;0,600;1,400&display=swap');
@import url('companion_pages.css');

/* ── Design tokens (Curricula Companion) ── */
:root {
  --bg: #F0F4F8;
  --bg2: #E2EAF2;
  --ink: #1C2D4A;
  --ink2: #3A5070;
  --ink3: #6080A0;
  --accent: #3A5A8C;
  --accent2: #5870A0;
  --line: #C0CEDC;
  --serif: 'Vollkorn', Georgia, serif;
  --sans: 'Montserrat', sans-serif;
  --mono: 'Courier New', monospace;

  /* Legacy aliases used across the app */
  --text-color: var(--ink);
  --background-color: var(--bg);
  --accent-color: var(--accent);
  --card-color: rgba(255, 255, 255, 0.55);
  --surface: rgba(255, 255, 255, 0.55);
  --surface-solid: #ffffff;
  --radius: 4px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  -webkit-hyphens: auto;
  hyphens: auto;
}

article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary {
  display: block;
}

audio, canvas, progress, video {
  display: inline-block;
  vertical-align: baseline;
}

audio:not([controls]) {
  display: none;
  height: 0;
}

[hidden], template {
  display: none;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
}

h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 16px;
}

h1 em, h2 em {
  font-style: italic;
  color: var(--accent);
}

h2 {
  font-size: clamp(22px, 3vw, 32px);
  margin: 0 0 14px;
}

h3 {
  font-size: 18px;
  margin: 0 0 10px;
}

p {
  line-height: 1.7;
  margin: 0 0 16px;
  font-weight: 300;
  color: var(--ink2);
}

em {
  font-style: italic;
}

strong, b {
  font-weight: 500;
  color: var(--ink);
}

small {
  font-size: 80%;
}

sub, sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sup { top: -0.5em; }
sub { bottom: -0.25em; }

/* ── Links ── */
a {
  background: transparent;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}

a:hover {
  color: var(--accent2);
  border-color: var(--accent);
}

a.footnoteRef {
  border-bottom: none;
}

/* ── Lists ── */
ul, ol {
  font-size: 95%;
  margin: 10px 0 15px;
  padding-left: 28px;
  color: var(--ink2);
  font-weight: 300;
}

ul { list-style: circle; }
ol { list-style: decimal; }

li {
  margin: 5px 0 7px;
}

/* ── Quotes ── */
blockquote, dd {
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  color: var(--ink);
  border-left: 3px solid var(--accent);
  padding-left: 24px;
  margin: 24px 0;
  line-height: 1.5;
}

q {
  font-style: italic;
}

/* ── Code ── */
code, kbd, pre, samp {
  font-family: var(--mono), monospace;
}

code {
  font-size: 85%;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 2px;
  color: var(--accent2);
}

pre {
  overflow: auto;
  margin: 0 0 16px;
}

pre > code {
  display: block;
  font-size: 80%;
  padding: 14px 16px;
  border-radius: var(--radius);
  overflow-x: auto;
}

/* ── Forms ── */
button, input, optgroup, select, textarea {
  color: inherit;
  font: inherit;
  margin: 0;
}

button {
  overflow: visible;
  cursor: pointer;
}

button, select {
  text-transform: none;
}

input, textarea, select {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 300;
}

input[type="search"] {
  -webkit-appearance: textfield;
}

fieldset {
  border: 1px solid var(--line);
  margin: 0 2px;
  padding: 0.35em 0.625em 0.75em;
}

legend {
  border: 0;
  padding: 0;
}

textarea {
  overflow: auto;
  resize: vertical;
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 1em 0;
}

tr td, tr th {
  padding: 0.45em 0.75em;
}

tr.header {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-weight: 500;
}

tr.odd {
  background: rgba(255, 255, 255, 0.35);
}

tr.even {
  background: rgba(255, 255, 255, 0.2);
}

tbody:last-child {
  border-bottom: 1px solid var(--line);
}

dt {
  font-weight: 500;
}

dt:after {
  content: ":";
}

dd {
  margin-bottom: 10px;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  height: 0;
  margin: 24px 0;
}

img {
  display: block;
  max-width: 100%;
  border: 0;
}

figure {
  margin: 1.3em 0;
  text-align: center;
  padding: 0;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

caption, figcaption {
  font-size: 80%;
  font-style: italic;
  text-align: right;
  margin-bottom: 5px;
  color: var(--ink3);
}

/* ── Utility ── */
.english {
  font-style: italic;
  opacity: 0.65;
}

.center {
  margin-right: auto;
  margin-left: auto;
  position: relative;
  max-width: 640px;
}

.mono, .section-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent2);
  text-transform: uppercase;
}

.section-label {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::after {
  content: '';
  display: block;
  flex: 1;
  height: 1px;
  background: var(--line);
  max-width: 120px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.footnotes {
  color: var(--ink3);
  font-size: 70%;
  font-style: italic;
}

.csl-bib-body {
  color: var(--accent);
  margin-top: 2em;
}

.csl-entry {
  margin-bottom: 1.5em;
  font-size: 0.8em;
  font-family: var(--mono);
}

.striped {
  background-image: repeating-linear-gradient(-56deg, transparent, transparent 8px, currentcolor 8px, currentcolor 10px);
  padding: 0;
  aspect-ratio: 6 / 1;
  border: 0 none;
  display: block;
  color: inherit;
}
