/* ==================================================
   STILE – diario di viaggio (versione moderna)
   Per cambiare i colori del sito basta modificare
   le variabili qui sotto.
================================================== */
:root {
  --brand: #4b0082;
  --brand-2: #6a0dad;
  --brand-soft: #efe6fb;
  --bg: #f6f3fb;
  --surface: #ffffff;
  --text: #2a2238;
  --muted: #6b6480;
  --line: #e3d9f2;
  --radius: 16px;
  --shadow: 0 2px 6px rgba(42, 34, 56, .06), 0 10px 28px rgba(75, 0, 130, .08);
  --shadow-hover: 0 4px 10px rgba(42, 34, 56, .08), 0 16px 36px rgba(75, 0, 130, .16);
  --nav-h: 56px;
}

/* --------------------------------------------------
   BASE
-------------------------------------------------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', 'Nunito', sans-serif;
  letter-spacing: .2px;
  line-height: 1.2;
}

p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 1rem;
}

a { color: var(--brand-2); }

/* --------------------------------------------------
   NAVBAR (vetro sfocato, fissa in alto)
-------------------------------------------------- */
.navbar {
  padding: 0 1.25rem;
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  height: var(--nav-h);
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
}

.navbar li { margin: 0; }

.navbar a {
  text-decoration: none;
  font-weight: 700;
  font-size: .95rem;
  padding: .5rem .25rem;
  display: inline-block;
}

.navbar.transparent {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(75, 0, 130, .08);
}

.navbar.transparent a { color: var(--brand); }
.navbar.transparent a:hover { color: var(--brand-2); }

/* le pagine non-home partono sotto la navbar */
.container,
body > main {
  margin-top: var(--nav-h);
}

/* --------------------------------------------------
   HERO (home)
-------------------------------------------------- */
.hero {
  background:
    linear-gradient(180deg, rgba(20, 0, 40, .25) 0%, rgba(20, 0, 40, .7) 100%),
    url('img/IMG_0001.JPG') center/cover no-repeat,
    #2a0a4a;
  height: 100vh;
  min-height: 100svh;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero-content {
  background: none;
  padding: 0 1.5rem 12vh;
  max-width: 760px;
}

.hero-content h1 {
  font-size: clamp(2.2rem, 7vw, 4.2rem);
  font-weight: 600;
  margin: 0 0 1.75rem;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .35);
}

.btn-primary {
  display: inline-block;
  background: #fff;
  color: var(--brand);
  padding: 14px 28px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  transition: transform .25s ease, box-shadow .25s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
}

/* --------------------------------------------------
   LAYOUT ITINERARIO (sidebar + contenuto)
-------------------------------------------------- */
.container {
  display: flex;
  min-height: calc(100vh - var(--nav-h));
}

aside {
  flex: 0 0 380px;
  max-width: 42%;
  padding: 2rem 1.5rem;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

aside h1 {
  font-size: 1.7rem;
  margin: 0 0 1.25rem;
  color: var(--brand);
}

aside ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* un giorno = una card cliccabile, con numero in evidenza */
aside li {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 .75rem;
  padding: .9rem 1rem;
  min-height: 60px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

aside li:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--brand-2);
}

aside li .num {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
}

aside li .tit { line-height: 1.3; }

/* --------------------------------------------------
   CONTENUTO PRINCIPALE
-------------------------------------------------- */
main {
  flex: 1;
  min-width: 0;
  padding: 2rem;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

main > h1 {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  color: var(--brand);
  margin: 0 0 1.25rem;
}

#default-view { width: 100%; }

#default-view h2 {
  font-size: 1.3rem;
  color: var(--muted);
  font-weight: 600;
}

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

.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

/* --------------------------------------------------
   VISTA DEL GIORNO
-------------------------------------------------- */
#day-view {
  display: none;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 1.75rem;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.day-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.day-header h2 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--brand);
}

.back-btn {
  background: var(--brand-soft);
  border: none;
  color: var(--brand);
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 48px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s ease;
}

