/* Teaching Starts At Home – Colorful styles */

:root {
  --color-bg: #f0f4f8;
  --color-paper: #ffffff;
  --color-text: #1a1a2e;
  --color-muted: #4a5568;
  --color-accent: #2563eb;
  --color-accent-light: #3b82f6;
  --color-green: #059669;
  --color-amber: #d97706;
  --color-rose: #be185d;
  --color-teal: #0d9488;
  --color-violet: #7c3aed;
  --color-border: #e2e8f0;
  --font-heading: 'Literata', Georgia, serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;
  --space: 1.25rem;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--color-text);
  background: linear-gradient(160deg, #f0f4f8 0%, #e8f0fa 40%, #f5f0f8 100%);
  min-height: 100vh;
}

.container {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 var(--space);
}

/* Header */
header {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #be185d 100%);
  border-bottom: 3px solid rgba(255, 255, 255, 0.2);
  padding: var(--space) 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space);
}

header h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.tagline {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

header nav a {
  color: #fff;
  border-bottom: 2px solid transparent;
}

header nav a:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

header nav a.active {
  color: #fff;
  border-bottom-color: #fff;
  text-decoration: none;
}

nav {
  margin-left: auto;
}

nav a {
  margin-left: var(--space);
  text-decoration: none;
  font-weight: 600;
}

/* Hero */
.hero {
  padding: 2rem 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(124, 58, 237, 0.08) 50%, rgba(5, 150, 105, 0.1) 100%);
  border-left: 4px solid var(--color-accent);
  margin-left: var(--space);
  margin-right: var(--space);
  padding-left: var(--space);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.hero h2 {
  margin: 0 0 0.5em;
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--color-text);
  background: linear-gradient(135deg, #1e40af, #6d28d9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  margin: 0;
  color: var(--color-muted);
  font-size: 1.1rem;
}

/* Content */
.content {
  padding: 2rem 0;
}

.content h2 {
  margin: 1.5em 0 0.5em;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-text);
  padding-bottom: 0.25em;
  border-bottom: 3px solid;
  border-image: linear-gradient(90deg, var(--color-accent), var(--color-violet)) 1;
}

.content h2:first-child {
  margin-top: 0;
}

.content p {
  margin: 0 0 1em;
  color: var(--color-text);
}

.content a {
  color: var(--color-accent);
  text-decoration: none;
}

.content a:hover {
  text-decoration: underline;
}

.benefits {
  margin: 0 0 1.5em;
  padding-left: 1.5em;
  list-style: none;
  padding-left: 0;
}

.benefits li {
  margin-bottom: 0.75em;
  padding: 0.5em 0 0.5em 2.25em;
  position: relative;
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.08) 0%, transparent 100%);
}

.benefits li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), var(--color-teal));
}

