/* ------------------------------
   PALETTE & RESET
--------------------------------*/
:root {
  --brand-primary: #006b8c;
  --brand-secondary: #00a0b0;
  --brand-accent: #83cbd4;
  --brand-soft: #daebec;

  --bg: #ffffff;
  --text-main: #0b1f26;
  --text-muted: #64727a;

  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.08);
  --shadow-subtle: 0 8px 20px rgba(0, 0, 0, 0.04);

  --transition-fast: 180ms ease-out;
  --transition-normal: 260ms ease-out;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
    system-ui, -system-ui, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
video {
  max-width: 100%;
  display: block;
}

/*button {
  font-family: inherit;
}*/

a {
  text-decoration: none;
  color: inherit;
}

/* ------------------------------
   LAYOUT BASE
--------------------------------*/
.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 16px 60px;
}

section {
  margin-top: 56px;
  position: relative;
}

.section-header {
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-title {
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Fade-in on scroll base state */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 500ms ease-out,
    transform 500ms ease-out;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ------------------------------
   1. HERO VIDEO 16:9 EDGE-TO-EDGE
--------------------------------*/

/* wrapper full-bleed che esce dal container */
.hero-wrapper {
  position: relative;
  width: 100vw;
  margin: 0 calc(50% - 50vw); /* full width rispetto al viewport */
}

/* hero centrata dentro la wrapper, ma visualmente edge-to-edge */
.hero {
  position: relative;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  background: #000;
  min-height: min(70vh, 640px);
  display: flex;
  align-items: stretch;
  justify-content: center;
  isolation: isolate;

  max-width: 1500px;
  margin: 0 auto;
  width: 100%;
}

.hero-video-wrapper {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 40px 20px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  background: radial-gradient(
      circle at top,
      rgba(0, 160, 176, 0.25),
      transparent 50%
    ),
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.7),
      rgba(0, 0, 0, 0.9)
    );
  color: #fff;
}

.hero-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 32px;
  padding-bottom: 24px;
  gap: 16px;
}

.hero-logo {
  width: 420px;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo-mark {
  width: 60%;
  height: 60%;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-logo-mark::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: transparent;
  border-right-color: transparent;
  transform: rotate(-20deg);
}

.hero-logo-mark span {
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.hero-slogan-main {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.hero-slogan-sub {
  max-width: 480px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.78);
}

.hero-tag {
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.22);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.flag-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
}

.hero-tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #3cffbe;
  box-shadow: 0 0 0 6px rgba(60, 255, 190, 0.15);
}

.hero-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  padding-bottom: 4px;
  opacity: 0.9;
}

.hero-scroll-arrow {
  width: 22px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
  position: relative;
  overflow: hidden;
}

.hero-scroll-arrow::after {
  content: "";
  width: 3px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  animation: scrollDot 1.6s ease-in-out infinite;
}

@keyframes scrollDot {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(14px);
    opacity: 0;
  }
}

/* Very light parallax illusion on overlay */
.hero-parallax {
  will-change: transform;
  transition: transform 320ms ease-out;
}

/* ------------------------------
   2. SNAP MAP PLACEHOLDER
--------------------------------*/
.snap-section {
  display: grid;
  gap: 18px;
}

.snap-placeholder {
  border-radius: var(--radius-lg);
  padding: 20px;
  background: radial-gradient(circle at top left, #f9feff, #f7fbfc);
  border: 1px solid rgba(0, 160, 176, 0.1);
  box-shadow: var(--shadow-subtle);
  position: relative;
  overflow: hidden;
}

.snap-placeholder::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: calc(var(--radius-lg) - 8px);
  border: 1px dashed rgba(0, 160, 176, 0.25);
  pointer-events: none;
}

.snap-inner {
  position: relative;
  display: grid;
  gap: 18px;
}

.snap-copy {
  max-width: 420px;
  z-index: 1;
}

.snap-copy h3 {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.snap-copy p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.snap-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(131, 203, 212, 0.16);
  font-size: 0.75rem;
  color: var(--brand-primary);
}

.snap-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--brand-secondary);
}

.snap-map-shell {
  position: relative;
  border-radius: var(--radius-md);
  background: #fff;
  min-height: 220px;
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
}

/* This is where the future interactive map will be injected */
#snap-map {
  width: 100%;
  height: 100%;
}

.snap-map-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(
    135deg,
    rgba(0, 160, 176, 0.02),
    rgba(131, 203, 212, 0.08)
  );
  pointer-events: none;
}

.snap-map-overlay span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.snap-map-skeleton {
  width: 64%;
  max-width: 260px;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 107, 140, 0.08);
  position: relative;
  overflow: hidden;
}

