/*
Theme Name: First Bank Abroad
Theme URI: https://firstbankabroad.com
Author: First Bank Abroad Editorial
Description: Variant A ("green"): document filter, service table and transfer calculator for newcomers in Poland, Germany and Czechia. Languages uk/en/ru.
Version: 1.0.0
Requires PHP: 8.1
Text Domain: firstbankabroad
*/

/* Tokens — light by default, dark by system preference or [data-theme="dark"] (as the prototype). */
:root {
  --fba-ink: #0d2b24; --fba-ink-2: #36554d; --fba-muted: #5d736e; --fba-line: #d9e4df;
  --fba-paper: #f4f8f5; --fba-card: #ffffff; --fba-accent: #0f8a5f; --fba-accent-2: #e8f5ee;
  --fba-on-accent: #ffffff; --fba-warn: #8a5a12; --fba-warn-soft: #fdf3e1;
  --fba-sans: Manrope, Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fba-serif: "Source Serif 4", Fraunces, Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fba-ink: #e6f2ec; --fba-ink-2: #b5cbc3; --fba-muted: #8fa59c; --fba-line: #24403a;
    --fba-paper: #0b1b17; --fba-card: #112620; --fba-accent: #3ccf91; --fba-accent-2: #173a2e;
    --fba-on-accent: #0b1b17; --fba-warn: #f0b75a; --fba-warn-soft: #3a2e17;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fba-ink: #e6f2ec; --fba-ink-2: #b5cbc3; --fba-muted: #8fa59c; --fba-line: #24403a;
  --fba-paper: #0b1b17; --fba-card: #112620; --fba-accent: #3ccf91; --fba-accent-2: #173a2e;
  --fba-on-accent: #0b1b17; --fba-warn: #f0b75a; --fba-warn-soft: #3a2e17;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-wrap: break-word; background: var(--fba-paper); color: var(--fba-ink); font: 16px/1.55 var(--fba-sans); }
a { color: var(--fba-accent); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--fba-accent); outline-offset: 2px; }
img { max-width: 100%; height: auto; }
.fba-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fba-skip { position: absolute; left: -999px; top: 8px; background: var(--fba-ink); color: var(--fba-paper); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.fba-skip:focus { left: 8px; }

.fba-wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.fba-narrow { max-width: 760px; }

/* Header */
.fba-header { border-bottom: 1px solid var(--fba-line); background: var(--fba-card); }
.fba-header-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.fba-logo { font: 700 20px var(--fba-serif); text-decoration: none; color: var(--fba-ink); letter-spacing: -.01em; }
.fba-logo em { font-style: normal; color: var(--fba-accent); }
.fba-sp { flex: 1; }
.fba-select, .fba-calc select, .fba-calc input {
  font: 600 14px var(--fba-sans); color: var(--fba-ink); background: var(--fba-paper);
  border: 1px solid var(--fba-line); border-radius: 10px; padding: 8px 10px; max-width: 60vw;
}
.fba-langlinks a { margin-left: 8px; font-weight: 600; font-size: 14px; }

/* Hero */
.fba-hero { padding: 40px 0 8px; }
h1, .fba-h2, .fba-box h2, .fba-box h3, .fba-entry h2 { font-family: var(--fba-serif); }
.fba-hero h1, .fba-article-head h1, .fba-404 h1 { font-weight: 700; font-size: clamp(30px, 4.6vw, 48px); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 10px; max-width: 20ch; }
.fba-article-head h1 { max-width: none; font-size: clamp(28px, 4vw, 40px); }
.fba-lead { color: var(--fba-ink-2); font-size: 17px; max-width: 60ch; margin: 0; }
.fba-h2 { font-size: 24px; margin: 28px 0 12px; }

/* Tabs (links) */
.fba-tabs { display: flex; gap: 6px; background: var(--fba-card); border: 1px solid var(--fba-line); border-radius: 14px; padding: 5px; margin: 24px 0 0; width: max-content; max-width: 100%; overflow-x: auto; }
.fba-tab { padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 15px; white-space: nowrap; color: var(--fba-ink); text-decoration: none; }
.fba-tab:hover { background: var(--fba-accent-2); }
.fba-tab[aria-current="page"] { background: var(--fba-ink); color: var(--fba-paper); }
.fba-tab[aria-disabled="true"] { color: var(--fba-muted); }

/* Layout */
.fba-grid { display: grid; grid-template-columns: 300px 1fr; gap: 20px; margin: 22px 0 24px; align-items: start; }
.fba-grid > * { min-width: 0; }
.fba-main > * + * { margin-top: 20px; }
.fba-box { background: var(--fba-card); border: 1px solid var(--fba-line); border-radius: 18px; padding: 20px; }
.fba-box h2 { font-weight: 700; font-size: 19px; margin: 0 0 4px; }
.fba-box h3 { font-weight: 700; font-size: 19px; margin: 0 0 6px; }
.fba-sub { color: var(--fba-muted); font-size: 13px; margin: 0 0 14px; }
.fba-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 0 0 24px; }
.fba-langcards { margin-top: 24px; }
.fba-card-soon { opacity: .6; }
.fba-btn { display: inline-block; background: var(--fba-ink); color: var(--fba-paper); text-decoration: none; font-weight: 700; border-radius: 12px; padding: 10px 16px; font-size: 14px; }
.fba-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.fba-chip { border: 1px solid var(--fba-line); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--fba-ink); }
.fba-how ul { margin: 8px 0 0; padding-left: 20px; }
.fba-how li { margin: 6px 0; }

