/* site.css — tokens from doc/DESIGN.md. Layout follows the original design language; colours are an
   independent dark-olive palette (2026-11-12, DECISIONS O3) so the public site is not read as an official
   Lietuvos bankas product. Series colours validated for colour-vision deficiency (dataviz validator). */

:root {
  color-scheme: light;
  --brand:        #5b6e1f;
  --brand-dark:   #3b4a1e;
  --brand-mid:    #6f8526;
  --brand-tint:   #d3dcae;
  --surface:      #ffffff;
  --surface-2:    #f4f4f4;
  --border:       #d7d7d7;
  --grid:         #eaeaea;
  --text:         #333333;
  --text-2:       #575757;
  --text-3:       #6f6f6f;   /* DESIGN.md text-3 is #949393; darkened to 4.9:1 for small text */
  --heading:      #3b4a1e;
  --negative:     #da4453;
  --series-1:     #5b6e1f;
  --series-2:     #2f6db5;
  --series-3:     #b8860b;
  --series-4:     #8e4b8a;
  --series-other: #949393;
  --scatter-old:  #d3d8c4;
  --header-bg:    #3b4a1e;
  --header-text:  #ffffff;
  --on-brand:     #ffffff;   /* text on --brand fills */
  --focus:        #2f6db5;
  --radius:       4px;
  --font-body:    "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head:    "Roboto Slab", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand: #9aaf45; --brand-dark: #cbd89a; --brand-mid: #a9bd55; --brand-tint: #3c4a1c;
    --surface: #1c1d19; --surface-2: #23251f; --border: #3b3e35; --grid: #2d2f28;
    --text: #ececec; --text-2: #c4c6bd; --text-3: #9da095; --heading: #cbd89a;
    --series-1: #5c7524; --series-2: #4f95e0; --series-3: #bb8c2a; --series-4: #b866b8;
    --series-other: #82857a; --scatter-old: #44493a;
    --header-bg: #262d16; --header-text: #ececec; --focus: #4f95e0; --on-brand: #1c1d19;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #9aaf45; --brand-dark: #cbd89a; --brand-mid: #a9bd55; --brand-tint: #3c4a1c;
  --surface: #1c1d19; --surface-2: #23251f; --border: #3b3e35; --grid: #2d2f28;
  --text: #ececec; --text-2: #c4c6bd; --text-3: #9da095; --heading: #cbd89a;
  --series-1: #5c7524; --series-2: #4f95e0; --series-3: #bb8c2a; --series-4: #b866b8;
  --series-other: #82857a; --scatter-old: #44493a;
  --header-bg: #262d16; --header-text: #ececec; --focus: #4f95e0; --on-brand: #1c1d19;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 64px; }
body {
  margin: 0; background: var(--surface); color: var(--text);
  font: 15px/1.5 var(--font-body); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ── Header and navigation ─────────────────────────────────────────────── */
.site-header { background: var(--header-bg); color: var(--header-text); }
.site-header .inner {
  max-width: 1240px; margin: 0 auto; padding: 22px 16px 18px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.site-header h1 { font: 700 26px/1.2 var(--font-head); margin: 0; letter-spacing: .2px; }
.site-header p { margin: 4px 0 0; opacity: .85; font-size: 14px; }
.theme-toggle {
  background: transparent; color: var(--header-text); border: 1px solid rgba(255,255,255,.45);
  border-radius: var(--radius); padding: 5px 12px; font: 500 13px var(--font-body); cursor: pointer;
}
.theme-toggle:hover { background: rgba(255,255,255,.12); }

.site-nav {
  position: sticky; top: 0; z-index: 20; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-nav .inner {
  max-width: 1240px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.site-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav li a {
  display: block; padding: 14px 12px 11px; color: var(--text-2); text-decoration: none;
  font-weight: 500; border-bottom: 3px solid transparent; white-space: nowrap;
}
.site-nav li a:hover { color: var(--brand); }
.site-nav li a.active { color: var(--brand); border-bottom-color: var(--brand); }

.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.segmented button {
  background: var(--surface); color: var(--text-2); border: 0; border-left: 1px solid var(--border);
  padding: 4px 10px; font: 500 13px var(--font-body); cursor: pointer; min-height: 30px;
}
.segmented button:first-child { border-left: 0; }
.segmented button:hover { background: var(--surface-2); color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.range-control { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 13px; color: var(--text-2); }

/* ── Layout ────────────────────────────────────────────────────────────── */
main { max-width: 1240px; margin: 0 auto; padding: 8px 16px 48px; }
/* Sections: a clear band so the reader sees where Growth / Labour market / Inflation start while scrolling */
section.block { padding-top: 40px; scroll-margin-top: 56px; }
section.block + section.block { margin-top: 24px; }
section.block > h2 {
  font: 700 32px/1.2 var(--font-head); color: var(--heading); margin: 0 0 6px;
  padding-top: 14px; border-top: 5px solid var(--brand);
}
section.block > p.intro { margin: 0 0 20px; color: var(--text-2); font-size: 16px; max-width: 860px; }
#overview > h2, section.block:first-child > h2 { border-top: 0; padding-top: 0; }
/* Subheadings inside a section (e.g. Price data / Supply or demand? / Cyclical or acyclical?) */
.grid > .subhead { grid-column: 1 / -1; margin: 18px 0 0; padding: 10px 0 2px; border-bottom: 2px solid var(--border); }
.grid > .subhead:first-child { margin-top: 0; }
.subhead h3 { font: 700 21px/1.3 var(--font-head); color: var(--heading); margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.subhead .tag {
  font: 500 11px/1 var(--font-body); text-transform: uppercase; letter-spacing: .06em; color: var(--brand);
  border: 1px solid var(--brand); border-radius: 999px; padding: 3px 8px;
}
.subhead p { margin: 4px 0 8px; color: var(--text-2); font-size: 14px; max-width: 860px; }
@media (max-width: 600px) { section.block > h2 { font-size: 26px; } .subhead h3 { font-size: 18px; } }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid { grid-template-columns: minmax(0, 1fr); } }

/* ── Tiles ─────────────────────────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile {
  background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px 8px;
  border-top: 3px solid var(--brand); min-width: 0;
}
.tile .label { font-size: 13px; color: var(--text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .value-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tile .freq { font-size: 10px; padding: 0 5px; flex-shrink: 0; }
.tile .value { font: 700 28px/1.15 var(--font-body); color: var(--text); margin-top: 2px; }
.tile .value small { font-size: 15px; font-weight: 500; color: var(--text-2); margin-left: 2px; }
.tile .meta { font-size: 12px; color: var(--text-3); }
.tile .spark { margin-top: 4px; height: 36px; }

/* ── Cards / charts ────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 10px; min-width: 0; display: flex; flex-direction: column;
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.card h3 { font: 600 17px/1.3 var(--font-head); color: var(--heading); margin: 0; }
.title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.freq {
  display: inline-block; font: 500 11px/1.6 var(--font-body); letter-spacing: .2px; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 0 7px; white-space: nowrap;
}
.card .subtitle { font-size: 13px; color: var(--text-2); margin: 2px 0 6px; }
.card .controls { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 2px; font-size: 13px; color: var(--text); }
.legend button {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 2px 0;
  color: var(--text); font: inherit; cursor: pointer;
}
.legend button[aria-pressed="false"] { color: var(--text-3); text-decoration: line-through; }
.legend .swatch { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.legend .swatch.box { height: 10px; width: 10px; border-radius: 2px; }
.chart { position: relative; min-height: 260px; }
.chart svg { display: block; overflow: visible; }
.card .foot { font-size: 12px; color: var(--text-3); margin-top: 6px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card .foot .notes { color: var(--text-3); }
.linkbtn { background: none; border: 0; color: var(--brand); font: 500 12px var(--font-body); cursor: pointer; padding: 0 0 0 10px; }
.linkbtn:hover { text-decoration: underline; }
.badge {
  display: inline-block; font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); cursor: help;
}
.badge::before { content: "⚠ "; color: var(--negative); }

.table-wrap { max-height: 280px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.data { border-collapse: collapse; width: 100%; font-size: 13px; }
table.data th, table.data td { padding: 4px 8px; text-align: right; border-bottom: 1px solid var(--grid); }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--text-2); font-weight: 500; }

/* ── Latest releases + status ──────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; margin-top: 16px; }
@media (max-width: 900px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
ul.releases { list-style: none; margin: 0; padding: 0; }
ul.releases li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--grid); font-size: 14px; }
ul.releases .when { color: var(--text-3); font-size: 13px; }
ul.releases .val { font-weight: 500; }
/* Release calendar */
.cal-day { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--grid); }
.cal-date strong { display: block; font-size: 14px; color: var(--heading); }
.cal-date span { font-size: 12px; color: var(--text-3); }
.cal-day ul { list-style: none; margin: 0; padding: 0; }
.cal-day li { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; column-gap: 8px; font-size: 14px; padding: 1px 0; }
.cal-time { color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.cal-title a { color: var(--text); text-decoration: none; }
.cal-title a:hover { color: var(--brand); text-decoration: underline; }
.cal-period { color: var(--text-2); font-size: 13px; white-space: nowrap; }
.cal-src { grid-column: 2 / -1; font-size: 11.5px; color: var(--text-3); margin-top: -1px; }
.flash-tag { display: inline-block; margin-left: 6px; font: 600 10px/1 var(--font-body); text-transform: uppercase; letter-spacing: .05em;
  color: var(--on-brand); background: var(--brand); border-radius: 999px; padding: 3px 6px; vertical-align: 1px; }
.link-btn { background: none; border: 0; padding: 8px 0 0; color: var(--brand); font: 500 13px var(--font-body); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.cal-note { font-size: 12px; color: var(--text-3); margin: 6px 0 0; }
.status-details { margin-top: 14px; font-size: 13px; color: var(--text-2); border-top: 1px solid var(--border); padding-top: 8px; }
.status-details summary { cursor: pointer; }
.status-details ul.status { margin-top: 6px; }
#calendar { scroll-margin-top: 64px; }
ul.status { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }

/* Observable Plot tooltip */
g[aria-label="tip"] { font-family: var(--font-body); }

footer.site-footer { border-top: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 13px; }
footer.site-footer .inner { max-width: 1240px; margin: 0 auto; padding: 20px 16px 28px; }
footer.site-footer p { margin: 4px 0; }

.loading { color: var(--text-3); padding: 40px 0; text-align: center; }
.error { color: var(--negative); }

/* full-width cards and the supply/demand table */
.card.wide { grid-column: 1 / -1; }
.sd-summary { font-size: 14px; margin: 4px 0 10px; color: var(--text); }
.table-wrap.tall { max-height: 460px; }
table.data td.ind { text-align: left; color: var(--text-2); max-width: 340px; }
table.data td .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--border); }
details.method { margin-top: 10px; font-size: 13px; color: var(--text-2); }
details.method summary { cursor: pointer; color: var(--brand); font-weight: 500; }
details.method p { margin: 6px 0; max-width: 90ch; }

/* "How this is built" button and dialog */
.info-btn {
  background: var(--surface); color: var(--brand); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 3px 10px; font: 500 13px var(--font-body); cursor: pointer; min-height: 30px; white-space: nowrap;
}
.info-btn:hover { border-color: var(--brand); background: var(--surface-2); }
.info-btn span { font-size: 15px; }
dialog.info-dialog {
  border: 1px solid var(--border); border-radius: 6px; padding: 0; width: min(880px, calc(100vw - 32px));
  max-height: calc(100vh - 48px); background: var(--surface); color: var(--text);
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
dialog.info-dialog::backdrop { background: rgba(0, 20, 14, .45); }
.dialog-body { padding: 0 24px 20px; overflow: auto; max-height: calc(100vh - 50px); font-size: 14px; }
.dialog-head {
  position: sticky; top: 0; background: var(--surface); display: flex; justify-content: space-between;
  align-items: flex-start; gap: 12px; padding: 18px 0 10px; border-bottom: 1px solid var(--border); z-index: 1;
}
.dialog-head h2 { font: 700 20px/1.3 var(--font-head); color: var(--heading); margin: 0; }
.dialog-close {
  background: none; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-2);
  font-size: 20px; line-height: 1; width: 32px; height: 32px; cursor: pointer; flex-shrink: 0;
}
.dialog-close:hover { color: var(--text); border-color: var(--text-2); }
.dialog-body h3 { font: 600 16px/1.3 var(--font-head); color: var(--heading); margin: 18px 0 6px; }
.dialog-body p, .dialog-body li { max-width: 80ch; }
.dialog-body ol, .dialog-body ul { padding-left: 20px; margin: 4px 0; }
.dialog-body li { margin: 3px 0; }
.dialog-body .table-wrap { max-height: none; }
.dialog-body table.data td.ind { max-width: none; }
.dialog-foot { color: var(--text-3); font-size: 12px; margin-top: 16px; }
table.data th.ind { text-align: left; }
.dialog-body table.data th, .dialog-body table.data td { text-align: left; vertical-align: top; }
.dialog-body table.data td:nth-child(3) { white-space: nowrap; }
@media (max-width: 600px) { .dialog-body { padding: 0 14px 16px; } .dialog-head h2 { font-size: 17px; } }
@media (max-width: 600px) {
  .cal-day { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .cal-date { display: flex; gap: 8px; align-items: baseline; }
}
