/* =========================================
   SEZIONE LOGISTICS - STILI BASE
   ========================================= */

.logistics-section {
  position: relative;
  width: 100%;
  padding: 10rem 0;
  background-color: #eae8de; /* Beige scuro specifico della sezione */
  overflow: hidden;
  min-height: 100vh;
  z-index: 10;
}

.logistics-content {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- SFONDO PARALLASSE --- */
.logistics-bg-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.parallax-wrapper {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.logistics-img {
  position: absolute;
  top: -30%; /* Start offset per dare spazio al movimento */
  left: 0;
  width: 100%;
  height: 160%; /* Molto più alto del contenitore per effetto parallasse profondo */
  background-image: url(../img/logistc-background.webp);
  background-size: cover;
  background-position: center;
  opacity: 0.25;
  filter: grayscale(10%);
  will-change: transform; /* Ottimizzazione per scroll fluido */
}

.img-overlay {
  position: absolute;
  inset: 0;
  /* Gradiente che sfuma l'immagine ai bordi */
  background: linear-gradient(to bottom, rgba(234, 232, 222, 0.95) 0%, rgba(234, 232, 222, 0.7) 50%, rgba(234, 232, 222, 0.95) 100%);
  mix-blend-mode: lighten;
}

/* --- TESTO GIGANTE SFONDO --- */
.huge-text {
  position: absolute;
  font-family: "Stencil", sans-serif; /* Fallback */
  font-size: 15rem;
  line-height: 1;
  white-space: nowrap;
  opacity: 0.04;
  pointer-events: none;
  user-select: none;
  font-weight: bold;
}

@media (min-width: 768px) {
  .huge-text {
    font-size: 20rem;
  }
}

.huge-text.top-left {
  top: 2rem;
  left: -5rem;
  color: var(--color-brand-green);
}

.huge-text.bottom-right {
  bottom: 0;
  right: -5rem;
  color: var(--color-brand-brown);
}

/* --- ANIMAZIONI DECORATIVE (JS Targets) --- */

/* Contenitore Vento */
.wind-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* Linea Vento (Generata da JS) */
.wind-line {
  position: absolute;
  height: 2px;
  width: 150px;
  background-color: rgba(122, 153, 57, 0.2); /* Brand green transparent */
  border-radius: 99px;
  opacity: 0;
}

@keyframes wind-fly {
  0% {
    transform: translateX(-100vw);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateX(100vw);
    opacity: 0;
  }
}

/* Contenitore Piante */
.plants-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* Pianta SVG (Generata da JS) */
.plant-svg {
  position: absolute;
  bottom: 0;
  transform-origin: bottom center;
  /* L'animazione sarà iniettata inline per variare la durata */
}

@keyframes sway {
  0%,
  100% {
    transform: rotate(-2deg) scale(var(--scale));
  }
  50% {
    transform: rotate(4deg) scale(var(--scale));
  }
}

/* --- LAYOUT HEADER --- */
.logistics-header {
  position: relative;
  z-index: 10;
  margin-bottom: 6rem;
  border-bottom: 1px solid rgba(62, 52, 43, 0.1);
  padding-bottom: 2rem;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .logistics-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.logistics-title-wrapper {
  display: flex;
  flex-direction: column;
  justify-items: center;
  align-items: center;
}

.logistics-tag {
  display: block;
  font-family: var(--font-mono);
  color: var(--color-brand-green);
  font-size: 0.875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.logistics-title {
  font-family: var(--font-primary);
  font-size: 1.8rem;
  letter-spacing: -0.15em;
  line-height: 1.5;
  color: var(--color-brand-brown);
  margin: 0;
}

.logistics-subtitle-wrapper {
  display: flex;
  flex-direction: column;
  justify-items: center;
  align-items: center;
}

.logistics-desc {
  font-family: var(--font-secondary);
  color: var(--color-text-grey);
  font-size: 1rem;
  line-height: 1.5;
  margin-top: 1.5rem;
  text-align: center;
}

.highlight-green {
  color: var(--color-brand-green);
  font-style: italic;
}

/* Grid Layout */
.logistics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 375px) {
  .logistics-title {
    font-size: 2.2rem;
  }
}
@media (min-width: 425px) {
  .logistics-title {
    font-size: 2.4rem;
  }
}
@media (min-width: 768px) {
  .logistics-title-wrapper {
    align-items: start;
  }

  .logistics-title {
    font-size: 4rem;
    line-height: 1.5;
  }

  .logistics-subtitle-wrapper {
    text-align: end;
  }

  .logistics-desc {
    text-align: right;
  }
}

@media (min-width: 1024px) {
  .logistics-grid {
    grid-template-columns: 5fr 7fr; /* Card (5) - Mappa (7) */
    gap: 4rem;
  }
}

/* =========================================
   LOGISTICS CONTENT (Card & Map)
   ========================================= */

/* --- LEFT COL: FIELD NOTE CARD --- */
.field-note-wrapper {
  position: relative;
  /* Animazione di entrata gestita poi opzionalmente */
}

/* Effetto Scotch (Tape) */
.tape-effect {
  position: absolute;
  top: -1rem;
  left: 50%;
  transform: translateX(-50%) rotate(2deg);
  width: 6rem;
  height: 1.5rem;
  background-color: rgba(254, 243, 199, 0.6); /* Yellowish transparent */
  backdrop-filter: blur(2px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  z-index: 20;
}

.field-note-card {
  background-color: rgba(249, 247, 242, 0.95); /* #F9F7F2 slightly transparent */
  backdrop-filter: blur(4px);
  padding: 2rem;
  border-radius: 2px; /* Angoli poco arrotondati come carta */
  box-shadow: 10px 10px 30px rgba(62, 52, 43, 0.05);
  border: 1px solid #e6ded1;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .field-note-card {
    padding: 3rem;
  }
}

/* Corner Accents */
.corner-accent {
  position: absolute;
  width: 2rem;
  height: 2rem;
  border-color: rgba(62, 52, 43, 0.2);
  border-style: solid;
}
.corner-accent.top-left {
  top: 0;
  left: 0;
  border-width: 2px 0 0 2px; /* Top & Left borders */
}
.corner-accent.bottom-right {
  bottom: 0;
  right: 0;
  border-width: 0 2px 2px 0; /* Bottom & Right borders */
}

/* Typography Card */
.note-title {
  font-family: var(--font-primary);
  font-size: 1.7rem;
  letter-spacing: -0.15em;
  line-height: 2;
  color: var(--color-brand-green);
  margin-bottom: 0.25rem;
}
.note-subtitle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(62, 52, 43, 0.6);
  margin-bottom: 2rem;
}
.note-desc {
  font-family: var(--font-secondary);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-brand-brown);
  line-height: 1.6;
  margin-bottom: 2rem;
  position: relative;
  z-index: 10;
}

/* Transport Options */
.transport-options {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  z-index: 10;
}

.transport-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background-color: rgba(230, 222, 209, 0.3); /* brand-beige light */
  border-radius: 0.5rem;
  transition: background-color 0.3s ease;
  cursor: default;
}
.transport-item:hover {
  background-color: rgba(230, 222, 209, 0.6);
}

