/* =========================================================
   Mercatino dell'Usato — "Il mercato di quartiere"
   Grotesque caldo + palette da cartello di mercato.
   ========================================================= */

:root {
  /* superfici */
  --ivory: #F7EEDA;
  --ivory-2: #FCF6E9;
  --paper: #FFFBF2;

  /* inchiostro */
  --ink: #1B2230;
  --ink-soft: #4C5260;
  --cream: #FFF7EC;

  /* colori del mercato */
  --brick: #C8462C;
  --brick-btn: #B23B22;
  --mustard: #E3A017;
  --pine: #2E6A4E;
  --slate: #2B5577;
  --pumpkin: #CC7A22;

  --line: rgba(27, 34, 48, 0.14);
  --line-strong: rgba(27, 34, 48, 0.28);
  --shadow: 0 18px 40px -22px rgba(27, 34, 48, 0.45);
  --shadow-soft: 0 10px 26px -18px rgba(27, 34, 48, 0.4);

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, sans-serif;

  --maxw: 1140px;
  --radius: 18px;
  --radius-sm: 12px;

  --header-h: 76px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--ivory);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
html { scroll-padding-top: calc(var(--header-h) + 12px); }

img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; font-weight: 800; letter-spacing: -0.01em; }
p { text-wrap: pretty; }
ul { list-style: none; padding: 0; }

a { color: inherit; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 10001;
  background: var(--ink); color: var(--cream);
  padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 600;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--slate); outline-offset: 3px; border-radius: 6px; }

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 10001; /* sopra il drawer (10000) così la X resta cliccabile */
  background: rgba(247, 238, 218, 0.94);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease, background .2s ease;
}
.site-header.scrolled {
  background: rgba(247, 238, 218, 0.98);
  box-shadow: var(--shadow-soft);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h); gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink);
}
.brand-tag { display: inline-flex; }
.brand-tag svg { display: block; }
.brand-name {
  font-family: var(--font-display); font-weight: 800; font-size: 1.18rem;
  line-height: 0.98; letter-spacing: -0.02em;
}
.footer-name { font-size: 1.4rem; }

.nav-desktop { display: flex; align-items: center; gap: 6px; }
.nav-desktop a {
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: 1rem;
  padding: 10px 14px; border-radius: 10px; transition: background .15s ease, color .15s ease;
}
.nav-desktop a:hover { background: rgba(27, 34, 48, 0.06); }
.nav-desktop a:not(.nav-cta)[aria-current="true"] { color: var(--brick); background: rgba(200, 70, 44, 0.08); }
.nav-desktop .nav-cta {
  background: var(--ink); color: var(--cream);
}
.nav-desktop .nav-cta:hover { background: #2a3346; }

/* hamburger */
.hamburger {
  display: none;
  width: 48px; height: 48px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--paper); cursor: pointer; align-items: center; justify-content: center;
  padding: 0;
}
.hamburger-box { position: relative; width: 22px; height: 16px; display: block; }
.hamburger-line, .hamburger-line::before, .hamburger-line::after {
  position: absolute; left: 0; width: 22px; height: 2.5px; background: var(--ink); border-radius: 3px;
  transition: transform .25s ease, opacity .2s ease;
}
.hamburger-line { top: 50%; transform: translateY(-50%); }
.hamburger-line::before { content: ""; top: -7px; }
.hamburger-line::after  { content: ""; top: 7px; }
.hamburger[aria-expanded="true"] .hamburger-line { background: transparent; }
.hamburger[aria-expanded="true"] .hamburger-line::before { top: 0; transform: rotate(45deg); }
.hamburger[aria-expanded="true"] .hamburger-line::after  { top: 0; transform: rotate(-45deg); }

/* mobile drawer (overlay full-screen, niente translate parziale) */
.mobile-nav {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--ivory);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease;
  padding: calc(var(--header-h) + 24px) 24px 32px;
  overflow-y: auto;
}
.mobile-nav.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.mobile-nav-inner { display: flex; flex-direction: column; gap: 6px; max-width: 460px; margin-inline: auto; }
.mobile-nav-inner a {
  text-decoration: none; color: var(--ink); font-family: var(--font-display);
  font-weight: 700; font-size: 1.6rem; letter-spacing: -0.02em;
  padding: 16px 8px; border-bottom: 1px solid var(--line);
}
.mobile-nav-inner a:active { color: var(--brick); }

/* =========================================================
   HERO + bacheca categorie
   ========================================================= */
