/**
 * TFS Oleodinamica — Typography
 *
 * Stili tipografici globali applicati a tag HTML base.
 * Le regole qui usano SOLO le variabili definite in variables.css.
 * Non definire colori/spaziature hardcoded in questo file.
 */

/* ============================================
   RESET TIPOGRAFICO BASE
   ============================================ */

body {
  font-family: var(--tfs-font-body);
  font-size: var(--tfs-fs-base);
  font-weight: var(--tfs-fw-regular);
  line-height: var(--tfs-lh-relaxed);
  color: var(--tfs-color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ============================================
   HEADINGS
   ============================================ */

h1, h2, h3, h4, h5, h6,
.tfs-h1, .tfs-h2, .tfs-h3, .tfs-h4, .tfs-h5, .tfs-h6 {
  font-family: var(--tfs-font-heading);
  font-weight: var(--tfs-fw-bold);
  line-height: var(--tfs-lh-tight);
  color: var(--tfs-color-primary);
  margin-top: 0;
  margin-bottom: var(--tfs-space-4);
  letter-spacing: var(--tfs-ls-tight);
}

h1, .tfs-h1 {
  font-size: var(--tfs-fs-5xl);
  font-weight: var(--tfs-fw-extrabold);
  line-height: 1.1;
}

h2, .tfs-h2 {
  font-size: var(--tfs-fs-4xl);
  font-weight: var(--tfs-fw-bold);
}

h3, .tfs-h3 {
  font-size: var(--tfs-fs-3xl);
  font-weight: var(--tfs-fw-semibold);
}

h4, .tfs-h4 {
  font-size: var(--tfs-fs-2xl);
  font-weight: var(--tfs-fw-semibold);
}

h5, .tfs-h5 {
  font-size: var(--tfs-fs-xl);
  font-weight: var(--tfs-fw-semibold);
  color: var(--tfs-color-gray-900);
}

h6, .tfs-h6 {
  font-size: var(--tfs-fs-lg);
  font-weight: var(--tfs-fw-medium);
  color: var(--tfs-color-gray-900);
  text-transform: uppercase;
  letter-spacing: var(--tfs-ls-wide);
}

/* Responsive — riduzione headings su mobile */
@media (max-width: 768px) {
  h1, .tfs-h1 { font-size: var(--tfs-fs-4xl); }
  h2, .tfs-h2 { font-size: var(--tfs-fs-3xl); }
  h3, .tfs-h3 { font-size: var(--tfs-fs-2xl); }
  h4, .tfs-h4 { font-size: var(--tfs-fs-xl); }
}

/* ============================================
   PARAGRAFI E TESTO
   ============================================ */

p {
  margin-top: 0;
  margin-bottom: var(--tfs-space-4);
}

.tfs-lead {
  font-size: var(--tfs-fs-lg);
  line-height: var(--tfs-lh-relaxed);
  color: var(--tfs-color-text-muted);
  font-weight: var(--tfs-fw-regular);
}

.tfs-small {
  font-size: var(--tfs-fs-sm);
}

.tfs-xs {
  font-size: var(--tfs-fs-xs);
}

/* ============================================
   LINK
   ============================================ */

a {
  color: var(--tfs-color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color var(--tfs-duration-fast) var(--tfs-ease-out);
}

a:hover,
a:focus {
  color: var(--tfs-color-link-hover);
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--tfs-color-primary);
  outline-offset: 2px;
  border-radius: var(--tfs-radius-sm);
}

/* ============================================
   LISTE
   ============================================ */

ul, ol {
  margin-top: 0;
  margin-bottom: var(--tfs-space-4);
  padding-left: var(--tfs-space-6);
}

li {
  margin-bottom: var(--tfs-space-2);
}

li:last-child {
  margin-bottom: 0;
}

/* ============================================
   TESTI ENFATIZZATI
   ============================================ */

strong, b {
  font-weight: var(--tfs-fw-bold);
  color: var(--tfs-color-gray-900);
}

em, i {
  font-style: italic;
}

mark {
  background-color: var(--tfs-color-primary-tint);
  color: var(--tfs-color-primary-dark);
  padding: 0.1em 0.3em;
  border-radius: var(--tfs-radius-sm);
}

/* ============================================
   CODICE E PRE
   ============================================ */

code, pre, kbd {
  font-family: var(--tfs-font-mono);
  font-size: 0.9em;
}

code {
  background-color: var(--tfs-color-gray-100);
  color: var(--tfs-color-gray-900);
  padding: 0.15em 0.4em;
  border-radius: var(--tfs-radius-sm);
  border: 1px solid var(--tfs-color-border);
}

pre {
  background-color: var(--tfs-color-gray-900);
  color: var(--tfs-color-gray-100);
  padding: var(--tfs-space-4);
  border-radius: var(--tfs-radius-md);
  overflow-x: auto;
  line-height: var(--tfs-lh-normal);
}

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

/* ============================================
   CITAZIONI
   ============================================ */

blockquote {
  border-left: 4px solid var(--tfs-color-primary);
  padding-left: var(--tfs-space-6);
  margin: var(--tfs-space-6) 0;
  font-style: italic;
  color: var(--tfs-color-text-muted);
  font-size: var(--tfs-fs-lg);
}

blockquote cite {
  display: block;
  margin-top: var(--tfs-space-2);
  font-size: var(--tfs-fs-sm);
  color: var(--tfs-color-gray-600);
  font-style: normal;
}

blockquote cite::before {
  content: "— ";
}

/* ============================================
   HR (separatore orizzontale)
   ============================================ */

hr {
  border: none;
  border-top: 1px solid var(--tfs-color-border);
  margin: var(--tfs-space-8) 0;
}

/* ============================================
   SELEZIONE TESTO
   ============================================ */

::selection {
  background-color: var(--tfs-color-primary);
  color: var(--tfs-color-white);
}

::-moz-selection {
  background-color: var(--tfs-color-primary);
  color: var(--tfs-color-white);
}
