@font-face { font-family: "Oswald"; src: url("assets/fonts/oswald.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("assets/fonts/dm-sans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --cream: #fbf4ec;
  --cream-deep: #f4e6d6;
  --peach: #fee5ca;
  --white: #fffdfa;
  --ink: #1d1512;
  --muted: #6b5d55;
  --line: #e8d9c8;
  --cherry: #b00e2f;
  --cherry-dark: #8c0a25;
  --display: "Oswald", "Arial Narrow", Impact, sans-serif;
  --sans: "DM Sans", system-ui, Arial, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --shadow: 0 1px 2px rgba(80, 30, 20, .06), 0 12px 32px -12px rgba(80, 30, 20, .22);
  --gutter: clamp(16px, 4vw, 56px);
  --header-h: 68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--cream); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2 { text-wrap: balance; }
p { text-wrap: pretty; }
em { font-style: normal; color: var(--cherry); }
.icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--cherry); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 3000; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 600; transition: top .2s var(--ease); }
.skip-link:focus { top: 12px; }

.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--cherry); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: currentColor; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border: 1px solid transparent; border-radius: 999px; font-size: 15px; font-weight: 600; transition: background-color .2s var(--ease), color .2s var(--ease), transform .15s var(--ease), border-color .2s; }
.button:active { transform: scale(.97); }
.button-primary { background: var(--cherry); color: #fff; }
.button-primary:hover { background: var(--cherry-dark); }
.button-ghost { border-color: var(--line); background: var(--white); }
.button-ghost:hover { border-color: var(--cherry); color: var(--cherry); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 1500; display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header-h); padding: 0 var(--gutter); background: rgba(251, 244, 236, .9); border-bottom: 1px solid transparent; transition: border-color .2s; }
@supports (backdrop-filter: blur(1px)) { .site-header { background: rgba(251, 244, 236, .78); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); } }
.site-header.scrolled { border-bottom-color: var(--line); }
.wordmark { display: flex; align-items: center; gap: 11px; }
.wordmark-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; padding-bottom: 4px; background: var(--cherry); color: #fff; font: 500 26px/1 var(--display); }
.wordmark-text { font: 500 24px/.9 var(--display); letter-spacing: -.01em; color: var(--cherry); }
.wordmark-text small { display: block; margin-top: 4px; font: 500 11px/1 var(--sans); letter-spacing: .04em; color: var(--muted); }
.header-nav { display: flex; gap: 6px; }
.header-nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 500; transition: background-color .2s, color .2s; }
.header-nav a:hover, .header-nav a.current { background: var(--cream-deep); color: var(--cherry); }
.header-socials { display: flex; gap: 6px; }
.header-social { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; transition: background-color .2s, color .2s; }
.header-social:hover { background: var(--cream-deep); color: var(--cherry); }

.preview-banner { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px var(--gutter); background: var(--peach); color: #6d2a1c; font-size: 14px; }
.preview-banner button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; }
.preview-banner button:hover { background: rgba(176, 14, 47, .08); }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 6vw, 96px); align-items: center; max-width: 1440px; margin: 0 auto; padding: clamp(40px, 7vw, 96px) var(--gutter) clamp(56px, 8vw, 120px); }
.hero h1 { margin: 22px 0 24px; font: 500 clamp(48px, 7.4vw, 108px)/.94 var(--display); letter-spacing: -.02em; text-transform: uppercase; }
.hero-lead { max-width: 30ch; color: var(--muted); font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; margin-top: 36px; }
.hero-count { color: var(--muted); font-size: 15px; }
.hero-count strong { margin-right: 4px; color: var(--ink); font: 500 28px/1 var(--display); font-variant-numeric: tabular-nums; }