.hero { padding-top: clamp(40px, 8vw, 72px); padding-bottom: clamp(36px, 6vw, 56px); }
.hero-inner { text-align: center; max-width: 860px; }
.hero-title {
  font-size: clamp(2.3rem, 8.5vw, 4.6rem);
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero-sub {
  margin-top: 20px; font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  color: var(--ink-soft); max-width: 640px; margin-inline: auto;
}
.hero-cta {
  margin-top: 30px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
}
.hero-phone {
  margin-top: 22px; font-size: 1.05rem; color: var(--ink-soft);
}
.hero-phone-num {
  font-family: var(--font-display); font-weight: 800; color: var(--ink);
  font-size: 1.2rem; letter-spacing: -0.01em; white-space: nowrap;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 14px 26px; border-radius: 999px;
  font-family: var(--font-body); font-weight: 700; font-size: 1.05rem;
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--brick-btn); color: var(--cream); box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: #9c3019; transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--cream); transform: translateY(-2px); }

/* bacheca tessere */
#cosa-trovo { margin-top: clamp(48px, 8vw, 80px); scroll-margin-top: calc(var(--header-h) + 12px); }
.tiles-title {
  text-align: center; font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin-bottom: 26px;
}
.tiles {
  display: grid; gap: 16px;
  grid-template-columns: repeat(2, 1fr);
}
.tile {
  position: relative;
  min-width: 0;
  background: var(--c, var(--pine));
  color: var(--tcolor, var(--cream));
  border-radius: var(--radius);
  padding: 26px 20px 22px;
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease;
}
/* occhiello del cartellino */
.tile::before {
  content: ""; position: absolute; top: 14px; right: 16px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ivory);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.25);
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.tile-icon { display: inline-flex; color: inherit; opacity: 0.95; }
.tile-name { font-size: clamp(1.02rem, 4.3vw, 1.22rem); margin-top: 12px; font-weight: 800; letter-spacing: -0.015em; overflow-wrap: break-word; hyphens: auto; }
.tile-desc { margin-top: 6px; font-size: 0.98rem; line-height: 1.5; }

