/* ==========================================================================
   Caterina & Matteo — high-end-visual-design
   Vibe: Editorial Luxury (cream / espresso / sage, variable-contrast serif,
   film-grain). Layout: Editorial Split + soft asymmetry. Zero external assets.
   ========================================================================== */

:root {
  --cream: #fdfbf7;
  --cream-deep: #f6f1e8;
  --ink: #2b241d;
  --ink-soft: #4a4136;
  --muted: #6b5f52;
  --sage: #5e6b54;
  --hairline: rgba(43, 36, 29, 0.08);
  --hairline-strong: rgba(43, 36, 29, 0.14);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --serif: "Didot", "Bodoni MT", "Cormorant Garamond", "Playfair Display",
    "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", ui-sans-serif,
    system-ui, sans-serif;
  --radius-xl: 2rem;
  --radius-core: calc(2rem - 0.5rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

::selection { background: var(--sage); color: var(--cream); }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Film grain (fixed, pointer-events-none, per skill §6) ---------------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

/* --- Skip link ------------------------------------------------------------ */
.skip-link {
  position: absolute;
  top: -4rem;
  left: 1.5rem;
  z-index: 90;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 0.85rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  transition: top 0.45s var(--ease);
}
.skip-link:focus { top: 1.5rem; }

/* --- Floating pill nav ---------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 0;
  pointer-events: none;
}

.nav-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: max-content;
  max-width: 100%;
  padding: 0.5rem 0.65rem 0.5rem 1.35rem;
  border-radius: 999px;
  background: rgba(253, 251, 247, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--hairline);
  box-shadow:
    0 1px 1px rgba(255, 255, 255, 0.6) inset,
    0 20px 45px -25px rgba(43, 36, 29, 0.35);
}

.brand {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}
.brand .amp { font-style: italic; color: var(--sage); padding: 0 0.1em; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  transition: color 0.5s var(--ease), background-color 0.5s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: rgba(43, 36, 29, 0.06); }
.nav-links a[aria-current="page"] {
  color: var(--cream);
  background: var(--ink);
}

/* Hamburger — morphs into an X */
.nav-toggle {
  display: none;
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 999px;
  background: rgba(43, 36, 29, 0.06);
  cursor: pointer;
  flex: none;
}
.nav-toggle .bar {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.1rem;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.6s var(--ease);
}
.nav-toggle .bar:first-child { transform: translate(-50%, calc(-50% - 3.5px)); }
.nav-toggle .bar:last-child { transform: translate(-50%, calc(-50% + 3.5px)); }
body.menu-open .nav-toggle .bar:first-child { transform: translate(-50%, -50%) rotate(45deg); }
body.menu-open .nav-toggle .bar:last-child { transform: translate(-50%, -50%) rotate(-45deg); }

/* Full-screen glass overlay menu */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(253, 251, 247, 0.86);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s var(--ease), visibility 0s linear 0.7s;
}
body.menu-open .nav-overlay {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.7s var(--ease);
}
.nav-overlay ul { list-style: none; text-align: center; }
.nav-overlay li { overflow: hidden; }
.nav-overlay a {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(2rem, 7vw, 3.25rem);
  line-height: 1.35;
  text-decoration: none;
  color: var(--ink);
  transform: translateY(110%);
  opacity: 0;
  transition: transform 0.8s var(--ease), opacity 0.8s var(--ease),
    color 0.4s var(--ease);
}
.nav-overlay a:hover, .nav-overlay a[aria-current="page"] { color: var(--sage); font-style: italic; }
body.menu-open .nav-overlay a { transform: translateY(0); opacity: 1; }
body.menu-open .nav-overlay li:nth-child(1) a { transition-delay: 0.08s; }
body.menu-open .nav-overlay li:nth-child(2) a { transition-delay: 0.14s; }
body.menu-open .nav-overlay li:nth-child(3) a { transition-delay: 0.2s; }
body.menu-open .nav-overlay li:nth-child(4) a { transition-delay: 0.26s; }
body.menu-open .nav-overlay li:nth-child(5) a { transition-delay: 0.32s; }
body.menu-open .nav-overlay li:nth-child(6) a { transition-delay: 0.38s; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  body.menu-open { overflow: hidden; }
}
@media (min-width: 861px) {
  .nav-overlay { display: none; }
}

/* --- Structure ------------------------------------------------------------ */
.wrap {
  width: min(72rem, 100% - 3rem);
  margin-inline: auto;
}

main { display: block; }

.section { padding: 7rem 0; }
.section + .section { padding-top: 0; }

.hero {
  padding: clamp(10rem, 18vh, 13rem) 0 5rem;
}

/* Eyebrow tag */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  background: rgba(255, 255, 255, 0.5);
  margin-bottom: 1.75rem;
}
.eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--sage);
}

