/* =========================================================
   Learning Hub — Shared Stylesheet
   Editorial / heritage theme. Earthy palette, serif display.
   Edit colours and type once here; every page picks it up.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
  /* Heritage earthy palette */
  --paper:   #ede5d8;   /* warm cream / parchment background */
  --paper-2: #e3d9c6;   /* slightly deeper for panels */
  --ink:     #1f1d18;   /* deep near-black */
  --ink-2:   #4a4137;   /* warm brown body text */
  --muted:   #8a8276;   /* stone grey */
  --line:    #cdc2ac;   /* hairline rules */
  --line-2:  #b8ac92;   /* stronger rules */

  /* Accent — rust default. Year hubs override. */
  --accent:    #b85a32;   /* rust / terracotta */
  --accent-2:  #d97a3d;   /* ochre */
  --accent-ink:#ffffff;   /* text on accent fills */

  --radius: 6px;          /* very subtle corners */
  --radius-pill: 999px;
  --max-w: 1180px;

  --serif: 'DM Serif Display', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --body:  'EB Garamond', Georgia, 'Times New Roman', serif;
}

/* Per-year accent overrides — applied via <body data-year="7"> */
body[data-year="7"]  { --accent:#481a07; --accent-2:#73492f; } /* rust    */
body[data-year="8"]  { --accent:#6b7d6f; --accent-2:#8a9d88; } /* sage    */
body[data-year="9"]  { --accent:#d97a3d; --accent-2:#b85a32; } /* ochre   */
body[data-year="10"] { --accent:#3a4a3d; --accent-2:#6b7d6f; } /* forest  */
body[data-year="11"] { --accent:#734a81; --accent-2:#432850; } /* Violet  */
body[data-year="12"] { --accent:#757575; --accent-2:#4a4137; } /* charcoal*/

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  background:
    radial-gradient(1200px 700px at 20% -10%, rgba(184,90,50,0.05), transparent 60%),
    radial-gradient(900px 600px at 110% 110%, rgba(107,125,111,0.06), transparent 60%),
    var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.005em; }
em, .italic { font-style: italic; font-family: var(--serif); }

/* Decorative double rule used across the masthead */
.masthead-rule {
  border: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  height: 4px;
  margin: 0;
}

/* ---------- Login ---------- */
.login-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--paper);
  padding: 44px 40px 36px;
  border: 1px solid var(--line-2);
  position: relative;
}
.login-card::before {
  content: ''; position: absolute; left: 24px; right: 24px; top: 16px;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  height: 4px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 46px; height: 46px; border: 1.5px solid var(--ink);
  border-radius: 50%;
  display: grid; place-items: center; color: var(--ink);
  font-family: var(--serif); font-size: 22px; line-height: 1;
}
.brand-name {
  font-family: var(--serif); font-size: 22px; line-height: 1.1;
  letter-spacing: 0.02em;
}
.brand-sub {
  font-size: 12px; color: var(--muted); margin-top: 4px;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.login-title {
  font-size: 38px; margin: 28px 0 16px;
  letter-spacing: -0.01em; line-height: 1.15;
}
.login-sub { font-size: 16px; color: var(--ink-2); margin: 0 0 24px; line-height: 1.5; }
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 11px; font-weight: 500; color: var(--ink);
  margin-bottom: 6px; letter-spacing: 0.2em; text-transform: uppercase;
  font-family: var(--body);
}
.field input {
  width: 100%; padding: 11px 0;
  border: 0; border-bottom: 1px solid var(--ink);
  background: transparent; color: var(--ink); font-size: 17px;
  font-family: var(--body);
  outline: none; transition: border-color .15s;
}
.field input:focus { border-color: var(--accent); }
.field input::placeholder { color: var(--muted); font-style: italic; }

.submit {
  margin-top: 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 28px; border: 1.5px solid var(--ink);
  background: var(--ink); color: var(--paper);
  font-family: var(--body); font-weight: 500; font-size: 14px;
  letter-spacing: 0.2em; text-transform: uppercase;
  border-radius: var(--radius-pill);
  transition: background .15s, color .15s;
  width: 100%;
}
.submit:hover { background: var(--accent); border-color: var(--accent); color: white; }
.login-error {
  font-size: 14px; color: #8c2a1a; margin-top: 10px; min-height: 20px;
  font-style: italic;
}
.hint {
  margin-top: 22px; padding-top: 16px;
  border-top: 1px dashed var(--line-2);
  font-size: 13px; color: var(--ink-2); line-height: 1.6;
}
.hint b {
  display: block; color: var(--ink); font-weight: 500; margin-bottom: 4px;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  font-family: var(--body);
}
.hint code {
  background: var(--paper-2); padding: 1px 7px;
  font-family: 'Courier New', monospace; font-size: 12px;
  border: 1px solid var(--line);
}

/* ---------- Top nav (masthead) ---------- */
.nav {
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  position: sticky; top: 0; z-index: 5;
}
.nav::after {
  content: ''; display: block; height: 1px;
  background: var(--ink); margin-top: 2px;
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
}
.nav-right { display: flex; align-items: center; gap: 4px; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 0;
  background: transparent; color: var(--ink-2);
  font-family: var(--body); font-size: 15px;
  font-style: italic;
}
.nav-btn:hover { color: var(--accent); text-decoration: none; }
.nav-btn.active { color: var(--ink); font-style: italic; }
.nav-btn.active::after {
  content: ''; display: inline-block; width: 6px; height: 6px;
  background: var(--accent); border-radius: 50%; margin-left: 6px;
}
.logout {
  margin-left: 10px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px;
  border: 1px solid var(--ink); border-radius: var(--radius-pill);
  background: transparent; color: var(--ink);
  font-family: var(--body); font-size: 12px;
  letter-spacing: 0.2em; text-transform: uppercase;
}
.logout:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

/* ---------- Page shell ---------- */
.page { max-width: var(--max-w); margin: 0 auto; padding: 36px 28px 80px; }

.crumbs {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted); margin-bottom: 24px;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: var(--accent); text-decoration: none; }
.crumbs .sep { opacity: 0.6; }

/* ---------- Hero (editorial style) ---------- */
.hero {
  padding: 56px 0 48px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  position: relative;
  text-align: left;
}
.hero::before {
  content: ''; position: absolute; left: 0; right: 0; top: -5px;
  border-top: 1px solid var(--ink); height: 1px;
}
.hero h1 {
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.98;
  margin: 0 0 18px;
  letter-spacing: -0.015em;
}
.hero h1 .italic { font-style: italic; color: var(--accent); }
.hero p {
  margin: 0; font-size: 19px; line-height: 1.55;
  max-width: 640px; color: var(--ink-2);
  font-style: italic;
}
.hero-meta {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 500; margin-bottom: 18px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink);
}
.hero-meta::before, .hero-meta::after {
  content: ''; display: inline-block;
  width: 28px; height: 1px; background: var(--ink);
}

/* Section eyebrow */
.eyebrow {
  display: flex; align-items: baseline; gap: 14px;
  margin: 44px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
}
.eyebrow .label {
  font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ink); font-weight: 500;
}
.eyebrow .count {
  font-family: var(--serif); font-style: italic; font-size: 16px;
  color: var(--muted);
}