/* Filter */
.fba-f { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--fba-line); font-weight: 600; font-size: 14px; cursor: pointer; }
.fba-f input { accent-color: var(--fba-accent); width: 18px; height: 18px; flex: none; }
.fba-note { background: var(--fba-warn-soft); color: var(--fba-warn); border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 600; margin-top: 12px; }

/* Table — values set with !important on a class to win over the shared contrast guard,
   which otherwise forces a light table palette in dark mode. */
.fba-tablewrap { overflow-x: auto; }
.fba-table { width: 100%; border-collapse: collapse; font-size: 14px; background: transparent !important; color: var(--fba-ink) !important; }
.fba-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 10px; background: transparent !important; color: var(--fba-muted) !important; border: 0 !important; border-bottom: 1px solid var(--fba-line) !important; }
.fba-table td { padding: 14px 10px; vertical-align: middle; background: transparent !important; color: var(--fba-ink) !important; border: 0 !important; border-bottom: 1px solid var(--fba-line) !important; }
.fba-table td small { display: block; color: var(--fba-muted); font-weight: 500; font-size: 12px; margin-top: 2px; }
.fba-table tr.fba-dim td { opacity: .35; }
.fba-bn { font-weight: 700; }
.fba-y { color: var(--fba-accent); font-weight: 700; }
.fba-n, .fba-muted { color: var(--fba-muted); }
.fba-stale { color: var(--fba-warn); font-weight: 700; }
.fba-go { display: inline-block; background: var(--fba-accent); color: var(--fba-on-accent); text-decoration: none; font-weight: 700; border-radius: 10px; padding: 8px 12px; font-size: 13px; white-space: nowrap; }
.fba-go[hidden] { display: none; }
.fba-spons { white-space: nowrap; }
.fba-count { font-size: 13px; color: var(--fba-ink-2); margin: 0 0 6px; }
.fba-more { margin: 12px 0 0; font-size: 14px; font-weight: 600; }
.fba-empty { border: 1px dashed var(--fba-line); border-radius: 14px; padding: 16px; color: var(--fba-ink-2); font-size: 14px; }
.fba-empty p { margin: 0 0 8px; }
.fba-empty p:last-child { margin-bottom: 0; }
.fba-empty-h { font-weight: 700; color: var(--fba-ink); }

