/* Verbista SEO content site — single stylesheet. Mobile-first. Light + dark via CSS custom
   properties: prefers-color-scheme by default, [data-theme] overrides on explicit toggle.
   Brand tokens mirror the app (app_theme.dart); editorial skin (airy, reading column). */

:root {
  --bg: #FAFAFA;
  --surface: #ffffff;
  --text: #1F2937;
  --muted: #5b6573;
  --primary: #0057E0;
  --primary-contrast: #ffffff;
  --border: #e5e7eb;
  --accent: #F97373;
  --en: #14387a;            /* English fragment tint (AA on light bg) */
  --en-underline: #9cb8ec;  /* tappable-word cue (non-color) */
  --radius: 16px;
  --measure: 38rem;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark, auto (no explicit choice) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212; --surface: #1b1d22; --text: #F3F4F6; --muted: #9aa3b2;
    --primary: #64B5F6; --primary-contrast: #06121f; --border: #2b2f36;
    --accent: #F97373; --en: #9fc2ff; --en-underline: #3a5d92;
  }
}
/* Dark, explicit */
:root[data-theme="dark"] {
  --bg: #121212; --surface: #1b1d22; --text: #F3F4F6; --muted: #9aa3b2;
  --primary: #64B5F6; --primary-contrast: #06121f; --border: #2b2f36;
  --accent: #F97373; --en: #9fc2ff; --en-underline: #3a5d92;
}

* { 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: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---- header / footer ---- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; }
.brand-mark { display: block; }
.brand-name { font-size: 1.1rem; }
.theme-toggle {
  min-width: 44px; min-height: 44px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); border-radius: 12px;
  font-size: 1.1rem; cursor: pointer;
}
.site-footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 24px 16px; color: var(--muted); font-size: .95rem; }
.site-footer a, .breadcrumb a { color: var(--primary); }

/* ---- layout ---- */
main { padding: 16px; }
article, .hub { max-width: var(--measure); margin: 0 auto; }
.breadcrumb { color: var(--muted); font-size: .9rem; margin-bottom: 8px; }

h1 { font-size: 1.9rem; line-height: 1.2; margin: .4em 0 .5em; }
h2 { font-size: 1.4rem; line-height: 1.25; margin: 1.6em 0 .4em; }
h3 { font-size: 1.15rem; margin: 1.4em 0 .3em; }
p, ul, ol { margin: 0 0 1em; }
a { color: var(--primary); }
hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
blockquote {
  margin: 1em 0; padding: .6em 1em; border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 6px;
}

/* ---- English fragments + tap-to-translate ---- */
[lang="en"] { color: var(--en); }
[lang="en"] strong { color: inherit; }
.w {
  cursor: pointer;
  border-bottom: 1px dashed var(--en-underline);
}
.w:hover, .w:focus { background: color-mix(in srgb, var(--primary) 14%, transparent); outline: none; border-radius: 3px; }
.gloss-bubble {
  position: absolute; z-index: 50; max-width: 220px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 10px; font-size: .9rem; line-height: 1.4;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.gloss-bubble .g-word { color: var(--en); font-weight: 700; }
.gloss-bubble .g-hint { display: block; margin-top: 4px; color: var(--muted); font-size: .78rem; }

/* ---- tables (reflow: scroll inside own container) ---- */
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .98rem; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: color-mix(in srgb, var(--text) 5%, transparent); font-weight: 700; }
tr:last-child td { border-bottom: none; }

/* ---- CTA ---- */
.cta,
article a[href^="https://verbista.com"] {
  display: inline-block; background: var(--primary); color: var(--primary-contrast);
  text-decoration: none; font-weight: 700; padding: 12px 20px; border-radius: 12px;
  min-height: 44px;
}
.cta:hover, article a[href^="https://verbista.com"]:hover { filter: brightness(1.06); }

/* ---- hub ---- */
.lede { color: var(--muted); font-size: 1.1rem; }
.card-grid, .lang-list { list-style: none; padding: 0; display: grid; gap: 14px; }
.card a { display: block; text-decoration: none; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card a:hover { border-color: var(--primary); }
.card h2 { margin: 0 0 .3em; font-size: 1.15rem; color: var(--primary); }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.lang-list a { display: block; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; text-decoration: none; color: var(--text); font-weight: 600; }
.cta-row { margin-top: 24px; }

/* ---- wider screens ---- */
@media (min-width: 700px) {
  body { font-size: 19px; }
  main { padding: 32px 24px; }
  h1 { font-size: 2.3rem; }
  .card-grid { grid-template-columns: 1fr 1fr; }
}
