/**
 * Stylesheet for the public, statically generated content pages
 * (/ielts-writing-task-1/*, /ielts-writing-task-2/*, /legal/*, hubs).
 *
 * Deliberately NOT style.css. Those pages exist to be crawled and to load fast
 * on a cold visit from a Google result: they must not pull in the app shell,
 * app-core.js or the multi-megabyte test JSON. Everything here is self-contained
 * and small enough to stay well inside one render-blocking request.
 *
 * Brand tokens are copied from style.css rather than imported, for the same
 * reason. Keep --accent and --text in sync if the brand palette moves.
 */

:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --border: rgba(15, 23, 42, 0.12);
  --text: #0b1220;
  --muted: #475569;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --success: #166534;
  --success-soft: #f0fdf4;
  --warn: #a16207;
  --warn-soft: #fffbeb;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 10px 28px rgba(2, 6, 23, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 860px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
}

/* ---------- Header / footer ---------- */

.seo-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.seo-header-inner,
.seo-main,
.seo-footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.seo-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
}

.seo-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
  text-decoration: none;
}

.seo-logo img {
  width: 26px;
  height: 26px;
}

.seo-nav {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.seo-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
}

.seo-nav a:hover {
  color: var(--accent);
}

.seo-nav a.seo-nav-cta {
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
}

.seo-nav a.seo-nav-cta:hover {
  background: var(--accent-hover);
  color: #fff;
}

.seo-main {
  padding-top: 26px;
  padding-bottom: 60px;
}

.seo-footer {
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 30px 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.seo-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  justify-content: space-between;
}

.seo-footer a {
  color: var(--muted);
  text-decoration: none;
  margin-right: 16px;
}

.seo-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------- Breadcrumbs ---------- */

.seo-breadcrumb {
  font-size: 0.87rem;
  color: var(--muted);
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seo-breadcrumb li::after {
  content: "›";
  margin-left: 6px;
  color: #94a3b8;
}

.seo-breadcrumb li:last-child::after {
  content: "";
}

.seo-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.seo-breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------- Typography ---------- */

h1 {
  font-size: 1.85rem;
  line-height: 1.25;
  margin: 0 0 12px;
  letter-spacing: -0.015em;
}

h2 {
  font-size: 1.32rem;
  margin: 38px 0 12px;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.08rem;
  margin: 24px 0 8px;
}

p {
  margin: 0 0 14px;
}

.seo-lede {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 22px;
}

.seo-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}

.seo-tag {
  display: inline-block;
  background: var(--accent-soft);
  color: #1e40af;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

a.seo-tag:hover {
  background: #dbeafe;
}

/* ---------- Cards / panels ---------- */

.seo-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 0 0 22px;
  box-shadow: var(--shadow-sm);
}

.seo-prompt {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 0 0 24px;
}

.seo-prompt p {
  margin: 0 0 10px;
}

.seo-prompt p:last-child {
  margin-bottom: 0;
}

.seo-prompt-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.seo-figure {
  margin: 0 0 24px;
}

.seo-figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.seo-figure figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 8px;
}

/* ---------- Band answer blocks ---------- */

.seo-answer {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 0 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.seo-answer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.seo-band {
  font-weight: 700;
  font-size: 1.02rem;
}

.seo-band-9 {
  color: var(--success);
}
.seo-band-7 {
  color: var(--accent);
}
.seo-band-6 {
  color: var(--warn);
}

.seo-wordcount {
  font-size: 0.85rem;
  color: var(--muted);
}

.seo-answer-body {
  padding: 18px 22px 4px;
}

.seo-answer-body p {
  margin: 0 0 16px;
}

.seo-why {
  border-top: 1px solid var(--border);
  background: var(--success-soft);
  padding: 16px 22px;
}

.seo-why-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin: 0 0 8px;
  color: var(--success);
}

.seo-why ul {
  margin: 0;
  padding-left: 20px;
  font-size: 0.94rem;
}

.seo-why li {
  margin-bottom: 6px;
}

/* ---------- Vocabulary table ---------- */

.seo-table-wrap {
  overflow-x: auto;
  margin: 0 0 22px;
}

table.seo-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  font-size: 0.94rem;
  min-width: 480px;
}

table.seo-table th,
table.seo-table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

table.seo-table th {
  background: #f8fafc;
  font-weight: 700;
}

/* ---------- Write-your-own box ---------- */

.seo-write {
  background: var(--accent-soft);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 0 0 24px;
}

.seo-write h2 {
  margin-top: 0;
}

.seo-write textarea {
  width: 100%;
  min-height: 190px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-family: var(--font);
  font-size: 0.98rem;
  line-height: 1.6;
  resize: vertical;
  background: #fff;
  color: var(--text);
}

.seo-write-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.seo-write-count {
  font-size: 0.88rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Buttons ---------- */

.seo-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.96rem;
  padding: 11px 22px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-family: var(--font);
}

.seo-btn:hover {
  background: var(--accent-hover);
}

.seo-btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.seo-btn-ghost:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

/* ---------- FAQ ---------- */

.seo-faq details {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 10px;
}

.seo-faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.seo-faq summary::-webkit-details-marker {
  display: none;
}

.seo-faq summary::after {
  content: "+";
  float: right;
  color: var(--accent);
  font-weight: 700;
}

.seo-faq details[open] summary::after {
  content: "–";
}

.seo-faq details p {
  margin: 12px 0 0;
  color: var(--muted);
}

/* ---------- Topic listing grid (hub pages) ---------- */

.seo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}

.seo-grid li {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.seo-grid a {
  display: block;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  height: 100%;
}

.seo-grid a:hover {
  background: #f8fafc;
}

.seo-grid-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: block;
}

.seo-grid-kicker {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.seo-grid-title {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}

/* ---------- Related links ---------- */

.seo-related ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.seo-related li {
  border-bottom: 1px solid var(--border);
}

.seo-related li:last-child {
  border-bottom: 0;
}

.seo-related a {
  display: block;
  padding: 11px 0;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.96rem;
}

.seo-related a:hover {
  text-decoration: underline;
}

/* ---------- Legal / long-form prose pages ---------- */

.seo-prose h2 {
  font-size: 1.2rem;
}

.seo-prose ul,
.seo-prose ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.seo-prose li {
  margin-bottom: 7px;
}

.seo-prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
}

.seo-prose td,
.seo-prose th {
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
}

.seo-updated {
  font-size: 0.87rem;
  color: var(--muted);
  margin-bottom: 26px;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.18rem;
  }

  .seo-header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 10px;
  }

  .seo-nav {
    gap: 14px;
  }

  .seo-card,
  .seo-answer-body,
  .seo-answer-head,
  .seo-why,
  .seo-write {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media print {
  .seo-header,
  .seo-footer,
  .seo-write,
  .seo-nav {
    display: none;
  }
}

/* ---------- Study library signpost ---------- */
/* Names the question type and links to the Premium structure library. It must
   never contain the structures themselves — see studyLibrarySignpost() in
   scripts/seo/page-template.mjs for why. */
.seo-signpost {
  background: var(--warn-soft);
  border-color: #fde68a;
}

.seo-signpost p:last-child {
  margin-bottom: 0;
}
