/* =========================================================================
   CITTÀ NARRATA — global stylesheet
   shared by index + all luogo pages
   ========================================================================= */

:root {
  --coral: #E74C5E;
  --coral-deep: #C13A4B;
  --coral-soft: #FBE9EC;
  --blue: #0066CC;
  --blue-deep: #004A99;
  --ink: #1A1612;
  --ink-soft: #2E2620;
  --ink-mute: #6E6963;
  --paper: #F4ECDE;
  --paper-warm: #EFE4D2;
  --paper-deep: #E8DBC4;
  --cream: #FBF6EC;
  --white: #FFFFFF;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--coral); color: var(--cream); }

/* === DISPLAY TYPE === */
.display, h1.display, .section-title {
  font-family: "Bricolage Grotesque", "Hanken Grotesk", sans-serif;
  font-weight: 700;
  font-stretch: 110%;
  letter-spacing: -0.025em;
  line-height: 0.92;
  color: var(--ink);
}

.eyebrow {
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--coral);
}
.eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--coral);
  border-radius: 50%;
  vertical-align: middle;
  margin: -2px 10px 0;
}

/* === TOP BAR === */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  transition: background .3s ease, padding .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}
.topbar.scrolled {
  background: rgba(244, 236, 222, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 14px 48px;
  border-bottom-color: rgba(26,22,18,0.08);
}

.topbar-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  height: 36px;
  position: relative;
}
.topbar-logo img {
  height: 100%;
  width: auto;
  display: block;
  transition: opacity .3s;
}
.topbar-logo .logo-light {
  position: absolute;
  inset: 0;
  opacity: 0;
}

/* Mappa pages: stacked logos in topbar (Comune on top, Città Narrata white below) */
.topbar-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-decoration: none;
  padding: 8px 14px;
  background: var(--ink);
  border-radius: 14px;
  transition: padding .3s, gap .3s, background .3s;
}
.topbar-stack img {
  display: block;
  width: auto;
  object-fit: contain;
}
.topbar-stack-comune {
  height: 38px;
  background: #ffffff;
  border-radius: 6px;
  padding: 4px 8px;
  box-sizing: content-box;
  transition: height .3s;
}
.topbar-stack-cn {
  height: 24px;
  transition: height .3s;
}
.topbar.scrolled .topbar-stack {
  padding: 6px 12px;
  gap: 4px;
}
.topbar.scrolled .topbar-stack-comune { height: 30px; }
.topbar.scrolled .topbar-stack-cn { height: 20px; }

@media (max-width: 640px) {
  .topbar-stack { padding: 6px 10px; gap: 4px; }
  .topbar-stack-comune { height: 28px; }
  .topbar-stack-cn { height: 18px; }
}

/* Brand cluster: Città Narrata + Comune di Potenza */
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 22px;
}
.topbar-brand-divider {
  width: 1px;
  height: 44px;
  background: rgba(26,22,18,0.18);
  display: block;
  transition: background .3s, height .3s;
}
.topbar-comune {
  display: flex;
  align-items: center;
  height: 60px;
  text-decoration: none;
  transition: opacity .25s, transform .25s, height .3s;
}
.topbar-comune img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: contain;
}
.topbar-comune:hover { transform: translateY(-1px); opacity: 0.85; }
.topbar.scrolled .topbar-comune { height: 48px; }
.topbar.scrolled .topbar-brand-divider { height: 36px; }

/* On luogo pages (dark hero) lighten divider so it stays visible */
body.luogo-page .topbar:not(.scrolled) .topbar-brand-divider { background: rgba(251,246,236,0.28); }

@media (max-width: 640px) {
  .topbar-comune, .topbar-brand-divider { display: none; }
}
/* On luogo pages (dark hero) show light logo when topbar is NOT scrolled */
body.luogo-page .topbar:not(.scrolled) .logo-dark { opacity: 0; }
body.luogo-page .topbar:not(.scrolled) .logo-light { opacity: 1; }
/* On luogo pages when not scrolled, also flip nav + CTA to light */
body.luogo-page .topbar:not(.scrolled) .topbar-nav a { color: var(--cream); }
body.luogo-page .topbar:not(.scrolled) .topbar-cta {
  background: rgba(0,0,0,0.35);
  color: var(--cream);
  border: 1px solid rgba(251,246,236,0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body.luogo-page .topbar:not(.scrolled) .topbar-cta:hover { background: var(--coral); border-color: var(--coral); }

.topbar-nav {
  display: flex;
  gap: 40px;
}
.topbar-nav a {
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 0;
  position: relative;
  transition: color .25s;
}
.topbar-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.topbar-nav a:hover { color: var(--coral); }
.topbar-nav a:hover::after { transform: scaleX(1); transform-origin: left center; }

.topbar-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  background: var(--ink);
  color: var(--cream);
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 999px;
  transition: background .3s, transform .3s;
}
.topbar-cta:hover { background: var(--coral); transform: translateY(-2px); }
.topbar-cta svg { width: 12px; height: 12px; transform: rotate(45deg); }

/* Right cluster: lang/CTA + Potenza Cultura hub mark */
.topbar-end {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}
/* Potenza Cultura wordmark — top right, returns to the main hub */
.topbar-pc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Hanken Grotesk", sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.62;
  white-space: nowrap;
  transition: opacity .25s, color .25s;
}
.topbar-pc::before {
  content: "";
  width: 1px;
  height: 16px;
  background: currentColor;
  opacity: 0.3;
  margin-right: 4px;
}
.topbar-pc svg { width: 10px; height: 10px; opacity: 0.8; }
.topbar-pc:hover { opacity: 1; color: var(--coral); }
/* On luogo pages (dark hero) the wordmark goes light until scrolled */
body.luogo-page .topbar:not(.scrolled) .topbar-pc { color: var(--cream); }

