/* ============================================================================
   PANIFICIO PERRONE — style.css
   Mobile-first. Palette calda: pane, legna, terracotta.
   ========================================================================== */

:root {
  /* Colori */
  --cream:       #faf3e7;   /* sfondo principale, caldo */
  --cream-2:     #f3e8d6;   /* sezioni alternate */
  --ink:         #2b1d12;   /* testo scuro, near-black brown */
  --ink-soft:    #5c4a39;   /* testo secondario */
  --crust:       #7a4322;   /* marrone crosta */
  --terracotta:  #c25b33;   /* accento primario */
  --terracotta-d:#a8481f;   /* accento hover */
  --line:        #e3d4bd;   /* bordi sottili */
  --white:       #fffdf8;

  /* Tipografia */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --maxw:   1120px;
  --pad:    1.25rem;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(43, 29, 18, .12);

  /* Sticky-bar height usata per padding-bottom body su mobile */
  --sticky-h: 72px;
}

/* ---------- Reset essenziale ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px; /* altezza header sticky */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  font-size: 1.0625rem;
  /* spazio per la barra sticky su mobile: sua altezza + safe area */
  padding-bottom: calc(var(--sticky-h) + env(safe-area-inset-bottom, 0px));
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--terracotta-d); }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

h1, h2, h3 {
  font-family: var(--serif);
  line-height: 1.1;
  color: var(--ink);
  font-weight: 900;
  margin: 0;
}

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

@media print {
  .site-header, .sticky-bar, .hero__cta, .section__actions { display: none !important; }
}

/* ---------- Accessibilità ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--ink); color: var(--white);
  padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

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

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section { padding-block: clamp(3rem, 8vw, 6rem); }
.section:nth-of-type(even) { background: var(--cream-2); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .75rem;
  font-weight: 700;
  color: var(--terracotta-d);
  margin: 0 0 .6rem;
}

.section__title {
  font-size: clamp(1.9rem, 6vw, 3rem);
  margin-bottom: 1rem;
}
.section__lead {
  max-width: 60ch;
  font-size: clamp(1.05rem, 2.6vw, 1.2rem);
  color: var(--ink-soft);
  margin-bottom: 0;
}
.section__actions { margin-top: 2.25rem; }

/* ---------- Animazione reveal (Intersection Observer) ---------- */
.reveal-section {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
  text-decoration: none;
  padding: .95rem 1.5rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn .ico { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }

.btn--primary { background: var(--terracotta); color: var(--white); box-shadow: var(--shadow); }
.btn--primary:hover { background: var(--terracotta-d); }

.btn--call { background: var(--ink); color: var(--white); }
.btn--call:hover { background: #1c120a; }

/* ============================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 243, 231, .92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease;
}
.site-header.is-scrolled { box-shadow: 0 4px 16px rgba(43,29,18,.12); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  color: var(--ink);
}
.brand__mark { font-size: 1.5rem; line-height: 1; }
.brand__name { font-family: var(--serif); font-weight: 900; font-size: 1.2rem; }

/* Hamburger */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 10px;
}
.nav-toggle__bar {
  height: 2px; width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav mobile: a tendina */
.primary-nav {
  display: none;
  position: absolute; left: 0; right: 0; top: 100%;
  flex-direction: column;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  padding: .5rem var(--pad) 1.25rem;
  box-shadow: var(--shadow);
}
.primary-nav.is-open { display: flex; }
.primary-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  padding: .85rem .25rem;
  border-bottom: 1px solid var(--line);
  transition: color .15s ease;
}
.primary-nav a:last-child { border-bottom: 0; }
.primary-nav a.is-active { color: var(--terracotta-d); }
.primary-nav__cta {
  margin-top: .75rem;
  background: var(--terracotta);
  color: var(--white) !important;
  text-align: center;
  border-radius: 999px;
  border-bottom: 0 !important;
}

/* ============================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 86vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: var(--white);
}
.hero__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
}
.hero__shade {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(
    to top,
    rgba(20,12,6,.85)  0%,
    rgba(20,12,6,.38) 45%,
    rgba(20,12,6,.15) 100%
  );
}
.hero__content { padding-block: clamp(2.5rem, 8vw, 5rem); }
.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: .2em;
  font-weight: 700;
  font-size: .8rem;
  margin: 0 0 1rem;
  color: #f1d8c4;
}
.hero h1 {
  color: var(--white);
  font-size: clamp(2.4rem, 9vw, 4.6rem);
  letter-spacing: -.01em;
  text-shadow: 0 2px 20px rgba(0,0,0,.35);
}
.hero h1 em { font-style: italic; font-weight: 400; color: #ffd9b8; }
.hero__sub {
  max-width: 34ch;
  font-size: clamp(1.05rem, 3.2vw, 1.4rem);
  margin: 1.25rem 0 2rem;
  text-shadow: 0 1px 12px rgba(0,0,0,.4);
}
.hero__cta { display: flex; flex-wrap: wrap; gap: .9rem; }
.hero__cta .btn { flex: 1 1 auto; justify-content: center; min-width: 9rem; }

/* ============================================================================
   IL PANE
   ========================================================================== */
.pane__gallery {
  display: grid;
  gap: 1rem;
  margin-top: 2.5rem;
}
.pane__figure { margin: 0; }
.pane__figure img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  object-fit: cover;
  aspect-ratio: 4 / 5;
}
.pane__figure figcaption {
  margin-top: .65rem;
  font-size: .95rem;
  color: var(--ink-soft);
  font-style: italic;
}