.hero-photo { position: relative; margin: 0; }
.hero-frame { position: relative; aspect-ratio: 4 / 5; max-height: 72dvh; width: 100%; overflow: hidden; border-radius: 28px; background: var(--cream-deep); box-shadow: var(--shadow); }
.hero-backdrop-image { position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0; transform: scale(1.04); transition: opacity 1.1s var(--ease), transform 6s linear; }
.hero-backdrop-image.active { opacity: 1; transform: scale(1); }
.hero-stamp { position: absolute; top: -26px; left: -26px; display: grid; place-items: center; width: 104px; height: 104px; border-radius: 50%; background: var(--cherry); color: var(--peach); font: 500 16px/1.05 var(--display); text-align: center; text-transform: uppercase; letter-spacing: .03em; transform: rotate(-12deg); box-shadow: 0 10px 24px -10px rgba(140, 10, 37, .6); }
.hero-photo-credit { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.hero-photo-credit small { display: block; color: var(--muted); font-size: 12px; }
.hero-photo-credit a { font: 500 20px/1.2 var(--display); text-transform: uppercase; transition: color .2s; }
.hero-photo-credit a:hover { color: var(--cherry); }
.photo-loop-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-size: 13px; font-weight: 500; transition: border-color .2s; }
.photo-loop-toggle:hover { border-color: var(--cherry); }
.pause-glyph { width: 9px; height: 10px; border-inline: 3px solid currentColor; }
.photo-loop-toggle[aria-pressed="true"] .pause-glyph { width: 0; height: 0; border: 0; border-left: 9px solid currentColor; border-block: 5.5px solid transparent; }

/* Discover */
.discover { max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter) clamp(64px, 8vw, 112px); }
.section-heading { display: grid; grid-template-columns: 1fr minmax(0, 34ch); gap: 24px 48px; align-items: end; margin-bottom: 32px; }
.section-heading h2, .closing-note h2 { margin-top: 16px; font: 500 clamp(40px, 5vw, 68px)/.98 var(--display); letter-spacing: -.015em; text-transform: uppercase; }
.section-heading > p { color: var(--muted); font-size: 17px; }

.toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.toolbar .search-box { grid-column: 1 / -1; }
.search-box, .select-field { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); transition: border-color .2s, box-shadow .2s; }
.search-box:focus-within, .select-field:focus-within { border-color: var(--cherry); box-shadow: 0 0 0 4px rgba(176, 14, 47, .1); }
.search-box .icon { width: 20px; height: 20px; color: var(--cherry); }
.search-box input { flex: 1; min-width: 0; height: 54px; border: 0; outline: 0; background: transparent; font-size: 16px; }
.search-box input::placeholder { color: #9a8a80; }
kbd { padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font: 500 11px var(--sans); white-space: nowrap; }
.select-field span { color: var(--muted); font-size: 13px; }
.select-field select { flex: 1; min-width: 0; height: 54px; border: 0; outline: 0; background: transparent; font-size: 16px; font-weight: 500; }

.explorer { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 16px; align-items: start; }
.places-panel { display: flex; flex-direction: column; min-width: 0; height: calc(100dvh - var(--header-h) - 24px); min-height: 520px; max-height: 860px; }
.results-heading { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin-bottom: 4px; color: var(--muted); font-size: 14px; font-weight: 500; }
.reset-link { border: 0; background: none; padding: 8px 0; color: var(--cherry); font-size: 14px; font-weight: 600; }
.reset-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.place-list { flex: 1; display: grid; align-content: start; gap: 4px; min-height: 0; margin: 0 -10px 0 -6px; padding: 6px 10px 48px 6px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 10px, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 10px, #000 calc(100% - 56px), transparent); }
.place-list:empty { flex: 0; padding: 0; }
.places-panel .empty-state { margin-top: 6px; }
.place-card { position: relative; display: grid; grid-template-columns: 76px 1fr; gap: 16px; align-items: center; width: 100%; padding: 10px; border: 0; border-radius: 18px; background: transparent; text-align: left; transition: background-color .2s; }
.place-card:hover { background: var(--white); }
.place-card.selected { background: var(--white); box-shadow: inset 3px 0 0 var(--cherry), var(--shadow); }
.place-thumb { width: 76px; height: 76px; border-radius: 14px; background: var(--cherry) center / cover no-repeat; display: grid; place-items: center; color: var(--peach); font: 500 24px var(--display); }
.place-copy { min-width: 0; }
.place-meta { display: block; color: var(--cherry); font-size: 12px; font-weight: 600; }
.place-copy strong { display: block; margin: 2px 0 3px; overflow: hidden; font: 500 21px/1.15 var(--display); text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; }
.place-address { display: block; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.place-skeleton { height: 96px; border-radius: 18px; background: linear-gradient(90deg, var(--cream-deep) 0 40%, #f9eee2 50%, var(--cream-deep) 60% 100%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.empty-state { display: grid; justify-items: start; gap: 6px; padding: 28px 18px; border: 1px dashed var(--line); border-radius: 18px; }
.empty-state strong { font: 500 22px var(--display); text-transform: uppercase; }
.empty-state p { margin-bottom: 10px; color: var(--muted); }

/* Map */
.map-panel { position: sticky; top: calc(var(--header-h) + 12px); height: calc(100dvh - var(--header-h) - 24px); min-height: 520px; max-height: 860px; overflow: hidden; border-radius: 24px; background: var(--cream-deep); box-shadow: var(--shadow); }
#map { position: absolute; inset: 0; background: var(--cream-deep); }
.leaflet-container { font-family: var(--sans); }
.leaflet-control-zoom.leaflet-bar { border: 0; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.leaflet-control-zoom a { width: 40px !important; height: 40px !important; line-height: 40px !important; color: var(--ink) !important; }
.map-fallback { display: grid; place-items: center; height: 100%; padding: 24px; color: var(--muted); text-align: center; }
.map-recenter { position: absolute; z-index: 1000; top: 16px; right: 16px; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--white); box-shadow: var(--shadow); font-size: 13px; font-weight: 600; transition: color .2s, transform .15s var(--ease); }
.map-recenter:hover { color: var(--cherry); }
.map-recenter:active { transform: scale(.96); }
.custom-pin { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid #fff; border-radius: 50% 50% 50% 4px; background: var(--cherry); color: #fff; font: 600 14px/1 var(--sans); transform: rotate(-45deg); box-shadow: 0 6px 14px -4px rgba(140, 10, 37, .55); transition: transform .2s var(--ease), background-color .2s; }
.custom-pin span { transform: rotate(45deg); }
.custom-pin:hover { transform: rotate(-45deg) scale(1.1); }
.custom-pin.selected-pin { background: var(--ink); transform: rotate(-45deg) scale(1.22); }

.map-place-card { position: absolute; z-index: 1100; top: 16px; left: 16px; max-height: calc(100% - 32px); display: flex; flex-direction: column; width: min(380px, calc(100% - 32px)); overflow: hidden auto; overscroll-behavior: contain; border-radius: 20px; background: var(--white); box-shadow: 0 24px 60px -20px rgba(60, 20, 10, .45); animation: card-in .35s var(--ease); }
@keyframes card-in { from { opacity: 0; transform: translateX(-12px); } }
.sheet-handle, .sheet-scrim { display: none; }
.map-place-cover { position: relative; flex: 0 0 auto; height: 190px; background: var(--cherry) center / cover no-repeat; }
.icon-button { position: absolute; top: 12px; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 253, 250, .94); box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .3); transition: transform .15s var(--ease), color .2s; }
.icon-button svg { display: block; }
.icon-button:focus-visible { outline-offset: -3px; }
.map-place-card:focus, .map-place-card:focus-visible { outline: none; }
.icon-button:hover { color: var(--cherry); }
.icon-button:active { transform: scale(.92); }
.share-place { right: 64px; }
.close-place { right: 12px; }
.map-place-body { display: grid; gap: 16px; padding: 0 20px 22px; }
.map-place-title { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: end; }
.map-place-logo { position: relative; margin-top: -30px; display: grid; place-items: center; width: 64px; height: 64px; overflow: hidden; border: 3px solid var(--white); border-radius: 16px; background: var(--peach); color: var(--cherry); font: 500 22px var(--display); box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .35); }
.map-place-logo img { width: 100%; height: 100%; object-fit: cover; }
.map-place-meta { color: var(--cherry); font-size: 12px; font-weight: 600; }
.map-place-title h3 { font: 500 26px/1.05 var(--display); text-transform: uppercase; }
.map-place-description { color: var(--muted); font-size: 15px; }
.map-place-address { display: flex; align-items: flex-start; gap: 10px; color: var(--ink); font-size: 14px; }
.map-place-address .icon { margin-top: 1px; color: var(--cherry); }
.map-place-address:hover span { text-decoration: underline; text-underline-offset: 3px; }
.map-place-actions { display: grid; gap: 8px; }
.map-place-actions .button { width: 100%; }
.map-place-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.place-link { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: 14px; background: var(--cream); font-size: 14px; font-weight: 500; transition: background-color .2s, color .2s; }
.place-link:hover { background: var(--cream-deep); color: var(--cherry); }
.place-link .icon { color: var(--cherry); }
.place-link:only-child, .place-link:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Closing + footer */
.closing-note { display: grid; grid-template-columns: auto minmax(0, 640px); gap: clamp(24px, 6vw, 96px); align-items: center; max-width: 1440px; margin: 0 auto; padding: clamp(56px, 8vw, 112px) var(--gutter); border-top: 1px solid var(--line); }
.closing-mark { color: var(--cherry); font: 500 clamp(120px, 16vw, 240px)/.8 var(--display); }
.closing-mark span { color: var(--peach); }
.closing-note h2 + p { max-width: 46ch; margin: 18px 0 28px; color: var(--muted); font-size: 17px; }
.closing-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.footer-social a:hover { color: var(--cherry); }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; max-width: 1440px; margin: 0 auto; padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer-wordmark { color: var(--cherry); font: 500 24px var(--display); }
.site-footer a:last-child:hover { color: var(--cherry); }

.toast { position: fixed; z-index: 2500; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (hover: none), (pointer: coarse) { kbd { display: none; } }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { max-width: 620px; }
  .hero-frame { aspect-ratio: 4 / 3; }
  .section-heading { grid-template-columns: 1fr; }
  .explorer { grid-template-columns: 1fr; }
  .places-panel { height: auto; min-height: 0; max-height: none; }
  .place-list { overflow: visible; margin: 0; padding: 0; -webkit-mask-image: none; mask-image: none; }
  .map-panel { position: relative; top: 0; order: -1; height: 56dvh; min-height: 340px; }
  /* scheda come foglio dal basso */
  .sheet-scrim { position: fixed; inset: 0; z-index: 1900; display: block; background: rgba(29, 21, 18, .38); touch-action: none; animation: fade-in .25s var(--ease); }
  body.sheet-open { overflow: hidden; }
  .map-place-card { position: fixed; z-index: 2000; inset: auto 0 0; top: auto; width: 100%; max-height: 86dvh; border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: sheet-in .38s var(--ease); }
  .sheet-handle { position: absolute; z-index: 2; top: 8px; left: 50%; display: block; width: 40px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .85); transform: translateX(-50%); }
  .map-place-cover { height: 170px; }
}
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }

@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .wordmark-text small, .header-nav { display: none; }
  .hero { padding-top: 28px; gap: 40px; }
  .hero-stamp { top: -18px; left: auto; right: 12px; width: 82px; height: 82px; font-size: 13px; }
  .hero-actions .button { flex: 1 1 100%; }
  .toolbar { grid-template-columns: 1fr; }
  .closing-note { grid-template-columns: 1fr; }
  .closing-mark { font-size: 120px; }
  .closing-note .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
