/* mathka.org — styles for statically generated SEO pages, Lesson Study Guides, Division Co-Learning Guides,
   Root portal, and E-E-A-T editorial/policy pages. Loaded by pages emitted by deploy/seo/build_pages.py. */
.seo-static-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 28px 42px;
  font-family: var(--font-book, "Andika", "Nunito", sans-serif);
  color: var(--ink, #1e293b);
}
.seo-static-page h1 {
  font-family: var(--font-heading, "Rubik", sans-serif);
  font-size: 29px;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: 0.012em;
  margin: 4px 0 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border, #e7d7c1);
}
.seo-static-page h2 {
  font-family: var(--font-heading, "Rubik", sans-serif);
  font-size: 22px;
  font-weight: 700;
  margin: 26px 0 10px;
  line-height: 1.3;
}
.seo-static-page h3 {
  font-family: var(--font-heading, "Rubik", sans-serif);
  font-size: 18.5px;
  font-weight: 700;
  margin: 18px 0 8px;
}
.seo-static-page p {
  font-size: 19px;
  line-height: 1.68;
  margin: 0 0 13px;
}
.seo-static-page .seo-lead {
  font-size: 20.5px;
  line-height: 1.68;
}
.seo-static-page .seo-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--amber-soft, #fdf0d5);
  border: 1px solid var(--amber-border, #e8b765);
  font-weight: 700;
  font-size: 15px;
  margin: 0 8px 10px 0;
}
.seo-lesson-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px 18px;
}
.seo-lesson-list a,
.seo-link-list a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--accent-text, #92400e);
  text-decoration: none;
  font-weight: 600;
}
.seo-lesson-list a:hover,
.seo-link-list a:hover {
  background: var(--bg-subtle, #f7efe3);
  text-decoration: underline;
}
.seo-lang-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin: 22px 0 28px;
}
.seo-lang-card {
  display: block;
  padding: 22px;
  border-radius: 18px;
  border: 2px solid var(--border, #e7d7c1);
  background: var(--bg-sheet, #fffdf8);
  text-decoration: none;
  color: inherit;
  min-height: 48px;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.seo-lang-card:hover,
.seo-lang-card:focus-visible {
  border-color: var(--accent, #d97706);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.12);
  outline: none;
}
.seo-lang-card strong {
  display: block;
  font-family: var(--font-heading, "Rubik", sans-serif);
  font-size: 24px;
  margin-bottom: 6px;
  color: var(--accent-text, #92400e);
}
.seo-lang-card span {
  font-size: 16px;
  line-height: 1.5;
}
.seo-lang-suggest-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  margin: 0 0 18px;
  border-radius: 14px;
  background: var(--amber-soft, #fef3c7);
  border: 2px solid var(--amber-border, #f59e0b);
  font-size: 17px;
  font-weight: 600;
}
.seo-lang-suggest-banner[hidden] {
  display: none !important;
}
.seo-lang-suggest-banner a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 10px;
  background: #d97706;
  color: #ffffff;
  font-family: var(--font-heading, "Rubik", sans-serif);
  font-weight: 700;
  text-decoration: none;
}
.seo-lang-suggest-banner a:hover,
.seo-lang-suggest-banner a:focus-visible {
  background: #b45309;
}
.seo-tips-box {
  margin: 22px 0 26px;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--bg-sheet, #fffdf8);
  border: 2px solid var(--border, #e7d7c1);
}
.seo-tips-box h2 {
  margin-top: 0;
}
.seo-tips-list {
  margin: 10px 0 0;
  padding-left: 1.35em;
}
.seo-tips-list li {
  font-size: 18px;
  line-height: 1.64;
  margin-bottom: 10px;
}
.seo-primes-table {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  line-height: 1.7;
  margin-top: 18px;
}
.seo-static-aside h2 {
  font-size: 20px;
  margin: 4px 0 8px;
}
.seo-static-aside ol {
  padding-left: 1.3em;
  margin: 0 0 16px;
}
.seo-static-aside li {
  margin: 0 0 8px;
  line-height: 1.55;
}
.seo-static-aside details {
  margin: 4px 0 12px;
}
#seoBreadcrumbs:empty,
#seoLinks:empty,
#lessonStudyGuide:empty {
  display: none;
}

/* ==========================================================================
   Lesson Study Guide (#lessonStudyGuide) — Co-Learning Editorial Companion
   ========================================================================== */
.lesson-study-guide {
  max-width: 1640px;
  margin: 18px auto 8px;
  padding: 0 22px;
  font-family: var(--font-book, "Andika", "Nunito", sans-serif);
  color: var(--ink, #1e293b);
}
.sg-shell {
  background: var(--bg-sheet, #fffdf8);
  border: 2px solid var(--border, #e7d7c1);
  border-radius: 20px;
  padding: 26px 28px;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05);
}
.sg-header {
  border-bottom: 2px solid var(--border, #e7d7c1);
  padding-bottom: 14px;
  margin-bottom: 20px;
}
.sg-header h2 {
  font-family: var(--font-heading, "Rubik", sans-serif);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.28;
  margin: 0;
  color: var(--ink, #1e293b);
}
.sg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}
.sg-card {
  background: var(--bg-subtle, #fbf6ed);
  border: 1.5px solid var(--border, #e7d7c1);
  border-radius: 16px;
  padding: 18px 20px;
}
.sg-card-wide {
  grid-column: 1 / -1;
}
.sg-card h3 {
  font-family: var(--font-heading, "Rubik", sans-serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.32;
  margin: 0 0 10px;
  color: var(--ink, #1e293b);
}
.sg-card p {
  font-size: 18px;
  line-height: 1.66;
  margin: 0 0 11px;
}
.sg-card p:last-child {
  margin-bottom: 0;
}
.sg-rule-callout {
  padding: 12px 15px;
  margin: 10px 0;
  border-radius: 12px;
  background: var(--amber-soft, #fef3c7);
  border-left: 4px solid var(--amber-border, #d97706);
  font-weight: 600;
}
.sg-terms-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.sg-term-chip {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-sheet, #ffffff);
  border: 1px solid var(--amber-border, #e8b765);
  font-size: 15px;
  font-weight: 700;
}
.sg-steps-list,
.sg-practice-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.sg-step-item,
.sg-practice-item {
  background: var(--bg-sheet, #ffffff);
  border: 1px solid var(--border, #e7d7c1);
  border-radius: 12px;
  padding: 13px 16px;
}
.sg-step-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.sg-step-head strong {
  font-family: var(--font-heading, "Rubik", sans-serif);
  font-size: 17.5px;
}
.sg-step-eq {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  background: var(--amber-soft, #fef3c7);
  font-family: var(--font-heading, "Rubik", sans-serif);
  font-size: 15px;
  font-weight: 700;
}
.sg-mistake-card {
  background: #fffbeb;
  border-color: #f59e0b;
}
.sg-mistake-fix {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(217, 119, 6, 0.4);
}
.sg-solution-box {
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-subtle, #f8fafc);
  font-size: 16.5px;
  line-height: 1.6;
}
.sg-faq-list {
  display: grid;
  gap: 12px;
}
.sg-faq-item {
  background: var(--bg-sheet, #ffffff);
  border: 1px solid var(--border, #e7d7c1);
  border-radius: 12px;
  padding: 13px 16px;
}
.sg-faq-item h4 {
  font-family: var(--font-heading, "Rubik", sans-serif);
  font-size: 17.5px;
  font-weight: 700;
  margin: 0 0 6px;
}
.sg-conn-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.sg-conn-list li {
  font-size: 17px;
  line-height: 1.58;
}
.sg-conn-list a {
  color: var(--accent-text, #92400e);
  font-weight: 700;
  text-decoration: none;
}
.sg-conn-list a:hover {
  text-decoration: underline;
}

/* Dark theme & Large-font adaptations */
[data-theme="dark"] .seo-static-page,
[data-theme="dark"] .lesson-study-guide {
  color: #f1f5f9;
}
[data-theme="dark"] .seo-lang-card,
[data-theme="dark"] .seo-tips-box,
[data-theme="dark"] .sg-shell {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}
[data-theme="dark"] .sg-card {
  background: rgba(15, 23, 42, 0.65);
  border-color: #334155;
}
[data-theme="dark"] .sg-step-item,
[data-theme="dark"] .sg-practice-item,
[data-theme="dark"] .sg-faq-item,
[data-theme="dark"] .sg-term-chip {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}
[data-theme="dark"] .sg-rule-callout,
[data-theme="dark"] .sg-step-eq,
[data-theme="dark"] .seo-lang-suggest-banner {
  background: rgba(120, 53, 15, 0.38);
  border-color: #f59e0b;
  color: #fef3c7;
}
[data-theme="dark"] .sg-mistake-card {
  background: rgba(120, 53, 15, 0.25);
  border-color: #f59e0b;
}
[data-theme="dark"] .sg-solution-box {
  background: rgba(30, 41, 59, 0.85);
}
[data-theme="dark"] .seo-lang-card strong,
[data-theme="dark"] .seo-lesson-list a,
[data-theme="dark"] .seo-link-list a,
[data-theme="dark"] .sg-conn-list a {
  color: #fbbf24;
}

[data-font-size="large"] .sg-card p,
[data-font-size="large"] .seo-static-page p {
  font-size: 21.5px;
}

@media (max-width: 960px) {
  .sg-grid {
    grid-template-columns: 1fr;
  }
  .lesson-study-guide {
    padding: 0 14px;
  }
  .sg-shell {
    padding: 20px 18px;
  }
  .seo-static-page {
    padding: 20px 16px 32px;
  }
}
