/* ============================================================
   CHI SIAMO CSS — Solferino Technology
   chi-siamo.html specific styles
   ============================================================ */

/* ============================================================
   ABOUT HERO
   ============================================================ */
.about-hero {
  padding-top: calc(var(--nav-h) + clamp(60px, 8vw, 120px));
  padding-bottom: clamp(60px, 8vw, 120px);
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  position: relative;
  overflow: hidden;
}

.about-hero-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: clamp(32px, 5vw, 80px);
}

.about-hero-text {
  position: relative;
  z-index: 2;
}

.about-hero-label {
  margin-bottom: 24px;
}

.about-hero-headline {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 7rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin-bottom: clamp(24px, 3vw, 40px);
  overflow: hidden;
}

.about-hero-headline .word-line span {
  display: block;
  will-change: transform, opacity;
}

.about-hero-headline em {
  color: var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.about-hero-intro {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.75;
  color: #4a4a4a;
  max-width: 420px;
  opacity: 0;
}

.about-hero-side {
  position: relative;
  z-index: 2;
  opacity: 0;
}

.about-stat-block {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.about-stat {
  border-left: 2px solid var(--accent);
  padding-left: 20px;
}

.about-stat-number {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 4px;
}

.about-stat-number span {
  color: var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
}

.about-stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================================
   CANVAS BACKGROUND
   ============================================================ */
.canvas-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
}

/* ============================================================
   MANIFESTO SECTION
   ============================================================ */
.manifesto-section {
  position: relative;
  z-index: 1;
  padding: var(--section-pad) var(--gutter);
  background: var(--text);
  overflow: hidden;
}

.manifesto-inner {
  max-width: var(--container-max);
  margin: 0 auto;
}

.manifesto-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(249, 248, 246, 0.4);
  margin-bottom: 40px;
}

.manifesto-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.8rem, 4vw, 4.5rem);
  line-height: 1.25;
  color: var(--bg);
  max-width: 900px;
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(40px);
  will-change: transform, opacity;
}

.manifesto-quote em {
  color: var(--accent);
  font-style: normal;
}

.manifesto-author {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(249, 248, 246, 0.35);
}

/* ============================================================
   EDITORIAL GRID — Team Section (SIMMETRICA E ALLINEATA)
   ============================================================ */
.team-section {
  position: relative;
  z-index: 1;
  padding: var(--section-pad) var(--gutter);
  background: var(--bg);
}

.team-inner {
  max-width: var(--container-max);
  margin: 0 auto;
}

.team-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: clamp(48px, 7vw, 96px);
  flex-wrap: wrap;
}

.team-headline {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 5rem);
  letter-spacing: -0.04em;
  line-height: 0.92;
  color: var(--text);
}

.team-headline em {
  color: var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.team-intro-text {
  max-width: 340px;
  color: #5a5a5a;
  align-self: end;
}

/* Griglia a 3 colonne perfettamente identiche */
.team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: clamp(24px, 3vw, 40px); /* Usiamo un gap moderno al posto del vecchio sfondo border */
  background: transparent;
}

/* Card del team pulita senza regole ereditate sballate */
.team-card {
  background: var(--bg);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px);
  will-change: transform, opacity;
  display: flex;
  flex-direction: column;
}

/* Contenitore ritratto: garantisce al 100% che siano grandi uguali */
.team-portrait-wrapper {
  width: 100%;
  aspect-ratio: 3 / 4; /* Proporzione verticale fissa per tutti e tre */
  background: #e8e6e3;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

/* Immagine all'interno del wrapper */
.team-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Taglia l'immagine senza mai deformarla */
  object-position: center top; /* Tiene il focus sul viso */
  display: block;
  filter: grayscale(100%);
  transition: filter 0.6s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* Effetto Hover */
.team-card:hover .team-portrait-img {
  filter: grayscale(0%);
  transform: scale(1.02);
}

/* Corpo del testo sotto la foto */
.team-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
}

.team-name {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}

.team-role {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.team-bio {
  font-size: 0.88rem;
  line-height: 1.65;
  color: #5a5a5a;
  margin-top: 8px;
}

/* ============================================================
   RESPONSIVE (Adattamento Tablet e Mobile)
   ============================================================ */
@media (max-width: 900px) {
  .about-hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .team-grid {
    grid-template-columns: 1fr 1fr; /* 2 colonne su tablet */
  }
}

@media (max-width: 600px) {
  .team-grid {
    grid-template-columns: 1fr; /* 1 colonna su mobile */
    gap: 32px;
  }
}
/* ============================================================
   VALUES SECTION — large typography breakdown
   ============================================================ */
.values-section {
  position: relative;
  z-index: 1;
  padding: var(--section-pad) var(--gutter);
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.values-section-inner {
  max-width: var(--container-max);
  margin: 0 auto;
}

.values-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.value-row {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
  padding: clamp(20px, 3vw, 36px) 0;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateX(-32px);
  will-change: transform, opacity;
  cursor: default;
  transition: padding 0.3s ease;
}

.value-row:first-child { border-top: 1px solid var(--border); }
.value-row:hover { padding-left: 12px; }

.value-row-num {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
  width: 28px;
}

.value-row-title {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 4rem);
  letter-spacing: -0.03em;
  line-height: 1;
  flex: 1;
  transition: color 0.25s;
}

.value-row:hover .value-row-title { color: var(--accent); }

.value-row-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 280px;
  text-align: right;
  flex-shrink: 0;
}

/* ============================================================
   VALUES ACCORDION
   ============================================================ */

