/* Shared styles for TeoriGO guide pages (/<slug>/) and 404.html. */
:root {
  --brand:       #A6D93A;
  --brand-dark:  #7FB224;
  --brand-ink:   #4E7A12;
  --teal:        #0EA5A4;
  --teal-dark:   #0B8382;
  --bg:          #F8FAF7;
  --surface:     #FFFFFF;
  --fg1:         #17212B;
  --fg2:         #4F5B66;
  --border:      rgba(0,0,0,0.08);
  --success-bg:  rgba(52,199,89,0.12);
  --success-fg:  #1A7A34;
  --error-bg:    rgba(255,59,48,0.10);
  --error-fg:    #B42318;
  --radius-card: 18px;
  --radius-pill: 9999px;
  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --max-w:       760px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg1);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; }

a { color: var(--teal-dark); }
a:hover { color: var(--fg1); }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  padding: 8px 14px;
  background: var(--fg1);
  color: #fff;
  border-radius: 8px;
  z-index: 400;
}
.skip-link:focus { left: 8px; }

/* ── NAV ── */
/* Mirrors the index.html nav: keep sizes, colours and breakpoints in sync with it. */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248,250,247,0.82);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(166,217,58,0.12);
  line-height: normal;
}
.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-logo img { width: 34px; height: 34px; border-radius: 8px; }
.nav-logo-text {
  font-size: 19px;
  font-weight: 700;
  color: var(--fg1);
  letter-spacing: 0;
  transform: scaleX(1.2);
  transform-origin: left center;
}
.nav-logo-text span { color: var(--brand-dark); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links li { margin: 0; }
.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: #5E6A75;
  text-decoration: none;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--fg1); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px;
  height: 38px;
  background: linear-gradient(160deg, #A6D93A 0%, #7FB224 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(127,178,36,0.32);
  transition: transform 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}