.benefits li:nth-child(2)::before { background: linear-gradient(135deg, var(--color-green), #10b981); }
.benefits li:nth-child(3)::before { background: linear-gradient(135deg, var(--color-amber), #f59e0b); }
.benefits li:nth-child(4)::before { background: linear-gradient(135deg, var(--color-rose), #ec4899); }
.benefits li:nth-child(5)::before { background: linear-gradient(135deg, var(--color-violet), #a78bfa); }

.cta {
  margin-top: 2em !important;
}

.button {
  display: inline-block;
  padding: 0.65em 1.4em;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-violet) 100%);
  color: #fff !important;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  text-decoration: none;
}

/* Curriculum page */
.curriculum .intro {
  margin-bottom: 2em;
  font-size: 1rem;
  color: var(--color-muted);
}

.grade-band {
  margin-bottom: 2.5em;
  padding: 1.5em;
  background: var(--color-paper);
  border: 2px solid transparent;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Rotating colors for 13 grades: green, amber, blue, violet */
.grade-band:nth-child(4n+2) {
  border-left: 4px solid #059669;
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.08) 0%, var(--color-paper) 30%);
}

.grade-band:nth-child(4n+3) {
  border-left: 4px solid #d97706;
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.08) 0%, var(--color-paper) 30%);
}

.grade-band:nth-child(4n+4) {
  border-left: 4px solid #2563eb;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, var(--color-paper) 30%);
}

.grade-band:nth-child(4n+5) {
  border-left: 4px solid #7c3aed;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, var(--color-paper) 30%);
}

.grade-band h3 {
  margin: 0 0 1em;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
}

.grade-band:nth-child(4n+2) h3 { color: #047857; }
.grade-band:nth-child(4n+3) h3 { color: #b45309; }
.grade-band:nth-child(4n+4) h3 { color: #1d4ed8; }
.grade-band:nth-child(4n+5) h3 { color: #6d28d9; }

.grade-band .subjects {
  margin: 0;
  padding-left: 1.25em;
}

.grade-band .subjects li {
  margin-bottom: 1em;
}

.grade-band .subjects .goals {
  margin: 0.35em 0 0 1em;
  padding-left: 1em;
  list-style: disc;
  font-size: 0.95em;
  color: var(--color-muted);
}

.grade-band .subjects .goals li {
  margin-bottom: 0.25em;
}

.curriculum .closing {
  margin-top: 2em;
  padding-top: 1.5em;
  border-top: 1px solid var(--color-border);
  font-size: 0.95rem;
  color: var(--color-muted);
}

/* Scope & Sequence page */
.container-wide {
  max-width: 56rem;
}

.scope-sequence .intro {
  margin-bottom: 2em;
  font-size: 1rem;
  color: var(--color-muted);
}

.seq-block {
  margin-bottom: 2.5em;
}

.seq-block h3 {
  margin: 0 0 0.75em;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-accent);
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-paper);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.seq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.seq-table th,
.seq-table td {
  padding: 0.6em 1em;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.seq-table thead th {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(124, 58, 237, 0.06) 100%);
  font-weight: 600;
  color: var(--color-text);
}

.seq-table th:first-child,
.seq-table td:first-child {
  width: 4.5em;
  font-weight: 600;
  color: var(--color-muted);
}

.seq-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

.scope-sequence .closing {
  margin-top: 2em;
  padding-top: 1.5em;
  border-top: 1px solid var(--color-border);
  font-size: 0.95rem;
  color: var(--color-muted);
}

/* Footer */
footer {
  margin-top: 3rem;
  padding: var(--space) 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(124, 58, 237, 0.06) 100%);
  border-top: 2px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-muted);
}

footer p {
  margin: 0;
}

/* Worksheets */
.worksheet-index { margin-top: 1em; }
.worksheet-index h3 { margin: 1.25em 0 0.5em; font-family: var(--font-heading); font-size: 1.2rem; color: var(--color-accent); }
.worksheet-index h3:first-child { margin-top: 0; }
.worksheet-index .worksheet-links { list-style: none; padding: 0; margin: 0 0 1em; display: flex; flex-wrap: wrap; gap: 0.5em 1.5em; }
.worksheet-index .worksheet-links a { color: var(--color-accent); font-weight: 600; text-decoration: none; }
.worksheet-index .worksheet-links a:hover { text-decoration: underline; }

.worksheet-page .container { max-width: 45rem; }
.worksheet-page main { padding-bottom: 2rem; }
.worksheet-back { display: inline-block; margin-bottom: 1rem; color: var(--color-accent); font-weight: 600; text-decoration: none; }
.worksheet-back:hover { text-decoration: underline; }
.worksheet-title { font-family: var(--font-heading); font-size: 1.5rem; margin: 0 0 0.5em; color: var(--color-text); }
.worksheet-subtitle { font-size: 1rem; color: var(--color-muted); margin: 0 0 1.25em; }
.worksheet-goals { background: rgba(37, 99, 235, 0.08); border-left: 4px solid var(--color-accent); padding: 0.75em 1em; margin-bottom: 1.5em; border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.95rem; }
.worksheet-goals strong { display: block; margin-bottom: 0.25em; }
.worksheet-goals ul { margin: 0; padding-left: 1.25em; }
.worksheet-activity { margin-bottom: 1.5em; padding-bottom: 1.5em; border-bottom: 1px dashed var(--color-border); }
.worksheet-activity:last-of-type { border-bottom: none; }
.worksheet-activity strong { display: block; margin-bottom: 0.35em; font-size: 1rem; }
.worksheet-lines { min-height: 2.5em; border-bottom: 1px solid var(--color-border); margin-top: 0.5em; }
.worksheet-lines.lines-2 { min-height: 5em; }
.worksheet-lines.lines-3 { min-height: 7.5em; }
.worksheet-lines.lines-4 { min-height: 10em; }

/* Interactive worksheet: textareas and toolbar */
textarea.worksheet-lines {
  display: block;
  width: 100%;
  min-height: 2.5em;
  padding: 0.5em 0.6em;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  resize: vertical;
  box-sizing: border-box;
}
textarea.worksheet-lines:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
textarea.worksheet-lines::placeholder {
  color: var(--color-muted);
  opacity: 0.8;
}
.worksheet-toolbar {
  margin: 1rem 0 1.25rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.worksheet-btn {
  padding: 0.5em 1em;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-paper);
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}
.worksheet-btn:hover {
  background: var(--color-accent-light);
}
.worksheet-btn-clear {
  background: var(--color-muted);
}
.worksheet-btn-clear:hover {
  background: var(--color-text);
}
.worksheet-btn-print {
  background: var(--color-green);
}
.worksheet-btn-print:hover {
  background: var(--color-teal);
}

@media print {
  .worksheet-page header, .worksheet-page footer, .worksheet-page .worksheet-back, .worksheet-page nav { display: none !important; }
  .worksheet-page .worksheet-toolbar { display: none !important; }
  .worksheet-page body { background: #fff; }
  .worksheet-activity { break-inside: avoid; }
  textarea.worksheet-lines { border: 1px solid #ccc; background: #fff; }
}

/* 185 Daily Lessons */
.lessons-index { margin-top: 1em; }
.lessons-index h3 { margin: 1.25em 0 0.5em; font-family: var(--font-heading); font-size: 1.2rem; color: var(--color-accent); }
.lessons-index h3:first-child { margin-top: 0; }
.lessons-index .lesson-links { list-style: none; padding: 0; margin: 0 0 1em; display: flex; flex-wrap: wrap; gap: 0.5em 1.5em; }
.lessons-index .lesson-links a { color: var(--color-accent); font-weight: 600; text-decoration: none; }
.lessons-index .lesson-links a:hover { text-decoration: underline; }

.lessons-view .intro { margin-bottom: 1em; color: var(--color-muted); }
.lessons-view .lessons-title { font-family: var(--font-heading); font-size: 1.5rem; margin: 0 0 0.25em; color: var(--color-text); }
.lessons-view .lessons-meta { font-size: 0.95rem; color: var(--color-muted); margin: 0 0 1.25em; }
.lessons-view .lessons-table td:first-child { width: 4em; font-weight: 600; color: var(--color-muted); }
.lessons-view .lessons-table th:nth-child(3),
.lessons-view .lessons-table td:nth-child(3) { max-width: 22em; }
.lessons-view .lessons-table td:nth-child(4) { white-space: nowrap; }
.lessons-view .lessons-table td:nth-child(4) a { color: var(--color-accent); font-weight: 600; }
.lessons-view .table-wrap { max-height: 70vh; overflow-y: auto; }

.lessons-worksheet-banner { background: rgba(37, 99, 235, 0.08); border-left: 4px solid var(--color-accent); padding: 0.75em 1em; margin-bottom: 1.5em; border-radius: 0 var(--radius) var(--radius) 0; }
.lessons-worksheet-banner .button-small { display: inline-block; padding: 0.4em 0.9em; font-size: 0.95rem; margin-top: 0.25em; }
.unit-overview-heading { font-family: var(--font-heading); font-size: 1.15rem; margin: 1.25em 0 0.5em; color: var(--color-text); }
.unit-overview-heading:first-of-type { margin-top: 0; }
.unit-overview-block { margin-bottom: 1.25em; padding: 1em; background: var(--color-paper); border: 1px solid var(--color-border); border-radius: var(--radius); }
.unit-overview-name { margin: 0 0 0.35em; font-size: 1.05rem; color: var(--color-accent); }
.unit-days { font-weight: 400; color: var(--color-muted); font-size: 0.9em; }
.unit-overview-goal { margin: 0 0 0.5em; font-size: 0.95rem; }
.unit-overview-detail { margin: 0; font-size: 0.95rem; color: var(--color-text); }
