/* =========================================================
   VECCHIO WEST · GLOBAL STYLES
   ========================================================= */

@import url('tokens.css');

/* --- Font loading (subset locale consigliato in produzione) --- */
@import url('https://fonts.googleapis.com/css2?family=Rye&family=Oswald:wght@400;600;700&family=Inter:wght@400;500;700&family=Special+Elite&display=swap');

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--vw-paper);
  background: var(--vw-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Texture seppia globale opzionale */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse at top, rgba(200, 155, 60, 0.04), transparent 70%),
    radial-gradient(ellipse at bottom, rgba(26, 18, 11, 0.5), transparent 60%);
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: var(--vw-gold); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--vw-gold-2); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--vw-paper);
  text-wrap: balance;
}

h1 { font-size: clamp(2.2rem, 6vw, 4.5rem); line-height: 1.05; }
h2 { font-size: clamp(1.7rem, 4vw, 3rem); line-height: 1.1; margin-bottom: var(--space-sm); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); line-height: 1.2; }

.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.78rem;
  color: var(--vw-gold);
}

/* --- Container --- */
.vw-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* --- Section spacing --- */
.vw-section {
  padding: var(--space-xl) 0;
  position: relative;
  z-index: 2;
}
@media (min-width: 768px) { .vw-section { padding: var(--space-2xl) 0; } }

/* --- Buttons --- */
.vw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  font-family: var(--font-headline);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.92rem;
  border: 2px solid var(--vw-gold);
  background: var(--vw-gold);
  color: var(--vw-bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  text-decoration: none;
}
.vw-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-gold); background: var(--vw-gold-2); }

.vw-btn--ghost {
  background: transparent;
  color: var(--vw-paper);
  border-color: var(--vw-paper-2);
}
.vw-btn--ghost:hover { background: var(--vw-paper); color: var(--vw-bg); }

.vw-btn--latin {
  background: var(--vw-latin-magenta);
  border-color: var(--vw-latin-magenta);
  color: var(--vw-paper);
}
.vw-btn--latin:hover { background: var(--vw-latin-accent); border-color: var(--vw-latin-accent); }

/* --- Decorazioni western (divisori) --- */
.vw-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: var(--space-md) auto;
  color: var(--vw-gold);
}
.vw-divider::before, .vw-divider::after {
  content: "";
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--vw-gold), transparent);
}
.vw-divider svg { width: 24px; height: 24px; fill: currentColor; }

/* --- Badge --- */
.vw-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--vw-gold);
  color: var(--vw-gold);
  background: rgba(200, 155, 60, 0.08);
  border-radius: var(--radius-sm);
}
.vw-badge--piccante { color: var(--vw-red-2); border-color: var(--vw-red-2); background: rgba(177, 74, 48, 0.1); }
.vw-badge--nuovo { color: var(--vw-paper); border-color: var(--vw-paper); }
.vw-badge--marchigiano { color: var(--vw-sand); border-color: var(--vw-sand); }
.vw-badge--vegan { color: #8ab06a; border-color: #8ab06a; }
.vw-badge--top { background: var(--vw-gold); color: var(--vw-bg); }

/* --- Card pergamena (recensioni, eventi) --- */
.vw-card-paper {
  background: var(--vw-paper);
  color: var(--vw-ink);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  position: relative;
  border-top: 3px solid var(--vw-gold);
}

/* --- Theme latin override (DJ Flow blocks) --- */
.theme-latin {
  --vw-gold: var(--vw-latin-magenta);
  --vw-gold-2: var(--vw-latin-accent);
}

/* --- Utility --- */
.vw-text-gold { color: var(--vw-gold); }
.vw-text-mono { font-family: var(--font-mono); }
.vw-text-display { font-family: var(--font-display); }
.vw-text-headline { font-family: var(--font-headline); text-transform: uppercase; letter-spacing: 0.05em; }
.vw-hide-mobile { display: none; }
@media (min-width: 768px) { .vw-hide-mobile { display: inherit; } .vw-hide-desktop { display: none; } }

/* --- Animations --- */
@keyframes vw-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.vw-anim-fade-up { animation: vw-fade-up .8s ease both; }

@keyframes vw-scroll-hint {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(8px); opacity: 1; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* --- x-cloak: solo PRIMA che Alpine sia caricato (rimosso quando arriva) ---
   Versione difensiva: NON nasconde tutto, nasconde solo span/text con bindings vuoti.
   Se Alpine non parte, almeno la struttura dei blocchi è visibile. */
[x-cloak] {
  visibility: visible;
}
.vw-loading [x-cloak] {
  visibility: hidden;
}
