/* Da Roma a Lione e ritorno via Provenza — Alessandra e Valerio */

:root {
  --paper: #F4EBD8;
  --paper-deep: #EDE3CF;
  --ink: #2A241C;
  --muted: #6B5E4E;
  --gold: #C4A35A;
  --gold-light: #D4B87A;
  --shadow: rgba(42, 36, 28, 0.12);
  --font-serif: "Cormorant Garamond", "Georgia", "Times New Roman", serif;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --nav-height: 3.25rem;
  --frame: 1px solid var(--gold);
  --radius: 2px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  background-attachment: fixed;
}

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

/* Leaflet tiles/markers must not inherit the global img max-width */
.leaflet-container img {
  max-width: none;
  height: auto;
}

.leaflet-attribution-flag,
.leaflet-control-attribution svg {
  display: none !important;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.2s ease;
}

a:hover,
a:focus-visible {
  color: var(--gold);
}

a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ——— Navigation ——— */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  min-height: var(--nav-height);
  padding: 0.5rem 1rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(244, 235, 216, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: var(--frame);
  box-shadow: 0 1px 0 rgba(196, 163, 90, 0.25);
}

.site-nav a {
  text-decoration: none;
  padding: 0.25rem 0.15rem;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.nav-sep {
  color: var(--muted);
  user-select: none;
  opacity: 0.6;
}

/* ——— Layout ——— */

.container {
  width: min(100% - 2rem, 68rem);
  margin-inline: auto;
  padding-block: 2rem 4rem;
}

.container--narrow {
  width: min(100% - 2rem, 42rem);
}

/* ——— Typography ——— */

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5rem;
  letter-spacing: 0.02em;
}

.page-subtitle {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.gold-heart {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-left: 0.2em;
  vertical-align: -0.08em;
  background-color: var(--gold);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.lead {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 38ch;
}

h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  letter-spacing: 0.02em;
}

h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

/* ——— Framed surfaces ——— */

.frame {
  border: var(--frame);
  background: var(--paper-deep);
  box-shadow:
    inset 0 0 0 1px rgba(196, 163, 90, 0.15),
    0 2px 12px var(--shadow);
}

.frame--gold-corner {
  position: relative;
}

.frame--gold-corner::before,
.frame--gold-corner::after {
  content: "";
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  border-color: var(--gold);
  border-style: solid;
  pointer-events: none;
}

.frame--gold-corner::before {
  top: 0.5rem;
  left: 0.5rem;
  border-width: 2px 0 0 2px;
}

.frame--gold-corner::after {
  bottom: 0.5rem;
  right: 0.5rem;
  border-width: 0 2px 2px 0;
}

/* ——— Hero ——— */

.hero {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
}

.hero__ornament {
  display: block;
  width: 4rem;
  height: 1px;
  margin: 1.5rem auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero__dates {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.hero__route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.75rem;
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  margin: 1.5rem 0 1.25rem;
  color: var(--ink);
}

.km-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.km-counter[hidden] {
  display: none;
}

.km-counter__value {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 7vw, 3.5rem);
  font-weight: 700;
  line-height: 1;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.km-counter__unit {
  margin-top: 0.35rem;
  font-family: var(--font-serif);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.km-counter--page {
  margin: 0.35rem 0 1.25rem;
}

.route-arrow {
  color: var(--gold);
  font-size: 0.85em;
}

/* ——— Buttons ——— */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper-deep);
  border: var(--frame);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.btn[hidden] {
  display: none !important;
}

.btn:hover,
.btn:focus-visible {
  background: var(--gold);
  color: var(--paper);
  border-color: var(--gold);
}

/* ——— Route strip (index) ——— */

/* ——— Route strip (index) ——— */

.route-strip {
  display: grid;
  gap: 0;
  margin: 3rem 0;
  border: var(--frame);
  overflow: hidden;
}

.route-strip__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1rem 1.25rem;
  background: var(--paper-deep);
  border-bottom: 1px solid rgba(196, 163, 90, 0.35);
}

.route-strip__item:last-child {
  border-bottom: none;
}

.route-strip__day {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  min-width: 2.5rem;
}

.route-strip__text {
  font-size: 0.95rem;
}

.route-strip__text strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin-bottom: 0.15rem;
}

/* ——— Timeline (itinerario) ——— */

.timeline {
  position: relative;
  margin: 2rem 0;
  padding-left: 1.75rem;
  border-left: 2px solid var(--gold);
}

