@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700;9..144,800&family=Inter:wght@400;500;600;700;800&display=swap");

/* ─────────────────────────────────────────────────────────────────────────────
   OER Navigator — shared stylesheet
   Scope: design tokens, reset, site chrome (header, nav, footer), common
   typography/components, and responsive helpers. Page-specific overrides may
   remain in each HTML file; this file only extracts the genuinely shared rules.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #1B2A41;
  --ink-deep: #10121B;
  --paper: #FAF8F4;
  --accent: #C96F2E;
  --accent-soft: #F0DFCE;
  --slate: #5B6B82;
  --line: #E3DED4;
  --surface: var(--paper);
  --card: #fffdf9;
  --border: var(--line);
  --text: var(--ink-deep);
  --muted: var(--slate);
  --red: #9f1d1d;
  --amber: #9a5a16;
  --radius: 8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--surface);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--ink); }
a:hover { text-decoration: underline; }

/* ── Site header / chrome ── */
header {
  background: var(--ink);
  color: #fff;
  padding: 1.25rem 2rem;
  border-bottom: 3px solid var(--accent);
}

header a { color: inherit; text-decoration: none; }
header a:hover { text-decoration: underline; }

.doc-institution {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .55;
}

.doc-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-top: .15rem;
}

.doc-unit {
  font-size: .82rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: .1rem;
}

/* Header used by the main app (index.html) */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.5rem;
}

.header-left { display: flex; flex-direction: column; gap: .05rem; }

.header-institution {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .55;
}

.header-left .logo {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -.02em;
  text-transform: uppercase;
  line-height: 1.1;
  cursor: pointer;
}
.header-left .logo:hover { opacity: .82; }

.header-unit {
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .02em;
  margin-top: .1rem;
}

.header-scope {
  font-size: .7rem;
  letter-spacing: .08em;
  opacity: .7;
  text-transform: uppercase;
  margin-top: .05rem;
}

/* ── Header info-page links (injected by nav.js into every page header) ── */
.info-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.info-btn {
  background: none; border: 1px solid rgba(255,255,255,.3); border-radius: 4px;
  color: rgba(255,255,255,.8); font-size: .8rem; padding: .18rem .55rem;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.info-btn:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ── Shared site navigation ── */
.site-nav {
  background: rgba(0,0,0,.12);
  border-top: 1px solid rgba(255,255,255,.08);
  padding: .45rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: .1rem .3rem;
  align-items: center;
  justify-content: flex-start;
}

.site-nav a,
.site-nav button,
.project-info-menu summary {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: transparent;
  border: 1px solid transparent;
  color: #F0DFCE;
  font-size: .82rem;
  font-weight: 500;
  padding: .35rem .65rem;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, color .12s, border-color .12s;
}

.site-nav a:hover,
.site-nav button:hover,
.site-nav a:focus,
.site-nav button:focus,
.project-info-menu summary:hover,
.project-info-menu summary:focus {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.site-nav a.active,
.site-nav button.active {
  background: rgba(255,255,255,.18);
  border-color: rgba(167,243,208,.4);
  color: #fff;
  font-weight: 600;
}

.project-info-menu {
  position: relative;
  margin-left: auto;
}

.project-info-menu summary {
  list-style: none;
}

.project-info-menu summary::-webkit-details-marker {
  display: none;
}

.project-info-menu summary::after {
  content: "▾";
  font-size: .7rem;
  margin-left: .1rem;
}

.project-info-menu[open] summary {
  background: rgba(255,255,255,.18);
  border-color: rgba(167,243,208,.4);
  color: #fff;
}

.project-info-menu[open] summary::after {
  content: "▴";
}

.project-info-links {
  position: absolute;
  right: 0;
  top: calc(100% + .35rem);
  z-index: 50;
  min-width: 230px;
  padding: .35rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}

.site-nav .project-info-links a {
  display: flex;
  width: 100%;
  color: var(--ink);
  padding: .45rem .55rem;
}

.site-nav .project-info-links a:hover,
.site-nav .project-info-links a:focus {
  background: var(--surface);
  color: var(--ink-deep);
}

/* Mobile nav toggle is hidden on desktop */
.nav-toggle { display: none; }

/* ── Main content ── */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem;
}

main.doc-main {
  max-width: 760px;
  padding: 2rem 1.5rem 4rem;
}

main.wide-main {
  max-width: 1000px;
}

/* ── Typography ── */
h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 1.8rem 0 .6rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--border);
}
h2:first-of-type { margin-top: .5rem; }

h3 {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.1rem 0 .4rem;
}

p, ul, ol {
  font-size: .92rem;
  color: #374151;
  margin-bottom: .8rem;
}

ul, ol { margin-left: 1.3rem; }
li { margin-bottom: .4rem; }

strong { color: var(--text); }

.lede {
  font-size: 1rem;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 1.4rem;
  line-height: 1.6;
}

