/*
 * Pagina Il Gruppo.
 *
 * Il foglio è caricato soltanto su /il-gruppo/: riprende ordine, asset e
 * gerarchia della bozza e li porta nel sistema editoriale del nuovo sito.
 */

body.fm-group-page {
  --group-section-space: clamp(5.75rem, 8vw, 8rem);
  --group-grid-gap: clamp(1rem, 2vw, 2rem);
  --group-copy: rgba(17, 27, 48, 0.76);
  --group-copy-muted: rgba(17, 27, 48, 0.68);
  --group-display-tracking: -0.04em;
  --group-operation-hover-bleed: clamp(0.75rem, 1.5vw, 1.5rem);
}

body.fm-group-page .group-page-content {
  overflow: clip;
  color: var(--ink);
  background: var(--white);
}

body.fm-group-page .group-page-content section {
  position: relative;
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

body.fm-group-page .group-overview,
body.fm-group-page .group-synergy,
body.fm-group-page .group-operation,
body.fm-group-page .group-activities {
  padding: var(--group-section-space) var(--gutter);
}

body.fm-group-page .group-overview__inner,
body.fm-group-page .group-synergy__inner,
body.fm-group-page .group-operation__inner,
body.fm-group-page .group-activities__inner {
  width: min(100%, var(--content-max));
  margin: 0 auto;
}

body.fm-group-page .group-page-media {
  position: relative;
  isolation: isolate;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: var(--paper-deep);
  box-shadow: 0 2.1rem 4.5rem -2.35rem rgba(8, 18, 37, 0.42);
}

body.fm-group-page .group-page-media::before {
  position: absolute;
  z-index: 2;
  top: clamp(0.8rem, 1.35vw, 1.2rem);
  left: clamp(0.8rem, 1.35vw, 1.2rem);
  width: clamp(3.5rem, 7vw, 6.5rem);
  aspect-ratio: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.72);
  border-left: 1px solid rgba(255, 255, 255, 0.72);
  content: "";
  pointer-events: none;
}

body.fm-group-page .group-page-media::after {
  position: absolute;
  z-index: 3;
  width: clamp(4.5rem, 8vw, 7.5rem);
  height: 0.2rem;
  background: var(--yellow);
  content: "";
  pointer-events: none;
}

body.fm-group-page .group-page-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.fm-group-page .group-overview__copy h2,
body.fm-group-page .group-synergy__copy h2,
body.fm-group-page .group-operation__header h2,
body.fm-group-page .group-activities__header h2 {
  margin: 0;
  font-weight: 250;
  letter-spacing: var(--group-display-tracking);
  line-height: 0.96;
  text-wrap: balance;
}

body.fm-group-page .group-hero__title {
  letter-spacing: -0.055em;
}

/* Introduzione: immagine a sinistra, testo a destra. */

body.fm-group-page .group-overview {
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(17, 27, 48, 0.055) 50%, transparent calc(50% + 0.5px)),
    var(--white);
}

body.fm-group-page .group-overview__inner {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--group-grid-gap);
  align-items: center;
}

body.fm-group-page .group-overview__media {
  position: relative;
  grid-column: 1 / 7;
  aspect-ratio: 1;
}

body.fm-group-page .group-overview__media::after {
  right: 0;
  bottom: clamp(1.25rem, 2vw, 2rem);
}

body.fm-group-page .group-overview__media img {
  object-position: center;
}

body.fm-group-page .group-overview__copy {
  min-width: 0;
  grid-column: 7 / -1;
}

body.fm-group-page .group-overview__copy .eyebrow,
body.fm-group-page .group-synergy__copy .eyebrow,
body.fm-group-page .group-operation__header .eyebrow,
body.fm-group-page .group-activities__header .eyebrow {
  color: var(--blue);
}

body.fm-group-page .group-overview__copy h2 {
  max-width: 16ch;
  font-size: clamp(2.6rem, 4vw, 4.6rem);
}

body.fm-group-page .group-overview__copy > p:last-child {
  max-width: 40rem;
  margin: clamp(2.25rem, 3.25vw, 3.25rem) 0 0;
  padding-top: clamp(1.5rem, 2.5vw, 2.25rem);
  border-top: 1px solid var(--line);
  color: var(--group-copy);
  font-size: clamp(1rem, 1.15vw, 1.12rem);
  line-height: 1.7;
}