.timeline__item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: -1.75rem;
  top: 0.35rem;
  width: 0.75rem;
  height: 0.75rem;
  margin-left: -0.375rem;
  background: var(--paper);
  border: 2px solid var(--gold);
  border-radius: 50%;
}

.timeline__date {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline__title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin: 0.25rem 0 0.35rem;
}

.timeline__desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.timeline__link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-family: var(--font-serif);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
}

/* ——— SVG Map ——— */

.map-container {
  margin: 2.5rem 0;
  padding: 1.5rem;
}

.map-container svg {
  width: 100%;
  height: auto;
  display: block;
}

.map-caption {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 1rem;
}

/* ——— Day cards (giorni) ——— */

.day-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 540px) {
  .day-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .day-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.day-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  padding: 1.25rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.day-card:hover,
.day-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow);
  color: inherit;
}

.day-card__num {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.day-card__month {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.day-card__title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin: 0.75rem 0 0.35rem;
  flex-grow: 1;
}

.day-card__route {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ——— Day detail ——— */

.day-header {
  text-align: center;
  padding-bottom: 2rem;
  border-bottom: var(--frame);
  margin-bottom: 2rem;
}

.day-header__num {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.day-header__meta {
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.5rem;
}

.diary-entry {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.75;
}

.diary-entry p {
  margin: 0 0 1.25rem;
  text-indent: 1.5rem;
}

.diary-entry p:first-child {
  text-indent: 0;
}

.diary-entry p:first-child::first-letter {
  font-size: 3.2rem;
  float: left;
  line-height: 0.85;
  padding-right: 0.35rem;
  color: var(--gold);
  font-weight: 600;
}

.day-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: var(--frame);
  font-family: var(--font-serif);
}

.day-nav a {
  text-decoration: none;
}

.day-nav__placeholder {
  color: var(--muted);
  opacity: 0.5;
}

/* ——— Polaroid placeholders ——— */

.polaroid-grid {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0;
}

@media (min-width: 540px) {
  .polaroid-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.polaroid {
  background: var(--paper);
  padding: 0.65rem 0.65rem 2.5rem;
  box-shadow:
    0 2px 8px var(--shadow),
    inset 0 0 0 1px rgba(42, 36, 28, 0.08);
  transform: rotate(var(--tilt, 0deg));
}

.polaroid__img {
  aspect-ratio: 4 / 3;
  background: var(--paper-deep);
  border: 1px solid rgba(107, 94, 78, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}

.polaroid__img:has(img) {
  aspect-ratio: auto;
  padding: 0;
  overflow: hidden;
}

.polaroid__caption {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 0.75rem;
  color: var(--muted);
}

.polaroid__comments {
  margin: 0.35rem 0 0;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-style: italic;
  text-align: center;
  color: var(--gold);
}

.polaroid:has(.polaroid__thread) {
  padding-bottom: 1rem;
}

.polaroid__thread {
  list-style: none;
  margin: 0.65rem 0.1rem 0;
  padding: 0.5rem 0.15rem 0;
  border-top: 1px solid rgba(196, 163, 90, 0.28);
  text-align: left;
}

/* ——— Gallery ——— */

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.5rem 0 2rem;
}

.filter-btn {
  padding: 0.4rem 0.85rem;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  background: var(--paper-deep);
  border: 1px solid rgba(196, 163, 90, 0.5);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.filter-btn:hover,
.filter-btn:focus-visible {
  border-color: var(--gold);
}

.filter-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--paper);
}

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

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
  }
}

.gallery-item {
  cursor: pointer;
  border: none;
  padding: 0;
  background: none;
  font: inherit;
  text-align: left;
}

.gallery-item__frame {
  aspect-ratio: 1;
  background: var(--paper-deep);
  border: var(--frame);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-item:hover .gallery-item__frame,
.gallery-item:focus-visible .gallery-item__frame {
  transform: scale(1.02);
  box-shadow: 0 4px 16px var(--shadow);
}

.gallery-item__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.5rem;
  text-align: center;
}

.gallery-item__label {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  margin-top: 0.4rem;
  color: var(--muted);
}

.gallery-empty {
  text-align: center;
  padding: 4rem 2rem;
  font-family: var(--font-serif);
  color: var(--muted);
}

.gallery-empty__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.75rem;
}