/* Calculator */
.fba-calc { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; margin-top: 6px; }
.fba-calc label { font-size: 12px; font-weight: 700; color: var(--fba-muted); text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: 6px; }
.fba-calc input, .fba-calc select { width: 100%; max-width: none; font-size: 16px; padding: 12px; border-radius: 12px; }
.fba-calc button { font: 700 15px var(--fba-sans); background: var(--fba-ink); color: var(--fba-paper); border: 0; border-radius: 12px; padding: 13px 18px; cursor: pointer; }
.fba-res { margin-top: 14px; color: var(--fba-ink-2); font-size: 14px; }
.fba-res ol { margin: 0; padding-left: 20px; }
.fba-res li { margin: 8px 0; }
.fba-calcnote { margin: 12px 0 0; }

/* Guides list */
.fba-guides { list-style: none; margin: 8px 0 0; padding: 0; }
.fba-guides li { padding: 10px 0; border-top: 1px solid var(--fba-line); }
.fba-guides a { font-weight: 700; }
.fba-guides span, .fba-guides small { display: block; color: var(--fba-muted); font-size: 13px; }

/* Article / page */
.fba-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 20px 0 0; font-size: 13px; color: var(--fba-muted); }
.fba-crumbs li + li::before { content: "›"; margin-right: 6px; }
.fba-article-head { padding: 24px 0 8px; }
.fba-byline { color: var(--fba-muted); font-size: 14px; margin: 12px 0 0; }
.fba-entry { font-size: 17px; line-height: 1.65; margin: 16px 0 24px; }
.fba-entry h2 { font-size: 24px; margin: 32px 0 8px; line-height: 1.2; }
.fba-entry h3 { font-size: 18px; margin: 24px 0 6px; }
.fba-entry table { width: 100%; border-collapse: collapse; font-size: 15px; background: transparent !important; color: var(--fba-ink) !important; }
.fba-entry :is(th, td) { padding: 8px 10px; text-align: left; background: transparent !important; color: var(--fba-ink) !important; border: 0 !important; border-bottom: 1px solid var(--fba-line) !important; }
.fba-sources { border-top: 1px solid var(--fba-line); padding-top: 12px; font-size: 14px; }
.fba-sources h2 { font-size: 18px; font-family: var(--fba-serif); }
.fba-affnote { margin: 8px 0 0; }

.fba-back { display: inline-block; margin-top: 24px; color: var(--fba-muted); font-weight: 600; font-size: 14px; }
.fba-disc { color: var(--fba-muted); font-size: 12px; margin: 16px 0 48px; }
.fba-disc a { color: inherit; }

/* Country hint (client-side) */
.fba-hint { background: var(--fba-accent-2); border-bottom: 1px solid var(--fba-line); font-size: 14px; }
.fba-hint .fba-wrap { display: flex; gap: 12px; align-items: center; min-height: 44px; }
.fba-hint-go { font-weight: 700; }
.fba-hint-x { margin-left: auto; background: none; border: 0; font-size: 22px; line-height: 1; color: var(--fba-ink); cursor: pointer; padding: 4px 8px; }

/* Footer */
.fba-footer { border-top: 1px solid var(--fba-line); background: var(--fba-card); margin-top: 24px; font-size: 14px; }
.fba-footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; padding-top: 28px; padding-bottom: 16px; }
.fba-footer-about p { color: var(--fba-ink-2); margin: 8px 0 0; }
.fba-footer-col { display: flex; flex-direction: column; gap: 6px; }
.fba-footer-col span { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--fba-muted); }
.fba-footer-col a { color: var(--fba-ink); text-decoration: none; }
.fba-footer-col a:hover { text-decoration: underline; }
.fba-footer-legal { color: var(--fba-muted); font-size: 12px; padding-bottom: 24px; }

@media (max-width: 820px) {
  .fba-grid { grid-template-columns: 1fr; }
  .fba-calc { grid-template-columns: 1fr; }
  .fba-footer-inner { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