/* Sinergia: impaginazione speculare, senza elementi o immagini aggiuntive. */

body.fm-group-page .group-synergy {
  border-top: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(17, 27, 48, 0.035) 1px, transparent 1px) 50% 0 / 25% 100%,
    var(--paper);
}

body.fm-group-page .group-synergy__inner {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--group-grid-gap);
  align-items: center;
}

body.fm-group-page .group-synergy__copy {
  min-width: 0;
  grid-column: 1 / 7;
}

body.fm-group-page .group-synergy__copy h2 {
  max-width: 15ch;
  font-size: clamp(2.6rem, 4.1vw, 4.75rem);
}

body.fm-group-page .group-synergy__copy > p:last-child {
  max-width: 38rem;
  margin: clamp(2.25rem, 3.25vw, 3.25rem) 0 0;
  color: var(--group-copy);
  font-size: clamp(1rem, 1.15vw, 1.12rem);
  line-height: 1.7;
}

body.fm-group-page .group-synergy__media {
  position: relative;
  grid-column: 7 / -1;
  aspect-ratio: 1;
}

body.fm-group-page .group-synergy__media::before {
  inset: auto clamp(0.8rem, 1.35vw, 1.2rem) clamp(0.8rem, 1.35vw, 1.2rem) auto;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.72);
}

body.fm-group-page .group-synergy__media::after {
  top: clamp(1.25rem, 2vw, 2rem);
  left: 0;
}

body.fm-group-page .group-synergy__media img {
  object-position: center;
}

/* Come opera: tre righe, con i cerchi volutamente vuoti come in bozza. */

body.fm-group-page .group-operation {
  border-top: 1px solid var(--line);
  background: var(--white);
}

body.fm-group-page .group-operation__header {
  display: grid;
  margin-bottom: clamp(4rem, 6vw, 6rem);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--group-grid-gap);
}

body.fm-group-page .group-operation__header .eyebrow {
  grid-column: 1 / 3;
}

body.fm-group-page .group-operation__header h2 {
  max-width: 15ch;
  grid-column: 4 / -1;
  font-size: clamp(3rem, 5.2vw, 5.75rem);
}

body.fm-group-page .group-operation__list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

body.fm-group-page .group-operation__item {
  position: relative;
  display: grid;
  min-height: 9rem;
  padding: clamp(2rem, 2.6vw, 2.6rem) 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--group-grid-gap);
  align-items: center;
  isolation: isolate;
}

body.fm-group-page .group-operation__item::before {
  position: absolute;
  z-index: 0;
  inset: 0 calc(-1 * var(--group-operation-hover-bleed));
  content: "";
  pointer-events: none;
  background: var(--blue);
  clip-path: inset(0 0 0 100%);
  transition: clip-path 420ms cubic-bezier(0.65, 0, 0.35, 1);
}

body.fm-group-page .group-operation__item > * {
  position: relative;
  z-index: 1;
}

