/* Shared sizing and touch behavior, including Safari's date controls. */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 100px; }
body { overflow-wrap: break-word; }
main, section, nav, form, figure { min-width: 0; }
.intro > *, .editorial-grid > *, .floor-section > *, .split-feature > *,
.experience-spotlight > *, .experiences-heading > *, .territory-grid > *,
.availability-section > *, .booking-section > *, footer > * { min-width: 0; }
button, input, select, textarea { font-family: var(--sans); }
button, .button, .social-link { touch-action: manipulation; }
.button { min-height: 44px; text-align: center; font-size: 1rem; }
.button-small { font-size: .86rem; }
.social-link, .footer-links > a { min-height: 44px; }
.social-links, .contact-socials { flex-wrap: wrap; gap: 8px 22px; }
.footer-links > a { display: flex; align-items: center; }
footer a, .direct-contacts a { overflow-wrap: anywhere; }
.availability-widget label, .booking-form label { min-width: 0; }
.availability-widget input, .availability-widget select,
.booking-form input, .booking-form select, .booking-form textarea {
  min-width: 0; max-width: 100%; font-size: 16px; line-height: 1.4;
  min-height: 48px; letter-spacing: normal; border-radius: 0;
}
input[type=date] { -webkit-appearance: none; appearance: none; }
input[type=date]::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; }
.booking-form textarea { resize: vertical; }
.legal-check { min-height: 44px; }
.legal-check input { min-height: 20px; height: 20px; min-width: 20px; flex-shrink: 0; }
.form-note { font-size: .86rem; opacity: 1; color: #575950; }
.form-honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.form-feedback:empty { display: none; }
.form-feedback { padding: 16px; background: #e8e5dc; border-left: 3px solid var(--gold); }
.form-feedback.error, .form-feedback.unavailable { background: #f3e0dc; border-color: #a24e42; }
.form-feedback.success, .form-feedback.available { background: #e3ede4; border-color: #4f755a; }
.form-feedback strong, .form-feedback span { display: block; }
.form-feedback span { margin-top: 6px; }
.pending-dot { background: #c5a66a; }
#calendar-grid[data-availability=pending] .calendar-day:not(.selected):not(.in-range) { background: #efede6; }
.booking-form button:disabled { cursor: progress; opacity: .65; }
.calendar-status { font-size: .86rem; line-height: 1.5; margin: 18px 0 0; }
.calendar-header { grid-template-columns: 44px minmax(0, 1fr) 44px; }
.calendar-header button { height: 44px; width: 44px; }
.calendar-header h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.calendar-day, .calendar-blank { min-height: 44px; }
.calendar-day { padding: 2px; }
.calendar-day.unknown { background: #f1eee5; }
.calendar-legend { line-height: 1.5; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 12px 18px; background: var(--cream); color: var(--ink); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.skip-link:not(:focus) { clip-path: inset(50%); }

/* Tablet landscape: keep comfortable columns for photos; stack the forms. */
@media (min-width: 901px) and (max-width: 1180px) {
  .availability-section, .booking-section { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .availability-tools, .booking-form { width: 100%; max-width: 760px; }
  .floor-copy { padding: 64px 4vw; }
  .floor-copy h2, .split-feature h2 { font-size: clamp(2.8rem, 4.5vw, 4rem); }
  .split-feature > div, .experience-spotlight > div { padding: 70px 4vw; }
  .room-gallery-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .experience-card { padding: 32px; }
  .experience-cta, .page-cta { gap: 30px; }
  .experience-cta .button, .page-cta .button { flex-shrink: 0; }
  footer { grid-template-columns: .65fr 1fr 1fr; gap: 24px; padding-inline: 5vw; }
  footer > img { max-width: 100%; }
}

@media (max-width: 1024px) {
  .site-header { padding: 18px max(5vw, env(safe-area-inset-left)); }
  .site-header.solid { position: relative; }
  .site-header.has-menu.menu-is-open { position: fixed; background: var(--ink); }
  .brand img { width: 156px; height: 54px; }
  /* Simple legal-page navigation stays visible even without JavaScript. */
  .main-nav { position: static; visibility: visible; opacity: 1; pointer-events: auto; transform: none; min-height: 0; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; gap: 8px 18px; padding: 0; background: transparent; }
  .main-nav a { font-size: .95rem; min-height: 44px; display: inline-flex; align-items: center; }
  .main-nav .button { margin: 0; }
  .menu-toggle { display: none; }
  .has-menu .menu-toggle { display: grid; grid-template-columns: auto 14px; align-items: center; column-gap: 9px; min-height: 44px; min-width: 86px; padding: 10px 12px; background: transparent; border: 1px solid #fff; color: #fff; font-size: .86rem; }
  .has-menu .menu-toggle::before, .has-menu .menu-toggle::after { content: ''; grid-column: 2; grid-row: 1; width: 14px; border-top: 1px solid currentColor; transition: transform .2s ease; }
  .has-menu .menu-toggle::before { transform: translateY(-3px); }
  .has-menu .menu-toggle::after { transform: translateY(3px); }
  .has-menu .menu-toggle.open::before { transform: rotate(45deg); }
  .has-menu .menu-toggle.open::after { transform: rotate(-45deg); }
  .has-menu .main-nav { visibility: hidden; opacity: 0; pointer-events: none; position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px); overflow-y: auto; overscroll-behavior: contain; background: var(--ink); padding: 20px 5vw max(28px, env(safe-area-inset-bottom)); flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: 8px; }
  .has-menu .main-nav.open { visibility: visible; opacity: 1; pointer-events: auto; }
  .has-menu .main-nav a { font-size: 1.1rem; padding: 8px 12px; }
  .has-menu .main-nav .active { border-bottom: 0; background: #ffffff12; }
  .has-menu .main-nav .button { margin-top: 8px; align-self: flex-start; }
}

@media (max-width: 900px) {
  .hero { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; padding: 145px 5vw 0; }
  .hero-content { width: 100%; padding-bottom: 48px; }
  .hero h1 { font-size: clamp(3rem, 8.8vw, 5.7rem); }
  .hero-lead { font-size: 1.05rem; }
  .quick-facts { position: relative; left: auto; right: auto; margin: 0 -5vw; padding: 18px 5vw max(18px, env(safe-area-inset-bottom)); grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .quick-facts span { white-space: normal; }
  .page-hero { min-height: 72vh; min-height: 72svh; padding: 145px 5vw 64px; }
  .page-hero h1 { font-size: clamp(2.8rem, 8.5vw, 5.4rem); line-height: 1.02; }
  .page-hero p:last-child { font-size: 1.05rem; }
  .intro, .editorial-grid, .territory-grid, .home-booking, .booking-section, .availability-section, .experiences-heading { gap: 32px; }
  .section, .experiences-section, .home-booking, .booking-section, .availability-section, .page-cta, .experience-cta { padding: 64px 5vw; }
  .section h2, .home-booking h2, .floor-copy h2, .split-feature h2, .experiences-heading h2, .experience-cta h2, .page-cta h2, .booking-section h2 { font-size: clamp(2.5rem, 6.6vw, 4.4rem); line-height: 1.06; }
  .experience-spotlight h2 { font-size: clamp(2.8rem, 7vw, 4.8rem); }
  .availability-section h1, .legal-page h1 { font-size: clamp(2.7rem, 8vw, 4.8rem); line-height: 1.05; }
  .floor-section { min-height: 0; }
  .floor-copy, .split-feature > div, .experience-spotlight > div { padding: 56px 5vw; }
  .floor-section > img, .split-feature > img, .experience-spotlight > img, .territory-grid img { height: auto; min-height: 0; max-height: 620px; aspect-ratio: 4 / 3; }
  .page-cards { padding: 0 5vw 64px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .page-card img { height: auto; aspect-ratio: 4 / 3; }
  .page-card h2 { font-size: 2.1rem; }
  .experience-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .experience-card { min-height: 0; padding: 28px; }
  .experience-card h3 { font-size: clamp(2rem, 4.5vw, 3rem); }
  .experience-cta, .page-cta { align-items: flex-start; flex-direction: column; gap: 28px; }
  .experiences-heading { margin-bottom: 36px; }
  .experiences-heading > p:last-child { margin: 0; }
  .room-gallery, .room-gallery-four { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 5vw 64px; gap: 20px 14px; }
  .room-gallery img { height: auto; min-height: 0; max-height: none; aspect-ratio: 4 / 3; }
  .room-gallery figcaption { font-size: .82rem; }
  .availability-tools { max-width: 720px; width: 100%; }
  .availability-widget { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 24px; }
  .availability-widget .full { grid-column: 1 / -1; }
  .calendar-day, .calendar-blank { aspect-ratio: auto; height: clamp(44px, 8vw, 64px); }
  .booking-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
  .booking-form .full { grid-column: 1 / -1; }
  .legal-page { padding: 60px 5vw 80px; }
  footer { padding: 48px 5vw; gap: 28px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  footer > img { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .site-header { padding-block: 14px; gap: 12px; }
  .brand img { width: 135px; height: 48px; }
  .hero { padding-top: 132px; min-height: 100svh; }
  .hero h1 { font-size: clamp(2.65rem, 10.5vw, 3.9rem); line-height: 1.02; }
  .hero-lead { margin-block: 24px; }
  .hero-content { padding-bottom: 36px; }
  .hero-actions { flex-direction: column; align-items: flex-start; gap: 14px; }
  .hero-actions .text-link { display: inline-flex; align-items: center; min-height: 44px; }
  .quick-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
  .page-hero { padding-block: 135px 48px; min-height: 70svh; }
  .page-hero h1 { font-size: clamp(2.55rem, 10.5vw, 4rem); }
  .page-hero p:last-child { margin-bottom: 0; }
  .eyebrow { font-size: .7rem; letter-spacing: .16em; }
  .section, .experiences-section, .home-booking, .booking-section, .availability-section, .page-cta, .experience-cta { padding-block: 48px; }
  .floor-copy, .split-feature > div, .experience-spotlight > div { padding-block: 44px; }
  .page-cards, .experience-grid, .booking-form, footer { grid-template-columns: minmax(0, 1fr); }
  .page-cards { gap: 32px; }
  .page-card h2 { font-size: 2.5rem; }
  .experience-card { padding: 28px 22px; }
  .experience-card h3 { font-size: 2.35rem; }
  .experience-card > span { letter-spacing: .06em; }
  .floor-index { padding-inline: 5vw; }
  .floor-index a { padding-block: 14px; font-size: .82rem; gap: 2px; }
  .floor-index a + a { padding-left: 12px; }
  .floor-details { gap: 12px; font-size: .84rem; }
  .room-gallery { padding-bottom: 44px; }
  .room-gallery:not(.room-gallery-four) figure:last-child { grid-column: 1 / -1; }
  .room-gallery figcaption { font-size: .78rem; }
  .availability-calendar { padding: 18px 10px; }
  .calendar-header { margin-bottom: 16px; gap: 8px; }
  .calendar-weekdays, .calendar-grid { gap: 2px; }
  .calendar-weekdays span { font-size: .64rem; letter-spacing: 0; }
  .calendar-legend { gap: 8px 16px; padding-inline: 4px; }
  .calendar-status { padding-inline: 4px; }
  .calendar-day { font-size: .9rem; }
  .availability-widget, .booking-form { padding: 20px 16px; }
  .availability-widget { grid-template-columns: minmax(0, 1fr); }
  .availability-widget .button { width: 100%; }
  .availability-result { padding: 14px; }
  .direct-contacts { font-size: 1rem; }
  footer > img { grid-column: auto; }
  .legal-page h1 { font-size: clamp(2.5rem, 10vw, 3.4rem); }
}

@media (max-width: 1024px) and (orientation: landscape) and (max-height: 600px) {
  .hero, .page-hero { min-height: 100svh; padding-top: 120px; }
  .hero h1, .page-hero h1 { font-size: clamp(2.5rem, 6vw, 4rem); }
  .hero-content { padding-bottom: 30px; }
}
@media (hover: none) { .button:hover { transform: none; } }

/* Keep event contact headings below the fixed navigation on direct links. */
#eventi-privati { scroll-margin-top: 120px; }

/* Static copyright notice remains visible even without JavaScript. */
footer > .footer-copyright {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid currentColor;
  font-size: .82rem;
  line-height: 1.6;
}
.legal-footer > .footer-copyright { margin-top: 20px; }

/* Exclude visibility on open: even reduced-motion duration overrides must not
   delay focusability. Opacity/transform and the closing fade remain unchanged. */
.main-nav.open { transition: opacity .2s ease, transform .2s ease; }

/* COM-02: equal access to stays and events, without sharing their booking flow. */
.intent-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 16px; margin-top: 28px; }
.intent-actions > .button { display: inline-flex; align-items: center; justify-content: center; flex: 1 1 220px; max-width: 340px; }
.intent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin-top: 32px; }
.intent-card { min-width: 0; padding: clamp(24px, 4vw, 48px); background: var(--brand-paper); border: 1px solid var(--brand-line-soft); display: flex; flex-direction: column; align-items: flex-start; }
.intent-card h2, .intent-card h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 3vw, 3rem); line-height: 1.1; margin: 0 0 16px; }
.intent-card > .button { margin-top: auto; }
.intent-card > p:last-of-type { margin-bottom: 28px; }
.hero .hero-payoff { font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.2; margin: 24px 0 0; }
.hero > .hero-shade { background: linear-gradient(90deg, #102b21e6 0%, #102b21c2 55%, #102b2166 100%), linear-gradient(0deg, #0d251e80, transparent 45%); }
.hero .hero-actions.intent-actions { align-items: stretch; flex-direction: row; max-width: 680px; }
.booking-intro { padding-bottom: 56px; border-bottom: 1px solid var(--brand-line-soft); }
.booking-intro h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(3rem, 6.4vw, 6.5rem); line-height: 1.05; margin: 0; max-width: 1100px; }
.booking-intro > p:not(.eyebrow) { max-width: 760px; font-size: 1.12rem; }
.booking-intro .intent-actions { max-width: 680px; }
.availability-section > div > h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.8rem, 4.5vw, 4.8rem); line-height: 1.05; margin: 0 0 24px; }
#soggiorni, #richiesta-soggiorno, #booking-form { scroll-margin-top: 120px; }
.faq-section { padding-block: 64px; }
.faq-list { margin-top: 32px; max-width: 960px; }
.faq-list details { border-top: 1px solid var(--brand-line); }
.faq-list details:last-child { border-bottom: 1px solid var(--brand-line); }
.faq-list summary { padding: 20px 8px; cursor: pointer; font-weight: 600; }
.faq-list summary:focus-visible { outline: 3px solid var(--brand-focus); outline-offset: 3px; }
.faq-list details > p { margin: 0; padding: 0 8px 24px; max-width: 850px; }
@media (max-width: 700px) {
  .hero > .hero-shade { background: linear-gradient(90deg, #102b21d9, #102b21b3); }
  .intent-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .intent-actions > .button { max-width: none; }
  .hero .hero-actions.intent-actions { gap: 12px; }
  .booking-intro { padding-top: 48px; }
}
