/* 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; }
.lang-card { display: flex; flex-direction: column; gap: 2px; }
.lang-card:hover { border-color: var(--primary); }
.lang-name { font-size: 1.15rem; font-weight: 700; }
.lang-target { font-size: .9rem; color: var(--muted); font-weight: 400; }
.cta-row { margin-top: 24px; }

/* ---- language switcher bar ---- */
.lang-bar { display: flex; gap: 10px; flex-wrap: wrap; padding: 8px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.ls { position: relative; }
.ls > summary { list-style: none; cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
  padding: 9px 12px; min-height: 44px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); font-size: .95rem; }
.ls > summary::-webkit-details-marker { display: none; }
.ls > summary::after { content: "▾"; color: var(--muted); }
.ls .ls-label { color: var(--muted); }
.ls > ul { position: absolute; z-index: 40; margin: 6px 0 0; padding: 6px; list-style: none; min-width: 210px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.ls > ul a { display: block; padding: 10px 12px; min-height: 44px; border-radius: 8px; text-decoration: none; color: var(--text); }
.ls > ul a:hover { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.ls > ul a[aria-current="true"] { font-weight: 700; color: var(--primary); }
.badge { display: inline-block; font-size: .72rem; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; vertical-align: middle; }

/* ---- root directory ---- */
.directory { display: grid; gap: 20px; }
.dir-group h2 { font-size: 1.1rem; margin: 0 0 .4em; }
.dir-targets { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dir-targets a { display: inline-block; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); text-decoration: none; color: var(--primary); font-weight: 600; }
.dir-targets a:hover { border-color: var(--primary); }
.dir-targets .muted { padding: 8px 12px; color: var(--muted); border: 1px dashed var(--border); border-radius: 10px; }
.comingsoon .badge-row { margin: 0 0 .5em; }

/* ---- prototype: sticky top autonym bar ---- */
.langbar { position: sticky; top: 0; z-index: 30; display: flex; gap: 6px; overflow-x: auto;
  padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); -webkit-overflow-scrolling: touch; }
.langbar a { flex: 0 0 auto; padding: 8px 14px; min-height: 40px; display: inline-flex; align-items: center;
  border-radius: 999px; text-decoration: none; color: var(--text); border: 1px solid var(--border); white-space: nowrap; }
.langbar a.active { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); font-weight: 700; }
.speak-panels { margin-top: 18px; }
.speak-panel h2 { font-size: 1.25rem; }
.topbar-proto[data-js] .speak-panel { display: none; }
.topbar-proto[data-js] .speak-panel.active { display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-block; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); text-decoration: none; color: var(--primary); font-weight: 600; }
.chip:hover { border-color: var(--primary); }
.chip.muted { color: var(--muted); border-style: dashed; }

/* ---- prototype: two-dropdown selector ---- */
.dd-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; margin: 18px 0; }
.dd-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.dd-field select { min-height: 48px; font-size: 1.05rem; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.dd-note { color: var(--muted); min-height: 1.2em; }
.dd-fallback { margin-top: 12px; color: var(--muted); }
.dd-fallback .muted { color: var(--muted); }

/* ---- prototypes: native-pick panel filtering (flag tiles, tabs) ---- */
.langpick[data-js] .speak-panel { display: none; }
.langpick[data-js] .speak-panel.active { display: block; }
.speak-panels { margin-top: 18px; }

/* /1 flag tiles */
.flag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin: 16px 0; }
.flag-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface); text-decoration: none; color: var(--text); font-weight: 600; }
.flag-tile .flag { font-size: 2.2rem; line-height: 1; }
.flag-tile.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }

/* /2 hero sentence */
.hero-sentence { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; font-size: 1.5rem; line-height: 1.7; margin: 28px 0; }
.hs-pick { font-size: 1.25rem; font-weight: 700; color: var(--primary); padding: 6px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); }
.hs-go { font-size: 1.05rem; }

/* /3 tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.tabs .tab { flex: 0 0 auto; padding: 12px 16px; min-height: 44px; text-decoration: none; color: var(--text);
  border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs .tab.active { border-bottom-color: var(--primary); color: var(--primary); font-weight: 700; }

/* /4 matrix */
.matrix th, .matrix td { text-align: center; white-space: nowrap; }
.matrix thead th, .matrix th[lang] { background: color-mix(in srgb, var(--text) 5%, transparent); }
.matrix td a { font-weight: 600; }
.matrix .x { color: var(--muted); }

/* /5 typeahead */
.ta-input { width: 100%; padding: 12px 14px; font-size: 1.1rem; margin: 8px 0 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.combo-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.combo-row a { display: block; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); }
.combo-row a:hover { border-color: var(--primary); }
.combo-row.muted { padding: 11px 14px; color: var(--muted); }

/* ---- 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; }
  .directory { grid-template-columns: 1fr 1fr; }
}
