/* ============================================================
   Le Faremo Sapere — Responsive overrides
   ============================================================
   Strategy: components use inline styles (React style={}). To
   override on small viewports we expose semantic class hooks
   on the same elements and use !important rules below.

   Breakpoints:
     1024px — tablet landscape: nav + section padding shrinks
     768px  — tablet portrait / mobile: hero stacks, grids → 1 col
     480px  — small phones: tighter type, full-width CTAs

   Class hook taxonomy (added to existing inline-styled nodes):
     .lfs-section            section padding
     .lfs-section-inner      max-width container
     .lfs-grid-stack         any horizontal grid that should stack on mobile
     .lfs-grid-stack-4       4-col grid → 2-col tablet → 1-col mobile
     .lfs-h1 / .lfs-h2 / .lfs-display-xxl / .lfs-display-xl
                             responsive type scale
     .lfs-cta-row            row of CTAs that becomes full-width column
     .lfs-hide-mobile        display:none below 768
     .lfs-show-mobile        display:none above 768 (inline-flex below)
     .lfs-coral-callout      terracotta full-bleed CTA card padding
     .lfs-formula-grid       FormulaCard 3-up grid
     .lfs-cities-grid        cities 3-col strip (locandina) → 2-col mobile
   ============================================================ */

/* ---------- 1024px: tablet landscape ---------- */
@media (max-width: 1024px) {
  .lfs-section {
    padding: 80px 32px !important;
  }
  .lfs-nav {
    padding: 0 24px !important;
    gap: 20px !important;
  }
  .lfs-nav-links {
    gap: 18px !important;
  }
}