.gallery-empty__text {
  font-size: 1.2rem;
  font-style: italic;
  margin: 0 0 1.25rem;
}

.gallery-empty__link {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
}

.gallery-empty[hidden] {
  display: none;
}

/* ——— Lightbox ——— */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: max(1rem, env(safe-area-inset-top)) 0.45rem max(1rem, env(safe-area-inset-bottom));
  background: rgba(18, 14, 10, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.38s cubic-bezier(0.22, 0.61, 0.36, 1),
    visibility 0.38s,
    background 0.48s cubic-bezier(0.22, 0.61, 0.36, 1),
    padding 0.48s cubic-bezier(0.22, 0.61, 0.36, 1);
  touch-action: none;
  overscroll-behavior: none;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox.is-closing {
  opacity: 0;
  pointer-events: none;
}

.lightbox.is-full {
  padding: 0;
  gap: 0;
  background: rgba(6, 6, 6, 0.98);
}

.lightbox__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: min(100%, 36rem);
  min-height: 0;
}

.lightbox.is-full .lightbox__row {
  width: 100%;
  height: 100%;
  gap: 0;
}

.lightbox__viewport {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
  -webkit-user-select: none;
  user-select: none;
}

.lightbox.is-full .lightbox__viewport {
  height: 100%;
  cursor: zoom-out;
}

.lightbox__track {
  display: flex;
  height: 100%;
  will-change: transform;
}

.lightbox__slide {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0 0.9rem;
}

.lightbox.is-full .lightbox__slide {
  padding: 0;
  height: 100%;
}

.lightbox__polaroid {
  position: relative;
  margin: 0;
  width: auto;
  max-width: min(22rem, 100%);
  box-sizing: border-box;
  background: var(--paper);
  border: 2px solid var(--gold);
  padding: 0.65rem 0.65rem 2.55rem;
  box-shadow:
    0 2px 8px var(--shadow),
    0 14px 44px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(42, 36, 28, 0.08);
  transform-origin: center center;
}

.lightbox.is-full .lightbox__polaroid {
  width: 100%;
  max-width: none;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-color: transparent;
  padding: 0;
  box-shadow: none;
}

.lightbox__polaroid img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(58vh, 64dvh);
  object-fit: contain;
  image-orientation: from-image;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.lightbox.is-full .lightbox__polaroid img {
  max-width: 100%;
  max-height: 100dvh;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lightbox__caption {
  position: absolute;
  left: 0.45rem;
  right: 0.45rem;
  bottom: 0.55rem;
  font-family: var(--font-serif);
  font-size: 0.92rem;
  text-align: center;
  padding: 0;
  color: var(--muted);
  margin: 0;
}

.lightbox.is-full .lightbox__caption {
  opacity: 0;
  visibility: hidden;
}

.lightbox__close {
  position: absolute;
  top: max(0.65rem, env(safe-area-inset-top));
  right: max(0.65rem, env(safe-area-inset-right));
  z-index: 5;
  width: 2.6rem;
  height: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  line-height: 1;
  font-family: var(--font-sans);
  font-weight: 400;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--gold);
  cursor: pointer;
  padding: 0;
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
  background: var(--gold);
  color: var(--ink);
}

.lightbox.has-comments,
.lightbox.is-commenting {
  justify-content: flex-start;
  overflow-y: auto;
  touch-action: pan-y;
}

.lightbox__comment-panel {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  z-index: 8;
  width: min(22rem, calc(100% - 1.4rem));
  max-height: min(36vh, 16.5rem);
  overflow: auto;
  flex-shrink: 0;
  touch-action: pan-y;
  background: var(--paper);
  border: 2px solid var(--gold);
  padding: 0.75rem 0.9rem 0.8rem;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4);
}

.lightbox__comment-panel[hidden] {
  display: none;
}

.lightbox.is-full .lightbox__comment-panel,
.lightbox.is-full .lightbox__comment {
  display: none;
}

.lightbox.has-comments .lightbox__polaroid img {
  max-height: min(46vh, 52dvh);
}

.lightbox.is-commenting .lightbox__polaroid img {
  max-height: min(36vh, 42dvh);
}

.lightbox__delete {
  display: none;
  flex-shrink: 0;
  min-width: 11rem;
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  background: var(--paper);
  color: #8a3a28;
  border: 1px solid rgba(138, 58, 40, 0.5);
  cursor: pointer;
}

