/* Gradebot Trust Center theme.
   Tokens mirror ../gradebotFrontend (Scholar's Teal palette).
   No inline styles anywhere (CSP: style-src 'self' + Google Fonts). */

:root {
  --teal: #008f85;
  --teal-dark: #005c56;
  --teal-light: #e8f5f4;
  --teal-lighter: #f2fafa;
  --bg: #ffffff;
  --bg-warm: #fafaf8;
  --bg-soft: #f4f5f3;
  --text: #1f1f1f;
  --text-muted: #5b6360;
  --divider: #e5e7eb;
  --success: #2e7d32;
  --warning: #c77700;
  --error: #c62828;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.07);
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Open Sans", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Sticky footer: main grows to fill so the footer sits at the viewport bottom
   even on short pages. */
main { flex: 1 0 auto; }

/* Visible keyboard focus + skip link (WCAG 2.4.7 / 2.4.1). */
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 3px; }
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 100;
  background: var(--teal-dark); color: #fff; padding: 8px 14px;
  border-radius: var(--radius-sm); transition: top 0.15s ease;
}
.skip-link:focus { top: 8px; text-decoration: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: "Merriweather", "Playfair Display", Georgia, serif;
  color: var(--teal-dark);
  line-height: 1.25;
  margin: 0 0 0.5em;
}

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

code, pre, .mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.92em;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--divider);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 34px; width: auto; display: block; }
.brand .brand-text { font-family: "Merriweather", serif; font-weight: 700; color: var(--teal-dark); font-size: 1.1rem; }
.brand .brand-sub { color: var(--text-muted); font-weight: 400; font-size: 0.85rem; font-family: "Open Sans", sans-serif; }
.nav a { color: var(--text-muted); font-size: 0.92rem; margin-left: 20px; }
.nav a:hover { color: var(--teal-dark); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--teal-lighter) 0%, #ffffff 100%);
  border-bottom: 1px solid var(--divider);
  padding: 56px 0 48px;
}
.hero h1 { font-size: 2.3rem; margin-bottom: 12px; }
.hero p.lede { font-size: 1.15rem; color: var(--text-muted); max-width: 720px; margin: 0 0 24px; }
.hero .meta { display: flex; gap: 24px; flex-wrap: wrap; color: var(--text-muted); font-size: 0.9rem; }
.hero .meta strong { color: var(--teal-dark); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--teal-dark); border-color: var(--divider); }
.btn-secondary:hover { background: var(--bg-soft); }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Sections ---------- */
section.band { padding: 44px 0; }
section.band.alt { background: var(--bg-warm); border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); }
.section-title { font-size: 1.5rem; margin-bottom: 6px; }
.section-sub { color: var(--text-muted); margin: 0 0 24px; }

/* ---------- Trust badges ---------- */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.badge {
  background: #fff;
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.badge .badge-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--teal-light); color: var(--teal-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; margin-bottom: 12px; font-size: 1.05rem;
}
.badge h3 { font-size: 1.02rem; margin-bottom: 4px; color: var(--text); font-family: "Open Sans", sans-serif; font-weight: 700; }
.badge p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Document library ---------- */
.band-head { max-width: 680px; margin-bottom: 28px; }
.framework-group { margin-bottom: 32px; }
.framework-group:last-child { margin-bottom: 0; }
.framework-label {
  display: inline-block;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--teal-dark); font-weight: 700; font-family: "IBM Plex Mono", monospace;
  margin-bottom: 14px;
}

.doc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

