/* base.css — fonts, the black / white / red colour tokens, dark mode, reset and small utilities.
   Used by: every page (loaded first). */


/* --------------------------------------------------------------------------
   Fonts — Barlow, a free (OFL) typeface based on highway road signs.
   The files live in assets/fonts/ so the site works offline.
   font-display: block = wait the few milliseconds these small files need,
   instead of drawing the page in another font first and then swapping
   (which made text and lines jump on every click).
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Barlow";
  font-weight: 400;
  font-style: normal;
  font-display: block;
  src: url("../fonts/barlow-400.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow";
  font-weight: 500;
  font-style: normal;
  font-display: block;
  src: url("../fonts/barlow-500.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow";
  font-weight: 600;
  font-style: normal;
  font-display: block;
  src: url("../fonts/barlow-600.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Semi Condensed";
  font-weight: 600;
  font-style: normal;
  font-display: block;
  src: url("../fonts/barlow-semi-condensed-600.woff2") format("woff2");
}


/* --------------------------------------------------------------------------
   Design tokens — only three colours: black, white and red.
   Greys are shades of black (saturation 0%), never a new colour.
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* [TOPIC: colors – HEX]  #RRGGBB */
  --color-red: #e41e20;               /* the red of the Albanian flag */
  --color-red-text: #e41e20;          /* red used for text (5.8 : 1 on white) */
  --color-ink: #111111;               /* headings, black rules, black buttons */
  --color-bg: #ffffff;
  --color-header-bg: #ffffff;
  --color-inverse-bg: #111111;        /* footer and call-to-action band */
  --color-inverse-text: #ffffff;

  /* [TOPIC: colors – HSL]  hsl(hue, saturation, lightness).
     Saturation 0% gives a pure grey, so the palette stays black / white / red. */
  --color-red-hover: hsl(359, 78%, 38%);
  --color-text: hsl(0, 0%, 13%);
  --color-muted: hsl(0, 0%, 38%);
  --color-surface: hsl(0, 0%, 96%);
  --color-border: hsl(0, 0%, 85%);
  --color-input-border: hsl(0, 0%, 55%);
  --color-art: hsl(0, 0%, 95%);       /* big quiet illustrations, a shade off the background */

  /* [TOPIC: colors – RGBA]  rgba(red, green, blue, opacity) — black and white see-through */
  --color-overlay: rgba(0, 0, 0, 0.6);
  --color-inverse-muted: rgba(255, 255, 255, 0.68);
  --color-inverse-border: rgba(255, 255, 255, 0.16);

  /* [TOPIC: units – rem]  1rem = the root font size (16px by default) */
  --container: 76rem;
  --header-height: 4.5rem;
  --space-section: 6rem;

  --font: "Barlow", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-display: "Barlow Semi Condensed", "Barlow", "Segoe UI", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  --ease: 0.18s ease-out;
}

/* Dark theme — theme.js puts data-theme="dark" on <html> (saved in a cookie) */
[data-theme="dark"] {
  color-scheme: dark;   /* date pickers and scrollbars turn dark too */

  --color-red-text: #ff4d4f;          /* lighter red so text stays readable on black */
  --color-ink: #f5f5f5;
  --color-bg: #0d0d0d;
  --color-header-bg: hsl(0, 0%, 12%);  /* a step lighter than the page so the bar stands out */
  --color-inverse-bg: #000000;
  --color-inverse-text: #ffffff;

  --color-red-hover: hsl(359, 85%, 55%);
  --color-text: hsl(0, 0%, 88%);
  --color-muted: hsl(0, 0%, 64%);
  --color-surface: hsl(0, 0%, 10%);
  --color-border: rgba(255, 255, 255, 0.16);
  --color-input-border: hsl(0, 0%, 45%);
  --color-art: hsl(0, 0%, 10%);

  --color-overlay: rgba(0, 0, 0, 0.75);
}


/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

/* [TOPIC: box model]
   Every element is: content + padding + border + margin.
   With border-box, the width you set INCLUDES padding and border,
   so a 300px box with 20px padding is still 300px wide. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--color-input-border) var(--color-bg);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--color-text);
  background-color: var(--color-bg);
  caret-color: var(--color-red);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
}

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

a:hover {
  color: var(--color-red-text);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 2px;
}

/* Make sure the HTML "hidden" attribute always wins */
[hidden] {
  display: none !important;
}

::selection {
  background-color: var(--color-red);
  color: #ffffff;
}


/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.icon {
  flex-shrink: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background-color: var(--color-ink);
  color: var(--color-bg);
}

.skip-link:focus {
  top: 1rem;
}

.skip-link:hover {
  color: var(--color-bg);
}

.text-center { text-align: center; }
.text-muted { color: var(--color-muted); }
.nowrap { white-space: nowrap; }
.mt-1 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }

/* Numbers line up in columns (prices, tables, codes) */
.num,
.price,
.mono {
  font-variant-numeric: tabular-nums;
}

.mono {
  color: var(--color-ink);
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-weight: 600;
  letter-spacing: 0.04em;
}


/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
