.site-brand { display: block; width: clamp(135px, 16vw, 180px); height: auto; }
.footer-brand { display: inline-flex; width: fit-content; }
.mobile-menu { display: none; }
.mobile-menu summary {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 0 14px;
  list-style: none;
  border: 1px solid #718596;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu nav {
  position: absolute;
  inset: 100% 0 auto;
  display: grid;
  background: #fff;
  padding: 12px max(20px, 4vw);
  box-shadow: 0 14px 28px #10233a26;
}
.mobile-menu a { padding: 10px 6px; min-height: 44px; color: #10233a; }

section[aria-labelledby="hero-t"],
article[aria-labelledby="hero-t"] > header,
main > .hero,
main section[aria-labelledby="form-t"] {
  background-image: linear-gradient(100deg, rgb(249 248 244 / .96), rgb(234 245 249 / .83)), url("background.webp") !important;
  background-size: cover !important;
  background-position: center !important;
}
section[aria-labelledby="hero-t"] > svg[aria-hidden="true"] { display: none; }

.visual-media {
  display: block;
  position: relative;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  background: #e5f1f5;
}
.visual-media > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.visual-media > img[src$="/hero.webp"] { object-position: 82% center; }
.visual-media.media-contain > img { object-fit: contain; }
.visual-media.body-map { aspect-ratio: 2 / 3 !important; }
.body-map span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: clamp(23px, 3vw, 30px);
  aspect-ratio: 1;
  color: #10233a;
  background: #fff;
  border-radius: 50%;
  border: 2px solid #0a678e;
  font-size: 14px;
  font-weight: 700;
}
.visual-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
  margin-top: 36px;
}
.visual-hero-copy { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hero-cover { aspect-ratio: 4 / 3; border-radius: 24px; box-shadow: 0 16px 48px #10233a20; }
main [aria-labelledby="hero-t"] .visual-media { border-radius: 24px; }
.hero .media .visual-media {
  border: 1px solid #d8e6ee;
  box-shadow: 0 14px 36px rgb(16 35 58 / .12);
}
[role="tab"] {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid #718596;
  border-radius: 999px;
  background: #fff;
  color: #0d223a;
  font: 600 16px/1.2 Inter, sans-serif;
  cursor: pointer;
}
[role="tab"][aria-selected="true"] { color: #fff; background: #0d223a; border-color: #0d223a; }
main a:focus-visible, header a:focus-visible, footer a:focus-visible {
  outline: 3px solid #137dae;
  outline-offset: 4px;
}
#modulo, #scrivi { scroll-margin-top: 92px; }

@media (max-width: 900px) {
  .mobile-menu { display: block; }
}
@media (max-width: 760px) {
  .visual-hero-grid { grid-template-columns: minmax(0, 1fr); margin-top: 22px; }
  .hero-cover { aspect-ratio: 16 / 10; }
  .visual-media { min-height: 0 !important; }
  .visual-media[style*="min-height"] { min-height: 225px !important; }
}

@media print {
  .hero .media { display: none; }
  section[aria-labelledby="hero-t"], article[aria-labelledby="hero-t"] > header, main > .hero {
    background-image: none !important;
  }
}

/* Home: apertura editoriale */
body:has(#hero-t) > .hdr { border-color: #e1eaf0; }
body:has(#hero-t) > .hdr .cta { background: #00669e; }
body:has(#hero-t) > .hdr .cta:hover { background: #00598a; }
@media (min-width: 1181px) {
  body:has(#hero-t) > .hdr > .wrap,
  .hero-x > .hero-x-wrap { width: min(calc(100% - 64px), 1360px); }
}
@media (min-width: 1181px) and (max-width: 1350px) {
  body:has(#hero-t) > .hdr .nav a { padding-inline: 6px; font-size: 14px; }
  body:has(#hero-t) > .hdr .cta { font-size: 14px; padding-inline: 14px; }
}
section.hero-x[aria-labelledby="hero-t"] {
  --hero-paper: #f0f6fa;
  --hero-primary: #00598a;
  background: var(--hero-paper) !important;
  isolation: isolate;
}
.hero-x .hero-x-wrap {
  position: relative;
  padding: clamp(20px, 1.5vw, 30px) 0 18px !important;
}
.hero-x .hero-x-copy { gap: 11px !important; }
.hero-x-copy > p:first-child { color: var(--hero-primary) !important; }
.hero-x-copy > p:first-child::after {
  content: "";
  display: block;
  width: 58px;
  border-bottom: 2px solid #8fb3c8;
  margin-top: 14px;
}
.hero-x #hero-t {
  color: #0d223a;
  font-size: clamp(1.75rem, 1.14rem + 1.32vw, 2.6875rem) !important;
  line-height: 1.12 !important;
  max-width: 26ch !important;
}
.hero-x-copy > p:not(:first-child) {
  font-size: clamp(1.0625rem, .95rem + .21vw, 1.125rem) !important;
  line-height: 1.42 !important;
  color: #10233a !important;
}
.hero-x-copy > form {
  padding: 14px 18px !important;
  border-color: #d8e6ee !important;
  box-shadow: 0 5px 15px rgb(13 34 58 / .10) !important;
  gap: 8px !important;
}
.hero-x-copy > form > div { flex-direction: column; align-items: start; gap: 8px !important; width: 100%; }
.hero-x-copy select { width: 100%; flex: none !important; min-height: 44px; }
.hero-x-copy button { background: var(--hero-primary); min-height: 44px; white-space: normal; }
.hero-x-copy button:hover { background: #004a73; }
.hero-x-copy > a { min-height: 44px; color: #00598a; text-decoration: underline; text-underline-offset: 3px; }
.hero-x-copy > a svg { flex: none; }
.hero-x :is(a,button):focus-visible, .hero-x select:focus { outline: 3px solid #00598a; outline-offset: 3px; }
.hero-x-photo { position: relative; margin: 0; overflow: hidden; }
.hero-x-photo .visual-media { border-radius: 0 !important; }
.hero-x-photo figcaption {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  background: rgb(13 34 58 / .91);
  border: 1px solid #c6dce9;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.35;
}
.hero-x-photo figcaption::before {
  content: "";
  width: 37px;
  height: 37px;
  flex: none;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.45' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2zm5 0v-2a4 4 0 0 0-2.5-3.7M16 4a3.5 3.5 0 0 1 0 7'/%3E%3Ccircle cx='9.5' cy='8' r='3.5'/%3E%3C/svg%3E") center / 23px no-repeat;
}
.hero-x-band { position: relative; z-index: 3; background: #e8f5fb; color: var(--hero-primary); }
.hero-x-band::before {
  content: "";
  position: absolute;
  inset: -25px 0 auto;
  height: 26px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 31' preserveAspectRatio='none'%3E%3Cpath fill='%23e8f5fb' d='M0 0C190 56 395 14 559 17S837 25 1000 1V31H0Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  pointer-events: none;
}
.hero-x-benefits {
  margin-block: 0;
  list-style: none;
  padding: 17px 0 19px;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  font-weight: 600;
}
.hero-x-benefits li { justify-content: center; padding: 5px clamp(9px, 1.4vw, 22px); }
.hero-x-benefits li + li { border-inline-start: 1px solid #adc6d6; }
.hero-x-benefits svg { width: clamp(24px, 2.4vw, 38px); height: auto; flex: none; stroke: #00598a; stroke-width: 1.4; }
.hero-x + [aria-labelledby="start-t"] > .wrap { margin-top: clamp(26px, 3.6vw, 54px) !important; }
@media (min-width: 901px) {
  .hero-x .hero-x-wrap { position: static; }
  .hero-x-copy { width: calc(47vw - (100vw - min(100vw - 64px, 1360px)) / 2 - 30px); }
  .hero-x-copy > :not(.hero-x-photo) { position: relative; z-index: 2; }
  .hero-x-photo { position: absolute; inset: 0 0 55px auto; width: 55%; }
  .hero-x-photo .visual-media { position: absolute !important; inset: 0; min-height: 0 !important; }
  .hero-x-photo .visual-media > img { object-position: 75% 38%; }
  .hero-x-photo::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 -1px;
    width: clamp(76px, 10.7vw, 210px);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 800' preserveAspectRatio='none'%3E%3Cpath fill='%238fb3c8' fill-opacity='.83' d='M0 0H70C-57 337 145 543 150 800H0Z'/%3E%3Cpath fill='%23c6dce9' fill-opacity='.72' d='M0 0H60C-66 337 121 543 138 800H0Z'/%3E%3Cpath fill='%23f0f6fa' d='M0 0H41C-62 330 111 535 98 800H0Z'/%3E%3C/svg%3E") left / 100% 100% no-repeat;
    pointer-events: none;
  }
  .hero-x-photo figcaption {
    position: absolute;
    z-index: 1;
    bottom: clamp(46px, 6vw, 104px);
    left: clamp(78px, 11vw, 210px);
    right: 18px;
    margin: 0;
    max-width: 47ch;
    padding: 12px 20px;
    border-radius: 32px;
  }
}
@media (max-width: 900px) {
  .hero-x-copy > form { max-width: none !important; }
  .hero-x-photo { order: 2; align-self: stretch; margin-bottom: 14px; border-radius: 22px 22px 12px 12px; }
  .hero-x-photo .visual-media { aspect-ratio: 16 / 10; min-height: 0 !important; height: auto !important; }
  .hero-x-photo figcaption { margin: 0; padding: 11px 14px; border: 0; }
}
@media (max-width: 580px) {
  .hero-x-benefits { grid-template-columns: 1fr; padding-block: 8px 13px; }
  .hero-x-benefits li { justify-content: flex-start; padding: 9px 0; }
  .hero-x-benefits li + li { border-inline-start: 0; border-top: 1px solid #adc6d6; }
  .hero-x-copy button { width: 100%; }
}

/* Cartoni "Ho bisogno di aiuto per…" con foto */
.pcard { padding: 0 !important; gap: 0 !important; overflow: hidden; }
.pcard-img { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: #e5f1f5; }
.pcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
a.pcard:hover .pcard-img img { transform: scale(1.05); }
.pcard-body { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 24px; flex-grow: 1; }
.pcard-body h3 { font-size: 21px !important; }
.pcard-body p { flex-grow: 1; }
.pcard-go { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #00598A; margin-top: 4px; }
a.pcard:hover .pcard-go svg { transform: translateX(3px); }
.pcard-go svg { transition: transform .2s; }
@media (hover: none) { a.pcard:hover .pcard-img img { transform: none; } }

/* Schede delle terapie: foto larga sopra, testo sotto */
.tabs-x [role="tabpanel"] { flex-direction: column !important; flex-wrap: nowrap !important; }
.tabs-x [role="tabpanel"] > .visual-media { flex: none !important; width: 100%; aspect-ratio: 16 / 7; min-height: 0 !important; }
.tabs-x [role="tabpanel"] > div:last-child { flex: none !important; }
@media (max-width: 760px) { .tabs-x [role="tabpanel"] > .visual-media { aspect-ratio: 4 / 3; } }

/* Foto nel blocco del modulo */
.aside-photo { margin: 0; border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 3; box-shadow: 0 14px 36px rgb(8 24 39 / .10); }
.aside-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
