/* ============================================================
   API Trentine — Base: fonts, reset, elements
   ============================================================ */

/* ─── Fonts (self-hosted) ─── */
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('fonts/Figtree-Variable.woff2') format('woff2');
}
@font-face {
  font-family: 'Figtree';
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url('fonts/Figtree-Italic-Variable.woff2') format('woff2');
}

/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
/* Lenis smooth scrolling (js/lenis.min.js) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
/* Optical letter-spacing: the em part tightens large display text, the fixed
   px part relaxes small text back toward 0 (tracking is inverse to size). */
h1, h2, h3, h4, h5, h6 { color: var(--secondary); letter-spacing: calc(-0.06em + 0.8px); }
h2 { font-weight: 400; }
a {
  color: inherit;
  /* underline is always present but transparent, so hover fades it in (no movement) */
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color var(--transition), text-decoration-color var(--transition);
}
/* fade the underline in on hover for every text link */
a:hover { text-decoration-color: currentColor; }
/* …except non-text links (buttons, nav items, cards, logo, social icons) */
.logo:hover,
.btn:hover,
.btn-nav:hover,
.nav-links a:hover,
.corso-card:hover,
.bando-card:hover,
.comm-card:hover,
.news-card:hover,
.gallery-item:hover,
.doc-item:hover,
.footer-social a:hover { text-decoration-color: transparent; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ─── Accessibility ─────────────────────────────────── */
/* Visible keyboard focus (only for keyboard users, not mouse clicks) */
:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
  border-radius: 3px;
}
/* Skip-to-content link: first focusable element, hidden until focused */
.skip-link {
  position: absolute;
  left: var(--space-xs);
  top: calc(-1 * var(--space-4xl));
  z-index: var(--z-lightbox);
  background: var(--secondary);
  color: var(--white);
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
  transition: top var(--transition);
}
.skip-link:focus { top: var(--space-xs); }
/* keep anchor/skip targets clear of the fixed navbar */
main[id], section[id] { scroll-margin-top: 84px; }
/* Global safety net: honour reduced-motion for any animation/transition */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
