/* Correzioni responsive globali per smartphone e tablet */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

.gprp-header,
.gprp-page,
.content,
.privacy-policy,
.hero,
main,
section,
article,
footer {
  max-width: 100%;
}

.gprp-header-inner > *,
.content > *,
.split > *,
.contact-page > *,
.formazione-page > *,
.pellegrinaggi-page > * {
  min-width: 0;
}

.gprp-menu-toggle {
  display: none;
}

@media screen and (max-width: 1024px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip !important;
  }

  .gprp-header {
    width: 100% !important;
  }

  .gprp-header-inner {
    position: relative;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    min-height: 68px !important;
    padding: 7px 10px !important;
    gap: 6px 8px !important;
  }

  .gprp-brand {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 102px) !important;
  }

  .gprp-brand-logo {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: min(72vw, 290px) !important;
    max-height: 58px !important;
    object-fit: contain !important;
    object-position: left center !important;
  }

  /* Facebook nell'header mobile */
  .gprp-facebook-link {
    flex: 0 0 40px !important;
    width: 40px !important;
    height: 40px !important;
    position: relative !important;
    top: 0 !important;
    margin: 0 !important;
    padding: 5px !important;
    border-radius: 8px !important;
    justify-content: center !important;
  }

  .gprp-facebook-logo {
    display: block !important;
    flex: 0 0 30px !important;
    width: 30px !important;
    height: 30px !important;
    object-fit: contain !important;
  }

  .gprp-facebook-text {
    display: none !important;
  }

  .gprp-menu-toggle {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin: 0 0 0 auto;
    padding: 9px;
    border: 1px solid rgba(118, 83, 41, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    color: #43372b;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
  }

  .gprp-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .gprp-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .gprp-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .gprp-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  html.gprp-js .gprp-menu-toggle {
    display: flex !important;
  }

  .gprp-navigation {
    order: 3;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    margin: 2px 0 0 !important;
    padding: 6px 0 4px !important;
    border-top: 1px solid rgba(118, 83, 41, 0.12);
    background: rgba(255, 255, 255, 0.98) !important;
    max-height: min(62vh, 460px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  html.gprp-js .gprp-navigation {
    display: none !important;
  }

  html.gprp-js .gprp-navigation.is-open {
    display: flex !important;
  }

  .gprp-navigation a {
    display: flex !important;
    width: 100% !important;
    min-height: 44px;
    justify-content: flex-start !important;
    padding: 12px 10px !important;
    border-radius: 7px !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    text-align: left !important;
  }

  .gprp-video-background {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100svh !important;
    max-width: 100% !important;
    object-fit: cover !important;
    object-position: 50% 14% !important;
    transform: none !important;
    transform-origin: center center !important;
  }

  .gprp-video-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
  }

  .hero {
    width: 100% !important;
    height: clamp(315px, 72vw, 430px) !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  .hero > img {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center center !important;
    transform: none !important;
  }

  .hero-copy {
    width: 100% !important;
    padding: 34px 16px 82px !important;
  }

  .hero-copy h1 {
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    font-size: clamp(27px, 6.8vw, 40px) !important;
    line-height: 1.12 !important;
    overflow-wrap: anywhere;
  }

  .hero-copy p {
    max-width: 92% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    font-size: clamp(15px, 4vw, 20px) !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere;
  }

  .content {
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    margin: -24px auto 22px !important;
    padding: 30px 18px 38px !important;
    border-radius: 16px !important;
    overflow: visible !important;
  }

  .privacy-policy {
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  .content img,
  .privacy-policy img,
  .split-media img,
  .contact-page img,
  .formazione-page img,
  .pellegrinaggi-page img {
    display: block;
    max-width: 100% !important;
    height: auto !important;
  }

  .split,
  .contact-grid,
  .formazione-grid,
  .pellegrinaggi-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .split-media,
  .split-content,
  .contact-form,
  .contact-card,
  .formazione-card,
  .pellegrinaggi-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .pilgrim h2,
  .contact-form-header p,
  .content h1,
  .content h2,
  .content h3,
  .privacy-policy h1,
  .privacy-policy h2,
  .privacy-policy h3 {
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  input,
  textarea,
  select,
  button {
    max-width: 100%;
  }

  table {
    max-width: 100%;
  }
}

@media screen and (max-width: 640px) {
  .gprp-header-inner {
    min-height: 62px !important;
    padding: 6px 8px !important;
  }

  .gprp-brand-logo {
    max-width: min(70vw, 245px) !important;
    max-height: 52px !important;
  }

  .hero {
    height: clamp(300px, 86vw, 390px) !important;
  }

  .hero > img {
    object-position: 50% 50% !important;
  }

  .hero-copy {
    justify-content: center !important;
    padding: 28px 14px 68px !important;
  }

  .hero-copy h1 {
    font-size: clamp(25px, 7.5vw, 34px) !important;
  }

  .content {
    width: calc(100% - 16px) !important;
    max-width: calc(100% - 16px) !important;
    margin: -18px auto 18px !important;
    padding: 25px 14px 32px !important;
    border-radius: 14px !important;
  }

  .privacy-policy {
    width: calc(100% - 16px) !important;
    max-width: calc(100% - 16px) !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .pilgrim {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .consecration {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .consecration-title {
    font-size: clamp(25px, 7vw, 31px) !important;
  }

  .consecration-text {
    font-size: 16px !important;
    line-height: 1.72 !important;
  }
}

@media screen and (max-width: 390px) {
  .gprp-brand-logo {
    max-width: 68vw !important;
    max-height: 48px !important;
  }

  .gprp-menu-toggle {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
  }

  .hero {
    height: 315px !important;
  }

  .content {
    width: calc(100% - 12px) !important;
    max-width: calc(100% - 12px) !important;
    padding: 22px 12px 30px !important;
  }
}