/* Rimuove il padding del value-row padre quando è un accordion */
.value-row.value-accordion {
  display: block;   /* sovrascrive il flex-row del .value-row base */
  padding: 0;
  cursor: default;
}
.value-row.value-accordion:hover {
  padding-left: 0;
}

.value-row-header {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
  width: 100%;
  background: none;
  border: none;
  padding: clamp(20px, 3vw, 36px) 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.value-row-header:hover .value-row-title { color: var(--accent); }

.value-row-toggle {
  margin-left: auto;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  position: relative;
  transition: background 0.35s ease, border-color 0.35s ease, transform 0.45s cubic-bezier(0.4,0,0.2,1);
}

.value-row-toggle::before,
.value-row-toggle::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  background: var(--text);
  transition: background 0.35s ease, transform 0.45s cubic-bezier(0.4,0,0.2,1);
}

.value-row-toggle::before {
  width: 13px; height: 1.5px;
  transform: translate(-50%, -50%);
}

.value-row-toggle::after {
  width: 1.5px; height: 13px;
  transform: translate(-50%, -50%);
}

.value-row.open .value-row-toggle {
  background: var(--accent);
  border-color: var(--accent);
  transform: rotate(45deg);
}

.value-row.open .value-row-toggle::before,
.value-row.open .value-row-toggle::after {
  background: #fff;
}

/* Panel uses CSS grid trick for smooth height animation */
.value-row-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.value-row.open .value-row-panel {
  grid-template-rows: 1fr;
}

.value-row-panel-inner {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(24px, 4vw, 60px);
  padding-bottom: 0;
  transition: padding-bottom 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.value-row.open .value-row-panel-inner {
  padding-bottom: clamp(28px, 4vw, 52px);
}

.value-row-panel-text {
  display: flex;
  align-items: center;
  min-width: 0;
}

.value-row-panel-text .value-row-desc {
  text-align: left;
  max-width: none;
  font-size: clamp(0.95rem, 1.25vw, 1.2rem);
  line-height: 1.75;
  color: #444;
  min-width: 0;
  flex: 1;
}

.value-row-panel-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 2px;
  overflow: hidden;
}

.value-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.value-row-img-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #e8e6e3;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.value-row-img-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0,
    transparent 10px,
    rgba(26,26,26,0.04) 10px,
    rgba(26,26,26,0.04) 11px
  );
}

@media (max-width: 600px) {
  .value-row-panel-inner {
    grid-template-columns: 1fr;
  }
  .value-row-img-placeholder,
  .value-row-panel-img {
    aspect-ratio: 16 / 9;
  }
}

/* ============================================================
   RESPONSIVE (Grid Adapts dynamically)
   ============================================================ */
@media (max-width: 900px) {
  .about-hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .team-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Primo membro (Emanuele) occupa tutto lo spazio orizzontale su tablet */
  .team-card:first-child {
    grid-column: span 2;
    grid-row: span 1;
    min-height: auto;
  }

  .team-card:first-child .team-portrait-wrapper {
    aspect-ratio: 16 / 9; /* Crop cinematico su tablet */
  }
}

@media (max-width: 600px) {
  .team-grid {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    gap: 16px; /* Aggiunge un respiro visivo tra i membri su mobile */
    background: transparent; /* Rimuove lo stacco rigido del bordo */
  }
  
  .team-card {
    padding: 20px;
    border: 1px solid var(--border); /* Riquadri puliti su mobile */
  }

  .team-card:not(:first-child) {
    min-height: auto;
  }

  .team-portrait-wrapper {
    aspect-ratio: 4 / 5; /* Ottimo compromesso verticale su schermi piccoli */
  }
}

/* ============================================================
   VALUES FEATURE BLOCK — foto + testo in "Cosa ci distingue"
   ============================================================ */
.values-feature-block {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  margin-bottom: clamp(48px, 7vw, 80px);
  padding-bottom: clamp(40px, 6vw, 64px);
  border-bottom: 1px solid var(--border);
}

.values-feature-img-wrap {
  position: relative;
}

.values-feature-img-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #e8e6e3;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.values-feature-img-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0,
    transparent 12px,
    rgba(26,26,26,0.04) 12px,
    rgba(26,26,26,0.04) 13px
  );
}

.values-feature-eyebrow {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 20px;
}

.values-feature-headline {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: clamp(16px, 2vw, 28px);
}

.values-feature-headline em {
  color: var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.values-feature-desc {
  color: #5a5a5a;
  line-height: 1.75;
  max-width: 480px;
}

@media (max-width: 768px) {
  .values-feature-block {
    grid-template-columns: 1fr;
  }
  .values-feature-img-placeholder {
    aspect-ratio: 16 / 9;
  }
}

/* Uniforma l'altezza e la grandezza di tutte le foto su mobile */
@media (max-width: 768px) {
  /* 1. Tutti e tre i contenitori avranno esattamente la stessa altezza e proporzione */
  .team-portrait-wrapper {
    width: 100% !important;
    aspect-ratio: 3 / 4 !important; /* Formato verticale identico per tutti e 3 */
    overflow: hidden !important;
  }

  /* 2. Tutte le foto riempiono il proprio box senza deformarsi */
  .team-portrait-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
  }

  /* 3. Aggiustamento mirato per centrare il viso di Emanuele nella sua foto orizzontale */
  .team-card:first-of-type .team-portrait-img {
    object-position: center 15% !important; /* Mantiene la messa a fuoco in alto sul volto */
  }
}