.log-icon-circle {
  padding: 0.5rem;
  background-color: white;
  border-radius: 50%;
  color: var(--color-brand-brown);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.transport-text strong {
  display: block;
  font-family: var(--font-primary);
  font-size: 0.8rem;
  letter-spacing: -0.15em;
  line-height: 2;
  color: var(--color-brand-brown);
  font-weight: 500;
}
.transport-text span {
  font-family: var(--font-secondary);
  font-size: 0.875rem;
  color: #6b7280; /* text-grey */
}

/* --- RIGHT COL: MAP --- */
.col-right {
  position: relative;
}

/* Shadow Blur under map */
.map-shadow-blur {
  position: absolute;
  inset: 1rem;
  background-color: rgba(0, 0, 0, 0.2);
  filter: blur(24px);
  transform: translateY(2rem);
  border-radius: 50%;
  z-index: -1;
}

.map-device-container {
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  border: 8px solid white;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  background-color: #e6ded1;
}

.map-interactive-area {
  position: relative;
  height: 450px;
  width: 100%;
}

.custom-map-svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Animazione Pin (Bounce) */
.map-pin-anim {
  animation: pin-bounce 2s ease-in-out infinite;
  transform-origin: center bottom;
}
@keyframes pin-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Overlay Hover */
.map-hover-overlay {
  position: absolute;
  inset: 0;
  background-color: transparent;
  transition: background-color 0.5s ease;
}
.map-interactive-area:hover .map-hover-overlay {
  background-color: rgba(62, 52, 43, 0.05);
}

/* Floating Action Bar */
.map-fab-bar {
  position: absolute;
  bottom: 2rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.time-badge {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.tiny-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 0.1rem;
}
.time-value {
  font-family: var(--font-primary);
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: -0.15em;
  line-height: 1;
  color: var(--color-brand-brown);
}

@media (min-width: 425px) {
  .time-value {
    font-size: 0.9rem;
  }
}

.btn-open-map {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--color-brand-brown);
  color: #e6ded1;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.15em;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}
.btn-open-map:hover {
  background-color: var(--color-brand-green);
  transform: scale(1.05);
}

/* Decorazione Rotante */
.map-corner-deco {
  position: absolute;
  top: -1.5rem;
  right: -1.5rem;
  width: 6rem;
  height: 6rem;
  animation: spin-slow 20s linear infinite;
  z-index: 10;
  pointer-events: none;
}
@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* =========================================
   NEBBIA E SFOCATURA CONTENUTO
   ========================================= */

/* --- NEBBIA (MIST CLOUDS) --- */
.mist-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5; /* Sopra piante/vento, sotto il contenuto */
  overflow: hidden;
}

.mist-cloud {
  position: absolute;
  left: -20%; /* Parte fuori schermo a sinistra */
  width: 60%;
  height: 8rem; /* h-32 tailwind */
  background-color: rgba(255, 255, 255, 0.2);
  filter: blur(40px);
  border-radius: 9999px;
  opacity: 0;
  will-change: transform, opacity;
}

/* Animazione Nebbia (Linear Drift) */
@keyframes mist-drift {
  0% {
    transform: translateX(-50%);
    opacity: 0;
  }
  20% {
    opacity: 0.6; /* Picco visibilità */
  }
  80% {
    opacity: 0.6;
  }
  100% {
    transform: translateX(250%); /* Esce a destra */
    opacity: 0;
  }
}

/* Configurazione Istanze (Tempi presi dal file React) */
.mist-cloud.c1 {
  top: 20%;
  animation: mist-drift 25s linear infinite;
}

.mist-cloud.c2 {
  top: 60%;
  animation: mist-drift 30s linear infinite;
  animation-delay: 5s;
}

.mist-cloud.c3 {
  top: 85%;
  animation: mist-drift 20s linear infinite;
  animation-delay: 2s;
}

/* --- CONTENUTO CENSURATO (BLUR TARGET) --- */
.blur-target {
  /* Stato iniziale: molto sfocato e semi-trasparente */
  filter: blur(16px) grayscale(0.3);
  opacity: 0.4;

  /* Disabilitiamo interazioni */
  pointer-events: none;
  user-select: none;

  /* Transizione fluida per effetto hover futuro */
  transition:
    filter 0.5s ease,
    opacity 0.5s ease;
}

/* Classe di utilità per ridurre il blur (la useremo con JS/Hover) */
.blur-target.is-focused {
  filter: blur(12px) grayscale(0.3); /* Si schiarisce leggermente */
  opacity: 0.6;
}

/* =========================================
   STEP 3: GLASS CARD & BUSSOLA
   ========================================= */

/* --- LAYOUT OVERLAY --- */
.censored-overlay {
  position: absolute;
  inset: 0;
  z-index: 50; /* Sopra a tutto */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* --- GLASS CARD DESIGN --- */
.glass-card-wrapper {
  perspective: 1000px; /* Per eventuali effetti 3D */
}

.glass-card {
  position: relative;
  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(24px); /* Effetto vetro smerigliato */
  -webkit-backdrop-filter: blur(24px); /* Safari support */
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 3rem 2.5rem;
  border-radius: 3rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
  max-width: 580px;
  width: 100%;
  text-align: center;
  overflow: hidden;
  transition: transform 0.4s ease;
  cursor: default;
}

.glass-card:hover {
  transform: scale(1.02);
}

/* Shimmer Effect (Luccichio al passaggio del mouse) */
.shimmer-effect {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-100%);
  transition: transform 1s ease-in-out;
  pointer-events: none;
}

.glass-card:hover .shimmer-effect {
  transform: translateX(100%);
}

/* --- BUSSOLA INTERATTIVA --- */
.compass-container {
  position: relative;
  width: 6rem; /* w-24 */
  height: 6rem;
  margin: 0 auto 1.5rem auto;
}

/* Anelli */
.compass-outer-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(62, 52, 43, 0.3); /* brand-brown/30 */
  border-radius: 50%;
}
.compass-inner-ring {
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(62, 52, 43, 0.1);
  border-radius: 50%;
}