.snap-map-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 160, 176, 0.14),
    transparent
  );
  animation: shimmer 1600ms linear infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* ------------------------------
   3. SEZIONE STORIES / SHORTCUT
--------------------------------*/
.stories-section {
  display: grid;
  gap: 16px;
}

.stories-wrapper {
  max-width: 480px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  padding: 16px 20px 18px;
  background: linear-gradient(
    135deg,
    rgba(0, 107, 140, 0.06),
    rgba(131, 203, 212, 0.12)
  );
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
}

.stories-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.stories-header-title {
  font-size: 0.95rem;
  font-weight: 500;
}

.stories-header-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stories-header-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--brand-secondary);
}

/* Progress bars */
.stories-progress {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
  margin-bottom: 14px;
}

.story-progress-bar {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  overflow: hidden;
}

.story-progress-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(
    90deg,
    var(--brand-primary),
    var(--brand-secondary)
  );
  transition: width linear;
}

/* Carousel container */
.story-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  user-select: none;
  cursor: grab;
}

.story-carousel.dragging {
  cursor: grabbing;
}

.story-track {
  display: flex;
  transition: transform var(--transition-normal);
  will-change: transform;
  touch-action: pan-y;
}

/* Card più compatta, piccolo distacco tra le storie */
.story-card {
  min-width: 100%;
  display: grid;
  grid-template-rows: auto auto;
  padding: 6px 0;
}

/* Immagine 1:1, più piccola e centrata */
.story-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  max-width: 340px;
  margin: 0 auto;
  border-radius: var(--radius-md);
}

.story-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 800ms ease-out;
}

.story-card.active .story-image img {
  transform: scale(1.06);
}

.story-gradient {
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.6),
    transparent
  );
}

/* Metadati allineati alla stessa larghezza dell'immagine */
.story-meta {
  max-width: 340px;
  margin: 0 auto;
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.story-title {
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.story-title span {
  max-width: 70%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.story-label {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 107, 140, 0.06);
  color: var(--brand-primary);
}

.story-description {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.story-cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  gap: 10px;
}

.story-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  outline: none;
  cursor: pointer;
  background: linear-gradient(
    135deg,
    var(--brand-primary),
    var(--brand-secondary)
  );
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 10px 20px rgba(0, 107, 140, 0.4);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    opacity 140ms ease-out;
}

.story-play-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(0, 107, 140, 0.45);
}

.story-play-btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 12px rgba(0, 107, 140, 0.5);
  opacity: 0.9;
}

.story-play-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-play-icon svg {
  width: 9px;
  height: 9px;
  transform: translateX(1px);
}

.story-duration {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stories-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stories-nav span {
  opacity: 0.8;
}

/* ------------------------------
   3B. PERCORSI BUTTONS
--------------------------------*/
.trails-section {
  margin-top: 24px;
}

.trails-grid {
  display: grid;
  gap: 12px;
}

.trail-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: none;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast);
}

.trail-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trail-pill {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
}

.trail-name {
  font-size: 0.9rem;
}

.trail-chevron {
  opacity: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trail-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.12);
  filter: brightness(1.05);
}

.trail-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.16);
  filter: brightness(0.97);
}

/* Colori sentieri */
.trail-1 {
  background: linear-gradient(135deg, #c62828, #ef5350);
}

.trail-2 {
  background: linear-gradient(135deg, #0288d1, #4fc3f7);
}

.trail-3 {
  background: linear-gradient(135deg, #2e7d32, #66bb6a);
}

.trail-5 {
  background: linear-gradient(135deg, #ef6c00, #ffb74d);
}

/* ------------------------------
   4. CTA BUTTONS
--------------------------------*/
.cta-section {
  margin-top: 56px;
}

.cta-grid {
  display: grid;
  gap: 16px;
}

.cta-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid rgba(0, 107, 140, 0.08);
  box-shadow: var(--shadow-subtle);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast),
    background 220ms ease-out;
}

.cta-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top left,
    rgba(131, 203, 212, 0.3),
    transparent 55%
  );
  opacity: 0;
  transition: opacity 220ms ease-out;
  pointer-events: none;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 160, 176, 0.3);
  background: #fafdff;
}

.cta-btn:hover::before {
  opacity: 1;
}

.cta-btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    var(--brand-primary),
    var(--brand-secondary)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.cta-btn-icon svg {
  width: 20px;
  height: 20px;
}

.cta-btn-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cta-btn-title {
  font-size: 0.95rem;
  font-weight: 500;
}

