/* ============================================================
   GLOBAL.CSS — ITALY CUCINE · CENTRO SCALE LAGHI
   Design system: variabili, reset, base, tipografia, utilità
   ============================================================ */

/* ── Google Fonts (fallback se i font locali non sono disponibili) ── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=DM+Sans:wght@400;500;600&display=swap');

/* ── Token cromatici ── */
:root {
  /* Palette approvata */
  --color-bg:           #F8F3EC;
  --color-bg-alt:       #E4D7C8;
  --color-white:        #FFFFFF;
  --color-dark:         #29251F;
  --color-text:         #29251F;
  --color-text-muted:   #6F5D50;
  --color-border:       rgba(41, 37, 31, 0.15);
  --color-border-dark:  rgba(41, 37, 31, 0.30);

  /* CTA */
  --color-cta:          #FFCC00;
  --color-cta-hover:    #E6B800;
  --color-cta-text:     #29251F;
  --color-cta-border:   rgba(41, 37, 31, 0.55);

  /* Accento / Icona pin */
  --color-pin:          #C23829;

  /* Stato focus */
  --color-focus:        #29251F;

  /* ── Tipografia ── */
  --font-display:  'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  --font-body:     'DM Sans', 'Segoe UI', system-ui, sans-serif;

  /* ── Scala tipografica (fluid) ── */
  --text-xs:    0.75rem;    /* 12px */
  --text-sm:    0.875rem;   /* 14px */
  --text-base:  1rem;       /* 16px */
  --text-md:    1.125rem;   /* 18px */
  --text-lg:    1.25rem;    /* 20px */
  --text-xl:    1.5rem;     /* 24px */
  --text-2xl:   1.875rem;   /* 30px */
  --text-3xl:   2.25rem;    /* 36px */
  --text-4xl:   2.75rem;    /* 44px */
  --text-5xl:   3.5rem;     /* 56px */

  /* ── Spacing ── */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* ── Layout ── */
  --container-max:    1200px;
  --container-narrow: 760px;
  --gutter:           clamp(1.25rem, 5vw, 2rem);

  /* ── Radius ── */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-btn:  10px;

  /* ── Ombre leggere ── */
  --shadow-card: 0 1px 4px rgba(41, 37, 31, 0.08), 0 4px 16px rgba(41, 37, 31, 0.06);
  --shadow-form: 0 2px 8px rgba(41, 37, 31, 0.10);

  /* ── Sezioni: padding verticale ── */
  --section-py: clamp(3.5rem, 8vw, 5.5rem);

  /* ── Transizioni ── */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Tipografia base ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

p {
  line-height: 1.7;
  max-width: 68ch;
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

img, picture {
  display: block;
  max-width: 100%;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* ── CTA Button — Componente condiviso ── */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  color: var(--color-cta-text);
  background-color: var(--color-cta);
  border: 1.5px solid var(--color-cta-border);
  border-radius: var(--radius-btn);
  padding: 0.875rem 1.75rem;
  white-space: nowrap;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.btn-cta:hover {
  background-color: var(--color-cta-hover);
  box-shadow: 0 2px 8px rgba(41, 37, 31, 0.18);
  text-decoration: none;
}

.btn-cta:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn-cta:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.btn-cta--lg {
  font-size: var(--text-md);
  padding: 1rem 2.25rem;
}

/* Smartphone stretti: le CTA grandi (Hero, CTA finale) possono andare a capo invece di uscire
   dal contenitore. line-height 1.3 compensato sul padding: su una riga l'altezza resta identica. */
@media (max-width: 419px) {
  .btn-cta--lg {
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
    padding-block: calc(1rem - 0.15em);
  }
}

/* Variante delle CTA contestuali nelle sezioni (desktop): pulsante pieno antracite
   con icona gialla; al passaggio del mouse diventa giallo come le CTA principali.
   Il giallo pieno a riposo resta riservato alle CTA di Hero e CTA finale. */
.btn-cta--section {
  background-color: var(--color-dark);
  border-color: var(--color-dark);
  color: var(--color-bg);
  box-shadow: 0 2px 8px rgba(41, 37, 31, 0.18);
}

.btn-cta--section:hover {
  background-color: var(--color-cta);
  border-color: var(--color-cta-border);
  color: var(--color-cta-text);
  box-shadow: 0 4px 14px rgba(41, 37, 31, 0.2);
}

.btn-cta__icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: var(--color-cta);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.btn-cta--section:hover .btn-cta__icon {
  color: var(--color-cta-text);
  transform: scale(1.08);
}

/* Contenitore delle CTA contestuali: visibili solo da 768px
   (sotto quella soglia le sostituisce la sticky bar mobile) */
.section-cta {
  display: none;
}

@media (min-width: 768px) {
  .section-cta {
    display: flex;
    margin-top: clamp(2rem, 4vw, 3rem);
  }

  .section-cta--center {
    justify-content: center;
  }
}

/* ── Eyebrow ── */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  display: block;
}

/* ── Sezione: struttura base ── */
.section {
  padding-block: var(--section-py);
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.section--dark {
  background-color: var(--color-dark);
  color: var(--color-bg);
}

.section--dark h2,
.section--dark h3,
.section--dark p {
  color: var(--color-bg);
}

.section__header {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section__header h2 {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  margin-top: var(--space-3);
}

/* ── Placeholder media ── */
.media-placeholder {
  background-color: var(--color-bg-alt);
  border: 1.5px dashed var(--color-border-dark);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: center;
  padding: var(--space-8);
}

.media-placeholder__icon {
  width: 40px;
  height: 40px;
  opacity: 0.4;
}

/* ── Divisore decorativo ── */
.divider {
  width: 40px;
  height: 3px;
  background-color: var(--color-cta);
  border-radius: 2px;
  margin-block: var(--space-4);
}

/* ── Utilità ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-center { text-align: center; }

/* ── Reveal allo scroll (classi aggiunte solo da JS: senza JS tutto resta visibile) ── */
.reveal {
  /* Stato finale esplicito: evita salti di compositing su Safari iOS. */
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: opacity, transform;
  transition:
    opacity 900ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 1000ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.is-reveal-hidden {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal.is-reveal-hidden {
    opacity: 1;
    transform: none;
  }
}

/* ── Responsive: visibilità ── */
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 768px) {
  .hide-desktop { display: none !important; }
}
