/* ============================================================
 * Reference page styles · shared by /reference (marketing) and
 * the in-classroom Reference view.
 *
 * Aesthetic: kid-cafe playful — warm off-white, amber accents,
 * Plus Jakarta display + Inter body, soft spring motion.
 * ============================================================ */

.ref-page { background: var(--bg-base, #fdfaf2); }

/* Hero */
.ref-hero {
  position: relative;
  padding: 56px 0 28px;
  background: linear-gradient(180deg, #fff8e6 0%, #fef3c7 100%);
  border-bottom: 1px solid #f4e3b2;
}
.ref-hero__inner {
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
}
.ref-hero__copy { max-width: 720px; }
.ref-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fef3c7; color: #b45309; border: 1.5px solid #fde68a;
  border-radius: 999px; padding: 6px 14px;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 700; font-size: 13px; letter-spacing: 0.02em;
  margin-bottom: 14px;
}
.ref-hero h1 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 900;
  color: #0a0f2c; line-height: 1.05; letter-spacing: -0.025em; margin: 0 0 12px;
}
.ref-hero p.lede { font-size: 1.05rem; color: #1f2a5c; max-width: 600px; margin: 0 0 8px; }
.ref-hero__spark { display: flex; align-items: flex-end; justify-content: flex-end; }
@media (max-width: 720px) {
  .ref-hero__inner { grid-template-columns: 1fr; }
  .ref-hero__spark { justify-content: flex-start; }
}

/* Layout grid: content + sticky TOC */
.ref-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 48px;
  padding: 40px 0 80px;
  align-items: start;
}
@media (max-width: 980px) {
  .ref-shell { grid-template-columns: 1fr; gap: 20px; }
}

.ref-content { min-width: 0; max-width: 800px; }
.ref-content article {
  background: #fff; border: 1px solid #e8e2cf; border-radius: 18px;
  padding: 28px 32px; margin: 0 0 22px;
  box-shadow: 0 2px 4px rgba(10,15,44,0.04);
}
@media (max-width: 560px) {
  .ref-content article { padding: 22px 18px; border-radius: 14px; }
}
.ref-content h2 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.55rem; font-weight: 800; color: #0a0f2c;
  letter-spacing: -0.02em; margin: 0 0 8px; scroll-margin-top: 90px;
}
.ref-content h3 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.1rem; font-weight: 700; color: #b45309;
  margin: 18px 0 6px;
}
.ref-content p { font-size: 1rem; color: #34406b; line-height: 1.6; margin: 0 0 12px; }
.ref-content ul { padding-left: 22px; margin: 6px 0 14px; color: #34406b; }
.ref-content li { margin: 4px 0; line-height: 1.55; }

/* TOC (sticky right side) */
.ref-toc {
  position: sticky; top: 90px;
  background: #fffbeb; border: 1.5px solid #fde68a; border-radius: 14px;
  padding: 16px 18px;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
}
.ref-toc__title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: #b45309; margin: 0 0 8px; font-weight: 800;
}
.ref-toc ul { list-style: none; padding: 0; margin: 0; }
.ref-toc li { margin: 2px 0; }
.ref-toc a {
  display: block; padding: 6px 10px; border-radius: 8px;
  color: #1f2a5c; font-size: 14px; font-weight: 600;
  text-decoration: none;
  min-height: 32px; line-height: 20px;
}
.ref-toc a:hover { background: #fef3c7; color: #0a0f2c; }
.ref-toc a.is-active { background: #f59e0b; color: #1b1300; }
@media (max-width: 980px) {
  .ref-toc { position: static; }
}

/* Big-idea callout */
.ref-bigidea {
  background: linear-gradient(135deg, #fde68a, #fcd34d);
  border: 2px solid #f59e0b; border-radius: 14px;
  padding: 16px 20px; margin: 8px 0 18px;
  color: #1b1300;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 700; font-size: 1.05rem; line-height: 1.4;
}
.ref-bigidea::before { content: "💡 "; margin-right: 4px; }

/* Week section header with hue */
.ref-week {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--week-tint, #fef3c7);
  border: 1.5px solid var(--week-edge, #fde68a);
  color: var(--week-ink, #b45309);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 700; font-size: 13px; letter-spacing: 0.02em;
  margin: 0 0 10px;
}
article[data-week="1"] { --week-tint:#dbeafe; --week-edge:#93c5fd; --week-ink:#1e40af; }
article[data-week="2"] { --week-tint:#d1fae5; --week-edge:#6ee7b7; --week-ink:#047857; }
article[data-week="3"] { --week-tint:#fce7f3; --week-edge:#f9a8d4; --week-ink:#9d174d; }
article[data-week="4"] { --week-tint:#ede9fe; --week-edge:#c4b5fd; --week-ink:#5b21b6; }

/* Vocab pills */
.ref-vocab { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 8px; }
.ref-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1.5px solid #e8e2cf; color: #0a0f2c;
  border-radius: 999px; padding: 8px 14px;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 700; font-size: 13.5px;
  min-height: 36px;
  transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1), background 150ms ease;
}
.ref-pill:hover { background: #fef3c7; transform: translateY(-2px); }

/* Vocab list (word + meaning) */
.ref-defs { display: grid; gap: 8px; margin: 8px 0 4px; }
.ref-def {
  display: grid; grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 14px; padding: 10px 14px;
  border-radius: 12px; background: #fdfaf2; border: 1px solid #f0e8d2;
}
@media (max-width: 560px) {
  .ref-def { grid-template-columns: 1fr; gap: 2px; }
}
.ref-def__word {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 800; color: #0a0f2c; font-size: 14.5px;
}
.ref-def__meaning { font-size: 14.5px; color: #34406b; line-height: 1.5; }

/* Build-CTA card */
.ref-build {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 2px solid #6ee7b7; border-radius: 14px;
  padding: 18px 22px; margin: 14px 0;
}
.ref-build__label {
  display: inline-block; background: #059669; color: #fff;
  border-radius: 999px; padding: 4px 12px;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 700; font-size: 11.5px; letter-spacing: 0.06em;
  text-transform: uppercase; margin-bottom: 8px;
}
.ref-build__title {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 800; font-size: 1.1rem; color: #064e3b; margin: 0 0 6px;
}
.ref-build__body { color: #065f46; font-size: 15px; line-height: 1.5; margin: 0; }

/* Big rules cards */
.ref-rules {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px; margin: 10px 0;
}
.ref-rule {
  background: #fff; border: 1.5px solid #e8e2cf; border-radius: 14px;
  padding: 16px; display: flex; gap: 12px; align-items: flex-start;
}
.ref-rule__icon {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
  background: #fef3c7; display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.ref-rule__text {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 700; color: #0a0f2c; font-size: 14.5px; line-height: 1.4;
}

/* Framework diagrams */
.ref-framework { margin: 8px 0 14px; }
.ref-framework__title {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 800; color: #0a0f2c; font-size: 1.05rem; margin: 0 0 8px;
}
.ref-flow {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px; padding: 14px;
  background: #fdfaf2; border: 1.5px dashed #f4e3b2;
  border-radius: 12px;
}
.ref-flow__node {
  background: #fff; border: 1.5px solid #fde68a;
  border-radius: 10px; padding: 8px 14px;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 700; font-size: 13.5px; color: #0a0f2c;
  min-height: 36px; display: inline-flex; align-items: center;
}
.ref-flow__arrow { color: #d97706; font-weight: 800; font-size: 18px; }

/* Tables */
.ref-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 12px; overflow: hidden; font-size: 14.5px;
  border: 1px solid #e8e2cf; margin: 10px 0;
}
.ref-table th, .ref-table td {
  text-align: left; padding: 11px 14px; border-bottom: 1px solid #f0e8d2;
}
.ref-table th {
  background: #fef3c7; font-weight: 800; font-size: 12.5px;
  letter-spacing: 0.04em; text-transform: uppercase; color: #b45309;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
}
.ref-table tr:last-child td { border-bottom: 0; }
.ref-table td:first-child { font-weight: 600; color: #0a0f2c; }
.ref-table .yes { color: #b91c1c; font-weight: 700; }
.ref-table .no  { color: #047857; font-weight: 700; }
@media (max-width: 560px) {
  .ref-table th, .ref-table td { padding: 8px 10px; font-size: 13px; }
}

/* Closing celebration card */
.ref-closing {
  background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%);
  border: 2px solid #f59e0b; border-radius: 18px;
  padding: 28px 28px 22px; text-align: center;
  margin: 14px 0 0;
}
.ref-closing h2 { color: #1b1300; margin: 8px 0 10px; }
.ref-closing p { color: #1b1300; font-size: 1rem; font-weight: 600; }
.ref-closing ul {
  display: inline-block; text-align: left;
  margin: 8px auto 12px; color: #1b1300;
}

/* In-classroom view: drop hero padding, tighten shell */
.aikc-view--reference .ref-page { background: transparent; }
.aikc-view--reference .ref-hero {
  padding: 28px 24px 18px; border-radius: 16px;
  background: linear-gradient(180deg, #fff8e6 0%, #fef3c7 100%);
  border: 1.5px solid #f4e3b2;
  margin: 0 0 18px;
}
.aikc-view--reference .ref-shell {
  padding: 0; gap: 28px; grid-template-columns: minmax(0, 1fr) 220px;
}
.aikc-view--reference .ref-toc { top: 16px; }
@media (max-width: 980px) {
  .aikc-view--reference .ref-shell { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ref-pill, .ref-pill:hover { transition: none; transform: none; }
}

/* Print friendly */
@media print {
  .site-header, .site-footer, .ref-toc, .chat-widget, .help-widget,
  .nav-cta, .nav-toggle { display: none !important; }
  .ref-shell { grid-template-columns: 1fr; padding: 0; }
  .ref-content article { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  .ref-hero { background: #fff8e6 !important; padding: 24px 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ref-build, .ref-bigidea, .ref-rule, .ref-pill, .ref-closing, .ref-flow {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  a { color: #0a0f2c; }
}
