/* Block Team per Reparto — Maexport
   Card orizzontale bordo 2px mobile / 3px desktop (coerente metodo clamp),
   radius 1.5rem, max-height 220px (13.75rem), media 42% + body 58%.
   Nome 20px/22px w600, ruolo 14px, icone 40px gap 16px.
   Bordo sotto h3 esteso dal bordo scheda all'immagine (spessore = bordo).
   Sotto 360px stacking verticale.
   Unità relative rem, palette via --maexport-team-border.
*/

.maexport-team-reparto {
  --maexport-team-border: #054290;
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.5rem) 0;
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vw, 3rem);
  font-family: var(--wp--preset--font-family--sans, Sarabun, sans-serif);
}

.maexport-team-reparto__group {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.5rem);
}

.maexport-team-reparto__heading {
  font-family: var(--wp--preset--font-family--sans, Sarabun, sans-serif);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  color: #1d1d1d;
  margin: 0;
  padding: 0;
  letter-spacing: 0;
}

.maexport-team-reparto__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  align-items: stretch;
}

@media (min-width: 48em) {
  .maexport-team-reparto__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Card — max 220px, bordo coerente metodo */

.maexport-team-card {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  height: 15.75rem;
  max-height: 15.75rem;
  min-height: 15.75rem;
  background: #fff;
  border: 2px solid var(--maexport-team-border, #054290);
  border-radius: 1.25rem;
  overflow: hidden;
  box-sizing: border-box;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

@media (min-width: 48em) {
  .maexport-team-card {
    border-width: 3px;
  }
}

.maexport-team-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.maexport-team-card:focus-within {
  outline: 2px solid var(--maexport-team-border, #054290);
  outline-offset: 2px;
}

/* Media sinistra — 42% */

.maexport-team-card__media {
  flex: 0 0 42%;
  max-width: 42%;
  position: relative;
  overflow: hidden;
  background: #efefef;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 100%;
}

.maexport-team-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  /* mantiene copertura su 220px, spaziatura verticale = cover top */
  min-height: 100%;
}

.maexport-team-card__placeholder {
  width: 100%;
  height: 100%;
  min-height: 13.75rem;
  background: linear-gradient(135deg, #efefef 0%, #e2e2e2 100%);
}

/* Body destro — padding 20px (1.25rem) top/bottom coerente Figma */

.maexport-team-card__body {
  flex: 1 1 58%;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.25rem 1.25rem 1.25rem; /* 20px */
  gap: 0;
  min-width: 0;
  background: #fff;
  position: relative;
}

.maexport-team-card__name {
  position: relative;
  font-size: clamp(1.25rem, 2vw, 2.1875rem); /* 20px mobile → 35px desktop */
  font-weight: 600;
  line-height: clamp(1.375rem, 2.2vw, 2.25rem); /* 22px → ~36px */
  color: #1d1d1d;
  margin: 0;
  padding: 0 0 1rem 0; /* 16px sotto nome prima del bordo */
  width: 100%;
  overflow-wrap: break-word;
  border-bottom: 0;
}

/* Bordo sotto h3: solo su body, dal bordo immagine al bordo scheda (non sopra foto) */
.maexport-team-card__name::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--maexport-team-border, #054290);
  pointer-events: none;
  width: calc(100% + 2.5rem);
  transform: translateX(-1.25rem);
}

@media (min-width: 48em) {
  .maexport-team-card__name::after {
    height: 3px;
  }
}

.maexport-team-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0 0 0; /* 16px sopra ruolo */
  flex: 1 1 auto;
}

.maexport-team-card__role {
  font-size: clamp(0.875rem, 1.2vw, 1rem); /* 14px mobile → 16px desktop */
  font-weight: 700;
  line-height: 1.4;
  color: #1d1d1d;
  margin: 0;
}

.maexport-team-card__langs {
  font-size: clamp(0.875rem, 1.2vw, 1rem); /* 14px mobile → 16px desktop */
  font-style: italic;
  font-weight: 400;
  line-height: 1.4;
  color: #1d1d1d;
  margin: 0;
  opacity: 0.95;
}

/* Contatti — icone 40px gap 16px */

.maexport-team-card__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem; /* 16px */
  margin-top: auto;
  padding-top: 1rem; /* 16px sopra icone */
  align-items: center;
}

.maexport-team-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem; /* 40px */
  height: 2.5rem;
  border-radius: 0.5rem;
  background-color: var(--maexport-team-border, #054290);
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
  border: 0;
  cursor: pointer;
}

.maexport-team-card__icon:hover {
  transform: translateY(-1px) scale(1.04);
  filter: brightness(1.06);
}

.maexport-team-card__icon:focus-visible {
  outline: 2px solid #1d1d1d;
  outline-offset: 2px;
}

.maexport-team-card__icon svg {
  width: 1.375rem;
  height: 1.375rem;
  display: block;
}

/* Link invisibile full-card per permalink — non copre icone */
.maexport-team-card__permalink {
  position: absolute;
  inset: 0;
  z-index: 0;
  text-decoration: none;
}

.maexport-team-card__body,
.maexport-team-card__media {
  position: relative;
  z-index: 1;
}

.maexport-team-card__contacts,
.maexport-team-card__contacts a {
  position: relative;
  z-index: 2;
}

/* Responsive: sotto 360px incolla sotto la foto (verticale) */
@media (max-width: 22.5em) {
  .maexport-team-card {
    flex-direction: column;
    height: auto;
    max-height: none;
    min-height: 0;
  }

  .maexport-team-card__media {
    flex: 0 0 auto;
    max-width: 100%;
    width: 100%;
    min-height: 0;
  }

  .maexport-team-card__image {
    aspect-ratio: 1 / 1;
    max-height: 16rem;
    height: auto;
    min-height: 0;
  }

  .maexport-team-card__body {
    flex: 0 0 auto;
    width: 100%;
    padding: 1.25rem;
  }

  .maexport-team-card__name::after {
    left: 0;
    right: 0;
  }
}

/* Editor fix */
.editor-styles-wrapper .maexport-team-reparto__grid {
  pointer-events: auto;
}

.maexport-team-reparto--empty,
.maexport-team-reparto__empty {
  font-size: 0.9375rem;
  line-height: 1.5;
}
