/* ============================================================
   Library / content styles — layered on top of styles.css
   ============================================================ */

/* --- shared bits --- */
.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}
.btn-secondary:hover { background: var(--gray-200); }

.nav-link-accent { color: var(--primary); font-weight: 600; }

/* --- article --- */
.article { max-width: 760px; }
.article-breadcrumb {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--gray-500); font-size: 0.9rem; font-weight: 500;
  margin-bottom: 1.25rem;
}
.article-breadcrumb:hover { color: var(--primary); }
.article-breadcrumb svg { width: 16px; height: 16px; }

.article-body { color: var(--gray-700); font-size: 1.02rem; }
.article-body h2 {
  font-size: 1.4rem; color: var(--gray-800);
  margin: 2rem 0 0.75rem; line-height: 1.3;
}
.article-body h3 { font-size: 1.12rem; color: var(--gray-800); margin: 1.5rem 0 0.5rem; }
.article-body p { margin: 0 0 1rem; }
.article-body ul, .article-body ol { margin: 0 0 1rem 1.25rem; }
.article-body li { margin-bottom: 0.4rem; }
.article-body strong { color: var(--gray-800); }
.article-body a { color: var(--primary); text-decoration: underline; }
.article-body hr { border: none; border-top: 1px solid var(--gray-200); margin: 2rem 0; }

.article-body blockquote {
  border-left: 4px solid var(--primary);
  background: var(--gray-100);
  padding: 1rem 1.25rem; margin: 1.5rem 0;
  border-radius: 0 8px 8px 0; color: var(--gray-700);
}
.article-body blockquote p:last-child { margin-bottom: 0; }

.article-body table {
  width: 100%; border-collapse: collapse; margin: 1.25rem 0;
  font-size: 0.95rem; display: block; overflow-x: auto;
}
.article-body th, .article-body td {
  border: 1px solid var(--gray-200); padding: 0.6rem 0.8rem; text-align: left;
}
.article-body th { background: var(--gray-100); font-weight: 600; color: var(--gray-700); }

.article-body code {
  background: var(--gray-100); padding: 0.1rem 0.35rem;
  border-radius: 4px; font-size: 0.9em;
}

/* --- mark complete --- */
.article-actions { margin: 2rem 0; }
.btn-progress {
  background: white; color: var(--gray-600);
  border: 1px solid var(--gray-300); width: auto;
}
.btn-progress:hover { border-color: var(--primary); color: var(--primary); }
.btn-progress.is-done {
  background: var(--success); color: white; border-color: var(--success);
}
.btn-progress svg { width: 18px; height: 18px; }

/* --- book CTA --- */
.book-cta {
  margin-top: 2.5rem; padding: 1.75rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius); color: white;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
}
.book-cta-text h3 { font-size: 1.2rem; margin-bottom: 0.35rem; }
.book-cta-text p { opacity: 0.92; font-size: 0.95rem; max-width: 46ch; }
.book-cta .book-cta-btn {
  background: white; color: var(--primary); width: auto; white-space: nowrap;
}
.book-cta .book-cta-btn:hover { background: var(--gray-100); }

/* --- progress bar --- */
.bundle-progress, .dash-progress {
  background: white; border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--shadow); margin-bottom: 2rem;
}
.bundle-progress-head {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; color: var(--gray-700); margin-bottom: 0.75rem;
  font-size: 0.95rem; gap: 1rem;
}
.bundle-progress-head svg { width: 16px; height: 16px; vertical-align: -3px; }
.progress-track {
  height: 10px; background: var(--gray-200);
  border-radius: 999px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 999px; transition: width 0.4s ease;
}
.dash-progress .course-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin-top: 0.9rem; color: var(--primary); font-weight: 600; font-size: 0.9rem;
}

.bundle-section-title {
  font-size: 1.25rem; color: var(--gray-700);
  margin: 2rem 0 1rem;
}

/* --- lesson cards --- */
.lesson-card { display: block; }
.lesson-card:hover { box-shadow: var(--shadow-lg); border-color: var(--primary); }
.lesson-meta { color: var(--gray-400); font-size: 0.85rem; }
.course-card-soon { opacity: 0.7; }
.badge-soon {
  background: var(--gray-200); color: var(--gray-600);
  font-size: 0.75rem; font-weight: 600;
  padding: 0.25rem 0.6rem; border-radius: 999px;
}

/* --- checklist --- */
.checklist { max-width: 760px; }
.checklist-phase {
  background: white; border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow); margin-bottom: 1.25rem;
}
.checklist-phase h2 {
  font-size: 1.05rem; color: var(--primary);
  margin-bottom: 0.9rem;
}
.check-item {
  display: flex; align-items: flex-start; gap: 0.7rem;
  padding: 0.5rem 0; cursor: pointer;
  border-top: 1px solid var(--gray-100);
}
.check-item:first-of-type { border-top: none; }
.check-item input { margin-top: 0.25rem; width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; }
.check-item input:checked + span { color: var(--gray-400); text-decoration: line-through; }

