/* ==========================================================================
   MARATHON DEI MONTI ERNICI - VEROLI (FR)
   Modern Sporty & Natural Web Design System
   ========================================================================== */

:root {
  /* --- Palette: Terra, Foresta & Pietra --- */
  --bg-darkest: #090e0b;
  --bg-dark: #0f1712;
  --bg-card: #15221a;
  --bg-card-hover: #1b2d23;
  --bg-elevated: #1e3025;
  --bg-stone: #1a1e24;
  --bg-stone-dark: #121519;

  /* --- Accenti Dinamici & Racing --- */
  --accent-orange: #ff5500;
  --accent-orange-hover: #ff6e1a;
  --accent-orange-glow: rgba(255, 85, 0, 0.35);
  --accent-lime: #d4ff00;
  --accent-lime-hover: #e5ff4d;
  --accent-lime-glow: rgba(212, 255, 0, 0.3);
  --accent-ochre: #c89658;

  /* --- Testo & Contrasto --- */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dark: #0f172a;

  /* --- Bordi & Linee --- */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(255, 85, 0, 0.4);
  --border-lime: rgba(212, 255, 0, 0.4);

  /* --- Glassmorphism --- */
  --glass-bg: rgba(15, 23, 18, 0.82);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);

  /* --- Tipografia --- */
  --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-condensed: 'Barlow Condensed', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* --- Transizioni & Effetti --- */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  font-size: 16px;
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-darkest);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(20, 45, 28, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 85, 0, 0.08) 0%, transparent 45%);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Scroll Progress Bar */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-lime));
  z-index: 1001;
  width: 0%;
  transition: width 0.1s linear;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 6rem 0;
  position: relative;
}

@media (max-width: 768px) {
  .section {
    padding: 4rem 0;
  }
}

.section-header {
  text-align: center;
  max-width: 750px;
  margin: 0 auto 3.5rem auto;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: rgba(255, 85, 0, 0.12);
  border: 1px solid var(--border-accent);
  color: var(--accent-orange);
  font-family: var(--font-condensed);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.section-title span.accent-orange {
  color: var(--accent-orange);
}

.section-title span.accent-lime {
  color: var(--accent-lime);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.6;
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.85rem;
  font-family: var(--font-condensed);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-orange), #e64a00);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--accent-orange-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-orange-hover), var(--accent-orange));
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(255, 85, 0, 0.5);
}

.btn-lime {
  background: linear-gradient(135deg, var(--accent-lime), #bfe800);
  color: var(--bg-darkest);
  box-shadow: 0 4px 15px var(--accent-lime-glow);
  text-shadow: none;
}

.btn-lime:hover {
  background: linear-gradient(135deg, var(--accent-lime-hover), var(--accent-lime));
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(212, 255, 0, 0.45);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  backdrop-filter: blur(8px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
}

/* ==========================================================================
   NAVIGATION BAR (Glassmorphism)
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-smooth);
}

.site-header.scrolled {
  background: rgba(9, 14, 11, 0.95);
  box-shadow: var(--glass-shadow);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-brand img {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text .title {
  font-family: var(--font-condensed);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 1;
}

.logo-text .subtitle {
  font-size: 0.75rem;
  color: var(--accent-orange);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style: none;
}

.nav-link {
  font-family: var(--font-condensed);
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  position: relative;
  padding: 0.3rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-orange);
  transition: width var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* Mobile Off-canvas */
@media (max-width: 1024px) {
  .mobile-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 76px;
    right: -100%;
    width: 280px;
    height: calc(100vh - 76px);
    background: var(--bg-card);
    flex-direction: column;
    align-items: flex-start;
    padding: 2.5rem 2rem;
    gap: 1.5rem;
    border-left: 1px solid var(--border-subtle);
    box-shadow: -10px 0 30px rgba(0,0,0,0.7);
    transition: right var(--transition-smooth);
    z-index: 999;
  }

  .nav-links.open {
    right: 0;
  }

  .nav-link {
    font-size: 1.25rem;
    width: 100%;
  }

  .nav-cta .btn {
    display: none;
  }
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 1.5rem 60px 1.5rem;
  background-image: 
    linear-gradient(180deg, rgba(9, 14, 11, 0.45) 0%, rgba(9, 14, 11, 0.8) 65%, var(--bg-darkest) 100%),
    url('../img/hero-bg.webp');
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  overflow: hidden;
}

@supports not (background-image: url('../img/hero-bg.webp')) {
  .hero-section {
    background-image: 
      linear-gradient(180deg, rgba(9, 14, 11, 0.45) 0%, rgba(9, 14, 11, 0.8) 65%, var(--bg-darkest) 100%),
      url('../img/hero-bg.jpg');
  }
}

.hero-overlay-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  opacity: 0.6;
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 920px;
  text-align: center;
  margin: 0 auto;
}

