/* ── Pagina Chi siamo ───────────────── */

.chi-siamo-page {
  --chi-nav-height: 72px;
  --chi-subnav-height: 0px;
  --chi-panel-height: calc(100vh - var(--chi-nav-height) - var(--chi-subnav-height));
}

/* Solo wrapper pagina standalone: non sul blocco .chi-horizontal (CMS) */
main.page-chi-siamo.chi-siamo-page {
  padding-top: var(--chi-nav-height);
}

/* Intro: meno padding sotto per attaccare il sottomenu (prima: clamp(1.5rem,3vw,2.25rem) creava stacco) */
.chi-page-header {
  padding: clamp(2rem, 5vw, 3rem) 0 0;
  margin-bottom: 0;
  background: var(--white);
}

.chi-page-title {
  font-family: var(--serif);
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  font-weight: 400;
  line-height: 1.15;
  margin: 0.35rem 0 1rem;
  color: var(--ink);
}

.chi-page-intro {
  max-width: 38rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink-light);
  margin: 0;
  padding-bottom: clamp(0.75rem, 2vw, 1rem);
}

.chi-subnav-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  margin-top: 0;
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--beige);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}
.chi-subnav-wrap:before {
  content: "";
  position: absolute;
  top: 0;
  left: 5vw;
  width: 1px;
  height: 100%;
  border-left: 1px solid var(--bs-white);
  z-index: 100;
}

.chi-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0.85rem clamp(1rem, 3vw, 2.5rem);
  justify-content: center;
  align-items: center;
}

.chi-subnav a {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: 0.35rem 0.15rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, opacity 0.2s;
}

.chi-subnav a:hover {
  opacity: 0.75;
}

.chi-subnav a:focus-visible {
  outline: 2px solid var(--blu1);
  outline-offset: 3px;
}

.chi-subnav a.active {
  border-bottom-color: var(--ink);
}

.chi-horizontal {
  position: relative;
  background: var(--beige);
  margin-top: 0;
}

.chi-horizontal-pin-inner {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  min-height: 0;
}

.chi-horizontal-viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
}

.chi-horizontal-track {
  display: flex;
  flex-wrap: nowrap;
  width: max-content;
  align-items: stretch;
}

.chi-panel {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding-left: clamp(1.25rem, 4vw, 1.5rem);
  padding-right: clamp(1.25rem, 4vw, 1.5rem);
  padding-top: 0;
  padding-bottom: 0;
  scroll-margin-top: calc(var(--chi-nav-height) + var(--chi-subnav-height) + 8px);
  background-color: var(--ink);
  background-image: var(--chi-panel-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.chi-panel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.35) 45%,
    rgba(0, 0, 0, 0.2) 100%
  );
  pointer-events: none;
}

.chi-panel--0 .chi-panel-overlay {
  background: linear-gradient(90deg, rgba(236, 226, 210, 0) 0%, rgba(236, 226, 210, 0.54) 50%, rgba(236, 226, 210, 1) 60%, rgba(236, 226, 210, 1) 100%);
}

.chi-panel--0 .chi-panel-title,
.chi-panel--0 .chi-panel-text {
  color: var(--blu1);
}

.chi-panel--0 .chi-panel-text strong {
  color: var(--ink);
}

.chi-panel--1 .chi-panel-overlay {
  background: #E2A9F1;
  background: linear-gradient(90deg, rgba(226, 169, 241, 0) 0%, rgba(226, 169, 241, 0.54) 50%, rgba(226, 169, 241, 1) 60%, rgba(226, 169, 241, 1) 100%);
}

.chi-panel--1 .chi-panel-text strong {
  color: var(--blu1);
}

.chi-panel--2 .chi-panel-overlay {
  background: #003C64;
  background: linear-gradient(90deg, rgba(0, 60, 100, 0) 0%, rgba(0, 60, 100, 0.54) 50%, rgba(0, 60, 100, 1) 60%, rgba(0, 60, 100, 1) 100%);
}

.chi-panel--2 .chi-panel-text strong {
  color: var(--lavanda);
}

.chi-panel--3 .chi-panel-overlay {
  background: #F1F1F1;
  background: linear-gradient(90deg, rgba(241, 241, 241, 0) 0%, rgba(241, 241, 241, 0.54) 50%, rgba(241, 241, 241, 1) 60%, rgba(241, 241, 241, 1) 100%);
}

.chi-panel--3 .chi-panel-title,
.chi-panel--3 .chi-panel-text {
  color: var(--blu1);
}
  

.chi-panel-inner {
  position: relative;
  z-index: 1;
  max-width: 100%;
  width: 100%;
  height:100%;
  color: #fff;
  padding: 50px;
  box-sizing: border-box;
  overflow-x: visible;
  overflow-y: visible;
  display:flex;justify-content: flex-end;align-items: center;
}

.box {
  position: relative;
  width: clamp(34rem, 46vw, 43rem);
  max-width: 100%;
}