.lightbox__delete.is-visible {
  display: block;
  position: relative;
  z-index: 6;
}

.lightbox__confirm {
  position: absolute;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 8;
  width: min(20rem, calc(100% - 1.4rem));
  background: var(--paper);
  border: 2px solid var(--gold);
  padding: 0.9rem 1rem 0.85rem;
  text-align: center;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4);
}

.lightbox__confirm[hidden] {
  display: none;
}

.lightbox__confirm p {
  font-family: var(--font-serif);
  margin: 0 0 0.75rem;
  color: var(--ink);
}

.lightbox__confirm-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.lightbox__confirm-no,
.lightbox__confirm-yes {
  font-family: var(--font-serif);
  font-size: 1rem;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  border: 1px solid var(--gold);
}

.lightbox__confirm-no {
  background: var(--paper);
  color: var(--ink);
}

.lightbox__confirm-yes {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.lightbox__comment-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin: 0 0 0.55rem;
  color: var(--ink);
  text-align: center;
}

.lightbox__comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lightbox__comment-list:not(:empty) {
  margin-bottom: 0.55rem;
}

.comment-item {
  padding: 0.45rem 0;
  border-top: 1px solid rgba(196, 163, 90, 0.28);
}

.comment-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.comment-item__meta {
  margin: 0 0 0.15rem;
  font-family: var(--font-serif);
  font-size: 0.82rem;
  color: var(--muted);
}

.comment-item__meta strong {
  color: var(--ink);
  font-weight: 600;
}

.comment-item__text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.comment-item__edit,
.comment-item__delete,
.comment-item__save,
.comment-item__cancel {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  padding: 0.15rem 0.5rem;
  cursor: pointer;
  border: 1px solid rgba(196, 163, 90, 0.55);
  background: var(--paper);
  color: var(--ink);
}

.comment-item__delete,
.comment-item__save {
  color: #8a3a28;
  border-color: rgba(138, 58, 40, 0.45);
}

.comment-item__save {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.comment-item__editor {
  display: block;
  margin-top: 0.2rem;
}

.comment-item__editor textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper-deep);
  border: 1px solid rgba(196, 163, 90, 0.55);
  padding: 0.4rem 0.5rem;
  resize: vertical;
}

.comment-item__error {
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  color: #8a3a28;
}

.comment-item__error[hidden] {
  display: none;
}

.lightbox__comment-empty {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--muted);
  text-align: center;
  margin: 0 0 0.75rem;
}

.lightbox__comment-empty[hidden] {
  display: none;
}

.lightbox:not(.is-commenting) .lightbox__comment-form,
.lightbox:not(.is-commenting) .lightbox__comment-empty {
  display: none;
}

.lightbox:not(.is-commenting) .lightbox__comment-title {
  margin-bottom: 0.35rem;
}

.lightbox__comment-form {
  display: grid;
  gap: 0.55rem;
}

.lightbox__comment-field {
  display: grid;
  gap: 0.25rem;
  font-family: var(--font-serif);
  font-size: 0.82rem;
  color: var(--muted);
}

.lightbox__comment-field input,
.lightbox__comment-field textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper-deep);
  border: 1px solid rgba(196, 163, 90, 0.55);
  padding: 0.45rem 0.55rem;
  resize: vertical;
}

.lightbox__comment-field input:focus,
.lightbox__comment-field textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.lightbox__comment-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.lightbox__comment-error {
  margin: 0;
  font-size: 0.88rem;
  color: #8a3a28;
}

.lightbox__comment-error[hidden] {
  display: none;
}

.lightbox__comment-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.lightbox__comment-cancel,
.lightbox__comment-send {
  font-family: var(--font-serif);
  font-size: 1rem;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  border: 1px solid var(--gold);
}

.lightbox__comment-cancel {
  background: var(--paper);
  color: var(--ink);
}

.lightbox__comment-send {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.lightbox__comment-send:disabled {
  opacity: 0.5;
  cursor: wait;
}

.polaroid__caption[contenteditable="true"],
.lightbox__caption[contenteditable="true"] {
  cursor: text;
  outline: none;
  min-height: 1.15em;
}

.polaroid__caption[contenteditable="true"]:focus,
.lightbox__caption[contenteditable="true"]:focus {
  color: var(--ink);
  box-shadow: 0 1px 0 var(--gold);
}

.polaroid__caption[contenteditable="true"]:empty::before,
.lightbox__caption[contenteditable="true"]:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  opacity: 0.55;
}

