/* Page du site. Couleurs, polices, tailles, interlignes et espacements viennent de brand/tokens.css ;
   seules les valeurs structurelles (0, 1px, 100 %) sont écrites en dur. */

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

html {
  color-scheme: light;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--size-2);
  line-height: var(--leading-body);
}

a {
  color: var(--ink);
  text-underline-offset: 0.15em;
}

a:focus-visible,
input:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  top: calc(-1 * var(--space-4));
  left: var(--space-2);
  padding: var(--space-1) var(--space-2);
  background: var(--ink);
  color: var(--paper);
}

.skip:focus {
  top: var(--space-2);
}

.site-header,
main,
.site-footer {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--space-2));
  margin-inline: auto;
  padding-inline: var(--space-2);
}

/* En-tête : logo et langues */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: var(--space-3);
}

.logo {
  display: block;
  color: var(--ink);
}

.logo svg {
  display: block;
  width: auto;
  height: var(--size-4);
}

.langs ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: var(--size-1);
}

.langs a {
  color: var(--ink-muted);
  text-decoration: none;
}

.langs a:hover,
.langs a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
}

.langs a[aria-current] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

/* Contenu */

main {
  flex: 1;
  padding-block: var(--space-3) var(--space-4);
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
}

.tagline {
  margin-bottom: var(--space-4);
  font-size: var(--size-5);
}

h2 {
  margin-bottom: var(--space-2);
  font-size: var(--size-4);
}

.hint {
  margin: 0 0 var(--space-2);
  color: var(--ink-muted);
  font-size: var(--size-1);
}

/* Formulaire */

.field {
  margin-bottom: var(--space-2);
}

label {
  display: block;
  margin-bottom: calc(var(--space-1) / 2);
  font-weight: 500;
}

input,
textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: var(--space-1);
  border: 1px solid var(--ink-muted);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: calc(2 * var(--space-4));
  resize: vertical;
}

[aria-invalid="true"] {
  border-color: var(--ink);
  border-left: calc(var(--space-1) / 2) solid var(--accent);
}

.field-error {
  margin: calc(var(--space-1) / 2) 0 0;
  padding-left: var(--space-1);
  border-left: calc(var(--space-1) / 2) solid var(--accent);
  font-size: var(--size-1);
}

.notice,
.alert {
  margin: 0 0 var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-left: var(--space-1) solid var(--accent);
}

.notice {
  border-left-color: var(--secondary);
}

button {
  padding: var(--space-1) var(--space-3);
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: var(--ink-muted);
}

/* Champ piège pour les robots : hors écran, ignoré par les lecteurs d'écran. */
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Pied de page */

.site-footer {
  padding-block: var(--space-3);
  color: var(--ink-muted);
  font-size: var(--size-1);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: inherit;
}

@media (max-width: 30rem) {
  .tagline {
    font-size: var(--size-4);
  }
}

/* Statistiques */

.stats {
  max-width: none;
}

.stats h1 {
  margin-bottom: var(--space-2);
  font-size: var(--size-4);
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: var(--size-1);
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: calc(var(--space-1) / 2) var(--space-1);
  border-bottom: 1px solid var(--ink-muted);
  text-align: right;
  white-space: nowrap;
}

th[scope="row"],
thead th:first-child {
  text-align: left;
}