/* ---------- Module / year grid ---------- */
.grid {
  display: grid; gap: 0; margin-top: 8px;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-2);
  border-left: 1px solid var(--line-2);
}
@media (max-width: 880px) {
  .grid { grid-template-columns: 1fr; }
  .nav-inner { padding: 14px 18px; }
  .page { padding: 24px 18px 56px; }
  .nav-btn span.label { display: none; }
}
.card {
  background: transparent;
  padding: 28px 26px 24px;
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 240px;
  transition: background .2s ease;
  position: relative;
}
.card:hover {
  background: var(--paper-2);
  text-decoration: none;
}
.card:hover h3 { color: var(--accent); }
.card .ico {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  color: var(--accent);
  border: 1px solid currentColor;
  border-radius: 50%;
}
.card .num {
  font-size: 11px; font-weight: 500; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--muted);
}
.card h3 {
  margin: 0; font-size: 28px; line-height: 1.05;
  letter-spacing: -0.01em;
  transition: color .2s;
}
.card p { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.5; }
.card .meta {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--muted);
  letter-spacing: 0.16em; text-transform: uppercase;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.card .meta .arrow {
  color: var(--accent); font-style: italic; font-family: var(--serif);
  font-size: 16px; letter-spacing: 0; text-transform: none;
  display: inline-flex; align-items: center; gap: 6px;
}