.steps {
  list-style: none;
  margin: 3rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.step {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.4rem;
  transition: box-shadow .2s ease;
}
.step:hover { box-shadow: var(--shadow); }
.step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem; height: 2.4rem;
  background: var(--terracotta);
  color: var(--white);
  border-radius: 50%;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 1.2rem;
  margin-bottom: .9rem;
}
.step__title { font-size: 1.3rem; margin-bottom: .35rem; color: var(--crust); }
.step p { margin: 0; color: var(--ink-soft); }

/* ============================================================================
   ALTRI PRODOTTI
   ========================================================================== */
.cards {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, 1fr);
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.card__title { font-size: 1.2rem; margin: .9rem 1rem .25rem; color: var(--crust); }
.card p { margin: 0 1rem 1.1rem; font-size: .95rem; color: var(--ink-soft); }

/* ============================================================================
   STORIA
   ========================================================================== */
.storia__grid { display: grid; gap: 2rem; }
.storia__media { margin: 0; }
.storia__media img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.storia__text p { color: var(--ink-soft); }
.storia__sign {
  font-family: var(--serif);
  font-style: italic;
  color: var(--crust);
  font-size: 1.15rem;
  margin-top: 1.5rem;
}

/* ============================================================================
   DOVE SIAMO
   ========================================================================== */
.dove__grid { display: grid; gap: 2rem; }

.info-list { margin: 1.5rem 0 0; display: grid; gap: 1rem; }
.info-list__row { border-bottom: 1px dashed var(--line); padding-bottom: 1rem; }
.info-list__row:last-child { border-bottom: 0; padding-bottom: 0; }
.info-list dt {
  font-weight: 700;
  color: var(--crust);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.info-list dd { margin: .25rem 0 0; font-size: 1.15rem; }
.info-list a { color: var(--ink); text-decoration: none; }
.info-list a:hover { color: var(--terracotta-d); }

.dove__map {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.dove__map img,
.dove__map iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform .3s ease;
}
.dove__map iframe { display: block; border: 0; }
.dove__map:hover img { transform: scale(1.03); }
.dove__map-pin {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -85%);
  width: 44px; height: 44px;
  display: grid; place-items: center;
}
.dove__map-pin svg {
  width: 40px; height: 40px;
  fill: var(--terracotta);
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.4));
}
.dove__map-label {
  position: absolute;
  left: 50%; bottom: 1rem;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--white);
  font-size: .9rem;
  font-weight: 600;
  padding: .5rem 1rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ============================================================================
   RECENSIONI
   ========================================================================== */
