/* Sokak Rayiç - the one style sheet of the site.
   Design: the Turkish street name plate. The plate is the one bold element.
   Everything else is quiet: white paper, graphite text, plain tables.
   No outside font: the plate face is a DIN-style system font where one exists. */

:root {
  --plate: #1c3f8c;      /* street name plate blue */
  --plate-ink: #ffffff;
  --ink: #262a31;        /* graphite text */
  --muted: #5b626e;      /* secondary text, 6:1 on white */
  --rule: #d4d9e1;       /* table and section lines */
  --wash: #edf1f8;       /* a quiet blue-grey for the highlighted row and strip */
  --odd: #a8251a;        /* only for an odd value */
  --paper: #ffffff;

  --face-plate: Bahnschrift, "DIN Alternate", "DIN Next", "Roboto Condensed",
    "sans-serif-condensed", "Arial Narrow", sans-serif;
  --face-text: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;

  --measure: 42rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--face-text);
  font-variant-numeric: tabular-nums;
}

a { color: var(--plate); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--plate); outline-offset: 2px; border-radius: 2px; }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Header ---------- */

.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-top: 1rem; padding-bottom: 1rem;
}

/* The wordmark is a small plate: the same object as the hero. */
.wordmark {
  display: inline-block;
  padding: 0.2rem 0.55rem 0.15rem;
  background: var(--plate); color: var(--plate-ink);
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px var(--plate), inset 0 0 0 3px var(--plate-ink);
  font: 700 1.05rem/1.3 var(--face-plate);
  letter-spacing: 0.01em;
  text-decoration: none;
}

.site-head nav a { color: var(--ink); font-size: 0.9375rem; }

