/* Gallerie: viaggi (cartina, pagine, gestione) e i miei momenti. Caricato dopo lista.css. */

/* ---------- foto di viaggio ---------- */

/* ---------- galleria momenti ---------- */
.gallery { columns: 2; column-gap: 12px; }
@media (min-width: 760px) { .gallery { columns: 4; column-gap: 16px; } }
.moment {
  break-inside: avoid; margin: 0 0 12px; border-radius: 16px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
}
@media (min-width: 760px) { .moment { margin-bottom: 16px; } }
.moment img { display: block; width: 100%; height: auto; transition: transform .3s ease; }
.moment:hover img { transform: scale(1.03); }
.moment figcaption { padding: 8px 12px 10px; font-size: .85rem; color: var(--muted); }

/* ---------- cartina dei viaggi ---------- */
.map-zoom { display: flex; gap: 6px; flex-wrap: wrap; }
.travel-map {
  position: relative; border-radius: 24px; overflow: hidden; max-width: 100%;
  background: radial-gradient(120% 120% at 50% 0%, rgba(23, 48, 39, .9), rgba(11, 22, 18, .95));
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.map-svg { display: block; width: 100%; height: auto; aspect-ratio: 960 / 500; }
.map-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); font-size: .9rem; padding: 16px; text-align: center; }
.travel-map.map-ready .map-loading { display: none; }
.travel-map.map-failed .map-svg { display: none; }
.travel-map.map-failed .map-loading { position: static; padding: 28px 16px; }
.map-sphere { fill: rgba(47, 163, 111, .05); stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-graticule { fill: none; stroke: rgba(214, 173, 82, .07); stroke-width: .5; vector-effect: non-scaling-stroke; }
.map-country { fill: #1d3a30; transition: fill .3s ease; }
.map-country:hover { fill: #24473b; }
.map-country.visited { fill: rgba(214, 173, 82, .35); }
.map-borders { fill: none; stroke: rgba(11, 22, 18, .9); stroke-width: .6; vector-effect: non-scaling-stroke; }
.map-pin { cursor: pointer; outline: none; }
.pin-dot { fill: var(--gold); stroke: var(--bg); stroke-width: 2; }
.pin-ring { fill: none; stroke: var(--gold); stroke-width: 1.5; opacity: .7; transform-box: fill-box; transform-origin: center; animation: pin-pulse 2.4s ease-out infinite; }
.map-pin.active .pin-dot, .map-pin:focus-visible .pin-dot { fill: var(--red); }
.map-pin.pop .pin-dot { animation: pin-pop .5s cubic-bezier(.3, 1.6, .5, 1) both; transform-box: fill-box; transform-origin: center; }
@keyframes pin-pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes pin-pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.map-card {
  position: absolute; z-index: 3; width: 220px; border-radius: 16px; overflow: hidden; text-decoration: none;
  background: var(--surface); border: 1px solid var(--gold); box-shadow: var(--shadow); color: var(--ink);
  animation: card-in .2s ease-out;
}
.map-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.map-card-body { display: grid; gap: 2px; padding: 10px 12px 12px; }
.map-card-place { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--emerald); }
.map-card-name { font-family: var(--font-display); font-size: 1.25rem; }
.map-card-go { font-size: .85rem; color: var(--gold); }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pin-ring, .map-card { animation: none; } }

/* ---------- pagina di un viaggio ---------- */
.trip-hero { position: relative; border-radius: 24px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 24px; aspect-ratio: 16 / 9; max-width: 100%; }
@media (min-width: 760px) { .trip-hero { aspect-ratio: 21 / 8; } }
.trip-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trip-hero-text { position: absolute; inset: auto 0 0 0; padding: 48px 20px 20px; background: linear-gradient(to top, rgba(11, 22, 18, .95), rgba(11, 22, 18, 0)); }
.trip-hero-text h1 { margin: 2px 0 0; }
.back { display: inline-flex; gap: 6px; margin-bottom: 14px; color: var(--muted); text-decoration: none; font-weight: 600; }
.back:hover { color: var(--gold); }
.moment button { all: unset; display: block; cursor: zoom-in; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 92vh; }
.lightbox::backdrop { background: rgba(5, 10, 8, .92); }
.lightbox img { display: block; max-width: 96vw; max-height: 82vh; border-radius: 12px; }
.lightbox p { color: var(--ink); text-align: center; margin: 10px 0 0; }
.lightbox-close { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 14px); right: 14px; }
.map-country-outlined { stroke: rgba(11, 22, 18, .9); stroke-width: .6; vector-effect: non-scaling-stroke; }