.back-btn:hover { background: #e0d0f6; }

/* agenda = timeline verticale */
.agenda {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--line);
}

.agenda li {
  position: relative;
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: .75rem;
  padding: .55rem 0 .55rem .5rem;
  line-height: 1.45;
}

.agenda li::before {
  content: "";
  position: absolute;
  left: calc(-1.25rem - 7px);
  top: calc(.55rem + 7px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--brand-2);
}

.ora {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: .9rem;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: .2rem .6rem;
  height: fit-content;
  text-align: center;
  white-space: nowrap;
}

.nota {
  display: block;
  margin-top: .15rem;
  font-style: italic;
  font-size: .92rem;
  color: var(--muted);
}

/* note di fine giornata */
.note-finali {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--brand-soft);
  border-left: 4px solid var(--brand-2);
  border-radius: 12px;
}

.note-finali li {
  display: block;
  padding: .3rem 0;
}

.note-finali li::before { display: none; }
.note-finali .nota { margin: 0; font-size: .98rem; color: var(--text); }

/* --------------------------------------------------
   SCOPRI DI PIÙ: luoghi come card
-------------------------------------------------- */
#day-view h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 600;
}

.luoghi {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.luoghi li {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 1rem 1.1rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.luoghi li strong {
  font-family: 'Poppins', sans-serif;
  color: var(--brand);
  font-size: 1rem;
}

.luoghi li strong i { margin-left: .35rem; color: var(--brand-2); }
.luoghi li span { color: var(--muted); line-height: 1.5; font-size: .97rem; }

/* --------------------------------------------------
   LISTA ITINERARI (pagina "Scopri di più")
-------------------------------------------------- */
.home { padding: 3rem; text-align: center; }

.lista-itinerari {
  list-style: none;
  padding: 0;
  max-width: 640px;
}

.lista-itinerari li {
  margin: 0 0 .75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.lista-itinerari li:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--brand-2);
}

.lista-itinerari a {
  display: block;
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: var(--brand);
  font-weight: 700;
  font-size: 1.05rem;
}

.lista-itinerari a::after {
  content: "→";
  float: right;
  color: var(--brand-2);
}

/* --------------------------------------------------
   MAPPA
-------------------------------------------------- */
#map {
  flex: 1;
  min-height: 420px;
  height: calc(100vh - var(--nav-h) - 150px);
  width: 100%;
  border: 0;
  border-radius: 20px;
  box-shadow: var(--shadow);
  z-index: 1;
}

/* pin viola al posto di quello blu di default */
.pin {
  background: none;
  border: none;
}

.pin i {
  font-size: 34px;
  color: var(--brand-2);
  filter: drop-shadow(0 3px 4px rgba(42, 0, 80, .4));
  transition: transform .15s ease;
}

.pin:hover i { transform: scale(1.15); }

.leaflet-popup-content-wrapper {
  border-radius: 14px;
  box-shadow: var(--shadow-hover);
}

.leaflet-popup-content { margin: 14px 18px; text-align: center; }
.leaflet-popup-content small { color: var(--muted); }

.map-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff !important;
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 999px;
  font-family: 'Poppins', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: .35rem;
  box-shadow: 0 3px 10px rgba(75, 0, 130, .3);
  transition: transform .2s ease;
}

.map-btn:hover { transform: translateY(-2px); }

/* --------------------------------------------------
   RESPONSIVE (iPad verticale e telefono)
-------------------------------------------------- */
@media (max-width: 900px) {
  .container { flex-direction: column; }

  aside {
    flex: none;
    max-width: 100%;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  main { padding: 1.25rem; }

  #day-view { padding: 1.25rem; border-radius: 16px; }

  .agenda li { grid-template-columns: 4rem 1fr; }

  #map { height: 70vh; }
}

@media (max-width: 480px) {
  .navbar ul { gap: 1rem; }
  .hero-content { padding-bottom: 8vh; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

/* più viaggi nello stesso marker della mappa */
.popup-viaggio + .popup-viaggio { margin-top: .6rem; }
