/* Salarium: one stylesheet. Tokens first; see DESIGN.md before adding colours or components. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-stretch: 85% 100%;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-latin-standard-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-stretch: 85% 100%;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-latin-ext-standard-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --ink: #1C2233;
  --paper: #FFFFFF;
  --form: #F1F3F8;
  --rule: #C9D0DE;
  --carbon: #4035A6;
  --muted: #555D70;
  --flag: #9A3412;

  --font: "IBM Plex Sans", "IBM Plex Sans JP", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --t-xs: 0.8125rem; --t-sm: 0.9375rem; --t-md: 1rem; --t-lg: 1.25rem; --t-xl: 1.5625rem; --t-2xl: 2rem; --t-3xl: 2.25rem;
  --radius: 3px;
  --gutter: 16px;
  --measure: 44rem;
  --wide: 60rem;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
  hyphens: auto;
}

a { color: var(--carbon); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--carbon); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.15; font-weight: 600; margin: 0 0 var(--s3); font-stretch: 92%; }
h1 { font-size: var(--t-2xl); margin-top: var(--s4); }
h2 { font-size: var(--t-xl); margin-top: var(--s7); }
h3 { font-size: var(--t-lg); margin-top: var(--s5); }
p { margin: 0 0 var(--s4); }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 24px; } h1 { font-size: 2.5rem; } }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--paper); padding: var(--s2) var(--s4); z-index: 10; }
.skip:focus { left: var(--s4); }
.muted { color: var(--muted); }
.small { font-size: var(--t-sm); color: var(--muted); }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header__inner { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: space-between; padding-top: var(--s3); padding-bottom: var(--s3); }
.brand { font-weight: 600; font-size: var(--t-lg); color: var(--ink); text-decoration: none; letter-spacing: 0.01em; }
.switcher { display: flex; gap: var(--s2); align-items: center; font-size: var(--t-sm); }
.switcher label { color: var(--muted); }
@media (max-width: 767px) { .switcher label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .switcher select { max-width: 12rem; font-size: var(--t-sm); min-height: 40px; } }
.switcher select { max-width: 15rem; }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); padding: 0; margin: var(--s4) 0 0; font-size: var(--t-xs); color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: var(--s2); color: var(--rule); }
.crumbs a { color: var(--muted); }

.lead { font-size: var(--t-lg); max-width: var(--measure); color: var(--muted); }
.lead-after, .context { max-width: var(--measure); }

/* Controls: the only rounded things on the page */
input, select, button { font: inherit; color: inherit; }
input[type="text"], input[type="number"], input[type="search"], select {
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  background: var(--paper);
  padding: var(--s2) var(--s3);
  min-height: 44px;
  max-width: 100%;
}
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--carbon); margin: 0; }
.button, .consent button {
  border: 1px solid var(--carbon);
  border-radius: var(--radius);
  background: var(--carbon);
  color: var(--paper);
  padding: var(--s2) var(--s4);
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
}