/* ---------- link nelle passioni e pagina viaggi ---------- */
.passion-link { margin-top: 4px; font-size: .9rem; font-weight: 700; color: var(--gold); text-decoration: none; }
.passion-link:hover { color: var(--ink); }
.map-page .section-head { align-items: center; }
.trip-card {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden; text-decoration: none;
  border: 1px solid var(--line); background: var(--surface); transition: transform .18s ease, border-color .18s ease;
}
.trip-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.trip-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.trip-card-body { display: grid; gap: 2px; padding: 10px 14px 14px; }
.trip-card-name { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); }

/* ---------- i miei momenti ---------- */
a.passion { text-decoration: none; color: var(--ink); transition: transform .18s ease, border-color .18s ease; }
a.passion:hover { transform: translateY(-3px); border-color: var(--gold); }
.moments-featured { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .moments-featured.count-2 { grid-template-columns: 1fr 1fr; }
  .moments-featured.count-many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .moments-featured.count-1 .moment-big { max-width: 760px; margin: 0 auto; }
}
.moment-big { border-color: var(--gold); }
.moment-big .moment-open img { max-height: 70vh; width: 100%; object-fit: cover; }
.moment-open { all: unset; display: block; cursor: zoom-in; width: 100%; }
.moment-open:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.moment-open img { display: block; width: 100%; height: auto; }
.moment figcaption { display: grid; gap: 2px; }
.moment-title { color: var(--ink); font-weight: 600; }
.moment-meta { font-size: .8rem; color: var(--muted); }
.year-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.year-head h2 { margin: 0; font-size: clamp(1.6rem, 5vw, 2.2rem); color: var(--gold); }
.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 64px;
  border: 0; border-radius: 12px; background: rgba(11, 22, 18, .6); color: var(--ink); font-size: 2.2rem; cursor: pointer;
}
.lb-prev { left: 8px; } .lb-next { right: 8px; }
.lb-nav:hover { background: rgba(11, 22, 18, .85); color: var(--gold); }
.lb-caption { display: grid; gap: 2px; justify-items: center; }
.lb-caption span { color: var(--muted); font-size: .9rem; }

/* ---------- gestione momenti ---------- */
.upload-form { gap: 14px; }
.upload-drop {
  display: grid !important; justify-items: center; gap: 6px; padding: 22px 16px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line); border-radius: 14px; background: var(--bg);
}
.upload-drop:hover, .upload-drop:focus-within { border-color: var(--gold); }
.upload-drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-cta { display: inline-block; padding: 10px 18px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-weight: 800; }
.upload-fields { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .upload-fields { grid-template-columns: 1fr 1fr 200px; } }
.upload-drop { position: relative; }
.moments-admin { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.m-item { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; min-width: 0; }
.m-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.m-star { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.m-form { padding: 12px; margin: 0; gap: 10px; }
.m-actions { gap: 8px; }
.btn.icon { padding: 9px 13px; }
.moments-featured { align-items: start; }
.moment-big .moment-open { background: #000; }
.moment-big .moment-open img { max-height: 72vh; object-fit: contain; }

/* ---------- gestione viaggi ---------- */
textarea { width: 100%; resize: vertical; min-height: 64px; }
.panel + .panel { margin-top: 16px; }
.panel-title { font-size: 1.1rem; margin: 0 0 12px; }
.trip-admin-list { display: grid; gap: 10px; }
.trip-admin { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; min-width: 0; }
.trip-admin-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.trip-admin-main .prod-thumb { background: var(--bg); flex: none; }
.trip-admin-main .prod-thumb img { object-fit: cover; }
.trip-admin-main .prod-main { min-width: 0; display: grid; gap: 4px; }
.trip-admin-main .prod-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-admin-main .prod-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.trip-admin-main .dash-tile-go { position: static; color: var(--gold); }
.trip-admin-order { display: flex; gap: 4px; margin: 0; }
.map-status { display: grid; gap: 6px; }
.map-status p { margin: 0; }
.coords summary { cursor: pointer; }
.coords .two { margin-top: 8px; }
.trip-desc { max-width: 70ch; color: var(--muted); margin: -8px 0 20px; white-space: pre-line; }

.card-body h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.full-name { font-weight: 400; overflow-wrap: anywhere; }