.tile-mobili        { --c: #B53A22; --tcolor: var(--cream); }
.tile-abbigliamento { --c: #E3A017; --tcolor: #2A2208; }
.tile-cucine        { --c: #2E6A4E; --tcolor: var(--cream); }
.tile-auto          { --c: #2B5577; --tcolor: var(--cream); }
.tile-casa          { --c: #CC7A22; --tcolor: #2A1C06; }

.tiles-note {
  text-align: center; margin-top: 24px; color: var(--ink-soft);
  font-size: 1.02rem; max-width: 560px; margin-inline: auto;
}

/* =========================================================
   BANDA FOTO
   ========================================================= */
.band { padding: clamp(40px, 7vw, 72px) 0; }
.band-figure {
  position: relative; max-width: var(--maxw); margin-inline: auto;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.band-figure img { width: 100%; height: clamp(280px, 52vw, 460px); object-fit: cover; object-position: center 38%; }
.band-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 56px 24px 22px;
  background: linear-gradient(to top, rgba(20, 16, 10, 0.86), rgba(20, 16, 10, 0));
}
.band-caption-text {
  display: block; color: var(--cream); max-width: 640px;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.05rem, 2.6vw, 1.5rem);
  line-height: 1.25; letter-spacing: -0.01em;
}

/* =========================================================
   SECTIONS generiche
   ========================================================= */
.section { padding: clamp(52px, 9vw, 96px) 0; }
.section-head { max-width: 680px; margin-bottom: 36px; }
.section-title { font-size: clamp(1.8rem, 5vw, 2.8rem); letter-spacing: -0.022em; }
.section-lead { margin-top: 16px; font-size: clamp(1.05rem, 2.4vw, 1.22rem); color: var(--ink-soft); }

/* SGOMBERI */
.sgomberi { background: var(--ivory-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sgomberi-grid { display: grid; gap: 32px; grid-template-columns: 1fr; align-items: start; }
.steps { display: flex; flex-direction: column; gap: 14px; }
.step {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 20px;
}
.step-mark {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brick); color: var(--cream);
}
.step-title { font-size: 1.2rem; margin-bottom: 4px; }
.step-body p { color: var(--ink-soft); }
.sgomberi-figure { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.sgomberi-figure img { width: 100%; height: clamp(300px, 60vw, 520px); object-fit: cover; object-position: center; }
.sgomberi-contact { margin-top: 28px; font-size: 1.08rem; color: var(--ink-soft); }
.sgomberi-contact .ph { font-family: var(--font-display); font-weight: 700; color: var(--ink); white-space: nowrap; }

/* STORIA */
.storia-grid { display: grid; gap: 32px; grid-template-columns: 1fr; align-items: center; }
.storia-figure { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.storia-figure img { width: 100%; height: clamp(260px, 56vw, 440px); object-fit: cover; }
.storia-text p { margin-top: 16px; font-size: 1.08rem; }
.storia-text .section-title { margin-bottom: 6px; }
.values { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.value { display: flex; gap: 12px; align-items: center; font-weight: 600; }
.value-icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--mustard); color: #2A2208;
}

/* COME COMPRARE */
.comprare-inner { max-width: var(--maxw); }
.comprare-inner .section-lead { max-width: 620px; }
.cards { margin-top: 34px; display: grid; gap: 18px; grid-template-columns: 1fr; }
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 24px;
  box-shadow: var(--shadow-soft);
}
.card-title { font-size: 1.25rem; margin-bottom: 10px; }
.card p { color: var(--ink-soft); }

/* CONTATTI */
.contatti { background: var(--ink); color: var(--cream); }
.contatti .section-title { color: var(--cream); }
.contatti .section-lead { color: rgba(255, 247, 236, 0.82); }
.contatti-inner { max-width: 760px; }
.contatti-card {
  margin-top: 30px; background: rgba(255, 247, 236, 0.06);
  border: 1px solid rgba(255, 247, 236, 0.18);
  border-radius: var(--radius); padding: 30px 26px; text-align: center;
}
.contatti-label { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.82rem; font-weight: 700; color: var(--mustard); }
.contatti-number {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.9rem, 7vw, 3rem); letter-spacing: -0.01em; margin-top: 10px;
}
.contatti-hint { margin-top: 10px; color: rgba(255, 247, 236, 0.78); }
.contatti-foot { margin-top: 24px; color: rgba(255, 247, 236, 0.82); text-align: center; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { background: var(--ivory-2); border-top: 1px solid var(--line); padding: 40px 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-end; }
.footer-line { margin-top: 8px; color: var(--ink-soft); font-size: 0.98rem; }
.footer-contact-label { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.76rem; font-weight: 700; color: var(--ink-soft); }
.footer-contact-number { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; margin-top: 4px; }

/* =========================================================
   WEEBY BADGE (credit canonico)
   ========================================================= */
.weeby-badge {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(10, 10, 10, 0.92); color: #fff;
  padding: 8px 16px 8px 8px; border-radius: 999px; text-decoration: none;
  font-size: 13px; font-weight: 500; line-height: 1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .2s ease, padding .25s ease;
  animation: weebyBadgeIn .6s ease 1.5s both;
}
.weeby-badge:hover { transform: translateY(-2px); padding-right: 20px; }
.weeby-badge img { width: 26px; height: 26px; border-radius: 7px; display: block; }
.weeby-badge .label { color: rgba(255, 255, 255, 0.9); }
.weeby-badge .label strong { color: #fff; font-weight: 700; }
.weeby-badge .cta {
  max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap;
  color: #ffb547; font-weight: 600; margin-left: -6px;
  transition: max-width .3s ease, opacity .2s ease .05s, margin-left .3s ease;
}
.weeby-badge:hover .cta { max-width: 200px; opacity: 1; margin-left: 0; }
@keyframes weebyBadgeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   MOTION reveal (attivata solo via JS)
   ========================================================= */
.anim .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.anim .reveal.is-visible { opacity: 1; transform: none; }

/* =========================================================
   BREAKPOINTS
   ========================================================= */
@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .cards { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  .sgomberi-grid { grid-template-columns: 1.05fr 0.95fr; gap: 44px; align-items: center; }
  .storia-grid { grid-template-columns: 0.92fr 1.08fr; gap: 48px; }
}

@media (min-width: 880px) {
  .tiles { grid-template-columns: repeat(5, 1fr); gap: 14px; }
  .tile-cucine { grid-column: auto; }
}

/* sotto i 768: hamburger + menu desktop nascosto */
@media (max-width: 767px) {
  .nav-desktop { display: none; }
  .hamburger { display: inline-flex; }
}

@media (min-width: 768px) {
  .mobile-nav { display: none; }
}

/* schermi grandi: tessere a 5 colonne con descrizioni più ariose */
@media (min-width: 1000px) {
  .tile { padding: 28px 22px 24px; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .anim .reveal { opacity: 1; transform: none; }
}