.cta-btn-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.cta-btn-chevron {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* ------------------------------
   5. FOOTER FULL-BLEED
--------------------------------*/

footer {
  margin-top: 64px;
  padding-top: 22px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.footer-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.footer-logo-slot {
  width: 200px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--brand-primary);
  opacity: 0.9;
}

.footer-logo-2 {
  width: 100%;
  height: 72px;
  align-items: center !important;
  align-self: center !important;
  font-size: 0.7rem;
  color: var(--brand-primary);
  opacity: 0.9;
}

.footer-logo-2 img {
  margin: auto;
}

.footer-credits {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-credits span {
  opacity: 0.9;
}

/* eventualmente usata per versioni "lineup" del footer */
.lineup {
  margin: 20pt 0 12pt 0;
  font-size: 32pt;
  font-style: italic;
  opacity: 0.65;
  letter-spacing: 1pt;
}

#lineup-flex {
  color: rgb(240, 240, 240);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100pt, 1fr));
  gap: 10pt;
  font-weight: 300;
  font-size: 12pt;
  margin-bottom: 20pt;
  padding: 0 15pt;
}

#lineup-flex > div {
  padding: 6pt 4pt;
  border-radius: 6pt;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.25s ease, transform 0.25s ease;
}

#lineup-flex > div:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2pt);
}

/* ------------------------------
   RESPONSIVE
--------------------------------*/
@media (min-width: 640px) {
  .hero-overlay {
    padding: 44px 40px 30px;
  }

  .snap-placeholder {
    padding: 22px 22px 24px;
  }

  .snap-inner {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
    align-items: center;
  }
}

@media (min-width: 768px) {
  .page-shell {
    padding-inline: 24px;
  }

  .hero {
    min-height: 520px;
  }

  .stories-wrapper {
    padding-inline: 24px;
  }

  .cta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .trails-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .page-shell {
    padding-inline: 32px;
  }
}

/* ---------------- MAIN AREA ---------------- */

#place-contain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(1, 1fr));
  gap: 12pt;
  max-width: 900pt;
  margin: 20pt auto 40pt auto;
  padding: 10pt;
}

@media (min-width: 600pt) {
  #place-contain {
    grid-template-columns: repeat(2, 1fr);
  }
}

#place-contain > a {
  padding: 6pt;
  margin: 4pt;
  border: 2pt solid #008fb7;
  border-radius: 12pt;
  background: white;
  text-decoration: none;
  color: #00485c;
  display: block;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 2pt 6pt rgba(0, 0, 0, 0.12);
}

#place-contain > a:hover {
  transform: translateY(-4pt);
  box-shadow: 0 6pt 14pt rgba(0, 0, 0, 0.18);
}

#place-contain p {
  text-align: center;
  font-size: 16pt;
  margin: 8pt 0 10pt 0;
  font-weight: 600;
  color: #006B8C;
}

#place-contain img {
  position: relative;
  width: 100%;
  border-radius: 10pt;
  box-shadow: 0 2pt 8pt rgba(0,0,0,0.15);
  transition: opacity 0.3s ease;
}

#place-contain img:hover {
  opacity: 0.9;
}

/* ---------------- MAP SECTION ---------------- */

#mappa {
  position: relative;
  display: block;
  width: calc(100% - 20pt);
  max-width: 800pt;
  margin: 30pt auto;
  padding: 10pt;
  background: linear-gradient(135deg, #f8fbfc 0%, #e8f4f8 100%);
  border-radius: 16pt;
  box-shadow: 0 8pt 24pt rgba(0, 107, 140, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#mappa:hover {
  transform: translateY(-2pt);
  box-shadow: 0 12pt 32pt rgba(0, 107, 140, 0.18);
}

#mappa img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12pt;
  box-shadow: 0 4pt 12pt rgba(0, 0, 0, 0.08);
}