.hero-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--accent-orange);
  padding: 0.5rem 1.35rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px rgba(255, 85, 0, 0.25);
  backdrop-filter: blur(8px);
}

.badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent-lime);
  box-shadow: 0 0 10px var(--accent-lime);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.hero-badge-text {
  font-family: var(--font-condensed);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-primary);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.8rem, 6.5vw, 5.2rem);
  font-weight: 900;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: -1px;
  margin-bottom: 1.25rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.hero-title .title-outline {
  color: transparent;
  -webkit-text-stroke: 1.5px #ffffff;
  display: block;
}

.hero-title .title-accent {
  background: linear-gradient(135deg, var(--accent-orange), #ff8833);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}

.hero-payoff {
  font-family: var(--font-condensed);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent-lime);
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.hero-description {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 740px;
  margin: 0 auto 2.5rem auto;
  line-height: 1.6;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}

/* Hero Quick Stats bar */
.hero-quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  background: rgba(15, 23, 18, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  max-width: 840px;
  margin: 0 auto;
}

.quick-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-right: 1px solid var(--border-subtle);
}

.quick-stat-item:last-child {
  border-right: none;
}

.quick-stat-val {
  font-family: var(--font-condensed);
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  font-weight: 800;
  color: var(--accent-lime);
  line-height: 1;
}

.quick-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-top: 0.35rem;
}

@media (max-width: 640px) {
  .hero-quick-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-stat-item:nth-child(2) {
    border-right: none;
  }
  .quick-stat-item {
    padding: 0.5rem 0;
  }
}

/* ==========================================================================
   COUNTDOWN SECTION (Dynamic: Prossimamente / 2027)
   ========================================================================== */
.countdown-section {
  background: linear-gradient(180deg, var(--bg-darkest) 0%, var(--bg-card) 50%, var(--bg-darkest) 100%);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 4.5rem 0;
  position: relative;
  overflow: hidden;
}

.countdown-box {
  background: rgba(9, 14, 11, 0.85);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 2.75rem 2rem;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(255, 85, 0, 0.05);
  position: relative;
}

.countdown-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 85, 0, 0.15);
  border: 1px solid var(--accent-orange);
  color: var(--accent-orange);
  padding: 0.4rem 1.25rem;
  border-radius: var(--radius-full);
  font-family: var(--font-condensed);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin: 1.75rem 0;
}

.countdown-unit {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  position: relative;
}

.countdown-unit::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0,0,0,0.3);
}

.countdown-number {
  font-family: var(--font-condensed);
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.countdown-number.highlight {
  color: var(--accent-lime);
}

.countdown-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-top: 0.5rem;
}

.countdown-footer-msg {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 1.5rem;
}

@media (max-width: 600px) {
  .countdown-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

/* ==========================================================================
   IL PERCORSO (Route Map, Stats & Elevation Profile)
   ========================================================================== */
.route-section {
  background-color: var(--bg-dark);
  position: relative;
}

.route-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.route-stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-orange);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: rgba(255, 85, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-orange);
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-card.lime .stat-icon {
  background: rgba(212, 255, 0, 0.12);
  color: var(--accent-lime);
}

.stat-info .stat-num {
  font-family: var(--font-condensed);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-info .stat-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* Map & Elevation Container */
.map-elevation-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--bg-stone);
  border-bottom: 1px solid var(--border-subtle);
  gap: 1rem;
}

.map-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-condensed);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-primary);
}

.map-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#routeMap {
  height: 500px;
  width: 100%;
  z-index: 1;
  background: #111;
}

/* Custom Leaflet Dark/Terrain Filter */
.leaflet-tile {
  filter: brightness(0.9) contrast(1.1) saturate(0.9);
}

/* Elevation Chart Box */
.elevation-profile-card {
  padding: 1.5rem;
  background: var(--bg-stone-dark);
  border-top: 1px solid var(--border-subtle);
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.profile-header .live-telemetry {
  font-family: var(--font-condensed);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-lime);
}

.elevation-canvas-container {
  position: relative;
  width: 100%;
  height: 200px;
}

#elevationChart {
  width: 100%;
  height: 100%;
  display: block;
}

/* Waypoints / Highlights list */
.route-waypoints {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.waypoint-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  transition: all var(--transition-fast);
}

.waypoint-card:hover {
  border-color: var(--accent-lime);
  transform: translateY(-2px);
}

.waypoint-badge {
  font-family: var(--font-condensed);
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-orange);
  background: rgba(255, 85, 0, 0.12);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  height: fit-content;
  white-space: nowrap;
}

