/* V9 home sections. The theme hero precedes this wrapper. */
.home .site-main:has(> .v9-home) {
  gap: 0;
  padding-bottom: 0;
}
@keyframes anffas-home-partners {
  to {
    transform: translateX(-50%);
  }
}
.v9-home {
  --volunteer-pop: 34px;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;

  @media (min-width: 1024px) {
    zoom: calc(1 / var(--anffas-desktop-preview-scale, 1));
  }

  &,
  & *,
  & *::before,
  & *::after {
    min-width: 0;
  }
  :is(h2, h3) {
    margin: 0;
    text-wrap: balance;
  }
  p {
    margin: 0;
    text-wrap: pretty;
  }
  :is(h2, h3, h4, .sc__t, .lbl) {
    overflow-wrap: break-word;
  }
  @media (max-width: 400px) {
    :is(.sc__t, .tile__t, h3) {
      hyphens: auto;
    }
  }
  .anffas-icon {
    width: 1.125em;
    height: 1.125em;
  }
  :focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: 6px;
  }
  .on-dark :focus-visible {
    --focus: var(--gold);
  }
  .tlx[hidden] {
    display: none;
  }

  .wrap {
    width: min(100% - 2 * var(--gut), var(--wrap));
    margin-inline: auto;
  }
  .band {
    padding-block: calc(var(--section) / 2);
  }
  .band--first {
    padding-top: var(--section);
  }

  .shead {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px clamp(16px, 3vw, 32px);
    margin-bottom: clamp(22px, 2.6vw, 34px);
  }
  .shead h2 {
    font-size: var(--fs-h2);
    line-height: 1.05;
    font-weight: 650;
    letter-spacing: -0.025em;
    color: var(--blue);
  }
  .more {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-weight: 600;
    color: var(--action);
    text-decoration: none;
  }
  .more:hover {
    text-decoration: underline;
  }
  .more .anffas-icon {
    transition: transform 0.25s var(--ease);
  }
  .more:hover .anffas-icon {
    transform: translateX(3px);
  }

  /* pulsanti del tema: superellisse 16 px × 1,84, altezza 52 */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    min-height: 52px;
    padding: 0 1.35rem;
    border-radius: var(--r-btn);
    border: 1px solid transparent;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition:
      background-color 0.18s,
      border-color 0.18s,
      color 0.18s,
      transform 0.18s,
      box-shadow 0.18s;
  }
  .btn:hover {
    transform: translateY(-1px);
  }
  .btn--gold {
    background: var(--gold);
    color: var(--action);
    box-shadow: var(--shadow-gold);
  }
  .btn--gold:hover {
    background: var(--gold-soft);
  }
  .btn--blue {
    background: var(--action);
    color: #fff;
  }
  .btn--blue:hover {
    background: var(--blue);
  }
  .btn--line {
    background: #fff;
    border-color: color-mix(in srgb, var(--blue) 24%, var(--line));
    color: var(--ink);
  }
  .btn--line:hover {
    border-color: var(--blue);
    background: color-mix(in srgb, var(--blue) 7%, #fff);
  }
  .btn--outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.9);
    color: #fff;
  }
  .btn--outline:hover {
    background: #fff;
    border-color: #fff;
    color: var(--blue);
  }
  .btn--sm {
    min-height: 40px;
    padding: 0 0.9rem;
    font-size: 0.9375rem;
  }
  .btn .anffas-icon {
    width: 1.1rem;
    height: 1.1rem;
  }
  .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }

  /* Storia: due pezzi che si incastrano, foto leggermente ruotata e riquadro blu */
  .story {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(1rem, 3vw, 2.2rem);
    align-items: stretch;
  }
  .story__photo {
    position: relative;
    margin: 0;
    overflow: hidden;
    min-height: clamp(300px, 25vw, 380px);
    border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--line));
    border-radius: calc(36px * var(--k)) calc(10px * var(--k)) calc(36px * var(--k))
      calc(10px * var(--k));
    background: var(--navy);
    transform: rotate(-0.7deg);
  }
  .story__photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .story__text {
    display: grid;
    align-content: center;
    gap: 1rem;
    padding: clamp(1.5rem, 3vw, 2.6rem);
    border-radius: calc(12px * var(--k)) calc(34px * var(--k)) calc(12px * var(--k))
      calc(34px * var(--k));
    background: var(--blue);
    color: #fff;
  }
  .story__text h3 {
    max-width: 20ch;
    font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.25rem);
    line-height: 1.05;
    font-weight: 650;
    letter-spacing: -0.02em;
  }
  .tlx {
    display: grid;
    gap: 18px;
  }
  .tlx__rail {
    --i: 0;
    --n: 4;
    --g: 5px;
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
    gap: var(--g);
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: var(--r-m);
    background: rgba(255, 255, 255, 0.06);
  }
  /* casella che scorre sulla data scelta, come la pill della barra */
  .tlx__rail::before {
    content: "";
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 5px;
    width: calc((100% - 10px - (var(--n) - 1) * var(--g)) / var(--n));
    border-radius: calc(var(--r-m) - 5px);
    background: #fff;
    box-shadow: 0 4px 12px rgba(10, 18, 60, 0.25);
    transform: translateX(calc((100% + var(--g)) * var(--i)));
    transition: transform 0.38s var(--ease);
  }
  .tlx__rail button {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 2px;
    min-height: 58px;
    padding: 6px 4px;
    border: 0;
    border-radius: calc(var(--r-m) - 5px);
    background: none;
    color: #fff;
    font: inherit;
    cursor: pointer;
    transition:
      color 0.25s,
      background-color 0.2s;
  }
  .tlx__rail button + button::after {
    content: "";
    position: absolute;
    left: calc(var(--g) / -2 - 0.5px);
    top: 12px;
    bottom: 12px;
    width: 1px;
    background: rgba(255, 255, 255, 0.22);
    transition: opacity 0.2s;
  }
  .tlx__rail button[aria-selected="true"]::after,
  .tlx__rail button[aria-selected="true"] + button::after {
    opacity: 0;
  }
  .tlx__y {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.05;
  }
  .tlx__m {
    font-size: 0.8125rem;
    font-weight: 500;
    opacity: 0.85;
  }
  .tlx__rail button:not([aria-selected="true"]):hover {
    background: rgba(255, 255, 255, 0.1);
  }
  .tlx__rail button[aria-selected="true"] {
    color: var(--blue);
  }
  .tlx__rail button:focus-visible {
    outline-offset: -3px;
  }
  .tlx__panels {
    display: grid;
  }
  .tlx__p {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transform: translateX(14px);
    transition:
      opacity 0.3s,
      transform 0.4s var(--ease),
      visibility 0s 0.3s;
  }
  .tlx__p.before {
    transform: translateX(-14px);
  }
  .tlx__p.on {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition:
      opacity 0.3s 0.05s,
      transform 0.4s var(--ease) 0.05s;
  }
  .tlx__p h4 {
    margin: 0 0 6px;
    font-size: 1.0625rem;
    font-weight: 650;
    color: var(--gold);
  }
  .tlx__p p {
    max-width: 62ch;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.6;
  }
  .story__text .btn {
    justify-self: start;
    margin-top: 0.4rem;
  }
  .partners {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 20px clamp(24px, 3vw, 48px);
    margin-top: clamp(28px, 3vw, 40px);
    padding-block: clamp(18px, 2vw, 26px);
    border-block: 1px solid var(--line);
  }
  .partners h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--blue);
    white-space: nowrap;
  }
  .partners__vp {
    min-width: 0;
  }
  .partners ul {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    justify-items: center;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .partners img {
    height: clamp(40px, 3.6vw, 54px);
    width: auto;
    max-width: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
  }

  /* Flat brand blue, like the story panel; rules and secondary text derive from the white ink. */
  .metrics {
    --metrics-ink: #fff;
    --metrics-soft: color-mix(in srgb, var(--metrics-ink) 76%, transparent);
    --metrics-rule: color-mix(in srgb, var(--metrics-ink) 22%, transparent);
    background: var(--blue);
    color: var(--metrics-ink);
    padding: clamp(1.6rem, 3vw, 2.6rem);
    border-radius: calc(26px * var(--k)) calc(12px * var(--k)) calc(26px * var(--k))
      calc(12px * var(--k));
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 2.2fr);
    gap: 32px;
    align-items: center;
  }
  .metrics h2 {
    font-size: var(--fs-h2);
    line-height: 1.05;
    font-weight: 650;
    letter-spacing: -0.025em;
  }
  .metrics__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .metrics__list li {
    padding: 6px clamp(16px, 2.4vw, 36px);
    border-left: 1px solid var(--metrics-rule);
    display: flex;
    flex-direction: column;
    container-type: inline-size;
  }
  .m__v {
    order: -1;
    /* Capped by the column width so long figures (e.g. 128.860) never reach the next separator. */
    font-size: min(clamp(2.6rem, 1.8rem + 2.6vw, 4.25rem), 27cqi);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--metrics-ink);
  }
  .m__l {
    margin-top: 12px;
    font-weight: 600;
  }
  .m__n {
    font-size: 0.9375rem;
    color: var(--metrics-soft);
  }

  /* Servizi: le schede del tema — foto incassata, icona a cavallo del bordo, freccia gialla.
   Tre sopra e due sotto; gli angoli esterni del gruppo sono più ampi, così la griglia si legge come una forma sola. */
  .svc {
    --ro: calc(34px * var(--k));
    --ri: calc(24px * var(--k));
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px;
  }
  .sc {
    grid-column: span 2;
    --tl: var(--ri);
    --tr: var(--ri);
    --br: var(--ri);
    --bl: var(--ri);
    --tilt: 0deg;
    --tilt-h: 0deg;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--blue) 14%, var(--line));
    border-radius: var(--tl) var(--tr) var(--br) var(--bl);
    box-shadow: var(--shadow);
    color: var(--ink);
    text-decoration: none;
    transform: rotate(var(--tilt));
    transition:
      transform 0.3s var(--ease),
      box-shadow 0.3s;
  }
  .sc:nth-child(4),
  .sc:nth-child(5) {
    grid-column: span 3;
  }
  .sc:nth-child(1) {
    --tl: var(--ro);
    --tilt: -0.46deg;
    --tilt-h: 0.18deg;
  }
  .sc:nth-child(2) {
    --tilt: 0.38deg;
    --tilt-h: -0.16deg;
  }
  .sc:nth-child(3) {
    --tr: var(--ro);
    --tilt: 0.44deg;
    --tilt-h: -0.18deg;
  }
  .sc:nth-child(4) {
    --bl: var(--ro);
    --tilt: -0.36deg;
    --tilt-h: 0.15deg;
  }
  .sc:nth-child(5) {
    --br: var(--ro);
    --tilt: -0.3deg;
    --tilt-h: 0.14deg;
  }
  .sc:hover,
  .sc:focus-visible {
    transform: rotate(calc(var(--tilt-h) * 1.5)) translateY(-3px);
    box-shadow: var(--shadow-hover);
  }
  .sc__media {
    --in: 0.6rem;
    height: clamp(180px, 14.5vw, 225px);
    margin: var(--in) var(--in) 0;
    overflow: hidden;
    background: var(--tint);
    border-radius: calc(var(--tl) - 1px - var(--in)) calc(var(--tr) - 1px - var(--in))
      calc(var(--tr) - 1px - var(--in)) calc(var(--tl) - 1px - var(--in));
  }
  .sc__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s var(--ease);
  }
  .sc:hover .sc__media img,
  .sc:focus-visible .sc__media img {
    transform: scale(1.045);
  }
  .sc__body {
    position: relative;
    display: grid;
    align-content: start;
    gap: 0.5rem;
    flex: 1;
    padding: 2rem 1.5rem 4rem;
  }
  .sc__icon {
    position: absolute;
    top: 0;
    left: clamp(1.1rem, 1.6vw, 1.5rem);
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--blue);
    box-shadow: 0 4px 12px rgba(38, 54, 134, 0.08);
    transform: translateY(-50%);
  }
  .sc__icon .anffas-icon {
    width: 1.3rem;
    height: 1.3rem;
  }
  .sc__t {
    font-size: clamp(1.125rem, 1.4vw, 1.4rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--blue);
  }
  .sc__p {
    line-height: 1.5;
  }
  .sc__go {
    position: absolute;
    right: clamp(1rem, 1.3vw, 1.2rem);
    bottom: clamp(1rem, 1.3vw, 1.2rem);
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--gold);
    color: var(--blue);
    transition: transform 0.25s var(--ease);
  }
  .sc:hover .sc__go {
    transform: translateX(3px);
  }

  /* Progetti */
  .mosaic {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    /* Published-site tile heights: shorter tiles let the titles cover the faces. */
    grid-template-rows: repeat(2, minmax(287px, auto));
    gap: 20px;
  }
  .tile {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 287px;
    border-radius: var(--r-l);
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    isolation: isolate;
    background: var(--navy);
    box-shadow: var(--shadow);
  }
  .tile:first-child {
    grid-row: span 2;
    min-height: 594px;
    border-radius: calc(34px * var(--k)) var(--r-l) var(--r-l) calc(34px * var(--k));
  }
  .tile:nth-child(2) {
    border-top-right-radius: calc(34px * var(--k));
  }
  .tile:nth-child(3) {
    border-bottom-right-radius: calc(34px * var(--k));
  }
  .tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 35%;
    z-index: -2;
    transition: transform 0.7s var(--ease);
  }
  .tile::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
      0deg,
      rgba(13, 22, 72, 0.9) 0%,
      rgba(13, 22, 72, 0.5) 40%,
      rgba(13, 22, 72, 0) 70%
    );
  }
  .tile:hover img {
    transform: scale(1.04);
  }
  .tile__b {
    display: block;
    padding: clamp(20px, 2.6vw, 34px);
    padding-right: clamp(64px, 6vw, 84px);
  }
  .tile__t {
    display: block;
    font-size: clamp(1.25rem, 1rem + 0.8vw, 1.625rem);
    line-height: 1.15;
    font-weight: 650;
    letter-spacing: -0.015em;
  }
  .tile:first-child .tile__t {
    font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.5rem);
  }
  .tile__p {
    display: block;
    margin-top: 8px;
    max-width: 46ch;
    color: rgba(255, 255, 255, 0.92);
  }
  .tile .sc__go {
    right: clamp(18px, 2vw, 26px);
    bottom: clamp(20px, 2.4vw, 30px);
  }
  .tile:hover .sc__go {
    transform: translateX(3px);
  }

  /* Contatti */
  .contact {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-l);
  }
  .contact__main {
    padding: clamp(16px, 2.6vw, 34px);
  }
  .k {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--muted);
  }
  .k .anffas-icon {
    color: var(--blue);
  }
  .tel {
    display: inline-block;
    margin-top: 6px;
    font-size: clamp(2.5rem, 1.6rem + 3.2vw, 4.25rem);
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--blue);
    text-decoration: none;
    font-variant-numeric: tabular-nums;
    border-radius: 10px;
  }
  .tel:hover {
    color: var(--action);
    text-decoration: underline;
    text-decoration-thickness: 3px;
  }
  .hours {
    margin-top: 8px;
  }
  .rows {
    list-style: none;
    margin: 28px 0 0;
    padding: 0;
  }
  .rows li {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 4px 14px;
    align-items: start;
    padding: 18px 0;
    border-top: 1px solid var(--line);
  }
  .rows li > .anffas-icon {
    width: 22px;
    height: 22px;
    margin-top: 3px;
    color: var(--blue);
  }
  .rows a.val {
    font-weight: 600;
    color: var(--action);
    text-decoration: none;
  }
  .rows a.val:hover {
    text-decoration: underline;
  }
  .rows small {
    display: block;
    margin-top: 2px;
    font-size: 0.9375rem;
    color: var(--muted);
  }
  .contact__photo {
    position: relative;
    margin: 0;
    border-radius: calc(var(--r-l) - 10px);
    overflow: hidden;
    min-height: 360px;
    background: var(--tint);
  }
  .contact__photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .contact__photo figcaption {
    position: absolute;
    left: 16px;
    bottom: 16px;
  }
  .contact__photo figcaption .btn {
    box-shadow: 0 8px 20px rgba(38, 54, 134, 0.25);
  }
  .vol {
    position: relative;
    display: grid;
    grid-template-columns: clamp(220px, 24vw, 300px) minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px 32px;
    margin-top: 56px;
    padding: 0 32px 0 0;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
    border-radius: var(--r-l);
  }
  /* il ritaglio dei volontari sta su un'onda calda e sporge dal bordo alto */
  .vol__media {
    position: relative;
    margin: 0;
    align-self: stretch;
    min-height: 150px;
    clip-path: inset(-60px 0 0 0);
    border-radius: calc(var(--r-l) - 1px) 0 0 calc(var(--r-l) - 1px);
    background:
      radial-gradient(
        ellipse 60% 70% at 50% 85%,
        color-mix(in srgb, var(--gold) 38%, #fcf6ea),
        transparent 72%
      ),
      radial-gradient(
        circle at 10% 90%,
        color-mix(in srgb, var(--gold) 26%, transparent) 0 16%,
        transparent 17%
      ),
      radial-gradient(
        circle at 92% 24%,
        color-mix(in srgb, var(--gold) 18%, transparent) 0 12%,
        transparent 13%
      ), #fcf6ea;
  }
  .vol__media img {
    pointer-events: none;
    position: absolute;
    left: 50%;
    bottom: 0;
    height: calc(100% + var(--volunteer-pop));
    width: auto;
    max-width: none;
    aspect-ratio: 1484 / 860;
    object-fit: cover;
    object-position: 0 0;
    transform: translateX(-27%);
    -webkit-mask-image: linear-gradient(to bottom, #000 86%, transparent);
    mask-image: linear-gradient(to bottom, #000 86%, transparent);
  }
  .vol__b {
    padding-block: 22px;
  }
  .vol h3 {
    font-size: 1.25rem;
    font-weight: 650;
    color: var(--blue);
    margin-bottom: 4px;
  }

  /* Notizie */
  .news {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 20px;
  }
  .lead,
  .row {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-l);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition:
      box-shadow 0.25s,
      transform 0.25s var(--ease);
  }
  .lead:hover,
  .row:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
  }
  .lead {
    display: grid;
    grid-template-rows: auto 1fr;
  }
  /* Cornice: riempie, oppure mostra l'immagine intera e arrotondata su un fondo piatto.
   Fuori dalla notizia niente sfocature: il sito è piatto. */
  .frame {
    position: relative;
    overflow: hidden;
    background: var(--tint);
    isolation: isolate;
    --fr: var(--r-m);
    --fi: 7%;
  }
  .frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .frame[data-fit="contain"] {
    background: var(--frame-vignette);
  }
  .frame[data-fit="contain"] img {
    object-fit: fill;
    border-radius: var(--fr);
    box-shadow: 0 0 0 1px rgba(38, 54, 134, 0.08);
  }

  .lead .frame {
    margin: 8px 8px 0;
    aspect-ratio: 16 / 9;
    border-radius: calc(var(--r-l) - 9px);
  }
  .lead__b {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 26px 24px;
  }
  .date {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gold-deep);
  }
  .lead h3 {
    font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem);
    line-height: 1.15;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--blue);
  }
  .list {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
  }
  .row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
    padding: 8px 22px 8px 8px;
  }
  .row .frame {
    --fr: var(--r-s);
    --fi: 9%;
    min-height: 150px;
    border-radius: calc(var(--r-l) - 9px);
  }
  .row__b {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 0;
  }
  .row__b > span:not(.go):not(.date) {
    font-size: 0.9375rem;
  }
  .row h3 {
    font-size: 1.125rem;
    line-height: 1.3;
    font-weight: 650;
    color: var(--blue);
  }
  .go {
    margin-top: auto;
    padding-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--action);
  }
  .go .anffas-icon {
    transition: transform 0.25s var(--ease);
  }
  .lead:hover .go .anffas-icon,
  .row:hover .go .anffas-icon {
    transform: translateX(4px);
  }

  /* Fai la differenza: niente scheda attorno, la grafica del 5x1000 è già un oggetto */
  .support {
    display: grid;
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
  }
  .support h2 {
    font-size: var(--fs-h2);
    line-height: 1.05;
    font-weight: 650;
    letter-spacing: -0.025em;
    color: var(--blue);
  }
  .support h2 em {
    font-style: normal;
    text-decoration: underline;
    text-decoration-color: var(--gold);
    text-decoration-thickness: 0.1em;
    text-underline-offset: 0.15em;
    text-decoration-skip-ink: none;
  }
  .support__p {
    margin: 1.1rem 0 1.6rem;
    max-width: 44ch;
    color: var(--navy);
    line-height: 1.65;
  }
  .support__media {
    margin: 0;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line));
    border-radius: calc(24px * var(--k)) calc(8px * var(--k)) calc(24px * var(--k))
      calc(8px * var(--k));
    box-shadow: var(--shadow);
    transform: rotate(0.5deg);
  }
  .support__media img {
    width: 100%;
    height: auto;
  }

  /* Trasparenza: un indice */
  .index {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-l);
    padding: clamp(12px, 2vw, 24px) 0;
    box-shadow: var(--shadow);
  }
  .ix {
    padding: 8px clamp(20px, 3vw, 44px);
  }
  .ix + .ix {
    border-left: 1px solid var(--line);
  }
  .ix h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.125rem;
    font-weight: 650;
    color: var(--blue);
    padding: 12px 0 10px;
  }
  .ix h3 .anffas-icon {
    width: 22px;
    height: 22px;
    color: var(--blue);
  }
  .ix ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .ix a {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-height: 50px;
    padding: 13px 2px;
    border-top: 1px solid var(--line);
    color: var(--navy);
    text-decoration: none;
    font-weight: 500;
  }
  .ix .lbl {
    flex: 0 1 auto;
  }
  .ix .dots {
    flex: 1 0 28px;
    border-bottom: 2px dotted var(--line-strong);
    transform: translateY(-0.3em);
    transition: border-color 0.2s;
  }
  .ix a .anffas-icon {
    align-self: center;
    width: 18px;
    height: 18px;
    color: var(--blue);
    transition: transform 0.25s var(--ease);
  }
  .ix a:hover {
    color: var(--action);
  }
  .ix a:hover .dots {
    border-color: var(--blue);
  }
  .ix a:hover .anffas-icon {
    transform: translateX(3px);
  }

  /* Larghezze intermedie e telefono */
  @media (max-width: 860px) {
    .story,
    .metrics,
    .contact,
    .news,
    .support,
    .index {
      grid-template-columns: minmax(0, 1fr);
    }
    .story__photo {
      min-height: 260px;
    }
    .metrics__list {
      grid-template-columns: minmax(0, 1fr);
    }
    .metrics__list li {
      border-left: 0;
      border-top: 1px solid var(--metrics-rule);
      padding: 18px 0;
    }
    .svc {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .sc,
    .sc:nth-child(4),
    .sc:nth-child(5) {
      grid-column: span 1;
      --tl: var(--ri);
      --tr: var(--ri);
      --br: var(--ri);
      --bl: var(--ri);
    }
    .sc:last-child {
      grid-column: 1 / -1;
    }
    .mosaic {
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: none;
    }
    .tile,
    .tile:first-child {
      grid-row: auto;
      border-radius: var(--r-l);
    }
    /* As on the published site: stacked tiles are tall enough for photo and description. */
    .tile,
    .tile:first-child {
      min-height: 420px;
    }
    .ix + .ix {
      border-left: 0;
    }
    .vol {
      grid-template-columns: 200px minmax(0, 1fr);
      padding-right: 24px;
    }
    .vol .btn {
      grid-column: 2;
      justify-self: start;
      margin-bottom: 22px;
    }
    .story__photo {
      transform: none;
    }
    .contact__photo {
      min-height: 260px;
    }
  }
  @media (max-width: 560px) {
    /* Same rule as the news archive lead: the long excerpt is for wide screens. */
    .lead__b > span:not(.go) {
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 5;
      line-clamp: 5;
      overflow: hidden;
    }
    .svc {
      grid-template-columns: minmax(0, 1fr);
    }
    .sc:nth-child(n) {
      --tilt: 0deg;
    }
    .tile::after {
      background: none;
    }
    .tile__b {
      width: 100%;
      background: linear-gradient(transparent, rgba(13, 22, 72, 0.72) 20px, rgba(13, 22, 72, 0.9));
    }
    .rows li {
      grid-template-columns: 22px minmax(0, 1fr);
      gap: 2px 10px;
    }
    .rows li > .anffas-icon {
      margin-top: 0;
      width: 20px;
      height: 20px;
    }
    .support .actions {
      flex-wrap: nowrap;
    }
    .support .btn {
      flex: 1 1 0;
      padding: 0 0.75rem;
      font-size: 0.9375rem;
    }
    .support .btn .anffas-icon {
      display: none;
    }
    .tlx__y {
      font-size: 1.0625rem;
    }
    .tlx__m {
      font-size: 0.75rem;
    }
    .vol {
      grid-template-columns: minmax(0, 1fr);
      padding: 0;
      margin-top: 44px;
    }
    .vol__media {
      min-height: 150px;
      border-radius: calc(var(--r-l) - 1px) calc(var(--r-l) - 1px) 0 0;
    }
    .vol__b {
      padding: 16px 20px 4px;
    }
    .vol .btn {
      grid-column: 1;
      margin: 0 20px 20px;
    }
    .list {
      grid-template-rows: none;
    }
    .row {
      grid-template-columns: minmax(0, 1fr);
      padding: 8px;
      align-items: start;
    }
    .row .frame {
      aspect-ratio: 16 / 9;
      min-height: 0;
      width: 100%;
    }
    .row__b {
      padding: 8px 14px 14px;
    }
  }

  /* Storia su telefono: il testo originale in due paragrafi al posto della linea del tempo */
  .story__text:has(.tlx:not([hidden])) .story__plain {
    display: none;
  }
  .story__plain p {
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.6;
  }
  .story__plain p + p {
    margin-top: 0.8em;
  }
  @media (max-width: 560px) {
    .story__text:has(.tlx:not([hidden])) .story__plain {
      display: block;
    }
    .tlx {
      display: none;
    }
    .story__plain p {
      font-size: 0.9375rem;
    }
    /* As on the published site, phones show only the founding paragraph. */
    .story__plain p + p {
      display: none;
    }
  }

  /* Partner: fermi in griglia quando c'è posto, a scorrimento continuo sul telefono (come nel tema) */
  .partners .dup {
    display: none;
  }
  @media (max-width: 640px) {
    .partners {
      grid-template-columns: minmax(0, 1fr);
      gap: 14px;
    }
    .partners__vp {
      overflow: hidden;
      cursor: grab;
      touch-action: pan-y;
      mask-image: linear-gradient(90deg, #000 0, #000 86%, transparent 100%);
    }
    .partners__vp.is-manual {
      overflow-x: auto;
      scrollbar-width: none;
      mask-image: none;
    }
    .partners__vp.is-manual::-webkit-scrollbar {
      display: none;
    }
    .partners__vp.is-dragging {
      cursor: grabbing;
      user-select: none;
    }
    .partners ul.partners__track {
      display: flex;
      width: max-content;
      gap: 0;
      animation: anffas-home-partners 26s linear infinite;
    }
    .partners__vp.is-manual .partners__track {
      animation: none;
    }
    .partners .dup {
      display: block;
    }
    .partners li {
      flex: 0 0 auto;
      padding-right: 40px;
    }
    .partners img {
      height: 40px;
      max-width: none;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .partners ul.partners__track {
      animation: none;
    }
  }

  /* Fai la differenza: testo dei pulsanti centrato anche quando va a capo */
  .support .btn {
    text-align: center;
    line-height: 1.2;
  }

  /* Alone colorato sotto le schede, come le card della home nel tema (tre tinte pastello che sbordano in basso);
   al passaggio del puntatore si accende. Fatto con ombre colorate: nessun livello in più nella scheda. */
  .sc,
  .lead,
  .row {
    --ga: #6f9dcf;
    --gb: #ffc8a6;
    --gc: #ad93c5;
    --wa: 20%;
    --wash:
      -28px 30px 48px -28px color-mix(in srgb, var(--ga) var(--wa), transparent), 28px 34px 52px -28px color-mix(
        in srgb,
        var(--gb) var(--wa),
        transparent
      ), 0 44px 64px -36px color-mix(in srgb, var(--gc) var(--wa), transparent);
    box-shadow: var(--shadow), var(--wash);
  }
  .sc:hover,
  .sc:focus-visible,
  .lead:hover,
  .row:hover,
  .lead:focus-visible,
  .row:focus-visible {
    --wa: 38%;
    box-shadow: var(--shadow-hover), var(--wash);
  }
  :is(.sc, .lead, .row):nth-child(4n + 2) {
    --ga: #8ab8dc;
    --gb: #f7df99;
    --gc: #ffc8a6;
  }
  :is(.sc, .lead, .row):nth-child(4n + 3) {
    --ga: #ffc8a6;
    --gb: #6f9dcf;
    --gc: #d8a7cc;
  }
  :is(.sc, .lead, .row):nth-child(4n + 4) {
    --ga: #a6d7e8;
    --gb: #f5b9d0;
    --gc: #ffc8a6;
  }
  @media (forced-colors: active) {
    :is(.sc, .lead, .row) {
      box-shadow: none;
    }
  }

  /* Approved home variation: contact and volunteering share a row. */
  .contact-pair {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 20px;
  }
  .contact__main {
    container-type: inline-size;
  }
  .tel {
    font-size: min(clamp(2.5rem, 1.6rem + 3.2vw, 4.25rem), 17cqi);
  }
  .rows li {
    border-top-color: color-mix(in srgb, var(--line) 84%, var(--muted));
  }
  .rows .val {
    overflow-wrap: anywhere;
  }
  @media (min-width: 1024px) {
    .vol {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      margin: 0;
      padding: 0;
    }
    .vol__media {
      flex: none;
      height: clamp(150px, 13vw, 190px);
      margin: 0;
      border-radius: calc(var(--r-l) - 1px) calc(var(--r-l) - 1px) 0 0;
    }
    .vol__b {
      padding: 16px 20px;
    }
    .vol > .btn {
      align-self: flex-start;
      margin: auto 20px 16px;
    }
  }
  .contact__photo figcaption .btn {
    box-shadow: var(--shadow);
  }
  .tile[href*="soggiorni-estivi"] img {
    object-position: 50% 42%;
  }
  @media (max-width: 1023px) {
    .contact-pair {
      grid-template-columns: minmax(0, 1fr);
      gap: 0;
    }
  }
}

html[data-accessibility-motion] .v9-home ul.partners__track {
  animation: none;
}
html[data-accessibility-contrast] .v9-home {
  --ink: var(--anffas-color-ink);
  --muted: var(--anffas-color-ink-soft);
  --line-strong: var(--anffas-color-border);
  :is(.sc, .lead, .row) {
    --wa: 0%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .v9-home *,
  .v9-home *::before,
  .v9-home *::after {
    /* biome-ignore lint/complexity/noImportantStyles: The motion preference overrides every component animation. */
    animation: none !important;
    /* biome-ignore lint/complexity/noImportantStyles: The motion preference overrides every component transition. */
    transition: none !important;
  }
}