/* Display typography */
.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 7.5vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.display em, h2 em { font-style: italic; color: var(--sage); }

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin-bottom: 1.5rem;
}

h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.lede {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 38rem;
}

.prose { max-width: 40rem; }
.prose p + p { margin-top: 1.25rem; }
.prose strong { font-weight: 600; }
.prose ul { padding-left: 1.25rem; margin-top: 1rem; }
.prose li + li { margin-top: 0.5rem; }
.prose a { color: var(--sage); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--ink); }

.sig {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--sage);
  margin-top: 1.5rem;
}

/* Editorial split */
.split {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}
.split--flip { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }

@media (max-width: 900px) {
  .split, .split--flip { grid-template-columns: 1fr; }
  .section { padding: 4.5rem 0; }
  .hero { padding-top: 8.5rem; }
}

/* --- Double-Bezel frames (skill §4A) -------------------------------------- */
.bezel {
  background: rgba(43, 36, 29, 0.045);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  padding: 0.5rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 40px 80px -40px rgba(43, 36, 29, 0.35),
    0 12px 30px -18px rgba(43, 36, 29, 0.2);
}
.bezel-core {
  border-radius: var(--radius-core);
  overflow: hidden;
  background: var(--cream-deep);
  box-shadow: 0 1px 1px rgba(255, 255, 255, 0.45) inset;
}
.bezel-core img { width: 100%; }
.bezel figcaption {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: 0.85rem 1rem 0.5rem;
}

.tilt-l, .tilt-r { transition: transform 0.9s var(--ease); }
@media (min-width: 901px) {
  .tilt-l { transform: rotate(-2deg); }
  .tilt-r { transform: rotate(2deg); }
  .tilt-l:hover, .tilt-r:hover { transform: rotate(0deg); }
}

/* Map link */
.map-link {
  display: block;
  text-decoration: none;
  border-radius: var(--radius-core);
}
.map-link img { transition: transform 1s var(--ease); }
.map-link:hover img { transform: scale(1.02); }

/* --- Island buttons (button-in-button, skill §4B) ------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 0.5rem 0.5rem 1.6rem;
  cursor: pointer;
  transition: transform 0.5s var(--ease), background-color 0.5s var(--ease),
    box-shadow 0.5s var(--ease);
  box-shadow: 0 18px 35px -18px rgba(43, 36, 29, 0.55);
}
.btn:hover { background: #3a3128; box-shadow: 0 24px 45px -20px rgba(43, 36, 29, 0.6); }
.btn:active { transform: scale(0.98); }
.btn .btn-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  transition: transform 0.5s var(--ease);
  flex: none;
}
.btn:hover .btn-ico { transform: translate(3px, -1px) scale(1.05); }
.btn .btn-ico svg { width: 0.9rem; height: 0.9rem; }

.btn--ghost {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--hairline-strong);
  box-shadow: none;
}
.btn--ghost:hover { background: rgba(43, 36, 29, 0.05); }
.btn--ghost .btn-ico { background: rgba(43, 36, 29, 0.07); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
}

/* --- Fact cards ----------------------------------------------------------- */
.fact-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}
@media (max-width: 720px) {
  .fact-row { grid-template-columns: 1fr; gap: 1rem; }
}
.fact {
  background: rgba(43, 36, 29, 0.045);
  border: 1px solid var(--hairline);
  border-radius: 1.5rem;
  padding: 0.4rem;
}
.fact-core {
  background: rgba(255, 255, 255, 0.55);
  border-radius: calc(1.5rem - 0.4rem);
  box-shadow: 0 1px 1px rgba(255, 255, 255, 0.6) inset;
  padding: 1.4rem 1.5rem;
  height: 100%;
}
.fact-core .k {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 0.5rem;
}
.fact-core .v {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.3;
}