.lightbox__nav {
  position: relative;
  z-index: 3;
  flex: 0 0 2.65rem;
  width: 2.65rem;
  height: 2.9rem;
  border: 2px solid var(--gold);
  background: var(--ink);
  color: var(--paper);
  font-size: 1.85rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.lightbox__nav:not(:disabled):hover,
.lightbox__nav:not(:disabled):focus-visible {
  background: var(--gold);
  color: var(--ink);
}

.lightbox__nav:disabled {
  opacity: 0.28;
  cursor: default;
}

.lightbox.is-full .lightbox__nav {
  opacity: 0;
  pointer-events: none;
  width: 0;
  flex-basis: 0;
  border-width: 0;
  overflow: hidden;
}

.lightbox__nav[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .lightbox,
  .lightbox__row,
  .lightbox__polaroid,
  .lightbox__polaroid img,
  .lightbox__caption,
  .lightbox__track,
  .lightbox__nav,
  .lightbox__comment,
  .lightbox__delete {
    transition: none !important;
  }
}

/* ——— Footer ——— */

.site-footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--muted);
  border-top: var(--frame);
  margin-top: auto;
}

.site-footer a {
  color: var(--muted);
}

/* ——— Utilities ——— */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}

/* ——— Live diary feed ——— */

.oggi-band {
  width: min(100% - 2rem, 42rem);
  margin: 0 auto 1.5rem;
  padding: 1.15rem 1.25rem 1.35rem;
}

.oggi-band[hidden] {
  display: none;
}

.oggi-band__label {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.35rem;
}

.oggi-band__title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
}

.oggi-band__note {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-serif);
  font-style: italic;
}

.oggi-band__thumb {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  margin: 0.75rem 0 0.5rem;
  border: 1px solid rgba(42, 36, 28, 0.08);
}

.oggi-band a {
  font-family: var(--font-serif);
}

.route-strip a.route-strip__item {
  text-decoration: none;
  color: inherit;
}

.route-strip__thumb {
  width: 4.5rem;
  height: 3.4rem;
  object-fit: cover;
  border: 1px solid rgba(196, 163, 90, 0.4);
}

.route-strip__item.is-live {
  grid-template-columns: auto auto 1fr;
}

.day-feed {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  margin: 1.5rem 0 2rem;
}

.day-feed-empty {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--muted);
  text-align: center;
  padding: 2rem 1rem;
}

.day-feed-empty[hidden] {
  display: none;
}

.diary-note {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.7;
}

.diary-note p {
  margin: 0;
  white-space: pre-wrap;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.4rem;
}

.gps-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: transparent;
  vertical-align: middle;
  margin-right: 0.25rem;
}

.day-feed .polaroid {
  max-width: 22rem;
  width: 100%;
  margin-inline: auto;
}

.polaroid__img img {
  width: 100%;
  height: auto;
  object-fit: contain;
  image-orientation: from-image;
}

.day-card.has-cover {
  padding: 0;
  overflow: hidden;
}

.day-card__cover {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.day-card.has-cover .day-card__num,
.day-card.has-cover .day-card__month,
.day-card.has-cover .day-card__title,
.day-card.has-cover .day-card__route {
  padding-inline: 1.25rem;
}

.day-card.has-cover .day-card__num {
  margin-top: 0.85rem;
}

.day-card.has-cover .day-card__route {
  padding-bottom: 1.15rem;
}

.day-card__preview {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 1.25rem 1.15rem;
}

/* itinerario (paper) */

.itinerario-layout {
  display: grid;
  gap: 2rem;
}

.viaggio-map {
  width: 100%;
  height: min(52vh, 420px);
  min-height: 280px;
  background: var(--paper-deep);
  z-index: 1;
}

.map-marker--live .map-marker__dot {
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  background: #8a3a28;
  border-color: var(--paper);
  box-shadow: 0 0 0 0 rgba(138, 58, 40, 0.45);
  animation: live-pulse 1.8s ease-out infinite;
}

@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(138, 58, 40, 0.5);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(138, 58, 40, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(138, 58, 40, 0);
  }
}

.map-marker {
  background: transparent;
  border: none;
}

.map-marker__dot {
  display: block;
  width: 11px;
  height: 11px;
  margin-left: -5px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--muted);
  border: 2px solid var(--paper);
  box-shadow: 0 1px 4px var(--shadow);
}