.nav-cta:hover { color: #fff; transform: translateY(-1px); opacity: 0.92; }
/* Like index.html: the store icon only shows on iOS and Android; desktop gets a text-only button. */
.nav-cta svg { width: 0; height: 0; }
.platform-ios .nav-cta-ios svg { width: 16px; height: 16px; }
.platform-android .nav-cta-android svg { width: 21px; height: 21px; }
.nav-cta-android,
.platform-android .nav-cta-ios { display: none; }
.platform-android .nav-cta-android { display: inline-flex; }
@media (max-width: 680px) {
  .nav-inner > nav { display: none; }
}
/* Below 360px the index.html header no longer fits; keep the wordmark for screen readers only. */
@media (max-width: 359px) {
  .nav-logo-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ── LAYOUT ── */
.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px 20px 56px;
}

.breadcrumb {
  font-size: 14px;
  color: var(--fg2);
  margin: 4px 0 18px;
}
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li + li::before { content: '›'; margin-right: 6px; color: var(--fg2); }
.breadcrumb a { color: var(--fg2); }

h1 {
  font-size: clamp(30px, 6vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.8px;
  font-weight: 850;
  margin: 0 0 18px;
}
h2 {
  font-size: clamp(22px, 4vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.3px;
  margin: 40px 0 12px;
}
h3 { font-size: 19px; line-height: 1.3; margin: 24px 0 8px; }
p, ul, ol { margin: 0 0 14px; }
ul, ol { padding-left: 22px; }
li { margin-bottom: 6px; }

.answer {
  background: var(--surface);
  border: 1px solid rgba(166,217,58,0.45);
  border-left: 6px solid var(--brand);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  margin: 0 0 22px;
  font-size: 18px;
}
.answer p:last-child { margin-bottom: 0; }

.fact-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fact-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0;
  font-size: 15px;
  color: var(--fg2);
}
.fact-list strong { display: block; font-size: 24px; color: var(--fg1); line-height: 1.2; }

.source-note { font-size: 14px; color: var(--fg2); }

/* ── STORE CTAs ── */
.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 4px; }
.btn-store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}
.btn-store svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn-ios { background: linear-gradient(160deg, #A6D93A 0%, #7FB224 100%); box-shadow: 0 4px 14px rgba(127,178,36,0.35); }
.btn-android { background: var(--teal); }
.btn-store:hover { color: #fff; opacity: 0.92; }

/* Platform-specific CTAs: without JS every store button is visible. */
.platform-ios [data-platform="android"],
.platform-android [data-platform="ios"] { display: none; }
.qr-block { display: none; }
.platform-desktop .qr-block {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: fit-content;
  max-width: 100%;
  color: var(--fg2);
  font-size: 14px;
  line-height: 1.4;
}
.qr-block img { width: 72px; height: 72px; border-radius: 8px; }
.qr-block strong { display: block; color: var(--fg1); }

.inline-cta {
  margin: 0 0 8px;
  padding: 16px 18px;
  background: rgba(166,217,58,0.12);
  border-radius: var(--radius-card);
}
.inline-cta p { margin-bottom: 6px; font-weight: 600; }

/* ── SAMPLE QUESTIONS ── */
.samples { list-style: none; padding: 0; margin: 16px 0 0; counter-reset: sample; }
.sample {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px 18px 14px;
  margin: 0 0 16px;
}
.sample-meta { font-size: 13px; font-weight: 700; color: var(--brand-ink); text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 6px; }
.sample-prompt { font-weight: 700; margin: 0 0 12px; }
/* The frame spans the full option width; the image sits centred inside it. */
.sample figure {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.sample figure img {
  display: block;
  width: 100%;
  max-width: 425px;
  height: auto;
  margin: 0 auto;
}
.options { list-style: none; padding: 0; margin: 0 0 12px; }
.options li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.45;
}
.option-letter {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* With JavaScript, seo.js wraps each option in a button that gives instant feedback. */
.options.is-interactive li { display: block; padding: 0; border: 0; }
.option-button {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(14,165,164,0.15);
}
.option-button:hover { border-color: var(--teal); }
.option-button:focus-visible { outline: 3px solid var(--teal-dark); outline-offset: 2px; }
.option-button > span:nth-child(2) { flex: 1; }
.option-mark { flex-shrink: 0; min-width: 1em; font-weight: 700; text-align: center; }
.option-button.is-correct { background: var(--success-bg); border-color: var(--success-fg); }
.option-button.is-correct .option-letter { background: var(--success-fg); color: #fff; }
.option-button.is-correct .option-mark { color: var(--success-fg); }
.option-button.is-incorrect { background: var(--error-bg); border-color: var(--error-fg); }
.option-button.is-incorrect .option-letter { background: var(--error-fg); color: #fff; }
.option-button.is-incorrect .option-mark { color: var(--error-fg); }
/* Screen-reader status only: the visible feedback is the answer block below the options. */
.sample-feedback {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sample details { border-top: 1px dashed var(--border); padding-top: 10px; }
.sample summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--teal-dark);
  min-height: 32px;
  display: flex;
  align-items: center;
}
.sample summary::-webkit-details-marker { color: var(--teal-dark); }
.sample details[open] summary { margin-bottom: 8px; }
.correct-answer {
  background: var(--success-bg);
  color: var(--success-fg);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  margin: 0 0 10px;
}
.explanation { font-size: 16px; color: var(--fg2); }
.explanation p:last-child { margin-bottom: 0; }
.sample-note { font-size: 15px; margin: 10px 0 0; padding: 10px 12px; background: rgba(14,165,164,0.08); border-radius: 12px; }
.topic-list li { margin-bottom: 10px; }

/* ── RELATED + FAQ ── */
.faq h3 { margin-top: 18px; }
.related { list-style: none; padding: 0; display: grid; gap: 10px; }
.related li { margin: 0; }
.related a {
  display: block;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  font-weight: 600;
  color: var(--fg1);
}
.related a:hover { border-color: var(--brand); }

/* ── FINAL CTA ── */
.cta-final {
  margin-top: 44px;
  padding: 28px 22px;
  background: linear-gradient(160deg, #17212B 0%, #1e3a2a 100%);
  color: #fff;
  border-radius: 24px;
}
.cta-final h2 { margin-top: 0; color: #fff; }
.cta-final p { color: rgba(255,255,255,0.82); }
.cta-final ul { list-style: none; padding: 0; margin: 0 0 18px; }
.cta-final li { padding-left: 26px; position: relative; color: rgba(255,255,255,0.9); }
.cta-final li::before { content: '✓'; position: absolute; left: 0; color: var(--brand); font-weight: 800; }
.cta-final .qr-block { color: var(--fg2); }

/* ── FOOTER ── */
.site-footer {
  background: #0f1a12;
  color: rgba(255,255,255,0.6);
  padding: 32px 20px;
  font-size: 14px;
}
.footer-inner { max-width: 1160px; margin: 0 auto; display: grid; gap: 18px; }
.footer-guides h2 { font-size: 15px; color: rgba(255,255,255,0.85); margin: 0 0 10px; letter-spacing: 0; }
.footer-guides ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-guides li { margin: 0; }
.site-footer a { color: rgba(255,255,255,0.72); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ── CONSENT ── */
.consent-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 16px;
  background: rgba(23,33,43,0.96);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.22);
}
.consent-banner.is-visible { display: flex; }
.consent-copy { margin: 0; font-size: 13px; line-height: 1.45; color: rgba(255,255,255,0.82); }
.consent-actions { display: flex; gap: 8px; flex-shrink: 0; }
.consent-btn {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.consent-btn-primary { background: var(--brand); color: var(--fg1); }
.consent-btn-secondary { background: rgba(255,255,255,0.14); color: #fff; }

@media (max-width: 540px) {
  body { font-size: 16px; }
  .answer { font-size: 17px; padding: 16px; }
  .btn-store { width: 100%; }
  .consent-banner { flex-direction: column; align-items: stretch; }
  .consent-actions { width: 100%; }
  .consent-btn { flex: 1; }
}
