/* ==========================================================================
   ItaloMir - Design System Stylesheet
   Based on /docs/design_system.md
   Institutional, high-performance broadsheet & operational utility interface
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,300..900;1,300..900&family=Newsreader:ital,opsz,wght@0,6..72,200..800;1,6..72,200..800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
  /* Surfaces & Canvas */
  --surface: #faf8ff;
  --surface-dim: #d2d9f4;
  --surface-bright: #faf8ff;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f2f3ff;
  --surface-container: #eaedff;
  --surface-container-high: #e2e7ff;
  --surface-container-highest: #dae2fd;
  --background: #faf8ff;

  /* Text & Inks */
  --on-surface: #131b2e;
  --on-surface-variant: #45474c;
  --on-background: #131b2e;
  --outline: #75777d;
  --outline-variant: #c5c6cd;

  /* Primary Palette (Blu Notte) */
  --primary: #091426;
  --on-primary: #ffffff;
  --primary-container: #1e293b;
  --on-primary-container: #8590a6;
  --primary-fixed: #d8e3fb;
  --primary-fixed-dim: #bcc7de;

  /* Secondary Palette (Rosso Argilla) */
  --secondary: #b80938;
  --secondary-hover: #db2e4e;
  --on-secondary: #ffffff;
  --secondary-container: #db2e4e;
  --on-secondary-container: #fffbff;
  --secondary-fixed: #ffdadb;
  --secondary-fixed-dim: #ffb2b7;
  --on-secondary-fixed: #40000d;

  /* Tertiary Palette */
  --tertiary: #051426;
  --on-tertiary: #ffffff;
  --tertiary-container: #1b293b;
  --on-tertiary-container: #8290a6;
  --tertiary-fixed: #d5e3fc;

  /* Feedback & Errors */
  --error: #ba1a1a;
  --on-error: #ffffff;
  --error-container: #ffdad6;
  --on-error-container: #93000a;
}

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

body {
  font-family: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--background);
  color: var(--on-surface);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Material Symbols Integration */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

/* Typography Hierarchy */
.font-headline-xl {
  font-family: 'Newsreader', serif;
  font-size: 48px;
  line-height: 54px;
  font-weight: 600;
  letter-spacing: -0.025em;
}
@media (max-width: 768px) {
  .font-headline-xl {
    font-size: 32px;
    line-height: 38px;
    letter-spacing: -0.02em;
  }
}

