/* ============================================
   IL PICCOLO BORGO CASE STUDY · prefix: pb-
   palette rosso vino + ocra su dark soul
   emoji food volanti con 4 keyframes complesse
   ============================================ */

:root {
  --pb-bg: #0a0a0a;
  --pb-text: #f5e6d3;
  --pb-text-muted: #c9b89a;
  --pb-text-soft: rgba(245, 230, 211, 0.65);
  --pb-wine: #8B1A1A;
  --pb-wine-light: #B5453F;
  --pb-gold: #D4A24C;
  --pb-cream: #E8C77E;
  --pb-glow-warm: rgba(139, 26, 26, 0.55);
  --pb-glow-soft: rgba(212, 162, 76, 0.25);
  --pb-glow-hot: rgba(139, 26, 26, 0.45);
  --pb-bg-soft: rgba(212, 162, 76, 0.15);
  --pb-bg-wine: rgba(139, 26, 26, 0.15);
  --pb-border: rgba(212, 162, 76, 0.4);
  --pb-divider: rgba(212, 162, 76, 0.25);
}

.pb-main {
  background: var(--pb-bg);
  color: var(--pb-text);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
}
.pb-main * { box-sizing: border-box; }

/* SECTIONS */
.pb-section {
  position: relative;
  padding: 100px 0;
  overflow: hidden;
}
.pb-section + .pb-section {
  border-top: 1px solid var(--pb-divider);
}

/* GLOW */
.pb-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 75%;
  height: 65%;
  background: radial-gradient(ellipse, var(--pb-glow-warm) 0%, var(--pb-glow-soft) 35%, transparent 70%);
  pointer-events: none;
  filter: blur(40px);
  z-index: 0;
}
.pb-glow--center { width: 85%; height: 80%; }
.pb-glow--hot {
  background: radial-gradient(ellipse, rgba(139, 26, 26, 0.5) 0%, var(--pb-glow-soft) 35%, transparent 70%);
}

/* EMOJI VOLANTI - 4 keyframes diverse */
.pb-fly {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  opacity: 0.32;
  will-change: transform;
}
.pb-fly--a { animation: pb-fly-a 12s ease-in-out infinite; }
.pb-fly--b { animation: pb-fly-b 14s ease-in-out infinite; }
.pb-fly--c { animation: pb-fly-c 10s ease-in-out infinite; }
.pb-fly--d { animation: pb-fly-d 16s ease-in-out infinite; }

@keyframes pb-fly-a {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25%      { transform: translate(20px, -30px) rotate(15deg); }
  50%      { transform: translate(-10px, -50px) rotate(-10deg); }
  75%      { transform: translate(-25px, -20px) rotate(8deg); }
}
@keyframes pb-fly-b {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33%      { transform: translate(-30px, -20px) rotate(-15deg); }
  66%      { transform: translate(15px, -40px) rotate(20deg); }
}
@keyframes pb-fly-c {
  0%, 100% { transform: translate(0, 0) rotate(-5deg); }
  50%      { transform: translate(25px, 25px) rotate(15deg); }
}
@keyframes pb-fly-d {
  0%, 100% { transform: translate(0, 0) rotate(8deg); }
  20%      { transform: translate(-15px, 20px) rotate(-10deg); }
  40%      { transform: translate(20px, 10px) rotate(15deg); }
  60%      { transform: translate(-10px, -25px) rotate(-8deg); }
  80%      { transform: translate(15px, -15px) rotate(12deg); }
}

/* CONTENT */
.pb-content { position: relative; z-index: 2; }

/* KICKER */
.pb-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pb-cream);
  margin-bottom: 20px;
}
.pb-kicker::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pb-gold);
  box-shadow: 0 0 14px var(--pb-gold);
}

/* TITLE */
.pb-title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  color: var(--pb-text);
  margin: 0 0 20px;
}
.pb-title__hot {
  background: linear-gradient(135deg, var(--pb-wine), var(--pb-wine-light), var(--pb-gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.pb-title__emoji {
  display: inline-block;
  font-size: 0.85em;
  transform: rotate(-12deg);
  margin-left: 6px;
  -webkit-text-fill-color: initial;
  background: none;
  -webkit-background-clip: initial;
  color: initial;
}

/* COPY */
.pb-copy {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--pb-text-muted);
  max-width: 640px;
  margin: 0;
}
.pb-copy--lead {
  font-size: 19px;
  margin-bottom: 32px;
}

/* SECTION HEAD */
.pb-section-head {
  text-align: center;
  margin-bottom: 50px;
}
.pb-section-head .pb-copy {
  margin: 20px auto 0;
}

/* HERO specifico */
.pb-hero {
  text-align: center;
  padding: 140px 0 100px;
}
.pb-hero .pb-title { max-width: 900px; margin: 0 auto 24px; }
.pb-hero .pb-copy { margin: 0 auto 32px; }
.pb-hero .pb-pills { justify-content: center; display: flex; }

/* HERO KPI ROW */
.pb-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 600px;
  margin: 0 auto 28px;
}
.pb-kpi {
  padding: 18px 12px;
  border: 1px solid var(--pb-border);
  border-radius: 12px;
  background: var(--pb-bg-wine);
  text-align: center;
}
.pb-kpi__num {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--pb-wine), var(--pb-gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.pb-kpi__label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--pb-text-muted);
  margin-top: 6px;
}

/* PILLS */
.pb-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.pb-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 100px;
  background: var(--pb-bg-soft);
  border: 1px solid var(--pb-border);
  font-size: 12px;
  font-weight: 700;
  color: var(--pb-cream);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