/* ── Common components ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  margin-bottom: 1.2rem;
}

.card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.badge {
  display: inline-block;
  background: #F0DFCE;
  color: #1B2A41;
  border: 1px solid #E3DED4;
  border-radius: 99px;
  padding: .1rem .55rem;
  font-size: .72rem;
  font-weight: 600;
  margin-right: .3rem;
}

.lcc-badge { background: #FAF8F4; color: #1B2A41; border-color: #E3DED4; }

.callout {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: .8rem 1rem;
  font-size: .87rem;
  margin: 1rem 0;
  color: #78350f;
}

.callout.error {
  background: #fef2f2;
  border-color: #fca5a5;
  border-left-color: var(--red);
  color: #7f1d1d;
}

.notice {
  background: #F0DFCE;
  border: 1px solid #E3DED4;
  border-radius: 6px;
  padding: .8rem 1rem;
  font-size: .85rem;
  margin: 1rem 0;
  color: #1B2A41;
}

/* ── Buttons ── */
.btn-primary {
  padding: .6rem 1.6rem;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: .9rem;
  transition: background .15s;
}
.btn-primary:hover { background: var(--ink-deep); }
.btn-primary:disabled { opacity: .5; cursor: default; }

.btn-peer {
  padding: .55rem 1.2rem;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: .8rem;
  transition: background .15s;
}
.btn-peer:hover { background: #fed7aa; }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--ink-deep);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* ── Forms ── */
label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .3rem; }

select, input[type="text"], input[type="email"], input[type="number"], input[type="file"] {
  width: 100%;
  padding: .55rem .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .9rem;
  font-family: inherit;
  background: #fff;
  transition: border-color .15s;
}

select:focus, input:focus { outline: none; border-color: var(--ink); }

textarea {
  width: 100%;
  padding: .6rem .8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .82rem;
  font-family: "Courier New", monospace;
  resize: vertical;
  min-height: 180px;
  background: #fff;
}
textarea:focus { outline: none; border-color: var(--ink); }

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
}

th {
  text-align: left;
  padding: .55rem .75rem;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: .78rem;
  white-space: nowrap;
}

td {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td { border: none; }
tr:hover td { background: var(--surface); }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 1.2rem 1.5rem 1.5rem;
  font-size: .76rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ── Trust layer nav (injected into footer by nav.js) ── */
.trust-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem .6rem;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}

.trust-nav a {
  color: var(--muted);
  font-size: .73rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color .12s;
}

.trust-nav a:hover { color: var(--ink); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #1a1f2e;
  color: #fff;
  padding: .55rem 1.1rem;
  border-radius: 8px;
  font-size: .83rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8px);
  transition: all .2s;
  pointer-events: none;
  max-width: 300px;
  z-index: 999;
}
.toast.show  { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--red); }

/* ── Empty state helper ── */
.empty { color: var(--muted); font-size: .87rem; padding: 1rem 0; }

/* ── Callout / info box ── */
.callout {
  background: #F0DFCE; border: 1px solid #E3DED4; border-radius: var(--radius);
  padding: .8rem 1rem; font-size: .85rem; color: #1B2A41; margin: 1rem 0;
  line-height: 1.55;
}

/* ── Lede paragraph ── */
.lede { font-size: 1rem; line-height: 1.6; color: var(--text); margin-bottom: 1.2rem; font-weight: 500; }

/* ── Doc pages: breathe more ── */
main.doc-main h2 { margin-top: 1.8rem; margin-bottom: .5rem; font-size: 1.05rem; color: var(--ink); }
main.doc-main h3 { margin-top: 1.2rem; margin-bottom: .35rem; font-size: .95rem; }
main.doc-main p  { margin-bottom: .75rem; line-height: 1.65; }
main.doc-main ul { margin: .4rem 0 .85rem 1.2rem; line-height: 1.65; }
main.doc-main ul li { margin-bottom: .35rem; }

/* ── Print ── */
@media print {
  .site-nav, footer, .toast { display: none !important; }
  header { background: #fff !important; color: var(--ink) !important; border-bottom: 2px solid var(--ink); }
  a { text-decoration: none; color: var(--text); }
}

/* ── Responsive / mobile ── */
@media (max-width: 760px) {
  header { padding: 1rem 1.25rem; flex-wrap: wrap; gap: .5rem; }
  .app-header { flex-wrap: wrap; gap: .5rem; }
  .site-nav { padding: .4rem 1.25rem; }
  .site-nav a, .site-nav button, .project-info-menu summary { font-size: .78rem; padding: .3rem .5rem; }
  main { padding: 1rem; }
  main.doc-main { padding: 1.25rem 1rem 3rem; }
  /* Trust layer wraps cleanly on mobile */
  .trust-nav { gap: .3rem .5rem; }
  .trust-nav a { font-size: .7rem; }
  /* Info buttons wrap into tighter grid on mobile */
  .info-nav { justify-content: flex-start; gap: .3rem; }
  .info-btn  { font-size: .68rem; padding: .15rem .4rem; }
}

@media (max-width: 540px) {
  .site-nav { padding: .35rem .75rem; gap: .15rem; }
  .site-nav a, .site-nav button, .project-info-menu summary { flex: 1 0 auto; justify-content: center; padding: .35rem .45rem; }
  .project-info-menu { width: 100%; margin-left: 0; }
  .project-info-links { left: 0; right: auto; width: 100%; }
  /* Header stacks on very small screens */
  header { flex-direction: column; align-items: flex-start; }
  .info-nav { justify-content: flex-start; max-width: 100%; }
}
