/* MyJobHunter archive page, rendered by scripts/archive_page.py.
   No JavaScript and no external resource: the Content-Security-Policy of
   nginx/myjobhunter-archive.conf only allows same-origin styles, fonts and
   images. Charts are inline SVG drawn with attributes, never inline styles.

   Archivo (variable font, latin subset of @fontsource-variable/archivo 5.2.8)
   Copyright 2020 The Archivo Project Authors
   (https://github.com/Omnibus-Type/Archivo), licensed under the SIL Open Font
   License 1.1; full text in /archivo-ofl.txt. */

@font-face {
  font-family: "Archivo";
  src: url("/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f3f5f9;
  --surface: #ffffff;
  --ink: #14213d;
  --muted: #56617a;
  --rule: #c9d1df;
  --accent: #2357d9;
  --track: #e1e7f1;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1626;
    --surface: #152036;
    --ink: #e7ecf6;
    --muted: #9eabc4;
    --rule: #2f3e5c;
    --accent: #7aa2ff;
    --track: #22304c;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  font-weight: 400;
  font-stretch: 100%;
  line-height: 1.6;
  font-kerning: normal;
}

/* One column up to tablets; from 64rem the figures sit side by side, and on
   large screens everything scales up so the page does not shrink to a strip. */
.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 48rem) {
  .page {
    padding: 0 2rem;
  }
}

@media (min-width: 64rem) {
  .page {
    max-width: 68rem;
    padding: 0 2.5rem;
  }
}

@media (min-width: 90rem) {
  html {
    font-size: 112.5%;
  }
}

p {
  max-width: 38rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible,
.scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- opening ---------- */

.hero {
  padding: clamp(3.5rem, 12vw, 7rem) 0 1rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3.1rem, 13vw, 7rem);
  font-weight: 860;
  font-stretch: 66%;
  line-height: 0.9;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.when {
  margin: 1.4rem 0 0;
  font-size: 1.25rem;
  font-weight: 620;
  font-stretch: 85%;
}

.lead {
  margin: 0.9rem 0 0;
  font-size: 1.125rem;
  color: var(--muted);
}

/* ---------- sections ---------- */

.bilan,
.duo,
.fin,
.duo > section + section {
  margin-top: clamp(3rem, 8vw, 4.5rem);
}

@media (min-width: 64rem) {
  .duo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 3.5rem;
    align-items: start;
  }

  .duo > section + section {
    margin-top: 0;
  }
}

h2 {
  margin: 0 0 1.25rem;
  font-size: 1.85rem;
  font-weight: 760;
  font-stretch: 74%;
  line-height: 1.05;
}

/* The closing statement of the books: labels, dot leaders, figures. */
.ledger {
  margin: 0;
}

.ledger .row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.28rem 0;
}

.ledger dt {
  flex: 0 1 auto;
  min-width: 0;
}

.ledger .row::after {
  content: "";
  order: 1;
  flex: 1 1 1.5rem;
  border-bottom: 2px dotted var(--rule);
  transform: translateY(-0.3em);
}

.ledger dd {
  order: 2;
  flex: 0 0 auto;
  margin: 0;
  font-size: 1.9rem;
  font-weight: 760;
  font-stretch: 70%;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
}

figure {
  margin: 2.75rem 0 0;
}

figcaption,
caption {
  margin-bottom: 0.75rem;
  text-align: left;
  font-weight: 650;
  font-stretch: 85%;
  font-size: 1.05rem;
}

.scroll {
  overflow-x: auto;
}

/* Phones: the months as a list of bars, the column chart hidden. From 40rem
   the chart shows and the list is kept for screen readers only. */
.months .scroll {
  display: none;
}

.months .month-list caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 40rem) {
  .months .scroll {
    display: block;
  }

  .months .month-list {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}

.chart {
  display: block;
  width: 100%;
  min-width: 34rem;
  height: auto;
}

.chart .col {
  fill: var(--accent);
}

.chart text {
  font-family: inherit;
  text-anchor: middle;
}

.chart .val {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 650;
  font-stretch: 80%;
  font-variant-numeric: tabular-nums;
}

.chart .mon {
  fill: var(--muted);
  font-size: 13px;
}

.chart .yr {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.chart .base {
  stroke: var(--rule);
  stroke-width: 1.5;
}

/* Wide screens: the ledger and the monthly chart side by side. */
@media (min-width: 64rem) {
  .bilan-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 3.5rem;
    align-items: start;
  }

  .bilan-grid > figure {
    margin-top: 0;
  }

  .bilan-grid .chart {
    min-width: 0;
  }
}

.split {
  display: grid;
  gap: 2.25rem;
  margin-top: 2.75rem;
}

/* Fixed columns, so the bars of both tables start and end at the same place. */
.bars {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.bars th {
  width: 40%;
  padding: 0.3rem 0.75rem 0.3rem 0;
  text-align: left;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.bars td {
  padding: 0.3rem 0;
}

.bars .bar {
  width: 20%;
  padding-right: 0.75rem;
}

.bars .bar svg {
  display: block;
  width: 100%;
  height: 0.55rem;
}

.bars .track {
  fill: var(--track);
}

.bars .fill {
  fill: var(--accent);
}

.bars .num {
  width: 22%;
  padding-right: 0.6rem;
  text-align: right;
  font-weight: 650;
  white-space: nowrap;
}

.bars .pct {
  width: 18%;
  text-align: right;
  color: var(--muted);
  white-space: nowrap;
}

@media (min-width: 40rem) {
  .bars th {
    width: 34%;
  }

  .bars .bar {
    width: 42%;
  }

  .bars .num {
    width: 13%;
  }

  .bars .pct {
    width: 11%;
  }
}

/* Wide screens: the two tables side by side, label column widened. */
@media (min-width: 64rem) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 3.5rem;
    align-items: start;
  }

  .bars th {
    width: 44%;
  }

  .bars .bar {
    width: 28%;
  }

  .bars .num {
    width: 16%;
  }

  .bars .pct {
    width: 12%;
  }
}

.note {
  margin-top: 2.25rem;
  font-size: 0.95rem;
  color: var(--muted);
}

/* ---------- the data notice: the one thing a former user may act on ---------- */

.data {
  padding: 1.5rem 1.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
}

.data h2 {
  font-size: 1.45rem;
}

.data p {
  margin: 0 0 0.85rem;
}

/* ---------- closing words ---------- */

.fin p {
  font-size: 1.125rem;
}

.foot {
  margin-top: clamp(3rem, 8vw, 4.5rem);
  padding-top: 1.5rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.92rem;
  color: var(--muted);
}

.foot p {
  margin: 0.25rem 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