/* MEDIA + HOVER GLOW */
.pb-media {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.2, 1);
  background: linear-gradient(160deg, #2a1410, #1a0a08);
}
.pb-media::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow 0.4s ease;
  pointer-events: none;
  z-index: -1;
}
.pb-media:hover {
  transform: translateY(-6px) scale(1.03);
}
.pb-media:hover::after {
  box-shadow:
    0 0 60px 8px var(--pb-glow-warm),
    0 0 140px 24px var(--pb-glow-soft);
}
.pb-media img,
.pb-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* BIG STAT (hero della sezione reel) */
.pb-big-stat {
  text-align: center;
  margin: 24px auto 36px;
  max-width: 560px;
  padding: 32px 24px;
  border: 1px solid var(--pb-border);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--pb-bg-wine), var(--pb-bg-soft));
}
.pb-big-stat__num {
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--pb-wine), var(--pb-wine-light), var(--pb-gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: lowercase;
}
.pb-big-stat__label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pb-cream);
  margin-top: 10px;
  font-weight: 600;
}

/* REEL GRID (5 colonne) */
.pb-reel-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.pb-reel-card { aspect-ratio: 9/16; }

/* PIATTI GRID (4 colonne x 2 righe) */
.pb-piatti-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.pb-piatto-card { aspect-ratio: 1/1; }

/* SERATE MASONRY (3 colonne, altezze variabili) */
.pb-serate-masonry {
  columns: 3;
  column-gap: 12px;
}
.pb-serata-card {
  break-inside: avoid;
  margin-bottom: 12px;
  display: block;
}
.pb-serata-card:nth-child(8n+1) { aspect-ratio: 4/3; }
.pb-serata-card:nth-child(8n+2) { aspect-ratio: 3/4; }
.pb-serata-card:nth-child(8n+3) { aspect-ratio: 1/1; }
.pb-serata-card:nth-child(8n+4) { aspect-ratio: 4/5; }
.pb-serata-card:nth-child(8n+5) { aspect-ratio: 3/4; }
.pb-serata-card:nth-child(8n+6) { aspect-ratio: 4/3; }
.pb-serata-card:nth-child(8n+7) { aspect-ratio: 1/1; }
.pb-serata-card:nth-child(8n+8) { aspect-ratio: 3/4; }

/* STAT GRID (Numeri sezione) */
.pb-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.pb-stat-card {
  padding: 24px 14px;
  border: 1px solid var(--pb-border);
  border-radius: 12px;
  background: var(--pb-bg-wine);
  text-align: center;
}
.pb-stat-card__num {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--pb-wine), var(--pb-gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.pb-stat-card__label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--pb-text-muted);
  margin-top: 8px;
  font-weight: 600;
}

/* CTA */
.pb-cta {
  text-align: center;
  padding: 120px 0;
}
.pb-cta .pb-title { max-width: 700px; margin: 0 auto 32px; }
.pb-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 18px 36px;
  background: linear-gradient(135deg, var(--pb-wine), var(--pb-wine-light));
  color: #ffffff !important;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.01em;
  box-shadow:
    0 0 60px var(--pb-glow-warm),
    0 0 0 1px rgba(212, 162, 76, 0.3);
  transition: all 0.3s ease;
}
.pb-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 0 80px var(--pb-glow-warm),
    0 0 0 1px var(--pb-gold);
}
.pb-btn__arrow { transition: transform 0.3s ease; }
.pb-btn:hover .pb-btn__arrow { transform: translateX(4px); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .pb-section { padding: 70px 0; }
  .pb-hero { padding: 100px 0 70px; }
  .pb-cta { padding: 90px 0; }
  .pb-piatti-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .pb-serate-masonry { columns: 2; }
  .pb-stat-grid { grid-template-columns: repeat(2, 1fr); }

  .pb-fly { opacity: 0.22; font-size: 18px !important; }
}

@media (max-width: 540px) {
  .pb-section { padding: 60px 0; }
  .pb-hero { padding: 80px 0 60px; }
  .pb-cta { padding: 70px 0; }

  .pb-title { font-size: 32px; }
  .pb-copy { font-size: 15px; }
  .pb-copy--lead { font-size: 16px; }

  .pb-kpi-row { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .pb-kpi { padding: 12px 6px; }
  .pb-kpi__num { font-size: 22px; }
  .pb-kpi__label { font-size: 9px; }
  .pb-piatti-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .pb-serate-masonry { columns: 2; column-gap: 8px; }
  .pb-serata-card { margin-bottom: 8px; }

  .pb-stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .pb-stat-card { padding: 16px 8px; }
  .pb-stat-card__num { font-size: 28px; }

  .pb-pills { justify-content: center; }
  .pb-section-head { margin-bottom: 32px; }
  .pb-btn { padding: 16px 28px; font-size: 14px; }

  .pb-big-stat { padding: 22px 16px; }
}


/* PB MOBILE REEL CAROUSEL — reel scroll orizzontale col dito (<=768px) */
@media (max-width: 768px){
  .pb-reel-grid{
    display:flex; grid-template-columns:none;
    overflow-x:auto; gap:12px;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    padding:4px 16px 14px; margin:0 -16px;
  }
  .pb-reel-grid::-webkit-scrollbar{ height:4px; }
  .pb-reel-grid::-webkit-scrollbar-thumb{ background:rgba(139,26,34,.55); border-radius:4px; }
  .pb-reel-card{ flex:0 0 60vw; max-width:230px; scroll-snap-align:start; }
}
/* ============================================================ */