/* ==========================================================================
   BASE — Tokens, reset, texture pinstripe (condiviso da tutte le pagine)
   ========================================================================== */

/* ==========================================================================
   TOKENS — Archivio Rose A.C. Milan
   Identità: rossonero classico, tipografia da stadio/programma di sala,
   numeri "da cartellino". Condiviso da tutte le pagine del sito.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* --- Colore --- */
  --color-red: #c8102e; /* rosso rossonero */
  --color-red-deep: #7a0c1f; /* rosso in ombra, per profondità */
  --color-black: #0c0c0e; /* nero maglia, non un nero puro */
  --color-black-soft: #18181b; /* superfici sopraelevate */
  --color-ivory: #f2eee3; /* carta d'annata, per il "cartellino" */
  --color-gold: #c9a24b; /* oro anticato, riservato ai trofei */
  --color-grey: #9a9a9f; /* testo secondario su fondo scuro */
  --color-grey-dim: #56565b; /* testo secondario su fondo chiaro */
  --color-line: rgb(242 238 227 / 14%);
  --color-focus-ring: color-mix(in srgb, var(--color-gold) 100%, white 0%);

  /* Colori "semantici" derivati, usati per rimpiazzare gli stili inline */
  --color-flag-citizenship: #fdb813;
  --color-flag-birth: #64b5f6;
  --surface-raised: color-mix(in srgb, var(--color-ivory) 6%, transparent);
  --surface-raised-hover: color-mix(
    in srgb,
    var(--color-ivory) 10%,
    transparent
  );
  --surface-accent: color-mix(in srgb, var(--color-red) 8%, transparent);

  /* --- Tipografia --- */
  --font-display: "Oswald", "Arial Narrow", sans-serif; /* titoli, insegne */
  --font-numeral:
    "Anton", "Arial Narrow", sans-serif; /* numeri di maglia/posizione */
  --font-body: "Inter", system-ui, sans-serif; /* testo corrente */

  /* --- Spaziatura --- */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;
  --space-xl: 5rem;

  /* --- Forma --- */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 26px;
  --radius-pill: 999px;

  /* --- Profondità --- */
  --shadow-card: 0 14px 34px rgb(0 0 0 / 38%);
  --shadow-lift: 0 22px 48px rgb(0 0 0 / 50%);
  --shadow-soft: 0 4px 14px rgb(0 0 0 / 25%);

  /* --- Movimento --- */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 0.18s;
  --dur-med: 0.4s;
  --dur-slow: 0.7s;
}

/* --- Reset minimo --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--color-grey-dim) transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-black);
  color: var(--color-ivory);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

input {
  font-family: inherit;
  accent-color: var(--color-red);
}

h1,
h2,
h3 {
  text-wrap: balance;
}

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

:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.hidden {
  display: none !important;
}

/* --- Pinstripe: la texture "da maglia" riutilizzata in più punti --- */
.pinstripe {
  background-image: repeating-linear-gradient(
    100deg,
    var(--color-red) 0,
    var(--color-red) 10px,
    var(--color-black-soft) 10px,
    var(--color-black-soft) 22px
  );
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Transizioni native tra pagine (progressive enhancement) ---
   Ignorata dai browser che non supportano l'API: nessun impatto negativo. */
@view-transition {
  navigation: auto;
}