/* Tacca del Nord (Fissa) */
.compass-north-mark {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 8px;
  background-color: var(--color-brand-green);
  z-index: 2;
}

/* Wrapper dell'ago (Gestisce l'animazione rotazione) */
.compass-needle-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  /* STATO IDLE: Animazione continua "Wander" */
  animation: compass-wander 8s ease-in-out infinite alternate;
}

/* Corpo dell'ago */
.needle-body {
  position: relative;
  width: 0.5rem; /* w-2 */
  height: 4rem; /* h-16 */
}

.needle-north {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background-color: var(--color-brand-brown);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%); /* Triangolo punta */
}

.needle-south {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background-color: rgba(62, 52, 43, 0.2);
  clip-path: polygon(0% 0%, 100% 0%, 50% 100%); /* Triangolo coda */
}

.needle-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0.75rem;
  height: 0.75rem;
  background-color: #e6ded1;
  border: 2px solid var(--color-brand-brown);
  border-radius: 50%;
  z-index: 3;
}

/* Keyframes per il movimento "Idle" (Vagabondaggio) */
@keyframes compass-wander {
  0% {
    transform: rotate(0deg);
  }
  20% {
    transform: rotate(45deg);
  }
  40% {
    transform: rotate(-30deg);
  }
  60% {
    transform: rotate(10deg);
  }
  80% {
    transform: rotate(-5deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

/* --- TYPOGRAPHY CARD (Adattata ai tuoi Font) --- */
.glass-card-content {
  position: relative;
  z-index: 10;
}

.glass-title {
  font-family: var(--font-primary); /* Lexend Peta */
  font-size: 1.5rem; /* ~text-3xl */
  color: #776e67; /* Colore "spento" iniziale */
  margin-bottom: 1rem;
  transition: color 0.3s ease;
  line-height: 1.3;
  letter-spacing: -0.15em;
}

/* Cambio colore titolo al passaggio del mouse */
.glass-card:hover .glass-title {
  color: var(--color-brand-brown);
}

.glass-divider {
  width: 3rem;
  height: 2px;
  background-color: rgba(122, 153, 57, 0.3); /* brand-green opaco */
  margin: 0 auto 1.5rem auto;
  border-radius: 99px;
}

.glass-desc {
  font-family: var(--font-secondary); /* Montserrat */
  font-size: 1rem;
  color: var(--color-brand-brown);
  line-height: 1.6;
}

.glass-sub {
  display: block;
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 0.5rem;
  font-weight: 500;
  font-style: italic;
}

/* --- DECORAZIONI FOGLIE (Aggiornato) --- */
.deco-leaf {
  position: absolute;
  width: 4rem;
  height: 4rem;
  pointer-events: none;
  transition: transform 0.5s ease;

  /* Tecnica Maschera: usa l'SVG esterno come forma, ma il background come colore */
  background-color: currentColor;
  -webkit-mask: url(../icons/card-leaf.svg) no-repeat center / contain;
  mask: url(../icons/card-leaf.svg) no-repeat center / contain;
}

.deco-leaf.top-right {
  top: -1rem;
  right: -1rem;
  color: var(--color-brand-green); /* Colore Verde */
  opacity: 0.2; /* Opacità come da React */
  transform: rotate(0deg);
}

.glass-card:hover .deco-leaf.top-right {
  transform: rotate(10deg) scale(1.1);
}

.deco-leaf.bottom-left {
  bottom: -1rem;
  left: -1rem;
  color: var(--color-brand-brown); /* Colore Marrone */
  opacity: 0.1; /* Opacità come da React */
  transform: rotate(180deg);
}

.glass-card:hover .deco-leaf.bottom-left {
  transform: rotate(190deg) translateX(-5px);
}
