/* ============================================================
   STEFANO FABIANI — Base Styles
   Typography, Resets, Global Styling
   ============================================================ */

/* Fonts loaded via <link> in head.ejs for performance */
/* ── Global Reset & Defaults ─────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-surface);
  color: var(--color-on-surface);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Typography Hierarchy (DESIGN.md §3) ─────────────── */

/* Display & Headlines — Bodoni Moda */
h1, h2,
.font-headline {
  font-family: var(--font-headline);
}

h1 {
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-weight: 400;
  letter-spacing: var(--tracking-tight);
}

/* Subsection — EB Garamond */
h3,
.font-subheading {
  font-family: var(--font-subheading);
  font-weight: 600;
}

/* Body & Labels — Jost */
p, span, a, li, input, select, textarea, button,
.font-body {
  font-family: var(--font-body);
}

.font-label {
  font-family: var(--font-label);
}

/* ── Selection Colors ─────────────────────────────────── */
::selection {
  background-color: var(--color-primary-container);
  color: var(--color-on-primary-container);
}

::-moz-selection {
  background-color: var(--color-primary-container);
  color: var(--color-on-primary-container);
}

/* ── Material Symbols Configuration ───────────────────── */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

/* ── Links ────────────────────────────────────────────── */
a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

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

/* ── Focus Accessibility ─────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ── Type Scale Weights (DESIGN.md §3) ───────────────── */
/* Body 16-18pt — Jost Regular */
body, .font-body {
  font-weight: 400;
}

/* Caption 12-14pt — Jost Regular */
.font-caption {
  font-family: var(--font-label);
  font-size: 0.8125rem; /* ~13pt */
  font-weight: 400;
}

/* Micro 9-10pt — Jost Light */
.font-micro {
  font-family: var(--font-label);
  font-size: 0.5625rem; /* ~9pt */
  font-weight: 300;
}

/* ── Label Utility (DESIGN.md §3 — All Caps labels) ──── */
.label-md {
  font-family: var(--font-label);
  font-size: var(--text-label-md);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: 700;
}

/* ── Scrollbar styling (subtle) ─────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-surface-container-low);
}

::-webkit-scrollbar-thumb {
  background: var(--color-outline-variant);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-outline);
}

/* ── Mobile menu scroll lock ─────────────────────────── */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}