/* Refined document card: quiet by default, decisive on hover. */
.doc-card {
  display: flex; flex-direction: column; gap: 10px;
  background: #fff;
  border: 1px solid var(--divider);
  border-radius: 14px;
  padding: 22px 22px 18px;
  transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.doc-card:hover {
  border-color: rgba(0, 143, 133, 0.55);
  box-shadow: 0 16px 32px -20px rgba(0, 92, 86, 0.45);
  transform: translateY(-3px);
}
.doc-card__eyebrow {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--teal); font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.doc-card h3 {
  margin: 0; font-size: 1.12rem; line-height: 1.3;
  font-family: "Merriweather", Georgia, serif; color: var(--text);
}
.doc-card__summary {
  margin: 0; flex: 1; color: var(--text-muted); font-size: 0.92rem; line-height: 1.55;
}
.doc-card__foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--divider);
}
.doc-meta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.7rem; letter-spacing: 0.06em; color: var(--text-muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.doc-meta svg { width: 13px; height: 13px; }
.doc-action {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.9rem; font-weight: 600; color: var(--teal-dark);
}
.doc-action svg { width: 16px; height: 16px; transition: transform 0.15s ease; }
.doc-action:hover { color: var(--teal); text-decoration: none; }
.doc-action:hover svg { transform: translateX(2px); }

/* Gated teaser: same shape, subtly tinted + a downward nudge on hover. */
.doc-card--locked { background: linear-gradient(180deg, #fff 0%, var(--bg-soft) 100%); }
.doc-card--locked .doc-action:hover svg { transform: translateY(2px); }

/* ---------- Document view ---------- */
.doc-view { padding: 40px 0 60px; }
.doc-view .doc-body { max-width: 760px; }
.doc-view .doc-body h1 { font-size: 1.9rem; }
.doc-view .doc-body h2 { font-size: 1.4rem; margin-top: 1.4em; }
.doc-view .doc-body h3 { font-size: 1.15rem; margin-top: 1.2em; }
.doc-view .doc-body p, .doc-view .doc-body li { color: var(--text); }
.doc-view .doc-body table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 0.92rem; }
.doc-view .doc-body th, .doc-view .doc-body td { border: 1px solid var(--divider); padding: 8px 10px; text-align: left; }
.doc-view .doc-body th { background: var(--bg-soft); }
.doc-view .doc-body pre { background: var(--bg-soft); padding: 14px; border-radius: var(--radius-sm); overflow-x: auto; }
.doc-view .doc-body blockquote { border-left: 3px solid var(--teal); margin: 1em 0; padding: 4px 16px; color: var(--text-muted); }
.breadcrumb { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }

/* ---------- Forms ---------- */
.form-card {
  max-width: 520px; margin: 0 auto; background: #fff; border: 1px solid var(--divider);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.field input[type="text"], .field input[type="email"], .field input[type="search"],
.field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--divider);
  border-radius: var(--radius-sm); font-size: 0.95rem; font-family: inherit;
  background: #fff; color: var(--text);
}
.field textarea { font-family: "IBM Plex Mono", ui-monospace, monospace; resize: vertical; }
.field input[type="file"] { width: 100%; font-size: 0.92rem; padding: 8px 0; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal);
}
.field.check { display: flex; gap: 10px; align-items: flex-start; }
.field.check input { margin-top: 4px; }
.field.check label { font-weight: 400; color: var(--text-muted); }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.92rem; }
.notice-info { background: var(--teal-lighter); color: var(--teal-dark); border: 1px solid var(--teal-light); }
.notice-success { background: #e6f4ea; color: var(--success); border: 1px solid #cce8d4; }
.notice-error { background: #fdecea; color: var(--error); border: 1px solid #f6c9c5; }
.nda-text {
  max-height: 200px; overflow-y: auto; background: var(--bg-soft);
  border: 1px solid var(--divider); border-radius: var(--radius-sm);
  padding: 14px; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px;
}

/* ---------- Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 68px); }
.admin-nav { background: var(--bg-soft); border-right: 1px solid var(--divider); padding: 24px 16px; }
.admin-nav a { display: block; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 0.92rem; }
.admin-nav a:hover, .admin-nav a.active { background: var(--teal-light); color: var(--teal-dark); text-decoration: none; }
.admin-main { padding: 28px 32px; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th, table.data td { border-bottom: 1px solid var(--divider); padding: 10px 12px; text-align: left; }
table.data th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.status-pill { font-size: 0.74rem; font-weight: 700; padding: 2px 8px; border-radius: 12px; }
.status-published { background: #e6f4ea; color: var(--success); }
.status-draft { background: var(--bg-soft); color: var(--text-muted); }
.status-retired { background: #fdecea; color: var(--error); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--divider); background: var(--bg-warm); padding: 32px 0; color: var(--text-muted); font-size: 0.88rem; }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.site-footer a { color: var(--teal-dark); }

/* ---------- Utilities (kept here so templates carry no inline styles) ---------- */
.mt-3 { margin-top: 20px; }
.mt-2 { margin-top: 12px; }
.mb-2 { margin-bottom: 12px; }
.muted { color: var(--text-muted); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: inline; }

@media (max-width: 720px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { border-right: none; border-bottom: 1px solid var(--divider); }
  .hero h1 { font-size: 1.8rem; }
}