/* Calculator */
.calc { background: var(--form); padding: var(--s4); margin: var(--s4) 0; }
.field { margin-bottom: var(--s4); display: flex; flex-direction: column; gap: var(--s1); }
.field label { font-weight: 600; font-size: var(--t-sm); }
.field small { color: var(--muted); font-size: var(--t-xs); }
.field--check { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.field--check small { flex-basis: 100%; }
.field--amount input { font-size: var(--t-lg); font-weight: 600; width: 100%; }
.amount-row { display: flex; gap: var(--s2); }
.amount-row input { flex: 1 1 8rem; min-width: 0; }
.amount-row select { flex: 0 0 auto; }
.with-unit { display: flex; align-items: center; gap: var(--s2); }
.with-unit input { width: 8rem; }
.mode { border: 0; padding: 0; margin: 0 0 var(--s4); display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; }
.mode label { font-weight: 600; font-size: var(--t-sm); }
.mode__opt { display: inline-flex; align-items: center; gap: var(--s2); }
.country p { margin-bottom: var(--s3); }
.country .muted { display: inline-block; margin-top: var(--s1); }
@media (max-width: 767px) { h1 { font-size: 1.75rem; } .lead { font-size: var(--t-md); } }
.more-options { margin-bottom: var(--s3); }
.more-options summary, .adjust summary { cursor: pointer; font-weight: 600; font-size: var(--t-sm); color: var(--carbon); padding: var(--s2) 0; }
.more-options[open] summary { margin-bottom: var(--s3); }
.hint { font-size: var(--t-xs); color: var(--muted); margin: 0; }
.js .js-hide { display: none; }
.adjust { margin: var(--s4) 0; }

.calc-layout { display: grid; gap: var(--s4); }
@media (min-width: 1024px) {
  .calc-layout { grid-template-columns: 20rem minmax(0, 1fr); gap: var(--s6); align-items: start; }
  .calc-layout .calc { margin-top: 0; position: sticky; top: var(--s4); }
}

/* Answer block */
.answer { background: var(--form); padding: var(--s4) var(--s4) var(--s3); margin: var(--s4) 0 var(--s3); }
.answer p { margin: 0; }
.answer__given { color: var(--ink); font-size: var(--t-md); }
.answer__figure { margin: var(--s1) 0 var(--s2) !important; line-height: 1.1; }
.answer__figure output { font-size: var(--t-3xl); font-weight: 600; color: var(--carbon); letter-spacing: -0.01em; }
.answer__unit { font-size: var(--t-md); white-space: nowrap; }
.answer__more { color: var(--muted); font-size: var(--t-sm); }
@media (min-width: 768px) { .answer__figure output { font-size: 2.75rem; } }
.is-loading .answer__figure output { opacity: 0.55; }

.note { max-width: var(--measure); font-size: var(--t-sm); }
.assumptions { color: var(--muted); margin-bottom: var(--s2); }
.flag, .flag-note .flag { color: var(--flag); font-weight: 600; }
.flag-note { color: var(--flag); }

/* Tables */
.table { width: 100%; border-collapse: collapse; margin: var(--s3) 0 var(--s4); font-size: var(--t-sm); }
.table caption { text-align: left; font-weight: 600; padding-bottom: var(--s2); caption-side: top; }
.table th, .table td { padding: var(--s2) var(--s2) var(--s2) 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.table thead th { font-size: var(--t-xs); color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--muted); }
.table th[scope="row"] { font-weight: 400; }
.table .num { text-align: right; white-space: nowrap; padding-right: 0; padding-left: var(--s3); }
.table .basis { color: var(--muted); font-size: var(--t-xs); }
.table .basis, .table .year { display: none; }
@media (min-width: 768px) { .table .basis, .table .year { display: table-cell; } }
.row-gross th, .row-gross td { font-weight: 600; }
.row-credit th { padding-left: var(--s4); color: var(--muted); }
.row-credit td { color: var(--muted); }
.row-info th, .row-info td { color: var(--muted); font-style: italic; }
.row-net th, .row-net td { font-weight: 600; border-top: 2px solid var(--ink); border-bottom: 0; }
.row-net .num { color: var(--carbon); }
.table--compact { max-width: var(--measure); }
.is-current th, .is-current td { font-weight: 600; }
.grid-table { max-width: 28rem; }

/* Sections */
.section { max-width: var(--wide); }
.changes { max-width: var(--measure); padding-left: 1.2em; }
.changes li { margin-bottom: var(--s2); }
.faq details { border-bottom: 1px solid var(--rule); padding: var(--s3) 0; max-width: var(--measure); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: var(--s2) 0 0; }
.link-grid { list-style: none; padding: 0; margin: 0 0 var(--s4); display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: var(--s2) var(--s4); font-size: var(--t-sm); }
.source-list { font-size: var(--t-sm); padding-left: 1.2em; }
.source-list li { margin-bottom: var(--s1); }
.sources summary { cursor: pointer; color: var(--carbon); }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: var(--s6); }
.prose code, code { font-size: 0.9em; background: var(--form); padding: 0 var(--s1); }
pre { background: var(--form); padding: var(--s3); overflow-x: auto; font-size: var(--t-sm); }
.countries { list-style: none; padding: 0; display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.country h2 { margin-top: var(--s4); font-size: var(--t-lg); }
.changelog { padding-left: 1.2em; max-width: var(--measure); }
.changelog time { font-weight: 600; margin-right: var(--s2); }
.search { max-width: 30rem; margin: var(--s4) 0; }
.search label { display: block; font-weight: 600; margin-bottom: var(--s1); }

/* Ads and partners: space reserved so nothing moves when an ad arrives */
.ad { margin: var(--s6) 0; min-height: 250px; background: var(--form); }
.ad--mid-content { min-height: 280px; }
.affiliates { font-size: var(--t-sm); border-top: 1px solid var(--rule); margin-top: var(--s6); padding-top: var(--s3); }
.affiliates__disclosure { color: var(--muted); font-size: var(--t-xs); }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); margin-top: var(--s8); padding: var(--s5) 0 var(--s7); font-size: var(--t-sm); }
.footer-links { list-style: none; padding: 0; margin: 0 0 var(--s3); display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.footer-note { color: var(--muted); max-width: var(--measure); }

/* Consent banner */
.consent { position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper); border-top: 2px solid var(--ink); padding: var(--s3) var(--gutter); z-index: 20; font-size: var(--t-sm); }
.consent p { margin: 0 0 var(--s2); max-width: var(--measure); }
.consent__actions { display: flex; gap: var(--s3); }
.consent__actions button { flex: 0 1 10rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Print: the answer, the breakdown, periods and sources on one sheet */
@media print {
  .site-header, .site-footer, .ad, .affiliates, .calc, .adjust, .related, .consent, .crumbs, .skip, .faq { display: none !important; }
  body { font-size: 11pt; }
  .answer { background: none; border: 1px solid #000; }
  .answer__figure output { color: #000; }
  .table .basis, .table .year { display: table-cell; }
  .sources details { display: block; }
  .sources details > * { display: block; }
  a { color: #000; }
  .source-list a::after { content: " (" attr(href) ")"; font-size: 8pt; }
}