.waypoint-info h4 {
  font-family: var(--font-condensed);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.waypoint-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   IL TERRITORIO (Veroli & Monti Ernici)
   ========================================================================== */
.territorio-section {
  background: var(--bg-darkest);
  position: relative;
}

.territorio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.territorio-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.territorio-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-orange);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.territorio-img-wrap {
  position: relative;
  height: 240px;
  overflow: hidden;
}

.territorio-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.territorio-card:hover .territorio-img-wrap img {
  transform: scale(1.08);
}

.territorio-tag {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background: rgba(9, 14, 11, 0.85);
  border: 1px solid var(--accent-orange);
  color: var(--accent-orange);
  font-family: var(--font-condensed);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.territorio-content {
  padding: 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.territorio-content h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  line-height: 1.3;
}

.territorio-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex: 1;
}

.territorio-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent-lime);
  font-weight: 600;
  text-transform: uppercase;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

/* ==========================================================================
   GALLERIA FOTOGRAFICA & LIGHTBOX
   ========================================================================== */
.gallery-section {
  background: var(--bg-stone-dark);
}

.gallery-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-condensed);
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--accent-orange-glow);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.gallery-item {
  position: relative;
  height: 260px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.gallery-item:hover {
  transform: translateY(-4px);
  border-color: var(--accent-lime);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-item-overlay {
  display: none !important;
}

.gallery-item-caption,
.gallery-item-tag {
  display: none !important;
}

/* Team Photos in Thanks Banner */
.team-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.team-photo-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  background: var(--bg-card);
}

.team-photo-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-lime);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.team-photo-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.team-photo-card:hover img {
  transform: scale(1.05);
}

.form-textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  min-height: 110px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-textarea:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(255, 85, 0, 0.2);
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.lightbox-modal.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.lightbox-caption-bar {
  margin-top: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 700px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-subtle);
  color: #fff;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}

.lightbox-close {
  top: 1.5rem;
  right: 1.5rem;
}

.lightbox-prev {
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  transform: scale(1.1);
}

.lightbox-prev:hover {
  transform: translateY(-50%) scale(1.1);
}

.lightbox-next:hover {
  transform: translateY(-50%) scale(1.1);
}

/* ==========================================================================
   ISCRIZIONI (Registrations & Stay Updated)
   ========================================================================== */
.iscrizioni-section {
  background: var(--bg-dark);
  position: relative;
}

.iscrizioni-wrapper {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 900px) {
  .iscrizioni-wrapper {
    grid-template-columns: 1fr;
  }
}

.iscrizioni-info h3 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.iscrizioni-info p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.requirements-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.requirements-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.requirements-item svg {
  color: var(--accent-lime);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

/* Registration Notify Form */
.notify-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  position: relative;
}

.notify-card-badge {
  position: absolute;
  top: -14px;
  right: 2rem;
  background: var(--accent-orange);
  color: #fff;
  font-family: var(--font-condensed);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
}

.notify-card h4 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.notify-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(255, 85, 0, 0.2);
}

.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 1.5rem;
}

.form-checkbox-label input {
  accent-color: var(--accent-orange);
}

/* ==========================================================================
   SPONSOR & PARTNER
   ========================================================================== */
.sponsor-section {
  background: var(--bg-stone-dark);
  position: relative;
}

.sponsor-category-title {
  text-align: center;
  font-family: var(--font-condensed);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.sponsor-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-bottom: 3.5rem;
}

.sponsor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 110px;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sponsor-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-orange);
  background: var(--bg-card-hover);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.sponsor-card img {
  max-width: 100%;
  max-height: 70px;
  object-fit: contain;
  filter: grayscale(80%) brightness(0.9);
  transition: filter var(--transition-fast);
}

.sponsor-card:hover img {
  filter: grayscale(0%) brightness(1);
}

/* Ringraziamenti Card */
.thanks-banner {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-stone));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.thanks-banner h4 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-lime);
  margin-bottom: 1rem;
}

.thanks-banner p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--bg-darkest);
  border-top: 1px solid var(--border-subtle);
  padding: 4.5rem 0 2rem 0;
  color: var(--text-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 550px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand h3 {
  font-family: var(--font-condensed);
  font-size: 1.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.footer-brand p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 320px;
  margin-bottom: 1.5rem;
}

.footer-col h5 {
  font-family: var(--font-condensed);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--accent-orange);
  padding-left: 4px;
}

.social-links {
  display: flex;
  gap: 0.75rem;
}

.social-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.social-btn:hover {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  transform: translateY(-2px);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Floating Back To Top */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent-orange);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 85, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: all var(--transition-smooth);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent-orange-hover);
  transform: translateY(-3px);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 2100;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--accent-lime);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  transform: translateX(-100%);
  opacity: 0;
  transition: all var(--transition-bounce);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon {
  color: var(--accent-lime);
  font-size: 1.3rem;
}