.map-marker--primary .map-marker__dot {
  width: 13px;
  height: 13px;
  margin-left: -6px;
  margin-top: -6px;
  background: var(--gold);
}

.map-marker__label {
  position: absolute;
  left: 10px;
  top: -8px;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink);
  text-shadow:
    -1px -1px 0 var(--paper),
    1px -1px 0 var(--paper),
    -1px 1px 0 var(--paper),
    1px 1px 0 var(--paper);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: var(--frame);
  background: rgba(196, 163, 90, 0.08);
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

.legend-dot--live {
  background: #8a3a28;
}

.legend-dot--photo {
  background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--gold);
}

.legend-dot--muted {
  background: var(--muted);
}

.legend-line {
  width: 18px;
  height: 2px;
  background: var(--gold);
  flex-shrink: 0;
}

.route-tape {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

.route-tape::before {
  content: "";
  position: absolute;
  left: 1.15rem;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    var(--gold) 0,
    var(--gold) 4px,
    transparent 4px,
    transparent 8px
  );
}

.route-stop {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.65rem 0;
  position: relative;
}

.route-stamp {
  flex: 0 0 2.3rem;
  width: 2.3rem;
  height: 2.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  background: var(--paper);
  border: 2px solid var(--gold);
  border-radius: 50%;
  position: relative;
  z-index: 1;
}

.route-card {
  display: block;
  padding: 0.35rem 0.15rem;
  text-decoration: none;
  color: inherit;
}

.route-card:hover,
.route-card:focus-visible {
  color: var(--gold);
}

.route-date {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.route-card__title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.15rem;
}

.route-path {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
}

.lightbox-inner,
.lightbox-img-wrap {
  max-width: min(90vw, 56rem);
}

.lightbox-close {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  padding: 0.35rem 0.65rem;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--gold);
  cursor: pointer;
  font-family: var(--font-serif);
}

@media (min-width: 900px) {
  .itinerario-layout {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
  }
}

/* Galaxy Z Flip cover (quasi quadrato) + telefoni stretti */
@media (max-width: 430px) {
  .site-nav {
    min-height: 2.6rem;
    font-size: 0.84rem;
    gap: 0.12rem 0.55rem;
    padding: 0.3rem 0.4rem;
  }

  .nav-sep {
    display: none;
  }

  .hero {
    padding: 1.1rem 0.85rem 1.4rem;
  }

  .page-title {
    font-size: 1.55rem;
  }

  .viaggio-map {
    height: 42vh;
    min-height: 180px;
  }

  .lightbox {
    padding: 0.45rem 0.2rem;
  }
}

@media (max-height: 520px) and (max-width: 430px) {
  .site-nav {
    min-height: 2.15rem;
    font-size: 0.82rem;
    padding: 0.15rem 0.35rem;
  }

  .hero {
    padding: 0.4rem 0.5rem 0.6rem;
  }

  .page-title {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
  }

  .page-subtitle {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
  }

  .viaggio-map {
    height: 36vh;
    min-height: 140px;
  }

  .site-footer {
    padding: 0.7rem 0.5rem 0.9rem;
    font-size: 0.78rem;
  }

  .lightbox {
    padding: max(0.15rem, env(safe-area-inset-top)) 0.1rem max(0.15rem, env(safe-area-inset-bottom));
    gap: 0.3rem;
  }

  .lightbox__row {
    flex: 1;
    min-height: 0;
    width: 100%;
  }

  .lightbox__viewport {
    height: 100%;
  }

  .lightbox__polaroid {
    max-width: min(18rem, calc(100% - 0.2rem));
    padding: 0.5rem 0.5rem 2.15rem;
  }

  .lightbox__polaroid img {
    max-height: min(52vh, calc(100dvh - 5.4rem));
  }

  .lightbox__nav {
    flex-basis: 2rem;
    width: 2rem;
    height: 2.4rem;
    font-size: 1.5rem;
  }

  .lightbox.has-comments .lightbox__polaroid img,
  .lightbox.is-commenting .lightbox__polaroid img {
    max-height: min(38vh, calc(100dvh - 14rem));
  }

  .lightbox__comment-panel {
    width: min(22rem, calc(100% - 0.7rem));
    max-height: min(32vh, 14rem);
  }

  .lightbox__confirm {
    width: min(22rem, calc(100% - 0.7rem));
    max-height: min(62vh, 26rem);
    bottom: max(0.35rem, env(safe-area-inset-bottom));
  }

  .lightbox__delete.is-visible {
    position: relative;
    z-index: 6;
  }

  .lightbox__close {
    top: max(0.25rem, env(safe-area-inset-top));
    right: 0.25rem;
  }
}