/* Map Points */
.punto-mappa {
  position: absolute;
  background: linear-gradient(135deg, #006B8C 0%, #008fb7 100%);
  padding: 12pt;
  border: 3pt solid white;
  border-radius: 100%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  box-shadow: 0 4pt 12pt rgba(0, 107, 140, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4pt 12pt rgba(0, 107, 140, 0.3), 0 0 0 0 rgba(0, 143, 183, 0.4);
  }
  50% {
    box-shadow: 0 4pt 12pt rgba(0, 107, 140, 0.3), 0 0 0 8pt rgba(0, 143, 183, 0);
  }
}

.punto-mappa:hover {
  background: linear-gradient(135deg, #008fb7 0%, #00a8d6 100%);
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 6pt 20pt rgba(0, 143, 183, 0.5);
  animation: none;
}

.punto-mappa:active {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Tooltip */
.punto-mappa::after {
  content: attr(sentiero-nome);
  position: absolute;
  top: -10pt;
  left: 50%;
  transform: translate(-50%, -120%);
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  color: white;
  padding: 8pt 12pt;
  font-size: 11pt;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 6pt;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4pt 12pt rgba(0, 0, 0, 0.3);
  letter-spacing: 0.3pt;
}

.punto-mappa::before {
  content: '';
  position: absolute;
  top: -10pt;
  left: 50%;
  transform: translate(-50%, -100%);
  width: 0;
  height: 0;
  border-left: 6pt solid transparent;
  border-right: 6pt solid transparent;
  border-top: 6pt solid #1a1a1a;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.punto-mappa:hover::after,
.punto-mappa:hover::before {
  opacity: 1;
  transform: translate(-50%, -130%);
}

/* Rotate Screen Message */
#ruota-schermo {
  display: none;
  text-align: center;
  padding: 60pt 20pt;
  margin: 40pt auto;
  max-width: 400pt;
  background: linear-gradient(135deg, #006B8C 0%, #00485c 100%);
  border-radius: 16pt;
  box-shadow: 0 8pt 24pt rgba(0, 107, 140, 0.3);
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20pt);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#ruota-schermo p {
  color: white;
  font-size: 18pt;
  font-weight: 600;
  margin: 0;
  line-height: 1.6;
  letter-spacing: 0.5pt;
  position: relative;
  animation: rotateIcon 2s ease-in-out infinite;
}

#ruota-schermo p::before {
  content: '📱';
  display: block;
  font-size: 48pt;
  margin-bottom: 16pt;
  animation: rotatePhone 2s ease-in-out infinite;
}

@keyframes rotatePhone {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-15deg);
  }
  75% {
    transform: rotate(15deg);
  }
}

@media screen and (orientation: portrait) and (max-width: 500pt) {
  #mappa {
    display: none;
  }
  #ruota-schermo {
    display: block;
  }
}

/* Map Modal */
#mappa-modale {
  max-width: 600pt;
  padding: 20pt;
  border: none;
  border-radius: 16pt;
  box-shadow: 0 12pt 40pt rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #ffffff 0%, #f8fbfc 100%);
  animation: modalSlideIn 0.3s ease-out;
}

@media screen and (max-width: 600pt) {
  #mappa-modale {
    border-radius: 0;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20pt);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#mappa-modale::backdrop {
  background: rgba(0, 72, 92, 0.7);
  backdrop-filter: blur(4pt);
  animation: backdropFadeIn 0.3s ease-out;
}

@keyframes backdropFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#mappa-modale .flex-horizontal {
  max-height: 100%;
  gap: 20pt;
}

#mappa-modale-img {
  position: relative;
  max-width: 300pt;
  max-height: calc(100vh - 28pt);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12pt;
  box-shadow: 0 4pt 16pt rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

#mappa-modale-img:hover {
  transform: scale(1.02);
}

#mappa-modale-close {
  display: block;
  text-align: right;
  font-size: 32pt;
  font-weight: bold;
  cursor: pointer;
  z-index: 3;
  height: 32pt;
  line-height: 24pt;
  color: #006B8C;
  transition: color 0.3s ease, transform 0.3s ease;
  user-select: none;
}

#mappa-modale-close:hover {
  color: #008fb7;
}

#mappa-modale-titolo {
  width: 100%;
  color: #006B8C;
  font-size: 24pt;
  margin: 0 0 12pt 0;
  font-weight: 700;
}

#mappa-modale-link {
  display: inline-block;
  padding: 10pt 20pt;
  margin: 0 0;
  border: 2pt solid #008fb7;
  border-radius: 8pt;
  background: linear-gradient(135deg, #006B8C 0%, #008fb7 100%);
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 14pt;
  transition: all 0.3s ease;
  box-shadow: 0 2pt 8pt rgba(0, 143, 183, 0.3);
}

#mappa-modale-link:hover {
  background: linear-gradient(135deg, #008fb7 0%, #00a8d6 100%);
  transform: translateY(-2pt);
  box-shadow: 0 4pt 12pt rgba(0, 143, 183, 0.5);
}

#mappa-modale-link:active {
  transform: translateY(0);
}

.flex-horizontal {
  display: flex;
  align-items: flex-start;
}

.flex-vertical {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#mappa-modale-descrizione {
  color: #333;
  line-height: 1.6;
  margin-top: 12pt;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
