/* Fiore di maggio: trasparente sul cielo, calce sul racconto. */
.nav, .page-sub .nav:not(.away) {
  --nav-ink: #f7f2e9;
  display: grid; grid-template-columns: 230px minmax(0, 1fr); align-items: center;
  column-gap: clamp(24px, 4vw, 64px); min-height: 102px;
  padding: 12px clamp(24px, 4vw, 64px); color: var(--nav-ink);
  background: linear-gradient(180deg, rgba(8, 12, 22, .28), transparent);
  border-bottom: 1px solid rgba(247, 242, 233, .17);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  transition: background-color .3s, border-color .3s, color .3s, min-height .3s;
}
.nav.away, .nav.open {
  --nav-ink: #514249; min-height: 82px; padding: 8px clamp(24px, 4vw, 64px);
  background: #f7f2e9; border-color: #ded6ce;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.nav.away:not(.open) {
  --nav-ink: #493f45;
  min-height: 72px;
  padding-top: 6px;
  padding-bottom: 6px;
  background: rgba(230, 224, 216, .82);
  border-color: rgba(81, 66, 73, .12);
  backdrop-filter: blur(18px) saturate(.7);
  -webkit-backdrop-filter: blur(18px) saturate(.7);
}
.nav.away:not(.open) .brand-logo img { width: 205px; }
.page-sub .nav:not(.away):not(.open) { background: linear-gradient(180deg, rgba(8, 12, 22, .72), rgba(8, 12, 22, .25)); }
.nav a { color: var(--nav-ink); text-shadow: none; }
.nav a:hover { opacity: 1; }
.nav .brand-logo { position: relative; z-index: 2; width: 230px; }
.nav .brand-logo img { display: block; width: 230px; height: auto; filter: brightness(0) invert(95%) sepia(12%) saturate(258%) hue-rotate(339deg); }
.nav.away .brand-logo img, .nav.open .brand-logo img { width: 230px; height: auto; filter: none; }
.nav .nav-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav .nav-links {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(22px, 2.3vw, 38px); margin: 0 auto;
  font-size: 14px; font-weight: 400; letter-spacing: .015em; text-transform: none;
}
.nav .nav-links a { display: flex; align-items: center; position: relative; min-height: 44px; white-space: nowrap; }
.nav .nav-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 5px;
  width: auto; height: 1px; margin: 0; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform .22s;
}
.nav .nav-links a:hover::after, .nav .nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav .nav-cta {
  display: inline-flex; justify-content: center; align-items: center; gap: 16px;
  min-height: 46px; padding: 11px 18px; border: 1px solid currentColor; border-radius: 3px;
  background: transparent; backdrop-filter: none;
  font-size: 13px; font-weight: 400; letter-spacing: .015em; text-transform: none; white-space: nowrap;
  transition: background-color .2s, color .2s;
}
.nav .nav-cta span { font-size: 19px; line-height: 1; }
.nav .nav-cta:hover { background: #f7f2e9; color: #514249; }
.nav.away:not(.open) .nav-cta { border-color: rgba(73, 63, 69, .3); min-height: 42px; padding-top: 9px; padding-bottom: 9px; }
.nav.away:not(.open) .nav-cta:hover { background: rgba(247, 242, 233, .36); border-color: rgba(73, 63, 69, .55); color: var(--nav-ink); }
.nav.away .nav-cta:hover, .nav.open .nav-cta:hover { background: #67476e; border-color: #67476e; color: #f7f2e9; }
.nav .nav-toggle, .nav .nav-place { display: none; }
.nav a:focus-visible, .nav button:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
.nav .nav-actions { display: flex; align-items: center; justify-content: flex-end; gap: 20px; }
.language-switch { position: relative; color: var(--nav-ink); }
.language-switch summary { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none; }
.language-switch summary::-webkit-details-marker { display: none; }
.language-current { font: italic 500 20px/1.2 'Cormorant Garamond', Georgia, serif; }
.language-code { display: none; text-transform: uppercase; font-size: 12px; letter-spacing: .08em; }
.language-mark { font-size: 16px; transition: transform .25s; }
.language-switch[open] .language-mark { transform: rotate(45deg); }
.language-switch summary:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.language-sheet { position: absolute; right: 0; top: calc(100% + 16px); width: 310px; padding: 28px; color: #514249; background: #f7f2e9; border: 1px solid #ded6ce; box-shadow: 0 16px 50px rgba(20,15,26,.18); }
.language-sheet > p { margin: 0 0 20px; font: 500 28px/1.12 'Cormorant Garamond', Georgia, serif; }
.language-sheet > p em { color: #67476e; }
.nav .language-sheet a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; border-top: 1px solid #ded6ce; color: #514249; font: 500 21px/1.3 'Cormorant Garamond', Georgia, serif; }
.language-sheet small { font: 400 10px/1.4 'Outfit', sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.nav .language-sheet a[aria-current] { color: #67476e; font-style: italic; }
.nav .language-sheet a:hover span { text-decoration: underline; text-underline-offset: 4px; }
@media (min-width: 1281px) {
  .nav, .page-sub .nav:not(.away) {
    grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr);
  }
  .nav .nav-panel { display: contents; }
  .nav .brand-logo { grid-column: 1; justify-self: start; }
  .nav .nav-links { grid-column: 2; margin: 0; }
  .nav .nav-actions { grid-column: 3; justify-self: end; }
}
@media (max-width: 1280px) {
  .nav, .nav.away, .page-sub .nav:not(.away) { grid-template-columns: minmax(0, 1fr) auto; min-height: 88px; padding: 10px 24px; gap: 16px; }
  .nav .brand-logo, .nav .brand-logo img, .nav.away .brand-logo img, .nav.open .brand-logo img { width: 210px; height: auto; }
  .nav.away:not(.open) .brand-logo img { width: 190px; }
  .nav.nav-ready .nav-panel { display: none; }
  .nav.nav-ready .nav-toggle {
    display: flex; align-items: center; justify-content: flex-end; gap: 14px;
    position: relative; z-index: 2; min-height: 48px; padding: 8px 0 8px 8px;
    border: 0; background: transparent; color: var(--nav-ink);
    font: inherit; font-size: 14px; letter-spacing: .02em; cursor: pointer;
  }
  .nav-toggle-icon { display: flex; flex-direction: column; justify-content: center; gap: 6px; width: 24px; height: 24px; }
  .nav-toggle-icon i { display: block; width: 24px; height: 1px; background: currentColor; transition: transform .25s; }
  .nav.open .nav-toggle-icon i:first-child { transform: translateY(3.5px) rotate(45deg); }
  .nav.open .nav-toggle-icon i:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .nav.open, .page-sub .nav.open:not(.away) { --nav-ink: #514249; background: #f7f2e9; }
  .nav.open .nav-panel {
    position: fixed; inset: 0; z-index: 1; display: flex; flex-direction: column;
    align-items: stretch; justify-content: flex-start; gap: 28px; height: 100dvh;
    overflow-y: auto; overscroll-behavior: contain;
    padding: 116px max(24px, calc((100vw - 680px) / 2)) 28px;
    background: #f7f2e9; animation: navigation-enter .25s ease-out;
  }
  .nav.open .nav-links {
    display: flex; position: static; inset: auto; flex-direction: column;
    align-items: stretch; justify-content: flex-start; gap: 0; width: 100%; background: transparent;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(30px, 5.5vw, 44px); line-height: 1.2; letter-spacing: -.02em;
  }
  .nav.open .nav-links a { min-height: 66px; padding: 12px 0; border-bottom: 1px solid #ded6ce; }
  .nav.open .nav-links a::after { display: none; }
  .nav.open .nav-links a[aria-current="page"] { color: #67476e; font-style: italic; }
  .nav.open .nav-cta { align-self: flex-start; min-height: 50px; }
  .nav .nav-actions { flex-direction: column; align-items: stretch; gap: 24px; }
  .nav .language-switch { width: 100%; }
  .nav .language-switch summary { justify-content: flex-start; }
  .language-sheet { position: static; width: auto; margin-top: 10px; padding: 22px 0 0; border: 0; border-top: 1px solid #ded6ce; box-shadow: none; }
  .language-sheet nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 24px; }
  .nav .language-sheet a { border-top: 0; border-bottom: 1px solid #ded6ce; }
  .nav.open .nav-place { display: block; margin: auto 0 0; padding-top: 20px; color: #756b6a; font-size: 12px; letter-spacing: .04em; }
  .nav-place span { padding: 0 8px; }
  /* Senza JavaScript i link restano accessibili. */
  .nav:not(.nav-ready) { position: absolute; background: #f7f2e9; --nav-ink: #514249; }
  .nav:not(.nav-ready) .brand-logo img { filter: none; }
  .nav:not(.nav-ready) .nav-panel { grid-column: 1 / -1; flex-wrap: wrap; }
  .nav:not(.nav-ready) .nav-links { flex-wrap: wrap; margin: 0; gap: 8px 20px; }
}
@media (max-width: 420px) {
  .nav, .nav.away, .page-sub .nav:not(.away) { min-height: 80px; padding: 8px 20px; gap: 8px; }
  .nav .brand-logo, .nav .brand-logo img, .nav.away .brand-logo img, .nav.open .brand-logo img { width: 190px; height: auto; }
  .nav.away:not(.open) .brand-logo img { width: 180px; }
  .nav.nav-ready .nav-toggle { gap: 10px; }
  .nav.open .nav-panel { padding: 100px 24px 24px; }
}
@keyframes navigation-enter { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .nav, .nav *, .nav *::after { transition: none !important; animation: none !important; }
}