.install-body {
  min-height: 100vh;
}

.install-main {
  text-align: center;
  padding: 2.5rem 0 3rem;
}

.install-icon {
  width: 11.5rem;
  height: 11.5rem;
  margin: 0.75rem auto 1.35rem;
  border-radius: 2.45rem;
  border: 1px solid rgba(196, 163, 90, 0.45);
  box-shadow: 0 12px 32px var(--shadow);
}

.install-lead {
  margin-inline: auto;
}

.install-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 1.75rem 0 1rem;
}

.install-actions .btn {
  min-width: 12.5rem;
}

.install-status {
  min-height: 1.5rem;
  margin: 0 auto 1.25rem;
  max-width: 28rem;
  color: var(--muted);
  font-family: var(--font-serif);
  font-style: italic;
}

.install-fallback {
  text-align: left;
  max-width: 24rem;
  margin: 0 auto;
  padding: 0 0 0 1.2rem;
  color: var(--muted);
}

.install-fallback li + li {
  margin-top: 0.45rem;
}

.album-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 0 0 1.25rem;
}

.album-toolbar .btn {
  min-width: 0;
  padding: 0.45rem 0.9rem;
  font-size: 0.95rem;
}

.lightbox__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  position: relative;
  z-index: 6;
}

.lightbox__share,
.lightbox__show,
.lightbox__comment {
  display: inline-block;
  flex-shrink: 0;
  min-width: 8.5rem;
  margin: 0;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.5rem 0.8rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid rgba(196, 163, 90, 0.55);
  cursor: pointer;
}

.lightbox.is-full .lightbox__share,
.lightbox.is-full .lightbox__show,
.lightbox.is-full .lightbox__comment,
.lightbox.is-commenting .lightbox__share,
.lightbox.is-commenting .lightbox__show {
  opacity: 0;
  pointer-events: none;
}

.lightbox.is-full .lightbox__delete.is-visible,
.lightbox.is-commenting .lightbox__delete.is-visible {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.lightbox.is-show .lightbox__show {
  background: var(--gold);
  border-color: var(--gold);
}

.offline-badge {
  position: fixed;
  right: max(0.7rem, env(safe-area-inset-right));
  bottom: max(0.7rem, env(safe-area-inset-bottom));
  z-index: 10050;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  background: rgba(42, 36, 28, 0.92);
  color: var(--paper);
  border: 1px solid var(--gold);
  border-radius: 999px;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 16px var(--shadow);
  pointer-events: none;
}

.offline-badge[hidden] {
  display: none !important;
}

.offline-badge svg {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

body.camera-open .offline-badge {
  right: auto;
  left: max(0.7rem, env(safe-area-inset-left));
}

#otr-comments-banner {
  position: fixed;
  left: 50%;
  bottom: max(0.85rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 10040;
  width: calc(100% - 1.5rem);
  max-width: 26rem;
  padding: 0.85rem 1rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid rgba(196, 163, 90, 0.55);
  box-shadow: 0 8px 24px var(--shadow);
  font-family: var(--font-serif);
}

#otr-comments-banner[hidden] {
  display: none !important;
}

#otr-comments-banner p {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  line-height: 1.35;
}

#otr-comments-banner .otr-banner-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

#otr-comments-banner button {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(196, 163, 90, 0.55);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

#otr-comments-banner button.otr-banner-go {
  background: var(--gold);
  border-color: var(--gold);
}

body.camera-open #otr-comments-banner {
  display: none !important;
}

.map-marker--photo {
  background: transparent !important;
  border: none !important;
}

.map-marker--photo .map-marker__photo {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: var(--paper);
  box-shadow: 0 2px 10px var(--shadow);
  overflow: hidden;
}

.map-marker--photo img {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: cover;
}

.map-photo-popup {
  width: 160px;
}

.map-photo-popup img {
  width: 100%;
  height: auto;
  margin-bottom: 0.35rem;
}

.map-photo-popup a {
  font-family: var(--font-serif);
}

.share-polaroid {
  max-width: 22rem;
  margin: 2rem auto;
}
