/* Castello della Spizzichina — Home mobile hotfix
   Caricare DOPO spz-site.css oppure incollare alla fine del CSS globale. */

@media (max-width: 768px) {
  html, body { width: 100% !important; max-width: 100% !important; overflow-x: hidden !important; }

  body:not(.gridbox):not(.ba-edit-mode)[data-spz-page="home"] :is(
    .ba-section:has(.spz-gridbox-host),
    .ba-section:has(.spz-gridbox-host) > .ba-section-items,
    .ba-section:has(.spz-gridbox-host) .ba-row-wrapper,
    .ba-section:has(.spz-gridbox-host) .ba-row,
    .ba-section:has(.spz-gridbox-host) .column-wrapper,
    .ba-section:has(.spz-gridbox-host) .ba-grid-column-wrapper,
    .ba-section:has(.spz-gridbox-host) .ba-grid-column,
    .spz-gridbox-host,
    .spz-gridbox-host > .custom-html,
    .spz-main
  ) {
    width: 100% !important; max-width: 100vw !important; min-width: 0 !important;
    margin-right: 0 !important; margin-left: 0 !important; box-sizing: border-box !important;
  }

  body:not(.gridbox):not(.ba-edit-mode)[data-spz-page="home"] :is(
    .ba-section:has(.spz-gridbox-host),
    .ba-section:has(.spz-gridbox-host) > .ba-section-items,
    .ba-section:has(.spz-gridbox-host) .ba-row-wrapper,
    .ba-section:has(.spz-gridbox-host) .ba-row,
    .ba-section:has(.spz-gridbox-host) .column-wrapper,
    .ba-section:has(.spz-gridbox-host) .ba-grid-column-wrapper,
    .ba-section:has(.spz-gridbox-host) .ba-grid-column,
    .spz-gridbox-host,
    .spz-gridbox-host > .custom-html
  ) { padding-right: 0 !important; padding-left: 0 !important; }

  body[data-spz-page="home"] .spz-manifesto {
    display: flex !important; flex-direction: column !important; gap: 2.25rem !important;
    width: 100% !important; max-width: 100% !important; min-width: 0 !important;
    padding: 5rem max(1.25rem, env(safe-area-inset-right, 0px)) 5rem max(1.25rem, env(safe-area-inset-left, 0px)) !important;
    box-sizing: border-box !important; overflow: hidden !important;
  }
  body[data-spz-page="home"] .spz-manifesto,
  body[data-spz-page="home"] .spz-manifesto * { min-width: 0 !important; max-width: 100% !important; box-sizing: border-box !important; }
  body[data-spz-page="home"] .spz-manifesto-title,
  body[data-spz-page="home"] .spz-manifesto-copy { width: 100% !important; transform: none !important; }
  body[data-spz-page="home"] .spz-manifesto-title > span {
    width: 100% !important; margin: 0 0 1.75rem !important;
    font-size: clamp(3.1rem, 14.5vw, 4.4rem) !important; line-height: .82 !important;
    white-space: normal !important; overflow-wrap: anywhere !important; transform: none !important;
  }
  body[data-spz-page="home"] .spz-manifesto-title h2 {
    width: 100% !important; margin: 0 !important;
    font-size: clamp(2.1rem, 9.6vw, 3.15rem) !important; line-height: 1 !important;
    letter-spacing: -.035em !important; white-space: normal !important;
    overflow-wrap: anywhere !important; word-break: normal !important; text-wrap: pretty; transform: none !important;
  }
  body[data-spz-page="home"] .spz-manifesto-title h2 br { display: none !important; }
  body[data-spz-page="home"] .spz-manifesto-title h2 em { display: inline !important; }
  body[data-spz-page="home"] .spz-manifesto-copy > p {
    width: 100% !important; margin: 0 0 1.75rem !important;
    font-size: 1rem !important; line-height: 1.65 !important;
    white-space: normal !important; overflow-wrap: break-word !important;
  }

  body[data-spz-page="home"] .spz-wedding-focus {
    display: flex !important; flex-direction: column !important; justify-content: flex-start !important;
    gap: 3rem !important; width: 100% !important; max-width: 100% !important;
    min-height: 0 !important; height: auto !important;
    padding: calc(6rem + env(safe-area-inset-top, 0px)) 1.25rem calc(3.5rem + env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box !important; overflow: hidden !important; isolation: isolate;
  }
  body[data-spz-page="home"] .spz-wedding-focus-title,
  body[data-spz-page="home"] .spz-wedding-focus-copy {
    position: relative !important; inset: auto !important;
    top: auto !important; right: auto !important; bottom: auto !important; left: auto !important;
    width: 100% !important; max-width: 100% !important; min-width: 0 !important;
    margin: 0 !important; opacity: 1 !important; transform: none !important;
    clip-path: none !important; box-sizing: border-box !important;
  }
  body[data-spz-page="home"] .spz-wedding-focus-title {
    display: flex !important; flex-direction: column !important; flex: 0 0 auto !important;
    z-index: 2 !important; font-size: clamp(4.4rem, 20vw, 5.8rem) !important; line-height: .62 !important;
  }
  body[data-spz-page="home"] .spz-wedding-focus-title strong { margin-left: clamp(1.5rem, 10vw, 3.5rem) !important; }
  body[data-spz-page="home"] .spz-wedding-focus-copy { display: block !important; z-index: 2 !important; }
  body[data-spz-page="home"] .spz-wedding-focus-copy .spz-kicker { margin: 0 0 1rem !important; }
  body[data-spz-page="home"] .spz-wedding-focus-copy h2 {
    width: 100% !important; max-width: 100% !important; margin: 0 !important;
    font-size: clamp(2.25rem, 9.8vw, 3.2rem) !important; line-height: .98 !important;
    white-space: normal !important; overflow-wrap: break-word !important;
    word-break: normal !important; text-wrap: pretty; transform: none !important;
  }
  body[data-spz-page="home"] .spz-wedding-focus-copy > p:not(.spz-kicker) {
    width: 100% !important; margin: 1.5rem 0 !important;
    font-size: 1rem !important; line-height: 1.6 !important; overflow-wrap: break-word !important;
  }
  body[data-spz-page="home"] .spz-wedding-focus-copy .spz-inline-actions {
    display: flex !important; flex-direction: column !important; gap: .75rem !important;
    width: 100% !important; margin: 0 !important;
  }
  body[data-spz-page="home"] .spz-wedding-focus-copy .spz-button {
    display: flex !important; width: 100% !important; max-width: 100% !important;
    min-width: 0 !important; box-sizing: border-box !important;
  }
  body[data-spz-page="home"] .spz-wedding-focus > img,
  body[data-spz-page="home"] .spz-motion-ready .spz-wedding-focus > img {
    position: absolute !important; inset: 0 !important; z-index: 0 !important;
    width: 100% !important; min-width: 100% !important; max-width: none !important;
    height: 100% !important; margin: 0 !important; object-fit: cover !important; transform: none !important;
  }
  body[data-spz-page="home"] .spz-wedding-focus-shade { z-index: 1 !important; }

  body .spz-mobile-actions { height: calc(70px + env(safe-area-inset-bottom, 0px)) !important; }
  body .spz-mobile-actions a {
    gap: .3rem !important; color: var(--spz-ink) !important;
    font-size: .56rem !important; line-height: 1 !important;
  }
  body .spz-mobile-actions a:last-child { color: var(--spz-paper) !important; }
  body .spz-mobile-actions a > span {
    display: grid !important; place-items: center !important;
    width: 22px !important; height: 22px !important;
    font-size: 0 !important; line-height: 0 !important; color: inherit !important;
  }
  body .spz-mobile-actions a > span::before {
    content: ""; display: block; width: 21px; height: 21px; background: currentColor;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-size: contain; mask-size: contain;
  }
  body .spz-mobile-actions a:nth-child(1) > span::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.65' d='M7.1 3.5H4.6c-.6 0-1.1.5-1.1 1.1 0 8.8 7.1 15.9 15.9 15.9.6 0 1.1-.5 1.1-1.1v-2.5l-4.2-1.4-1.2 2.1a14.8 14.8 0 0 1-8.7-8.7l2.1-1.2z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.65' d='M7.1 3.5H4.6c-.6 0-1.1.5-1.1 1.1 0 8.8 7.1 15.9 15.9 15.9.6 0 1.1-.5 1.1-1.1v-2.5l-4.2-1.4-1.2 2.1a14.8 14.8 0 0 1-8.7-8.7l2.1-1.2z'/%3E%3C/svg%3E");
  }
  body .spz-mobile-actions a:nth-child(2) > span::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.55' d='M20.4 11.7a8.4 8.4 0 0 1-12.5 7.4L3.5 20.5l1.4-4.3A8.4 8.4 0 1 1 20.4 11.7Z'/%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.45' d='M8.1 7.6c.2-.4.4-.4.7-.4h.4c.2 0 .4.1.5.4l.8 2c.1.3 0 .5-.2.7l-.7.8c-.2.2-.1.4 0 .6.7 1.3 1.7 2.3 3 3 .2.1.4.2.6 0l.9-1.1c.2-.2.4-.3.7-.2l2 .9c.3.1.4.3.4.5 0 .7-.3 1.5-.8 1.9-.5.4-1.2.7-2 .7-1.1 0-2.8-.6-4.5-2.1-1.4-1.2-2.7-3-3.1-4.4-.4-1.3 0-2.6.5-3.3Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.55' d='M20.4 11.7a8.4 8.4 0 0 1-12.5 7.4L3.5 20.5l1.4-4.3A8.4 8.4 0 1 1 20.4 11.7Z'/%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.45' d='M8.1 7.6c.2-.4.4-.4.7-.4h.4c.2 0 .4.1.5.4l.8 2c.1.3 0 .5-.2.7l-.7.8c-.2.2-.1.4 0 .6.7 1.3 1.7 2.3 3 3 .2.1.4.2.6 0l.9-1.1c.2-.2.4-.3.7-.2l2 .9c.3.1.4.3.4.5 0 .7-.3 1.5-.8 1.9-.5.4-1.2.7-2 .7-1.1 0-2.8-.6-4.5-2.1-1.4-1.2-2.7-3-3.1-4.4-.4-1.3 0-2.6.5-3.3Z'/%3E%3C/svg%3E");
  }
  body .spz-mobile-actions a:nth-child(3) > span::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6'%3E%3Crect width='18' height='14' x='3' y='5' rx='1.5'/%3E%3Cpath d='m4 7 8 6 8-6'/%3E%3C/g%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6'%3E%3Crect width='18' height='14' x='3' y='5' rx='1.5'/%3E%3Cpath d='m4 7 8 6 8-6'/%3E%3C/g%3E%3C/svg%3E");
  }

  body .spz-button > i {
    position: relative !important; flex: 0 0 18px !important;
    width: 18px !important; height: 18px !important;
    font-size: 0 !important; line-height: 0 !important; color: inherit !important;
  }
  body .spz-button > i::before {
    content: ""; position: absolute; top: 3px; right: 2px;
    width: 8px; height: 8px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor;
  }
  body .spz-button > i::after {
    content: ""; position: absolute; top: 9px; left: 3px;
    width: 12px; height: 1.5px; background: currentColor;
    transform: rotate(-45deg); transform-origin: center;
  }
}

@media (max-width: 380px) {
  body[data-spz-page="home"] .spz-manifesto-title h2,
  body[data-spz-page="home"] .spz-wedding-focus-copy h2 {
    font-size: clamp(2rem, 9.4vw, 2.65rem) !important;
  }
}
