/* ==========================================================================
   GeoPreview — content / landing page stylesheet
   --------------------------------------------------------------------------
   Self-contained styles for the static, crawlable SEO pages (NOT the Svelte
   app). Tokens below MIRROR viewer/src/app.css so these pages feel like the
   same product. Light + dark aware (prefers-color-scheme), fully responsive,
   readable with JS off. No external fonts or CDNs — system-ui like the app.
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------ */
/* Default = light. Dark palette (mirrored from app.css) applied below via
   prefers-color-scheme. The accent, radii, and font match the app exactly. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f1f4;
  --surface-3: #e7e9ee;

  --border: #e2e4ea;
  --border-strong: #cdd0da;

  --text: #1a1c24;
  --text-muted: #545a6b;
  --text-faint: #737a8c;

  /* Accent matches the app; link/CTA uses the darker strong on light bg for
     AA contrast, brightening to --accent on hover. */
  --accent: #6ea8e8;
  --accent-strong: #4f8fdd;
  --accent-link: #2f6fc4;
  --accent-soft: rgba(79, 143, 221, 0.12);

  --danger: #cf5b5b;
  --success: #2f9c63;

  --radius: 8px;
  --radius-sm: 5px;
  --shadow: 0 8px 28px rgba(20, 24, 40, 0.10);
  --shadow-sm: 0 2px 10px rgba(20, 24, 40, 0.06);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 44rem; /* readable article width */
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Mirrored from viewer/src/app.css + index.html #seo-hero (#151520). */
    --bg: #101018;
    --surface: #16161f;
    --surface-2: #1d1d29;
    --surface-3: #262635;

    --border: #2a2a3a;
    --border-strong: #3c3c50;

    --text: #e6e6ee;
    --text-muted: #9a9aac;
    --text-faint: #8a8a9e;

    --accent: #6ea8e8;
    --accent-strong: #4f8fdd;
    --accent-link: #6ea8e8;
    --accent-soft: rgba(110, 168, 232, 0.14);

    --danger: #e87a7a;
    --success: #7cd6a2;

    --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- Header ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--border);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.wordmark:hover { text-decoration: none; }

/* Small map-pin glyph as the logo mark, tinted with the accent. */
.wordmark .mark {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--accent-strong);
}

.header-cta {
  font-size: 13.5px;
  font-weight: 550;
  color: var(--accent-link);
  white-space: nowrap;
}

/* ---- Layout ------------------------------------------------------------- */
.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 40px 20px 8px;
}

.article-footer-cta,
.related,
.site-footer-wrap {
  max-width: var(--measure);
  margin: 0 auto;
}

/* ---- Article typography ------------------------------------------------- */
.article h1 {
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 14px;
}

.article .intro {
  font-size: clamp(17px, 2.4vw, 19px);
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 28px;
}

.article h2 {
  font-size: clamp(21px, 3vw, 25px);
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 40px 0 12px;
  padding-top: 8px;
}

.article h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 8px;
}

.article p {
  margin: 0 0 16px;
}

.article ul,
.article ol {
  margin: 0 0 16px;
  padding-left: 1.4em;
}

.article li { margin: 0 0 8px; }
.article li::marker { color: var(--text-faint); }

.article strong { font-weight: 650; color: var(--text); }

.article a { text-decoration: underline; text-underline-offset: 2px; }

.article code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}

.article pre {
  overflow-x: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0 0 16px;
}
.article pre code {
  border: 0;
  padding: 0;
  background: none;
  white-space: pre;
}

.article hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.article blockquote {
  margin: 0 0 16px;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-muted);
}

/* ---- Primary CTA (matches .btn / .btn-primary in app.css) --------------- */
.article-footer-cta {
  margin: 40px auto 8px;
  padding: 28px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.article-footer-cta p {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 14.5px;
}

.btn-primary {
  display: inline-block;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 550;
  color: #fff;
  background: var(--accent-strong);
  border: 1px solid var(--accent-strong);
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* ---- FAQ (matches .empty-faq <details> in App.svelte) ------------------- */
.faq {
  margin: 44px auto 8px;
}
.faq h2 {
  font-size: clamp(21px, 3vw, 25px);
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.faq details {
  border-top: 1px solid var(--border);
  padding: 12px 0;
}
.faq details:last-child { border-bottom: 1px solid var(--border); }

.faq summary {
  font-size: 16px;
  font-weight: 550;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "＋";
  color: var(--text-faint);
  font-weight: 400;
  flex-shrink: 0;
}
.faq details[open] summary::before { content: "－"; }

.faq details p {
  margin: 10px 0 0;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}
.faq details p code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

/* ---- Related links ------------------------------------------------------ */
.related {
  margin: 44px auto 8px;
}
.related h2 {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.related ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.related a {
  display: block;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 550;
  font-size: 15px;
  transition: border-color 0.15s, background 0.15s;
}
.related a:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  text-decoration: none;
}
.related a::after {
  content: " →";
  color: var(--accent-link);
}

/* ---- Footer (matches sidebar-footer: contact + privacy + support) ------- */
.site-footer-wrap {
  margin-top: 56px;
}
.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}
.site-footer .contact-line {
  font-size: 13px;
  color: var(--text-muted);
}
.site-footer .contact-line a {
  color: var(--text-muted);
  text-decoration: underline;
}
.site-footer .contact-line a:hover { color: var(--text); }

.site-footer .privacy-note {
  font-size: 12px;
  color: var(--text-faint);
  max-width: 34rem;
  margin: 0 auto;
  line-height: 1.5;
}

.site-footer .support-line {
  display: inline-block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.9;
}
.site-footer .support-line:hover {
  color: var(--text);
  opacity: 1;
  text-decoration: underline;
}

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 640px) {
  .site-header { padding: 10px 14px; }
  .header-cta { font-size: 12.5px; }
  .page { padding: 28px 16px 4px; }
}

/* ---- Reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.001ms !important; }
}