@media (max-width: 640px) {
  .topbar-pc { font-size: 13px; }
  .topbar-pc::before { display: none; }
}

.topbar-burger {
  display: none;
  width: 40px; height: 40px;
  background: var(--ink);
  border: none;
  border-radius: 50%;
  color: var(--cream);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

@media (max-width: 980px) {
  .topbar-nav { display: none; }
  .topbar { padding: 16px 22px; }
  .topbar.scrolled { padding: 12px 22px; }
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 999px;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), background .3s, color .3s;
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--ink); color: var(--cream); }
.btn-primary:hover { background: var(--coral); transform: translateY(-3px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--cream); transform: translateY(-3px); }
.btn-coral { background: var(--coral); color: var(--cream); }
.btn-coral:hover { background: var(--ink); transform: translateY(-3px); }
.btn svg { width: 14px; height: 14px; }

/* === REVEAL ANIMATIONS === */
@keyframes fadeUp { from {opacity:0; transform:translateY(28px)} to {opacity:1; transform:translateY(0)} }
@keyframes fadeIn { from {opacity:0} to {opacity:1} }

/* default: visible. JS adds .pre-reveal at load, then .in-view removes it. */
.reveal.pre-reveal { opacity: 0; }
.reveal.in-view {
  animation: fadeUp 1s cubic-bezier(.22,.61,.36,1) both;
}
.reveal-stagger.pre-reveal > * { opacity: 0; }
.reveal-stagger.in-view > * { animation: fadeUp 1s cubic-bezier(.22,.61,.36,1) both; }
.reveal-stagger.in-view > *:nth-child(1) { animation-delay: 0.06s; }
.reveal-stagger.in-view > *:nth-child(2) { animation-delay: 0.16s; }
.reveal-stagger.in-view > *:nth-child(3) { animation-delay: 0.26s; }
.reveal-stagger.in-view > *:nth-child(4) { animation-delay: 0.36s; }
.reveal-stagger.in-view > *:nth-child(5) { animation-delay: 0.46s; }
.reveal-stagger.in-view > *:nth-child(6) { animation-delay: 0.56s; }

/* === COMMON FOOTER === */
.site-footer {
  position: relative;
  background: var(--ink);
  color: var(--cream);
  padding: 100px 48px 36px;
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 380px at 80% 10%, rgba(231,76,94,0.22), transparent 60%),
    radial-gradient(600px 300px at 10% 100%, rgba(0,102,204,0.12), transparent 60%);
  pointer-events: none;
}
.footer-grid {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px;
  padding-bottom: 72px;
  border-bottom: 1px solid rgba(251,246,236,0.18);
}
.footer-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-stretch: 110%;
  font-size: clamp(48px, 5.5vw, 84px);
  line-height: 0.9;
  letter-spacing: -0.025em;
  color: var(--cream);
}
.footer-title em {
  font-style: italic;
  font-weight: 600;
  color: var(--coral);
}
.footer-logo {
  display: inline-block;
  max-width: 200px;
  width: 100%;
}
.footer-logo img {
  width: 100%;
  height: auto;
  display: block;
}
.footer-col-brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.footer-brand-x {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 300;
  font-size: 28px;
  line-height: 1;
  color: rgba(251,246,236,0.45);
  display: inline-block;
  transform: translateY(-2px);
}
.footer-comune {
  display: inline-flex;
  align-items: center;
  height: 92px;
  text-decoration: none;
  transition: opacity .25s, transform .25s;
}
.footer-comune img {
  height: 100%;
  width: auto;
  display: block;
  /* Invert white logo color in the dark footer for harmony, but the comune logo has its own colors. Keep as-is. */
}
.footer-comune:hover { transform: translateY(-1px); opacity: 0.85; }
.footer-tag {
  margin-top: 18px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.7;
}
.footer-col h4 {
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 18px;
}
.footer-col p, .footer-col a {
  display: block;
  font-size: 15px;
  line-height: 1.65;
  color: var(--cream);
  text-decoration: none;
  margin-bottom: 4px;
  transition: color .25s;
}
.footer-col a:hover { color: var(--coral); }

.footer-bottom {
  position: relative;
  max-width: 1400px;
  margin: 24px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.6;
}
.footer-bottom .heart { color: var(--coral); opacity: 1; }
.footer-credit { text-transform: none; letter-spacing: 0.02em; font-weight: 500; opacity: 0.9; }

@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; padding-bottom: 48px; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
  .site-footer { padding: 60px 24px 28px; }
}