/* Year card variant — colored circle markers */
.year-card[data-year="7"]  .ico { color:#b85a32; }
.year-card[data-year="8"]  .ico { color:#6b7d6f; }
.year-card[data-year="9"]  .ico { color:#d97a3d; }
.year-card[data-year="10"] .ico { color:#3a4a3d; }
.year-card[data-year="11"] .ico { color:#2a2620; }

/* legacy swatch classes used inline — repurpose as accent tints */
.swatch-1, .swatch-2, .swatch-3, .swatch-4, .swatch-5, .swatch-6 {
  background: transparent; color: var(--accent);
  border: 1px solid currentColor; border-radius: 50%;
}

/* ---------- Bottom panels ---------- */
.footer-row {
  margin-top: 48px;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
@media (max-width: 880px) { .footer-row { grid-template-columns: 1fr; } }
.panel {
  padding: 26px 28px;
  border-right: 1px solid var(--line-2);
}
.panel:last-child { border-right: 0; }
.panel h4 {
  margin: 0 0 16px;
  font-family: var(--body);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.28em; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.update {
  display: flex; gap: 14px; padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.update:last-child { border-bottom: 0; }
.update .when {
  font-size: 11px; color: var(--muted); margin-bottom: 4px;
  letter-spacing: 0.2em; text-transform: uppercase;
}
.update .what {
  font-size: 17px; color: var(--ink); font-family: var(--serif);
  line-height: 1.3;
}
.tip {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0; font-size: 16px; color: var(--ink-2);
  font-style: italic; font-family: var(--serif);
  border-bottom: 1px dashed var(--line);
}
.tip:last-child { border-bottom: 0; }
.tip::before {
  content: '§'; flex: none; color: var(--accent);
  font-style: normal; font-family: var(--serif);
  font-size: 18px; line-height: 1;
}

.icon { width: 18px; height: 18px; }

/* ---------- Module detail page ---------- */
.module-hero {
  padding: 48px 0 40px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end;
}
.module-hero .num-pill {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 500; margin-bottom: 14px;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ink);
}
.module-hero .num-pill::before {
  content: ''; display: inline-block; width: 22px; height: 1px; background: var(--ink);
}
.module-hero h1 {
  font-size: clamp(44px, 6vw, 72px); margin: 0 0 14px;
  line-height: 1.0; letter-spacing: -0.015em;
}
.module-hero p {
  margin: 0; max-width: 600px; line-height: 1.55;
  color: var(--ink-2); font-style: italic; font-size: 18px;
}
.module-hero .progress {
  border: 1px solid var(--line-2);
  background: var(--paper-2);
  padding: 16px 18px;
  font-size: 13px; min-width: 220px;
}
.module-hero .progress .label {
  color: var(--muted); margin-bottom: 8px;
  letter-spacing: 0.2em; text-transform: uppercase; font-size: 10px;
}
.module-hero .progress .bar {
  height: 4px; background: var(--line); overflow: hidden;
}
.module-hero .progress .bar > span {
  display: block; height: 100%; background: var(--accent);
}
.module-hero .progress > div:last-child {
  margin-top: 10px; font-family: var(--serif); font-size: 16px;
}
@media (max-width: 720px) { .module-hero { grid-template-columns: 1fr; } }

/* tabs */
.tabs {
  display: flex; gap: 28px; margin: 36px 0 8px;
  border-bottom: 1px solid var(--ink);
}
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 0; background: transparent; border: 0;
  font-family: var(--body); font-size: 14px; color: var(--ink-2);
  font-style: italic;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  text-decoration: none;
}
.tab:hover { color: var(--accent); }
.tab.active {
  color: var(--ink); border-bottom-color: var(--accent);
  font-style: italic;
}
.tab-count {
  background: transparent; color: var(--muted);
  font-size: 11px; padding: 0 0 0 4px;
  font-style: normal; letter-spacing: 0.1em;
}

.tabpanel { display: none; padding-top: 18px; }
.tabpanel.active { display: block; }

/* item lists inside tabs */
.item-list { display: flex; flex-direction: column; gap: 0; }
.item {
  background: transparent;
  border-bottom: 1px solid var(--line-2);
  padding: 22px 4px;
  display: grid;
  grid-template-columns: 38px 1fr auto; gap: 22px; align-items: start;
  transition: background .2s;
}
.item:hover { background: var(--paper-2); }
.item .item-ico {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--accent); color: var(--accent);
  border-radius: 50%;
  margin-top: 4px;
}
.item h4 {
  margin: 0 0 4px;
  font-size: 22px; font-weight: 400;
  letter-spacing: -0.01em; line-height: 1.2;
}
.item .item-sub {
  font-size: 11px; color: var(--muted);
  letter-spacing: 0.2em; text-transform: uppercase;
}
.item .item-desc {
  font-size: 16px; color: var(--ink-2);
  margin-top: 8px; line-height: 1.55;
  font-style: italic; font-family: var(--serif);
}
.item .tags { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.item .tag {
  background: transparent; color: var(--ink-2);
  font-size: 11px; padding: 3px 10px;
  border: 1px solid var(--line-2); border-radius: var(--radius-pill);
  letter-spacing: 0.16em; text-transform: uppercase;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--ink); border-radius: var(--radius-pill);
  background: var(--ink); color: var(--paper);
  font-family: var(--body); font-size: 12px;
  letter-spacing: 0.2em; text-transform: uppercase;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: white; text-decoration: none; }
.btn.ghost {
  background: transparent; color: var(--ink); border-color: var(--ink);
}
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

.empty {
  background: var(--paper-2); border: 1px dashed var(--line-2);
  padding: 32px; text-align: center; color: var(--muted);
  font-family: var(--serif); font-style: italic; font-size: 18px;
}
.empty b {
  color: var(--ink); display: block; margin-bottom: 6px;
  font-weight: 400; font-style: normal;
  font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase;
  font-family: var(--body);
}