/* --- Details ("popup" storico, itinerario) -------------------------------- */
details.lore {
  background: rgba(43, 36, 29, 0.045);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  padding: 0.5rem;
  margin-top: 3rem;
}
details.lore summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  padding: 1.1rem 1.5rem;
  border-radius: var(--radius-core);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 1px 1px rgba(255, 255, 255, 0.6) inset;
  transition: background-color 0.5s var(--ease);
}
details.lore summary::-webkit-details-marker { display: none; }
details.lore summary:hover { background: rgba(255, 255, 255, 0.8); }
details.lore summary .chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: rgba(43, 36, 29, 0.07);
  transition: transform 0.6s var(--ease);
  flex: none;
}
details.lore[open] summary .chev { transform: rotate(45deg); }
details.lore summary .chev svg { width: 0.85rem; height: 0.85rem; }
details.lore .lore-body { padding: 1.75rem 1.5rem 1.25rem; }
details.lore .lore-body p + p { margin-top: 1.1rem; }

/* --- Itinerary (tappe) ----------------------------------------------------- */
.tappa {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
  padding: 3.5rem 0;
  border-top: 1px solid var(--hairline);
}
.tappa:nth-child(even) .tappa-media { order: 2; }
@media (max-width: 900px) {
  .tappa { grid-template-columns: 1fr; padding: 2.75rem 0; }
  .tappa:nth-child(even) .tappa-media { order: 0; }
}
.tappa-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--sage);
  display: block;
  margin-bottom: 0.4rem;
}
.tappa .date {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 1rem;
}
.tappa p + p { margin-top: 1rem; }

/* --- Film strip (slideshow) ------------------------------------------------ */
.strip {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding: 2.5rem 1.5rem 3rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.strip::-webkit-scrollbar { height: 6px; }
.strip::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 999px; }
.strip .bezel {
  flex: 0 0 auto;
  width: clamp(14rem, 30vw, 19rem);
  scroll-snap-align: center;
}
@media (min-width: 901px) {
  .strip .bezel:nth-child(odd) { transform: rotate(-1.5deg); }
  .strip .bezel:nth-child(even) { transform: rotate(1.5deg); }
}

/* --- Gallery (foto.html) --------------------------------------------------- */
.gallery {
  columns: 3;
  column-gap: 1.5rem;
}
.gallery .bezel {
  break-inside: avoid;
  margin-bottom: 1.5rem;
}
@media (max-width: 1000px) { .gallery { columns: 2; } }
@media (max-width: 640px) { .gallery { columns: 1; } }

/* --- B&B list -------------------------------------------------------------- */
.bnb-list {
  list-style: none;
  margin-top: 2.5rem;
  border-top: 1px solid var(--hairline);
  max-width: 40rem;
}
.bnb-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0.25rem;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--serif);
  font-size: 1.35rem;
}
.bnb-list li .n {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}

/* --- Contact / address block ----------------------------------------------- */
.address {
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--ink-soft);
  border-left: 2px solid var(--sage);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
}
.address strong {
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}

/* --- Footer ---------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  background: var(--cream-deep);
  padding: 5rem 0 3rem;
  text-align: center;
}
.site-footer .foot-monogram {
  font-family: var(--serif);
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}
.site-footer .foot-monogram .amp { font-style: italic; color: var(--sage); }
.site-footer .foot-date {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-footer nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.5rem;
  margin: 2.25rem 0;
}
.site-footer nav a {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.4s var(--ease);
}
.site-footer nav a:hover { color: var(--ink); }
.site-footer .foot-mail {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--sage);
  text-decoration: none;
  text-underline-offset: 4px;
}
.site-footer .foot-mail:hover { text-decoration: underline; }

/* --- Scroll reveal (skill §5C) ---------------------------------------------
   Hidden state applies only when JS is available (html.js). */
html.js .reveal {
  opacity: 0;
  transform: translateY(3rem);
  filter: blur(8px);
  transition: opacity 0.9s var(--ease-soft), transform 0.9s var(--ease-soft),
    filter 0.9s var(--ease-soft);
  transition-delay: var(--d, 0s);
}
html.js .reveal.is-in {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  html.js .reveal { opacity: 1; transform: none; filter: none; }
}
