:root {
  --fg: #1a1a1a;
  --bg: #fdfdfb;
  --muted: #666;
  --accent: #2c5cc5;
  --max-width: 700px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
}

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

.site-header, main, .site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid #e5e5e0;
}

.site-title {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--fg);
}

.site-header nav a {
  margin-left: 1.25rem;
  color: var(--fg);
}

.hero { padding: 2rem 0 1rem; }
.hero h1 { margin-bottom: 0.25rem; }
.tagline { color: var(--muted); font-size: 1.1rem; }

.mission blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 0 0.5rem 1.25rem;
  border-left: 3px solid var(--accent);
  color: #333;
}

.video-link-button {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.9rem 1.6rem;
  background: var(--accent);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
}

.video-link-button:hover {
  opacity: 0.9;
}

.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid #eee;
}

.post-date { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

.post h1 { margin-bottom: 0.25rem; }
.post .post-date { display: block; margin-bottom: 1.5rem; }

.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}

.lesson-list {
  padding-left: 1.25rem;
}

.lesson-list li {
  padding: 0.4rem 0;
}

.category-list {
  list-style: none;
  padding: 0;
}

.category-card {
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
}

.category-header-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 0.6rem;
}

.category-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.category-desc {
  margin: 0.3rem 0;
  color: #333;
}

.category-count {
  color: var(--muted);
  font-size: 0.85rem;
}

.category-coming-soon {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #a15c00;
  background: #fff3d6;
  border: 1px solid #f0d38a;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
}

.category-breadcrumb {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.category-intro {
  color: #333;
  margin-bottom: 1.5rem;
}

.lesson h1 { margin-bottom: 1.5rem; }

.lesson-body img,
.post-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto 0.5rem;
  border: 1px solid #e5e5e0;
  border-radius: 6px;
}

.lesson-body p:has(> img),
.post-body p:has(> img) {
  margin-bottom: 0.4rem;
}

.lesson-body p:has(> img) + p em {
  display: block;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: -0.4rem;
  margin-bottom: 1.5rem;
}

.next-lesson {
  display: inline-block;
  margin-top: 2.5rem;
  padding: 0.6rem 1.1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
}

.next-lesson:hover {
  text-decoration: none;
  opacity: 0.9;
}

.practice-solutions {
  margin-top: 2rem;
}

.solutions-button {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  background: #fff;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 6px;
  font-weight: 600;
}

.solutions-button:hover {
  text-decoration: none;
  background: var(--accent);
  color: #fff;
}

.further-reading {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e5e0;
}

.further-reading h2 {
  font-size: 1.1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.further-reading ul {
  padding-left: 1.25rem;
}

.further-reading li {
  padding: 0.25rem 0;
}

.reading-kind {
  color: var(--muted);
  font-size: 0.85rem;
}

.unit-reading-list {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e5e0;
}

.unit-reading-list h2 {
  font-size: 1.1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.unit-reading-list ul {
  list-style: none;
  padding-left: 0;
}

.unit-reading-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid #f0f0eb;
}

.unit-reading-list li:last-child {
  border-bottom: none;
}

.unit-reading-list li a {
  font-weight: 600;
}

.unit-reading-list .reading-desc {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid #e5e5e0;
  margin-top: 2rem;
}

pre {
  padding: 1rem;
  overflow-x: auto;
  border-radius: 6px;
}

.giallo-l {
  display: inline-block;
  min-height: 1lh;
  width: 100%;
}
.giallo-ln {
  display: inline-block;
  user-select: none;
  margin-right: 0.4em;
  padding: 0.4em;
  min-width: 3ch;
  text-align: right;
  opacity: 0.8;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th, td {
  border: 1px solid #ddd;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.handout-page { max-width: 760px; }

.handout-back {
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.handout-actions {
  margin: 0 0 1.5rem;
}

.handout-actions button {
  font-size: 0.95rem;
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.handout-actions button:hover { opacity: 0.9; }

.handout-body h2 { margin-top: 2rem; }
.handout-body h3 { margin-top: 1.5rem; }
.handout-body p { margin: 0.9rem 0; }

@media print {
  .site-header, .site-footer, .handout-back, .no-print, .next-lesson, .practice-solutions { display: none !important; }
  body { background: #fff; }
  main { max-width: 100%; padding: 0; }
  a { color: inherit; text-decoration: none; }
}

/* Unit review links (test review / video review) shown as the last item under a unit's topics */
.unit-review-list {
  list-style: none;
  padding: 0;
  margin-top: 0.75rem;
  border-top: 1px solid rgba(128,128,128,0.35);
}

.unit-review-list li {
  padding: 0.5rem 0 0;
}