/* ---------- 768px: mobile ---------- */
@media (max-width: 768px) {
  /* Section padding */
  .lfs-section {
    padding: 64px 20px !important;
  }
  .lfs-section--tight {
    padding: 48px 20px !important;
  }

  /* Any 2-col / 3-col / asymmetric grid -> stack */
  .lfs-grid-stack {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
  .lfs-grid-stack--tight {
    gap: 24px !important;
  }

  /* 4-col -> 2-col on mobile */
  .lfs-grid-stack-4 {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
  }

  /* Formula cards 3-up -> stack */
  .lfs-formula-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Cities strip in locandina (was 3-col) -> 2-col */
  .lfs-cities-grid {
    grid-template-columns: 1fr 1fr !important;
    column-gap: 12px !important;
  }

  /* Footer columns 4 -> 2 */
  .lfs-footer-cols {
    grid-template-columns: 1fr 1fr !important;
    gap: 32px !important;
  }
  .lfs-footer-wrap {
    padding: 48px 24px 32px !important;
  }
  .lfs-footer-brand {
    margin-bottom: 32px !important;
  }

  /* Typography scale-down */
  .lfs-display-xxl {
    font-size: 44px !important;
    letter-spacing: -1px !important;
    line-height: 1.07 !important;
  }
  .lfs-display-xl {
    font-size: 38px !important;
    letter-spacing: -0.8px !important;
    line-height: 1.07 !important;
  }
  .lfs-h1 {
    font-size: 36px !important;
    letter-spacing: -0.8px !important;
    line-height: 1.08 !important;
  }
  .lfs-h2 {
    font-size: 30px !important;
    letter-spacing: -0.5px !important;
    line-height: 1.15 !important;
  }
  .lfs-h2-large {
    font-size: 36px !important;
    letter-spacing: -0.8px !important;
  }
  .lfs-quote-large {
    font-size: 24px !important;
    line-height: 1.3 !important;
  }
  .lfs-counter {
    font-size: 96px !important;
    letter-spacing: -3px !important;
  }
  .lfs-formula-number {
    font-size: 72px !important;
    letter-spacing: -2px !important;
  }
  .lfs-lede {
    font-size: 17px !important;
  }
  .lfs-prose-large {
    font-size: 20px !important;
    line-height: 1.35 !important;
  }
  .lfs-city-name {
    font-size: 24px !important;
  }

  /* Coral callout / CTA card - reduce padding */
  .lfs-coral-callout {
    padding: 36px 24px !important;
    border-radius: 12px !important;
  }
  .lfs-coral-callout h2 {
    font-size: 36px !important;
    letter-spacing: -0.8px !important;
  }

  /* Locandina dark card padding */
  .lfs-locandina {
    padding: 24px !important;
    gap: 32px !important;
  }

  /* CTA rows: stack and full-width */
  .lfs-cta-row {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
  }
  .lfs-cta-row > a,
  .lfs-cta-row > button {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* Hero: ensure visual block goes BELOW text on stack */
  .lfs-hero-figure {
    order: 2 !important;
    max-height: 540px !important;
  }
  .lfs-hero-text {
    order: 1 !important;
  }

  /* Compagnia portrait: cap height when stacked */
  .lfs-portrait {
    aspect-ratio: 4 / 5 !important;
    max-width: 360px !important;
    margin: 0 auto !important;
    width: 100% !important;
  }

  /* Form: 2-col grid -> 1-col */
  .lfs-form {
    grid-template-columns: 1fr !important;
  }
  .lfs-form > div[style*="span 2"] {
    grid-column: auto !important;
  }
  .lfs-form-footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
  }
  .lfs-form-footer button {
    width: 100% !important;
  }

  /* Nav: hide desktop links + CTA, show hamburger */
  .lfs-nav {
    height: 56px !important;
    padding: 0 16px !important;
  }
  .lfs-nav-links,
  .lfs-nav-right {
    display: none !important;
  }
  .lfs-nav-burger {
    display: inline-flex !important;
  }

  /* Press quote: reduce */
  .lfs-press-quote {
    font-size: 20px !important;
  }

  /* PCTO numbered list left-pad */
  .lfs-pcto-grid {
    grid-template-columns: 1fr !important;
    gap: 48px !important;
  }

  /* Backstage strip: keep 2-col on tablets but stack on phones */
  .lfs-backstage-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Aziende: hanno partecipato dark card grid */
  .lfs-applicants-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

/* ---------- 480px: small phones ---------- */
@media (max-width: 480px) {
  .lfs-section {
    padding: 48px 16px !important;
  }
  .lfs-section--tight {
    padding: 36px 16px !important;
  }
  .lfs-grid-stack-4 {
    grid-template-columns: 1fr !important;
  }
  .lfs-display-xxl { font-size: 36px !important; }
  .lfs-display-xl  { font-size: 32px !important; }
  .lfs-h1          { font-size: 30px !important; }
  .lfs-h2          { font-size: 26px !important; }
  .lfs-h2-large    { font-size: 30px !important; }
  .lfs-counter     { font-size: 72px !important; letter-spacing: -2px !important; }
  .lfs-formula-number { font-size: 56px !important; }
  .lfs-quote-large { font-size: 21px !important; }
  .lfs-prose-large { font-size: 18px !important; }
  .lfs-coral-callout { padding: 28px 20px !important; }
  .lfs-coral-callout h2 { font-size: 30px !important; }
  .lfs-footer-cols { grid-template-columns: 1fr !important; gap: 28px !important; }
  .lfs-cities-grid { grid-template-columns: 1fr !important; }
  .lfs-applicants-grid { grid-template-columns: 1fr !important; }
}

/* ---------- Mobile-only nav drawer (hamburger) ---------- */
.lfs-nav-burger {
  display: none;
  align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: transparent; border: 1px solid #e6dfd8; border-radius: 8px;
  cursor: pointer; padding: 0;
  color: #141413;
}
.lfs-nav-burger:hover { background: #efe9de; }
.lfs-nav-burger svg { display: block; }

.lfs-nav-drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(20,20,19,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.lfs-nav-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.lfs-nav-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(360px, 88vw);
  background: #faf9f5;
  border-left: 1px solid #e6dfd8;
  z-index: 100;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
  box-shadow: -24px 0 60px rgba(20,20,19,0.12);
}
.lfs-nav-drawer.open {
  transform: translateX(0);
}
.lfs-nav-drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid #e6dfd8;
}
.lfs-nav-drawer__close {
  width: 40px; height: 40px;
  background: transparent; border: 1px solid #e6dfd8; border-radius: 8px;
  cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: #141413;
}
.lfs-nav-drawer__close:hover { background: #efe9de; }
.lfs-nav-drawer__links {
  display: flex; flex-direction: column;
  padding: 8px 0;
}
.lfs-nav-drawer__link {
  display: block;
  padding: 18px 24px;
  font-family: 'Fraunces, Georgia, serif';
  font-size: 22px;
  letter-spacing: -0.4px;
  color: #141413;
  text-decoration: none;
  border-bottom: 1px solid #efe9de;
}
.lfs-nav-drawer__link.current {
  color: #cc785c;
}
.lfs-nav-drawer__link:hover { background: #efe9de; }
.lfs-nav-drawer__footer {
  margin-top: auto;
  padding: 24px;
  border-top: 1px solid #e6dfd8;
  display: flex; flex-direction: column; gap: 12px;
}

/* Lock body scroll when drawer is open */
body.lfs-drawer-open {
  overflow: hidden;
}
