/**
 * @file
 * LINCS Theme - Base Styles
 * 
 * Stili di base e reset per il tema LINCS.
 */

/* ========================================
   RESET & BASE
   ======================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: var(--font-weight-bold);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-base);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

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

/* Links */
a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus {
  color: var(--text-link-hover);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Lists */
ul, ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

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

/* Blockquote */
blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-6);
  border-left: 4px solid var(--sapienza-bordeaux);
  background-color: var(--bg-secondary);
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.125em 0.375em;
  background-color: var(--bg-tertiary);
  border-radius: var(--border-radius-sm);
}

pre {
  font-family: var(--font-mono);
  padding: var(--space-4);
  background-color: var(--neutral-800);
  color: var(--neutral-100);
  border-radius: var(--border-radius-lg);
  overflow-x: auto;
  margin-bottom: var(--space-4);
}

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

/* Horizontal Rule */
hr {
  border: none;
  height: 1px;
  background-color: var(--border-light);
  margin: var(--space-8) 0;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

figure {
  margin: var(--space-6) 0;
}

figcaption {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  text-align: center;
  margin-top: var(--space-2);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-4);
}

th, td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

th {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

tr:hover {
  background-color: var(--bg-secondary);
}

/* Selection */
::selection {
  background-color: var(--sapienza-bordeaux);
  color: var(--text-inverse);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--neutral-400);
  border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-500);
}

/* Focus Visible */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-3) var(--space-6);
  background-color: var(--sapienza-bordeaux);
  color: var(--text-inverse);
  font-weight: var(--font-weight-medium);
  border-radius: var(--border-radius-md);
  z-index: 9999;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
  text-decoration: none;
}

/* Visually Hidden */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Clearfix */
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}