.crumbs { margin: 0.25rem 0 1.5rem; font-size: 0.9375rem; color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.crumbs li + li::before { content: "/"; padding: 0 0.45rem; color: var(--rule); }
.crumbs a { color: var(--muted); }

/* ---------- The street name plate (hero) ---------- */

.plate {
  display: inline-block;
  max-width: 100%;
  margin: 0 0 1.25rem;
  padding: 0.7rem 1.4rem 0.8rem;
  background: var(--plate); color: var(--plate-ink);
  border-radius: 8px;
  /* the white line inside the edge, as on a real plate */
  box-shadow: inset 0 0 0 5px var(--plate), inset 0 0 0 7px var(--plate-ink),
    0 1px 0 rgba(28, 63, 140, 0.25);
  font-family: var(--face-plate);
  text-transform: uppercase;
  line-height: 1.05;
}
.plate .plate-top {
  display: block;
  padding-bottom: 0.4rem; margin-bottom: 0.45rem;
  border-bottom: 2px solid var(--plate-ink);
  font-size: clamp(0.8rem, 2.6vw, 0.95rem); font-weight: 600; letter-spacing: 0.06em;
}
.plate .plate-name {
  display: block;
  font-size: clamp(1.9rem, 8.5vw, 3.1rem); font-weight: 700; letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

/* ---------- Headings and the value ---------- */

h1 {
  margin: 0 0 0.25rem;
  font: 600 1.125rem/1.4 var(--face-text);
  color: var(--ink);
}

h2 {
  margin: 2.75rem 0 0.9rem;
  font: 700 1.3125rem/1.25 var(--face-plate);
  letter-spacing: 0.005em;
}

/* A page without a plate (the calculator) sets its title in the plate face. */
h1.page-title { font: 700 clamp(1.75rem, 6vw, 2.4rem)/1.15 var(--face-plate); margin-bottom: 0.75rem; }

.value { margin: 0.6rem 0 0.4rem; }
.value-number {
  display: block;
  font: 700 clamp(2.6rem, 11vw, 4.25rem)/1 var(--face-plate);
  letter-spacing: -0.01em;
}
.value-number small { font-size: 0.42em; font-weight: 600; letter-spacing: 0; margin-left: 0.2em; }
.value-label { display: block; margin-top: 0.4rem; color: var(--muted); }

.source {
  margin: 1.25rem 0 0;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem; color: var(--muted);
}
.source p { margin: 0; }

.lede { max-width: 36rem; }
.note { color: var(--muted); font-size: 0.9375rem; max-width: 36rem; }
.odd-note { color: var(--odd); font-weight: 600; }

/* ---------- Where the street stands ---------- */

.strip { margin: 0.5rem 0 0.25rem; }
.strip svg { display: block; width: 100%; height: auto; }
.strip-ends {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: 0.875rem; color: var(--muted);
}
.strip-ends span:last-child { text-align: right; }
.rank { margin: 0.9rem 0 0; font-weight: 600; }

/* ---------- Figures: low, median, high ---------- */

.figures {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 1rem 1.5rem; margin: 1rem 0 0;
}
.figures div { border-left: 3px solid var(--wash); padding-left: 0.75rem; }
.figures dt { font-size: 0.875rem; color: var(--muted); }
.figures dd { margin: 0.1rem 0 0; font: 700 1.25rem/1.3 var(--face-plate); white-space: nowrap; }

/* ---------- The tax ledger ---------- */

.ledger { margin: 0; max-width: 32rem; }
.ledger div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.45rem 0; border-bottom: 1px solid var(--rule);
}
.ledger dt { min-width: 0; }
.ledger dt span { display: block; font-size: 0.875rem; color: var(--muted); }
.ledger dd { margin: 0; text-align: right; white-space: nowrap; }
/* The total carries the accountant's double rule. */
.ledger .total { border-bottom: 3px double var(--ink); font-weight: 700; }
.ledger .total dd { font: 700 1.25rem/1.2 var(--face-plate); }
.ledger .part dt { padding-left: 1rem; color: var(--muted); }

.cap-line { margin: 0.9rem 0 0; font-weight: 600; max-width: 34rem; }

/* ---------- Tables ---------- */

table { width: 100%; border-collapse: collapse; }
caption { text-align: left; color: var(--muted); font-size: 0.9375rem; padding-bottom: 0.5rem; }
th, td { padding: 0.5rem 0.5rem; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: baseline; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
thead th { font-size: 0.875rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--ink); }
td.num, th.num { text-align: right; white-space: nowrap; }
tbody tr:hover { background: var(--wash); }
td .kind { color: var(--muted); }

.filter { margin: 1.25rem 0 0.75rem; }
.filter label { display: block; font-weight: 600; margin-bottom: 0.3rem; }

/* ---------- Forms ---------- */

input[type="text"], input[type="search"], select {
  width: 100%; max-width: 22rem;
  font: inherit; color: var(--ink);
  padding: 0.55rem 0.7rem;
  border: 1px solid #8f97a3; border-radius: 4px;
  background: var(--paper);
}
input:focus-visible, select:focus-visible { outline: 3px solid var(--plate); outline-offset: 1px; }

.field { margin: 0 0 1.1rem; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 0.3rem; padding: 0; }
.field .hint { display: block; font-size: 0.875rem; color: var(--muted); margin-top: 0.25rem; }
.field .error { display: block; font-size: 0.875rem; color: var(--odd); font-weight: 600; margin-top: 0.25rem; }
fieldset.field { border: 0; margin: 0 0 1.1rem; padding: 0; }
.check { display: flex; gap: 0.5rem; align-items: center; font-weight: 400; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--plate); }
.row-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0 1.25rem; max-width: 34rem; }

button {
  font: 700 1.0625rem/1 var(--face-plate);
  color: var(--plate-ink); background: var(--plate);
  border: 0; border-radius: 4px;
  padding: 0.8rem 1.4rem;
  cursor: pointer;
}
button:hover { background: #163274; }

.steps { padding-left: 1.4rem; max-width: 36rem; }
.steps li { margin-bottom: 0.5rem; }

/* ---------- Street before and after ---------- */

.neighbours {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.neighbours span { display: block; color: var(--muted); font-size: 0.875rem; }
.neighbours .next { text-align: right; }

/* ---------- Footer ---------- */

.site-foot { margin-top: 3.5rem; padding-bottom: 2.5rem; }
.site-foot > div {
  padding-top: 1.25rem;
  border-top: 2px solid var(--ink);
  font-size: 0.875rem; color: var(--muted);
}
.site-foot p { margin: 0 0 0.75rem; max-width: 36rem; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.site-foot a { color: var(--ink); }

@media (max-width: 30rem) {
  .plate { display: block; }
  th, td { padding-left: 0.3rem; padding-right: 0.3rem; }
  .neighbours { grid-template-columns: 1fr; }
  .neighbours .next { text-align: left; }
}

@media print {
  .site-head nav, .filter, .neighbours { display: none; }
  .plate { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