body.fm-group-page .group-operation__index {
  display: inline-block;
  width: fit-content;
  grid-column: 1 / 2;
  color: var(--blue);
  font-size: clamp(1.25rem, 1.85vw, 1.75rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
  line-height: 0.95;
  transform-origin: left bottom;
  transition: color var(--motion-fast) ease;
}

body.fm-group-page .group-operation__item h3 {
  max-width: 14ch;
  margin: 0;
  grid-column: 3 / 7;
  font-size: clamp(1.75rem, 2.4vw, 2.65rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
  transition: color var(--motion-fast) ease;
}

body.fm-group-page .group-operation__item p {
  max-width: 38rem;
  margin: 0;
  grid-column: 7 / 12;
  color: var(--group-copy);
  font-size: 1rem;
  line-height: 1.62;
  transition: color var(--motion-fast) ease;
}

body.fm-group-page .group-operation__marker {
  position: relative;
  width: 2.5rem;
  overflow: hidden;
  grid-column: 12;
  justify-self: end;
  aspect-ratio: 1;
  color: var(--blue);
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.82;
  transition:
    color var(--motion-fast) ease,
    opacity var(--motion-fast) ease,
    transform 260ms var(--ease-out);
}

body.fm-group-page .group-operation__marker::before {
  position: absolute;
  inset: -1px;
  content: "";
  border-radius: inherit;
  background: var(--yellow);
  transform: scale(0);
  transition: transform 180ms cubic-bezier(0.4, 0, 1, 1);
}

@media (hover: hover) and (pointer: fine) {
  body.fm-group-page .group-operation__item:hover::before {
    clip-path: inset(0);
    transition-duration: 620ms;
    transition-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
  }

  body.fm-group-page .group-operation__item:hover .group-operation__index {
    color: var(--yellow);
  }

  body.fm-group-page .group-operation__item:hover h3 {
    color: var(--white);
  }

  body.fm-group-page .group-operation__item:hover p {
    color: rgba(255, 255, 255, 0.84);
  }

  body.fm-group-page .group-operation__item:hover .group-operation__marker {
    color: var(--yellow);
    opacity: 1;
    transform: scale(1.07);
  }

  body.fm-group-page .group-operation__item:hover .group-operation__marker::before {
    transform: scale(1);
    transition-delay: 80ms;
    transition-duration: 360ms;
    transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  }
}

/* Attività: le tre icone originali sostituiscono integralmente le foto. */

body.fm-group-page .group-activities {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

body.fm-group-page .group-activities__header {
  max-width: 64rem;
  margin: 0 auto clamp(4.5rem, 7vw, 7rem);
  text-align: center;
}

body.fm-group-page .group-activities__header .eyebrow {
  margin-bottom: clamp(2rem, 3vw, 3rem);
}

body.fm-group-page .group-activities__header h2 {
  font-size: clamp(2.9rem, 5.1vw, 5.5rem);
}

body.fm-group-page .group-activities__header > p:last-child {
  max-width: 42rem;
  margin: clamp(2rem, 3vw, 3rem) auto 0;
  color: var(--group-copy);
  font-size: clamp(1rem, 1.15vw, 1.12rem);
  line-height: 1.68;
}

body.fm-group-page .group-activities__grid {
  display: grid;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.fm-group-page .group-activity {
  --group-activity-icon-scale: 1;
  --group-activity-icon-size: clamp(4.75rem, 5.5vw, 5.25rem);

  position: relative;
  min-width: 0;
  padding: clamp(3rem, 4.5vw, 4.5rem) clamp(1.5rem, 2.6vw, 2.75rem);
  background-color: transparent;
  text-align: center;
  transition: background-color var(--motion-fast) ease;
}

body.fm-group-page .group-activity + .group-activity {
  border-left: 1px solid var(--line);
}

body.fm-group-page .group-activity__icon {
  --group-activity-icon-color: rgb(77, 158, 215);

  position: relative;
  display: grid;
  width: var(--group-activity-icon-size);
  height: var(--group-activity-icon-size);
  margin: 0 auto clamp(2.25rem, 3.5vw, 3.25rem);
  place-items: center;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.fm-group-page .group-activity__glyph {
  display: none;
  width: 100%;
  height: 100%;
}

body.fm-group-page .group-activity__icon img {
  display: block;
  width: 100%;
  height: 100%;
  filter: none;
  object-fit: contain;
  transform: scale(var(--group-activity-icon-scale));
  transform-origin: center;
  transition: filter var(--motion-fast) ease;
}

@supports ((-webkit-mask-image: url("")) or (mask-image: url(""))) {
  body.fm-group-page .group-activity__glyph {
    display: block;
    width: 100%;
    height: 100%;
    background-color: var(--group-activity-icon-color);
    -webkit-mask-image: var(--group-activity-icon-url);
    mask-image: var(--group-activity-icon-url);
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    transform: scale(var(--group-activity-icon-scale));
    transform-origin: center;
    transition: background-color var(--motion-fast) ease;
  }

  body.fm-group-page .group-activity__icon img {
    display: none;
  }
}

body.fm-group-page .group-activity--1 {
  --group-activity-icon-scale: 1.07;
}

body.fm-group-page .group-activity--2 {
  --group-activity-icon-scale: 0.98;
}

body.fm-group-page .group-activity--3 {
  --group-activity-icon-scale: 0.94;
}

body.fm-group-page .group-activity h3 {
  max-width: 17ch;
  margin: 0 auto;
  font-size: clamp(1.35rem, 1.75vw, 1.72rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-wrap: balance;
}

body.fm-group-page .group-activity p {
  max-width: 29rem;
  margin: 1.5rem auto 0;
  color: var(--group-copy-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

@media (hover: hover) and (pointer: fine) {
  body.fm-group-page .group-activity:hover {
    background-color: rgba(255, 255, 255, 0.48);
  }

  body.fm-group-page .group-activity:hover .group-activity__icon {
    transform: scale(1.045);
  }

  body.fm-group-page .group-activity:hover .group-activity__glyph {
    background-color: var(--blue);
  }

  body.fm-group-page .group-activity:hover .group-activity__icon img {
    filter: saturate(1.55) brightness(0.72);
  }
}

/* Micro-animazioni: reveal del sito, indici e zoom media. */

@keyframes group-operation-index-reveal {
  0% {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: translateX(-0.45rem);
  }

  100% {
    opacity: 1;
    clip-path: inset(0);
    transform: none;
  }
}

.js body.fm-group-page .group-operation__item.reveal .group-operation__index {
  opacity: 0;
}

.js body.fm-group-page .group-operation__item.reveal.is-visible .group-operation__index {
  animation: group-operation-index-reveal 520ms cubic-bezier(0.16, 1, 0.3, 1) 80ms both;
}

.js body.fm-group-page .group-page-content .reveal.group-page-media img {
  transform: scale(1.025);
  transition: transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.js body.fm-group-page .group-page-content .reveal.is-visible.group-page-media img {
  transform: scale(1.001);
}

.js body.fm-group-page .group-activity.reveal,
.js body.fm-group-page .group-activity.reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: background-color var(--motion-fast) ease;
}

.js body.fm-group-page .group-operation__item--2 {
  transition-delay: 70ms;
}

.js body.fm-group-page .group-operation__item--3 {
  transition-delay: 140ms;
}

@media (max-width: 1100px) {
  body.fm-group-page .group-operation__item h3 {
    grid-column: 2 / 6;
  }

  body.fm-group-page .group-operation__item p {
    grid-column: 6 / 12;
  }
}

@media (max-width: 820px) {
  body.fm-group-page .group-overview,
  body.fm-group-page .group-synergy,
  body.fm-group-page .group-operation,
  body.fm-group-page .group-activities {
    padding-top: 5.5rem;
    padding-bottom: 5.5rem;
  }

  body.fm-group-page .group-overview__inner,
  body.fm-group-page .group-synergy__inner {
    row-gap: 4rem;
  }

  body.fm-group-page .group-overview__media,
  body.fm-group-page .group-overview__copy,
  body.fm-group-page .group-synergy__copy,
  body.fm-group-page .group-synergy__media {
    grid-column: 1 / -1;
  }

  body.fm-group-page .group-overview__media,
  body.fm-group-page .group-synergy__media {
    width: min(100%, 38rem);
  }

  body.fm-group-page .group-overview__copy,
  body.fm-group-page .group-synergy__copy {
    width: min(100%, 42rem);
  }

  body.fm-group-page .group-synergy__media {
    justify-self: end;
  }

  body.fm-group-page .group-operation__header {
    display: block;
  }

  body.fm-group-page .group-operation__header .eyebrow {
    margin-bottom: 2.25rem;
  }

  body.fm-group-page .group-operation__item {
    grid-template-columns: 3.5rem minmax(0, 1fr) 2.65rem;
    column-gap: 1.25rem;
    align-items: start;
  }

  body.fm-group-page .group-operation__index {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  body.fm-group-page .group-operation__item h3 {
    max-width: none;
    grid-column: 2;
  }

  body.fm-group-page .group-operation__item p {
    margin-top: 1.5rem;
    grid-column: 2;
  }

  body.fm-group-page .group-operation__marker {
    grid-column: 3;
    grid-row: 1 / 3;
  }

  body.fm-group-page .group-activities__grid {
    grid-template-columns: 1fr;
  }

  body.fm-group-page .group-activity {
    --group-activity-icon-size: 5rem;

    display: grid;
    padding: 2.75rem 0;
    grid-template-columns: minmax(5.5rem, 1fr) minmax(13rem, 1.45fr) minmax(0, 2.6fr);
    gap: 2rem;
    align-items: center;
    text-align: left;
  }

  body.fm-group-page .group-activity + .group-activity {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  body.fm-group-page .group-activity__icon {
    margin: 0;
    justify-self: center;
  }

  body.fm-group-page .group-activity h3,
  body.fm-group-page .group-activity p {
    max-width: none;
    margin: 0;
  }
}

@media (max-width: 767px) {
  body.fm-group-page .group-overview,
  body.fm-group-page .group-synergy,
  body.fm-group-page .group-operation,
  body.fm-group-page .group-activities {
    padding-top: 4.75rem;
    padding-bottom: 4.75rem;
  }

  body.fm-group-page .group-overview {
    background: var(--white);
  }

  body.fm-group-page .group-page-media {
    box-shadow: 0 1.6rem 3.25rem -1.9rem rgba(8, 18, 37, 0.46);
  }

  body.fm-group-page .group-overview__inner,
  body.fm-group-page .group-synergy__inner {
    display: block;
  }

  body.fm-group-page .group-overview__copy,
  body.fm-group-page .group-synergy__media {
    margin-top: 3.5rem;
  }

  body.fm-group-page .group-overview__copy h2,
  body.fm-group-page .group-synergy__copy h2,
  body.fm-group-page .group-operation__header h2,
  body.fm-group-page .group-activities__header h2 {
    font-size: clamp(2.45rem, 10.8vw, 3.35rem);
  }

  body.fm-group-page .group-operation__header,
  body.fm-group-page .group-activities__header {
    margin-bottom: 3.5rem;
  }

  body.fm-group-page .group-operation__item {
    min-height: 0;
    padding: 2.25rem 0;
    grid-template-columns: 2.25rem minmax(0, 1fr) 2.25rem;
    column-gap: 0.85rem;
  }

  body.fm-group-page .group-operation__index {
    grid-column: 1;
    grid-row: 1;
    margin-top: 0.15rem;
  }

  body.fm-group-page .group-operation__item h3 {
    grid-column: 2;
    grid-row: 1;
  }

  body.fm-group-page .group-operation__item p {
    grid-column: 2 / 4;
    grid-row: 2;
    margin-top: 1.25rem;
  }

  body.fm-group-page .group-operation__marker {
    display: block;
    width: 2.25rem;
    grid-column: 3;
    grid-row: 1;
  }

  body.fm-group-page .group-activities__grid {
    display: block;
  }

  body.fm-group-page .group-activity {
    --group-activity-icon-size: 4.5rem;

    display: block;
    padding: 3.5rem 1rem;
    text-align: center;
  }

  body.fm-group-page .group-activity + .group-activity {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  body.fm-group-page .group-activity__icon {
    margin: 0 auto 2.25rem;
  }

  body.fm-group-page .group-activity p {
    max-width: 29rem;
    margin: 1.5rem auto 0;
  }

  .js body.fm-group-page .group-operation__item--2,
  .js body.fm-group-page .group-operation__item--3 {
    transition-delay: 0ms;
  }
}

@media (max-width: 430px) {
  body.fm-group-page .group-overview__copy > p:last-child,
  body.fm-group-page .group-synergy__copy > p:last-child {
    line-height: 1.65;
  }

  body.fm-group-page .group-operation__item {
    grid-template-columns: 1.85rem minmax(0, 1fr) 2rem;
    column-gap: 0.75rem;
  }

  body.fm-group-page .group-operation__marker {
    width: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.fm-group-page .group-page-content *,
  body.fm-group-page .group-page-content *::before,
  body.fm-group-page .group-page-content *::after {
    scroll-behavior: auto !important;
    transition-delay: 0ms !important;
  }

  .js body.fm-group-page .group-page-content .reveal.group-page-media img,
  .js body.fm-group-page .group-page-content .reveal.is-visible.group-page-media img,
  .js body.fm-group-page .group-operation__item.reveal .group-operation__index,
  .js body.fm-group-page .group-operation__item.reveal.is-visible .group-operation__index {
    animation: none;
    opacity: 1;
    clip-path: none;
    transform: none;
  }

  body.fm-group-page .group-activity,
  body.fm-group-page .group-activity__icon,
  body.fm-group-page .group-activity__glyph,
  body.fm-group-page .group-activity__icon img {
    transition: none;
  }

  body.fm-group-page .group-activity:hover .group-activity__icon {
    transform: none;
  }
}
