/**
 * Taxi Lille Connect — Base layer.
 * Global resets, surfaces, layout primitives, accessibility helpers.
 */

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* The header is fixed, so anchor and focus scrolling has to stop short of it
     or the target lands underneath. */
  scroll-padding-top: calc(var(--tlc-header-height) + var(--tlc-space-sm));
}

body {
  margin: 0;
  background: var(--tlc-color-paper);
  color: var(--tlc-color-text);
  font-family: var(--tlc-font-body);
  font-size: var(--tlc-text-body);
  line-height: var(--tlc-leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

img {
  display: block;
}

/* <picture> is inline by default, which would reintroduce the descender gap
   under every photograph now that images are wrapped for WebP delivery. */
.tlc-picture {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--tlc-transition), opacity var(--tlc-transition);
}

hr {
  border: 0;
  border-top: 1px solid var(--tlc-color-line-light);
  margin: var(--tlc-space-lg) 0;
}

::selection {
  background: rgba(198, 161, 91, 0.28);
  color: inherit;
}

/* ---------- Surfaces ---------- */

.tlc-surface-dark {
  background-color: var(--tlc-color-midnight);
  color: var(--tlc-color-text-inverse);
}

.tlc-surface-navy {
  background-color: var(--tlc-color-navy);
  color: var(--tlc-color-text-inverse);
}

.tlc-surface-ink {
  background-color: var(--tlc-color-ink);
  color: var(--tlc-color-text-inverse);
}

/* Once the ground is dark the light-surface roles invert: raw gold is both the
   brighter focus ring and the readable gold text (7.8:1 on midnight), while the
   darkened variants would sink into it. */
.tlc-surface-dark,
.tlc-surface-navy,
.tlc-surface-ink {
  --tlc-color-focus: var(--tlc-color-gold);
  --tlc-color-gold-text: var(--tlc-color-gold);
}

.tlc-surface-ivory {
  background-color: var(--tlc-color-ivory);
  color: var(--tlc-color-text);
}

.tlc-surface-paper {
  background-color: var(--tlc-color-paper);
  color: var(--tlc-color-text);
}

/* ---------- Layout primitives ---------- */

.tlc-container {
  width: 100%;
  max-width: var(--tlc-container);
  margin-inline: auto;
  padding-inline: var(--tlc-gutter);
}

.tlc-container--wide {
  max-width: var(--tlc-container-wide);
}

.tlc-container--narrow {
  max-width: var(--tlc-container-narrow);
}

.tlc-section {
  padding-block: var(--tlc-section-pad);
}

.tlc-section--sm {
  padding-block: var(--tlc-section-pad-sm);
}

/* ---------- Accessibility ---------- */

.tlc-skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100000;
  padding: 0.75rem 1.25rem;
  background: var(--tlc-color-ink);
  color: var(--tlc-color-ivory);
  font-size: var(--tlc-text-small);
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 0 0 var(--tlc-radius-sm) var(--tlc-radius-sm);
  transition: top 0.2s ease;
}

.tlc-skip-link:focus {
  top: 0;
  outline: 2px solid var(--tlc-color-gold);
  outline-offset: 2px;
}

.screen-reader-text,
.tlc-visually-hidden {
  position: absolute !important;
  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;
}

/* Visible, consistent focus for keyboard users */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--tlc-color-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Overflow guard ---------- */

html,
body {
  overflow-x: clip;
}
