.novita-dialog {
  --novita-altezza: calc(100dvh - 2 * clamp(.5rem, 3vh, 1.5rem));
  position: fixed;
  inset: 0;
  inline-size: min(calc(100% - 2 * clamp(.5rem, 3vw, 2rem)), 74rem);
  max-inline-size: 100%;
  max-block-size: var(--novita-altezza);
  margin: auto;
  padding: 0;
  overflow: clip;
  border: 0;
  border-radius: .35rem .35rem 2.45rem .35rem;
  background: var(--light);
  color: var(--blu-porto);
  box-shadow: 0 2rem 6rem rgb(11 31 43 / 42%);
}
.novita-dialog::backdrop { background: rgb(9 29 43 / 67%); }
:root:has(.novita-dialog[open]) {
  overflow: hidden;
  scrollbar-gutter: stable;
}
.novita-pannello {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  max-block-size: var(--novita-altezza);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.novita-contenuto { min-inline-size: 0; overflow-wrap: anywhere; }
.novita-foto {
  position: relative;
  min-block-size: clamp(24rem, 66vh, 37rem);
  overflow: hidden;
  background: var(--blu-porto);
}
.novita-foto img {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: 50% 48%;
}
.novita-foto::after {
  content: "";
  position: absolute;
  inset: clamp(.55rem, 1.35vw, 1.2rem);
  border: 1px solid rgb(255 253 248 / 74%);
  border-start-end-radius: 2rem;
  pointer-events: none;
}
.novita-contenuto {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  align-content: center;
  gap: clamp(.9rem, 2.25vh, 1.55rem);
  padding: 4.25rem clamp(1.7rem, 4vw, 4.4rem) 3.75rem;
  background: linear-gradient(147deg, var(--light) 61%, #e8f4f8 100%);
}
.novita-stagione {
  width: fit-content;
  max-width: 100%;
  padding: .48em .76em;
  border-radius: .14rem .14rem .75rem .14rem;
  background: #e4f2f7;
  color: var(--blu-porto);
  font: 770 .91rem/1.35 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.novita-contenuto h2 {
  font: 550 clamp(2.85rem, 5.3vw, 5.55rem)/.95 var(--display);
  letter-spacing: -.042em;
}
.novita-contenuto h2 em { display: block; color: var(--blu-azione); }
.novita-contenuto > p:not(.novita-stagione) {
  max-inline-size: 34ch;
  overflow-wrap: anywhere;
  font: 535 1.07rem/1.64 var(--sans);
}
.novita-azione {
  display: inline-flex;
  align-items: center;
  gap: .6em 1.15em;
  min-block-size: 50px;
  max-inline-size: 100%;
  padding: .65rem 1.2rem;
  border-radius: .22rem .22rem .9rem .22rem;
  background: var(--blu-azione);
  color: white;
  font: 720 .98rem/1.36 var(--sans);
  overflow-wrap: anywhere;
  text-decoration: none;
}
.novita-azione:hover { background: var(--blu-porto); }
.novita-azione:focus-visible { outline: 2px solid var(--blu-porto); outline-offset: 3px; }
.novita-chiusura { position: absolute; z-index: 1; inset: .85rem .85rem auto auto; }
.novita-chiudi {
  display: grid;
  place-items: center;
  min-inline-size: 44px;
  min-block-size: 44px;
  padding: 0;
  border: 1px solid #9eb9c4;
  border-radius: 50%;
  background: var(--light);
  color: var(--blu-porto);
  cursor: pointer;
}
.novita-chiudi span { position: relative; display: block; width: 18px; height: 18px; }
.novita-chiudi span::before, .novita-chiudi span::after {
  content: "";
  position: absolute;
  inset: 8px 0 auto;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
}
.novita-chiudi span::after { transform: rotate(-45deg); }
.novita-chiudi:hover { background: #e4f2f7; }
.novita-chiudi:focus-visible {
  outline: none;
  border-color: var(--blu-porto);
  background: var(--blu-porto);
  color: white;
}
@media (forced-colors: active) {
  .novita-chiudi:focus-visible { border: 2px solid Highlight; }
}
@media (max-width: 48rem) {
  .novita-dialog { inline-size: min(calc(100% - 1.3rem), 32rem); }
  .novita-pannello { grid-template-columns: minmax(0, 1fr); }
  .novita-foto { min-block-size: clamp(108px, 28svh, 15rem); }
  .novita-foto img { object-position: center 47%; }
  .novita-contenuto { padding: clamp(1rem, 5vw, 2rem); gap: .84rem; }
  .novita-contenuto h2 { font-size: clamp(2rem, 1.55rem + 5.6vw, 3.8rem); }
  .novita-chiusura { inset: .65rem .65rem auto auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .novita-dialog[open] { animation: novita-pannello .48s cubic-bezier(.16, 1, .3, 1) both; }
  .novita-dialog[open] .novita-foto { animation: novita-foto .68s .05s cubic-bezier(.2, .75, .3, 1) both; }
  .novita-dialog[open] .novita-contenuto > :is(p, h2) { animation: novita-testo .52s .11s ease-out both; }
  .novita-dialog[open] .novita-contenuto h2 { animation-delay: .18s; }
  .novita-dialog[open] .novita-contenuto > p:last-of-type { animation-delay: .23s; }

  @keyframes novita-pannello {
    from { opacity: 0; transform: translateY(18px) scale(.973); }
    to { opacity: 1; transform: none; }
  }
  @keyframes novita-foto {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0); }
  }
  @keyframes novita-testo {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
  }
}

.novita-contenuto:has(.novita-lettura) { padding-inline: clamp(1.25rem, 3vw, 3rem); }
.novita-contenuto:has(.novita-lettura) > #testo-novita { max-inline-size: 50ch; }
.novita-lettura { width: 100%; }
.novita-lettura summary {
  width: fit-content;
  min-height: 44px;
  align-content: center;
  cursor: pointer;
  color: var(--blu-azione);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .22em;
}
.novita-lettura summary:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.novita-lettura > p { max-inline-size: 50ch; font: 535 1.07rem/1.64 var(--sans); }
.novita-lettura:not([open]) .novita-riduci,
.novita-lettura[open] .novita-leggi,
.novita-contenuto:has(.novita-lettura[open]) .novita-puntini { display: none; }
@media (max-width: 48rem) {
  .novita-pannello:has(.novita-lettura) .novita-foto { min-block-size: clamp(5rem, 16svh, 8rem); }
}