.font-headline-lg {
  font-family: 'Newsreader', serif;
  font-size: 36px;
  line-height: 42px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
@media (max-width: 768px) {
  .font-headline-lg {
    font-size: 26px;
    line-height: 32px;
    letter-spacing: -0.015em;
  }
}

.font-headline-md {
  font-family: 'Newsreader', serif;
  font-size: 26px;
  line-height: 32px;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.font-headline-sm {
  font-family: 'Newsreader', serif;
  font-size: 20px;
  line-height: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.font-subheading-lg {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 18px;
  line-height: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.font-body-lg {
  font-family: 'Newsreader', serif;
  font-size: 19px;
  line-height: 30px;
  font-weight: 400;
}

.font-body-md {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 15px;
  line-height: 24px;
  font-weight: 400;
}

.font-body-sm {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 13px;
  line-height: 18px;
  font-weight: 400;
  letter-spacing: 0.005em;
}

.font-label-lg {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 13px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.font-label-md {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 11px;
  line-height: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.font-label-sm {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 10px;
  line-height: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* Background Color Utility Classes */
.bg-background { background-color: var(--background); }
.bg-surface { background-color: var(--surface); }
.bg-surface-container-lowest { background-color: var(--surface-container-lowest); }
.bg-surface-container-low { background-color: var(--surface-container-low); }
.bg-surface-container { background-color: var(--surface-container); }
.bg-surface-container-high { background-color: var(--surface-container-high); }
.bg-surface-container-highest { background-color: var(--surface-container-highest); }
.bg-surface-dim { background-color: var(--surface-dim); }
.bg-surface-bright { background-color: var(--surface-bright); }
.bg-primary { background-color: var(--primary); }
.bg-primary-container { background-color: var(--primary-container); }
.bg-secondary { background-color: var(--secondary); }
.bg-secondary-container { background-color: var(--secondary-container); }
.bg-secondary-fixed { background-color: var(--secondary-fixed); }
.bg-tertiary { background-color: var(--tertiary); }
.bg-tertiary-container { background-color: var(--tertiary-container); }
.bg-error-container { background-color: var(--error-container); }

/* Text Color Utility Classes */
.text-primary { color: var(--primary); }
.text-on-primary { color: var(--on-primary); }
.text-on-primary-container { color: var(--on-primary-container); }
.text-secondary { color: var(--secondary); }
.text-on-secondary { color: var(--on-secondary); }
.text-on-secondary-fixed { color: var(--on-secondary-fixed); }
.text-tertiary { color: var(--tertiary); }
.text-on-tertiary { color: var(--on-tertiary); }
.text-on-surface { color: var(--on-surface); }
.text-on-surface-variant { color: var(--on-surface-variant); }
.text-outline { color: var(--outline); }
.text-outline-variant { color: var(--outline-variant); }
.text-on-error-container { color: var(--on-error-container); }

/* Border Classes */
.border-surface-container { border-color: var(--surface-container); }
.border-surface-container-high { border-color: var(--surface-container-high); }
.border-surface-container-highest { border-color: var(--surface-container-highest); }
.border-outline { border-color: var(--outline); }
.border-outline-variant { border-color: var(--outline-variant); }
.border-secondary { border-color: var(--secondary); }

/* Border Radius (Strict Level 1 - 0.25rem = 4px max) */
.rounded-sm { border-radius: 0.125rem; }
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.375rem; }
.rounded-xl { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

/* Structural Spacing */
.px-margin { padding-left: 3rem; padding-right: 3rem; }
.px-margin-mobile { padding-left: 1rem; padding-right: 1rem; }
.p-space-xs { padding: 0.25rem; }
.p-space-sm { padding: 0.5rem; }
.p-space-md { padding: 1rem; }
.p-space-lg { padding: 1.5rem; }
.p-space-xl { padding: 2.5rem; }
.py-space-xs { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-space-sm { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-space-md { padding-top: 1rem; padding-bottom: 1rem; }
.py-space-lg { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-space-xl { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.mb-space-xs { margin-bottom: 0.25rem; }
.mb-space-sm { margin-bottom: 0.5rem; }
.mb-space-md { margin-bottom: 1rem; }
.mb-space-lg { margin-bottom: 1.5rem; }
.mb-space-xl { margin-bottom: 2.5rem; }
.gap-space-xs { gap: 0.25rem; }
.gap-space-sm { gap: 0.5rem; }
.gap-space-md { gap: 1rem; }
.gap-space-lg { gap: 1.5rem; }
.gap-space-xl { gap: 2.5rem; }

/* Components */
.card-ds {
  background: var(--surface-container-lowest);
  border: 1px solid var(--surface-container-high);
  border-radius: 0.25rem;
  padding: 1.5rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.card-ds:hover {
  border-color: var(--primary);
}

.btn-ds {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 1.5rem;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 0.25rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease-in-out;
}
.btn-ds-primary {
  background-color: var(--secondary);
  color: var(--on-secondary);
}
.btn-ds-primary:hover {
  background-color: var(--secondary-hover);
}
.btn-ds-secondary {
  background-color: var(--primary);
  color: var(--on-primary);
}
.btn-ds-secondary:hover {
  background-color: #0f1f3a;
}
.btn-ds-outline {
  background-color: transparent;
  border-color: var(--outline-variant);
  color: var(--primary);
}
.btn-ds-outline:hover {
  background-color: var(--surface-container-low);
  border-color: var(--primary);
}

/* Hairline Separators */
.hairline-divider {
  height: 1px;
  background-color: var(--surface-container-high);
  width: 100%;
}