/* --- worksheet --- */
.worksheet { max-width: 760px; }
.worksheet-intro { color: var(--gray-600); margin-bottom: 1.25rem; }
.worksheet-table {
  width: 100%; border-collapse: collapse; margin-bottom: 1.25rem;
  background: white; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.worksheet-table th, .worksheet-table td {
  border: 1px solid var(--gray-200); padding: 0.5rem 0.7rem; text-align: left;
}
.worksheet-table th { background: var(--gray-100); font-size: 0.85rem; color: var(--gray-600); }
.worksheet-table input { width: 100%; border: none; padding: 0.35rem; font-size: 0.95rem; background: transparent; }
.worksheet-table input:focus { outline: 2px solid var(--primary); border-radius: 4px; }
.util-row-pct { font-weight: 600; color: var(--gray-600); }
.util-high { color: var(--danger) !important; }
.util-ok { color: var(--success) !important; }
.worksheet-total {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  background: white; border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem;
}
.worksheet-total-label { color: var(--gray-500); font-size: 0.85rem; display: block; }
.worksheet-total-value { font-size: 1.75rem; font-weight: 700; }
.worksheet-verdict { color: var(--gray-600); font-size: 0.9rem; max-width: 32ch; text-align: right; }

/* --- quiz --- */
.quiz { max-width: 760px; }
.quiz-q {
  background: white; border: 1px solid var(--gray-200);
  border-left: 4px solid var(--gray-200);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow); margin-bottom: 1rem;
}
.quiz-prompt { font-weight: 600; color: var(--gray-800); margin-bottom: 0.75rem; }
.quiz-q label { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0; cursor: pointer; }
.quiz-q.quiz-correct { border-left-color: var(--success); }
.quiz-q.quiz-wrong { border-left-color: var(--danger); }
.quiz-result {
  margin-top: 1rem; padding: 1rem 1.25rem; border-radius: var(--radius);
  font-weight: 600;
}
.quiz-result.quiz-pass { background: #dcfce7; color: #166534; }
.quiz-result.quiz-fail { background: #fee2e2; color: #991b1b; }

/* --- glossary --- */
.glossary-search {
  position: relative; max-width: 480px; margin-bottom: 1.5rem;
}
.glossary-search svg {
  position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--gray-400);
}
.glossary-search input {
  width: 100%; padding: 0.75rem 0.75rem 0.75rem 2.5rem;
  border: 1px solid var(--gray-300); border-radius: 8px; font-size: 1rem;
}
.glossary-search input:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.glossary { display: grid; gap: 0.75rem; }
.glossary-entry {
  background: white; border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow);
}
.glossary-entry dt { font-weight: 700; color: var(--gray-800); margin-bottom: 0.25rem; }
.glossary-entry dd { color: var(--gray-600); margin: 0; }
.glossary-count { color: var(--gray-400); font-size: 0.85rem; margin-top: 1rem; }

/* --- resources --- */
.resource-group { margin-bottom: 2.5rem; }
.resource-group h2 { font-size: 1.25rem; color: var(--gray-700); margin-bottom: 0.5rem; }
.resource-lead { color: var(--gray-600); margin-bottom: 1rem; max-width: 70ch; }
.resource-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem;
}
.resource-card {
  display: flex; gap: 0.9rem; align-items: flex-start;
  background: white; border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow);
  transition: all 0.2s;
}
.resource-card:hover { box-shadow: var(--shadow-lg); border-color: var(--primary); }
.resource-card svg { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.resource-card h3 { font-size: 1rem; color: var(--gray-800); margin-bottom: 0.2rem; }
.resource-card p { font-size: 0.9rem; color: var(--gray-500); }
.resource-note {
  display: flex; gap: 0.75rem; align-items: flex-start;
  background: var(--gray-100); border-radius: var(--radius); padding: 1rem 1.25rem;
  color: var(--gray-600); font-size: 0.9rem;
}
.resource-note svg { width: 20px; height: 20px; color: var(--gray-400); flex-shrink: 0; }
.resource-note a { color: var(--primary); text-decoration: underline; }

/* --- book page --- */
.book-hero {
  background: white; border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow);
  max-width: 720px;
}
.book-hero h2 { font-size: 1.4rem; color: var(--gray-800); margin-bottom: 0.75rem; }
.book-hero p { color: var(--gray-600); margin-bottom: 1rem; }
.book-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.book-list li { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0; color: var(--gray-700); }
.book-list svg { width: 18px; height: 18px; color: var(--success); flex-shrink: 0; }
.book-hero .book-cta-btn { width: auto; }
.book-note { font-size: 0.85rem; color: var(--gray-500); margin-top: 1rem; }
.book-note a { color: var(--primary); }

/* --- disclaimers --- */
.disclaimer-box {
  display: flex; gap: 0.85rem; align-items: flex-start;
  max-width: 720px; margin-top: 1.5rem;
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: var(--radius); padding: 1rem 1.25rem;
  color: #78350f; font-size: 0.9rem;
}
.disclaimer-box svg { width: 20px; height: 20px; color: var(--warning); flex-shrink: 0; margin-top: 2px; }
.disclaimer-box strong { color: #78350f; }
.disclaimer-box p { margin: 0.25rem 0 0; }
.disclaimer-box a { color: var(--primary-dark); text-decoration: underline; }

.site-disclaimer {
  margin-top: 3rem; padding-top: 1.25rem;
  border-top: 1px solid var(--gray-200);
  color: var(--gray-400); font-size: 0.8rem; line-height: 1.5;
  max-width: 900px;
}
.site-disclaimer a { color: var(--gray-500); text-decoration: underline; }

/* --- print (worksheet) --- */
@media print {
  .sidebar, .mobile-header, .book-cta, .article-actions, .btn { display: none !important; }
  .main-content { margin: 0 !important; }
}
