/**
 * ite-reset.css — Icaro Template Engine
 * Reset, tipografia base, elementi HTML fondamentali
 * Versione: 1.0.0
 */

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

html {
  font-size: var(--ite-font-size-base);
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--ite-font);
  font-size: var(--ite-text-base);
  background: var(--ite-bg);
  color: var(--ite-text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Elementi base ───────────────────────────────────── */
img, svg, video {
  display: block;
  max-width: 100%;
}

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

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

a {
  color: var(--ite-accent);
  text-decoration: none;
  transition: color var(--ite-transition);
}

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

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════
   TIPOGRAFIA
   ═══════════════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  color: var(--ite-text-bright);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: var(--ite-text-3xl); }
h2 { font-size: var(--ite-text-2xl); }
h3 { font-size: var(--ite-text-xl); }
h4 { font-size: var(--ite-text-lg); }
h5 { font-size: var(--ite-text-md); }
h6 { font-size: var(--ite-text-base); }

p {
  color: var(--ite-text2);
  line-height: 1.65;
  margin-bottom: 0;
}

strong, b {
  font-weight: 700;
  color: var(--ite-text);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--ite-text-xs);
  color: var(--ite-text3);
}

code {
  font-family: var(--ite-font-mono);
  font-size: 0.9em;
  background: var(--ite-surface2);
  border: 1px solid var(--ite-border);
  border-radius: var(--ite-radius-xs);
  padding: 1px 5px;
  color: var(--ite-accent);
}

pre {
  font-family: var(--ite-font-mono);
  font-size: var(--ite-text-sm);
  background: var(--ite-bg);
  border: 1px solid var(--ite-border);
  border-radius: var(--ite-radius-sm);
  padding: var(--ite-space-4);
  overflow-x: auto;
  line-height: 1.6;
  color: var(--ite-text);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

blockquote {
  border-left: 3px solid var(--ite-accent);
  padding: var(--ite-space-3) var(--ite-space-4);
  background: var(--ite-accent-dim);
  border-radius: 0 var(--ite-radius-sm) var(--ite-radius-sm) 0;
  color: var(--ite-text2);
  font-style: italic;
}

hr {
  border: none;
  border-top: 1px solid var(--ite-border);
  margin: var(--ite-space-6) 0;
}

/* ═══════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--ite-border2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ite-text3);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--ite-border2) transparent;
}

/* ═══════════════════════════════════════════════════════
   SELEZIONE TESTO
   ═══════════════════════════════════════════════════════ */
::selection {
  background: var(--ite-accent-dim2);
  color: var(--ite-text);
}

/* ═══════════════════════════════════════════════════════
   FOCUS ACCESSIBILITÀ
   ═══════════════════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--ite-accent);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════
   UTILITY CLASSI BASE
   ═══════════════════════════════════════════════════════ */

/* Testo */
.text-accent   { color: var(--ite-accent) !important; }
.text-muted    { color: var(--ite-text3) !important; }
.text-dim      { color: var(--ite-text2) !important; }
.text-bright   { color: var(--ite-text-bright) !important; }
.text-green    { color: var(--ite-green) !important; }
.text-amber    { color: var(--ite-amber) !important; }
.text-red      { color: var(--ite-red) !important; }
.text-blue     { color: var(--ite-blue) !important; }
.text-sm       { font-size: var(--ite-text-sm) !important; }
.text-xs       { font-size: var(--ite-text-xs) !important; }
.text-mono     { font-family: var(--ite-font-mono) !important; }
.text-uppercase{ text-transform: uppercase; letter-spacing: .5px; }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-bold     { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium   { font-weight: 500; }

/* Display */
.d-flex        { display: flex; }
.d-grid        { display: grid; }
.d-none        { display: none !important; }
.d-block       { display: block; }
.d-inline-flex { display: inline-flex; }

/* Flex utility */
.flex-1        { flex: 1; }
.flex-col      { flex-direction: column; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end   { justify-content: flex-end; }
.gap-1         { gap: var(--ite-space-1); }
.gap-2         { gap: var(--ite-space-2); }
.gap-3         { gap: var(--ite-space-3); }
.gap-4         { gap: var(--ite-space-4); }

/* Spacing */
.mt-1 { margin-top: var(--ite-space-1); }
.mt-2 { margin-top: var(--ite-space-2); }
.mt-3 { margin-top: var(--ite-space-3); }
.mt-4 { margin-top: var(--ite-space-4); }
.mb-1 { margin-bottom: var(--ite-space-1); }
.mb-2 { margin-bottom: var(--ite-space-2); }
.mb-3 { margin-bottom: var(--ite-space-3); }
.mb-4 { margin-bottom: var(--ite-space-4); }
.mb-6 { margin-bottom: var(--ite-space-6); }
.p-3  { padding: var(--ite-space-3); }
.p-4  { padding: var(--ite-space-4); }
.p-6  { padding: var(--ite-space-6); }

/* Misc */
.w-100     { width: 100%; }
.min-w-0   { min-width: 0; }
.rounded   { border-radius: var(--ite-radius); }
.rounded-sm{ border-radius: var(--ite-radius-sm); }
.rounded-full { border-radius: var(--ite-radius-full); }
.truncate  { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-only   { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ═══════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════ */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; }
}

/* Previeni overflow orizzontale globale */
body { overflow-x: hidden; }
