@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=IBM+Plex+Serif:ital,wght@0,300;0,400;0,500;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,400,0..1,0&display=block');

/* ============================================================
   VARIABILI
   ============================================================ */

:root {
  /* Ruoli colore Material 3 (derivati dai colori di marca) */
  --md-primary:                  #061991;
  --md-on-primary:               #ffffff;
  --md-primary-container:        #dfe0ff;
  --md-on-primary-container:     #000d61;
  --md-secondary-container:      #ffdcc2;
  --md-on-secondary-container:   #2e1500;
  --md-surface:                  #fbf8f4;
  --md-surface-container-lowest: #ffffff;
  --md-surface-container-low:    #f5f2f6;
  --md-surface-container:        #efecf3;
  --md-surface-container-high:   #e9e7ef;
  --md-surface-container-highest:#e3e1ea;
  --md-inverse-surface:          #2f3036;
  --md-outline:                  #767680;
  --md-outline-variant:          #c6c5d0;

  --color-primary:       var(--md-primary);
  --color-primary-dark:  #04116a;
  --color-primary-light: var(--md-primary-container);
  --color-accent:        #EE891D;
  --color-accent-dark:   #a85a00;
  --color-bg:            var(--md-surface);
  --color-surface:       var(--md-surface-container-lowest);
  --color-text:          #1a1a2e;
  --color-text-muted:    #5c5d69;
  --color-border:        var(--md-outline-variant);
  --color-success:       #1f6b3a;
  --color-success-bg:    #d8f0df;
  --color-error:         #ba1a1a;
  --color-error-bg:      #ffdad6;

  --font-heading: 'Space Mono', monospace;
  --font-body:    'DM Sans', sans-serif;
  --font-serif:   'IBM Plex Serif', serif;

  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;

  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius-md:   16px;
  --radius-lg:   28px;
  --radius-full: 999px;

  /* Elevazioni Material 3 */
  --elev-1: 0 1px 2px rgba(0,0,0,0.20), 0 1px 3px 1px rgba(0,0,0,0.10);
  --elev-2: 0 1px 2px rgba(0,0,0,0.20), 0 2px 6px 2px rgba(0,0,0,0.10);
  --elev-3: 0 1px 3px rgba(0,0,0,0.20), 0 4px 8px 3px rgba(0,0,0,0.10);
  --shadow-sm: var(--elev-1);
  --shadow-md: var(--elev-2);
  --shadow-lg: var(--elev-3);

  /* Movimento */
  --ease-standard:   cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasized: cubic-bezier(0.05, 0.7, 0.1, 1);
  --transition: 0.2s var(--ease-standard);

  --bottom-nav-height: 80px;
}

/* ============================================================
   RESET
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
}

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

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-primary-dark);
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ============================================================
   TIPOGRAFIA
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.375rem, 3vw, 1.875rem); }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.375rem); }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
  max-width: 68ch;
}

strong { font-weight: 600; }
em     { font-style: italic; }

small {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* ============================================================
   UTILITY — SPAZIATURA
   ============================================================ */

.mt-xs  { margin-top: var(--space-xs); }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

.mb-xs  { margin-bottom: var(--space-xs); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

/* ============================================================
   UTILITY — TESTO
   ============================================================ */

.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }
.text-accent  { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-error   { color: var(--color-error); }
.text-white   { color: #ffffff; }
.text-sm      { font-size: 0.875rem; }
.text-xs      { font-size: 0.8125rem; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }

/* ============================================================
   UTILITY — LAYOUT
   ============================================================ */

.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm       { gap: var(--space-sm); }
.gap-md       { gap: var(--space-md); }
.gap-lg       { gap: var(--space-lg); }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }

.hidden       { display: none !important; }
/* Elementi dell'iscrizione annuale: nascosti finché js/components.js non conferma iscrizioni_aperte=true */
[data-iscrizione] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   UTILITY — ACCESSIBILITÀ
   ============================================================ */

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

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  z-index: 9999;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-sm) var(--space-md);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0;
}

/* ============================================================
   UTILITY — SFONDO E SUPERFICI
   ============================================================ */

.bg-primary-light { background-color: var(--color-primary-light); }
.bg-surface       { background-color: var(--color-surface); }
.rounded-md       { border-radius: var(--radius-md); }
.rounded-lg       { border-radius: var(--radius-lg); }
.shadow-sm        { box-shadow: var(--shadow-sm); }
.shadow-md        { box-shadow: var(--shadow-md); }

/* ============================================================
   ICONE — Material Symbols Rounded
   ============================================================ */

.icon {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  flex-shrink: 0;
  user-select: none;
}

.icon-filled { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

/* ============================================================
   STATE LAYER (Material 3) — hover 8%, focus/press 12%
   ============================================================ */

.state-layer {
  position: relative;
  isolation: isolate;
}

.state-layer::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-color: currentColor;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  transition: opacity var(--transition);
}

.state-layer:hover::before         { opacity: 0.08; }
.state-layer:focus-visible::before,
.state-layer:active::before        { opacity: 0.12; }

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