.reviews {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}
.review {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  box-shadow: var(--shadow);
}
.review__stars {
  color: #e8a020;
  letter-spacing: .12em;
  margin: 0 0 .75rem;
  font-size: 1.1rem;
}
.review blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.4;
  color: var(--ink);
}
.review__author { margin: 1rem 0 0; font-weight: 700; color: var(--ink-soft); }

/* ============================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--ink);
  color: #e8dccc;
  /* padding-bottom extra su mobile copre la barra sticky */
  padding-block: 3rem calc(var(--sticky-h) + env(safe-area-inset-bottom, 0px) + 2rem);
}
.site-footer a { color: #e8dccc; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }

.site-footer__grid { display: grid; gap: 2rem; }
.site-footer__brand .brand__name {
  color: var(--white);
  font-size: 1.4rem;
  display: block;
  margin-bottom: .5rem;
}
.site-footer__brand p { margin: 0; color: #b9a78f; }
.site-footer__h {
  font-family: var(--sans);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #b9a78f;
  margin: 0 0 .8rem;
  font-weight: 700;
}
.site-footer__col ul {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: .55rem;
}
.site-footer__bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.12);
}
.site-footer__bottom p { margin: 0; color: #b9a78f; font-size: .9rem; }

/* ============================================================================
   BARRA STICKY (solo mobile)
   ========================================================================== */
.sticky-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 200;
  display: flex;
  gap: .5rem;
  padding: .55rem .55rem calc(.55rem + env(safe-area-inset-bottom, 0px));
  background: rgba(250, 243, 231, .96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(43,29,18,.12);
}
.sticky-bar__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  padding: .9rem 1rem;
  border-radius: 12px;
  color: var(--white);
  transition: filter .15s ease;
}
.sticky-bar__btn:active { filter: brightness(.88); }
.sticky-bar__btn .ico { width: 1.2em; height: 1.2em; fill: currentColor; }
.sticky-bar__btn--call { background: var(--ink); }
.sticky-bar__btn--map  { background: var(--terracotta); }

/* ============================================================================
   BREAKPOINT — TABLET / DESKTOP
   ========================================================================== */
@media (min-width: 720px) {
  .pane__gallery   { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .steps           { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
  .cards           { grid-template-columns: repeat(4, 1fr); }
  .reviews         { grid-template-columns: repeat(3, 1fr); }
  .storia__grid    { grid-template-columns: 1fr 1fr; align-items: center; }
  .dove__grid      { grid-template-columns: 1fr 1fr; align-items: start; }
  .site-footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .hero__cta .btn  { flex: 0 0 auto; }
}

@media (min-width: 880px) {
  /* La barra sticky è SOLO mobile */
  .sticky-bar { display: none; }

  /* Ripristina padding normali (niente sticky-bar da coprire) */
  body { padding-bottom: 0; }
  .site-footer { padding-bottom: 3rem; }

  /* Header desktop: niente hamburger, nav in linea */
  .nav-toggle { display: none; }
  .primary-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.75rem;
    position: static;
    background: transparent;
    border: 0;
    padding: 0;
    box-shadow: none;
  }
  .primary-nav a {
    border-bottom: 0;
    padding: .35rem 0;
    position: relative;
  }
  .primary-nav a:not(.primary-nav__cta)::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 2px;
    background: var(--terracotta);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .2s ease;
  }
  .primary-nav a:not(.primary-nav__cta):hover::after,
  .primary-nav a.is-active:not(.primary-nav__cta)::after { transform: scaleX(1); }
  .primary-nav a:not(.primary-nav__cta):hover { color: var(--terracotta-d); }
  .primary-nav__cta { margin-top: 0; padding: .65rem 1.4rem; }

  .section__title { font-size: clamp(2.4rem, 4vw, 3.2rem); }
  .steps { grid-template-columns: repeat(4, 1fr); }
}