.chi-panel-title {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 400;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.chi-panel-kicker {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
  opacity: 0.95;
}

.chi-panel-lead {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 1rem;
  opacity: 0.88;
  line-height: 1.5;
}

.chi-panel-text {
  font-size: clamp(14px, 0.94vw, 18px);
  line-height: 1.62;
  margin: 0 0 0.85rem;
  color: rgba(255, 255, 255, 0.94);
}

.chi-panel-text:last-child {
  margin-bottom: 0;
}

.chi-team {
  padding: 0 0 clamp(3.5rem, 8vw, 6rem) 0;
}

.chi-team-media {
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.chi-team-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chi-team-copy {
  max-width: 40rem;
  margin: clamp(2rem, 4vw, 3rem) auto 0;
  text-align: center;
}

.chi-team-title {
  font-family: var(--serif);
  font-size: clamp(1.85rem, 3.2vw, 2.35rem);
  font-weight: 400;
  margin: 0 0 1.5rem;
  color: var(--ink);
}

.chi-team-text {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--ink-light);
  margin: 0 0 1.1rem;
  text-align: left;
}

.chi-team-text:last-child {
  margin-bottom: 0;
}

/* Desktop: altezza slider = spazio residuo sotto nav + sottomenu */
@media (min-width: 992px) {
  .chi-horizontal {
    overflow: hidden;
    min-height: calc(var(--chi-panel-height) + var(--chi-subnav-height));
  }

  .chi-horizontal-pin-inner {
    min-height: calc(100vh - var(--chi-nav-height));
  }

  .chi-horizontal:before {
    content: "";
    position: absolute;
    top: 0;
    left: 5vw;
    width: 1px;
    height: 100%;
    border-left: 1px solid var(--bs-white);
    z-index: 100;
  }
  
  .chi-horizontal:after {
    content: "";
    position: absolute;
    top: 0;
    right: 5vw;
    width: 1px;
    height: 100%;
    border-left: 1px solid var(--bs-white);
    z-index: 100;
  }
  
  .chi-horizontal section:before,.chi-horizontal section:after{display:none}

  .chi-horizontal-viewport {
    flex: 0 0 auto;
    height: var(--chi-panel-height);
    min-height: var(--chi-panel-height);
    overflow: hidden;
  }

  .chi-horizontal-track {
    will-change: transform;
    height: var(--chi-panel-height);
    min-height: var(--chi-panel-height);
  }

  .chi-panel {
    flex: 0 0 100vw;
    width: 100vw;
    min-width: 100vw;
    height: var(--chi-panel-height);
    min-height: var(--chi-panel-height);
    padding-left: clamp(2rem, 5vw, 5rem);
    padding-right: clamp(2rem, 5vw, 5rem);
  }

  .chi-panel-inner {
    max-width: 100%;
    max-height: 100%;
    min-height: 0;
    overflow-y: visible;
    -webkit-overflow-scrolling: auto;
  }

  .chi-panel-overlay {
    background: linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.75) 0%,
      rgba(0, 0, 0, 0.45) 55%,
      rgba(0, 0, 0, 0.25) 100%
    );
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .box {
    width: clamp(38rem, 64vw, 44rem);
  }

  .chi-panel-text {
    font-size: clamp(14px, 1.25vw, 16px);
    line-height: 1.56;
  }
}

@media (min-width: 992px) and (max-height: 780px) {
  .chi-panel-inner {
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .chi-panel-title {
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    margin-bottom: 0.35rem;
  }

  .chi-panel-text {
    font-size: clamp(13px, 0.78vw, 15px);
    line-height: 1.5;
    margin-bottom: 0.65rem;
  }

  .box {
    width: clamp(24rem, 42vw, 48rem);
  }
}

@media (max-width: 991.98px) {
  .chi-horizontal-track {
    flex-direction: column;
    transform: none !important;
    will-change: auto;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
  }

  .chi-horizontal-viewport {
    min-height: 0;
    height: auto;
    overflow: visible;
  }

  .chi-panel {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: auto;
    padding-top: 56vw;
    overflow-x: hidden;
    overflow-y: visible;
    align-items: flex-end;  
    background-size: contain;
        background-position: center top;
        background-color: #fff;
  }

  .chi-panel-inner {
    max-height: none;
    overflow-y: visible;
    padding: 30px;
  }

  .chi-subnav{display:none;}
  .box {
      width: 100%;
  }
  .chi-panel--0 .chi-panel-overlay{background: rgba(236, 226, 210, 0.8); background: linear-gradient(180deg, rgba(236, 226, 210, 0) 0%, rgba(236, 226, 210, 0.44) 28%, rgba(236, 226, 210, 1) 46%, rgba(236, 226, 210, 1) 100%);}
  .chi-panel--1 .chi-panel-overlay{background: linear-gradient(180deg, rgba(226, 169, 241, 0) 0%, rgba(226, 169, 241, 0.44) 28%, rgba(226, 169, 241, 1) 46%, rgba(226, 169, 241, 1) 100%);}
  .chi-panel--2 .chi-panel-overlay{background:rgba(0, 60, 100, 0.7); background: linear-gradient(180deg, rgba(0, 60, 100, 0) 0%, rgba(0, 60, 100, 0.44) 28%, rgba(0, 60, 100, 1) 46%, rgba(0, 60, 100, 1) 100%);}
  .chi-panel--3 .chi-panel-overlay{background:rgba(241, 241, 241, 0.7); background: linear-gradient(180deg, rgba(241, 241, 241, 0) 0%, rgba(241, 241, 241, 0.44) 28%, rgba(241, 241, 241, 1) 46%, rgba(241, 241, 241, 1) 100%);}

.chi-team-text p{text-align: left!important;}

}

@media (prefers-reduced-motion: reduce) {
  .chi-horizontal-track {
    transform: none !important;
    will-change: auto !important;
  }
}

body.chi-reduced-motion .chi-horizontal-track {
  transform: none !important;
  will-change: auto !important;
}

#chi-team {
  scroll-margin-top: calc(var(--chi-nav-height) + var(--chi-subnav-height) + 8px);
}
