/* ══════════════════════════════════════════════
   ETRUSCAFORM v2.9.8
   ══════════════════════════════════════════════
   - Fix "Percorsi formativi su misura" visibility in light mode
   - Fix "crescere" font (same font as "Pronto a", italic)
   - Team cards: bigger, slower hover, name+social overlay, bio modal
   ══════════════════════════════════════════════ */


/* ══════════════════════════════════════════════
   1. FIX — "Percorsi formativi su misura" LIGHT MODE
   ══════════════════════════════════════════════
   The h2 in the services section on the homepage
   had color: var(--color-cream) which is invisible
   on the dark brown background in light mode.
   Force it to white explicitly.
   ══════════════════════════════════════════════ */

/* Fix all text in services section on dark background */
.ef-services .ef-section__header h2,
.page-id-138 .ef-services .ef-section__header h2,
.site-main--homepage .ef-services .ef-section__header h2,
section.ef-services .ef-section__header h2 {
  color: #ffffff !important;
}

.ef-services .ef-section__header p,
section.ef-services .ef-section__header p {
  color: rgba(255, 255, 255, 0.7) !important;
}


/* ══════════════════════════════════════════════
   2. FIX — "crescere" FONT MATCH
   ══════════════════════════════════════════════
   The <em> in "Pronto a crescere?" was rendering
   in a different font. Force same font-family as
   parent (Outfit sans-serif), keep italic.
   ══════════════════════════════════════════════ */

/* Override v2.9.7 which sets Cormorant Garamond on both title and em */
.ef-cta__title,
.ef-cta .ef-cta__title,
section.ef-cta h2.ef-cta__title {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-style: normal !important;
  font-weight: 700 !important;
}

.ef-cta__title em,
.ef-cta .ef-cta__title em,
section.ef-cta h2 em {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-style: italic !important;
  font-weight: 700 !important;
  color: var(--color-secondary, #d07c39) !important;
}


/* ══════════════════════════════════════════════
   3. TEAM CARDS v4 — Bigger, Smoother, Overlay
   ══════════════════════════════════════════════ */

/* Grid: more space for bigger cards */
.ef-team-grid {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 450px;
  padding: 2rem 0;
  flex-wrap: wrap;
}

/* Card default: bigger pill */
.ef-team-card {
  position: relative;
  width: 150px;
  height: 360px;
  border-radius: 90px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  /* Slower, more fluid spring animation */
  transition: all 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 20px rgba(57, 17, 14, 0.15);
}

/* Hover: expand to larger rounded square */
.ef-team-card:hover {
  width: 320px;
  height: 380px;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(57, 17, 14, 0.25);
}

/* Image: smooth scaling on hover */
.ef-team-card__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.ef-team-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ef-team-card:hover .ef-team-card__image img {
  transform: scale(1.05);
}

/* ── Info overlay: name + role + social ── */
.ef-team-card__info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem;
  background: linear-gradient(
    to top,
    rgba(57, 17, 14, 0.92) 0%,
    rgba(57, 17, 14, 0.6) 60%,
    transparent 100%
  );
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 50%;
}

.ef-team-card:hover .ef-team-card__info {
  transform: translateY(0);
  opacity: 1;
}

/* Name */
.ef-team-card__name {
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.15rem;
  transform: translateY(10px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s;
}

.ef-team-card:hover .ef-team-card__name {
  transform: translateY(0);
  opacity: 1;
}

/* Role */
.ef-team-card__role {
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--color-secondary, #d07c39);
  margin-bottom: 0.75rem;
  transform: translateY(10px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.25s;
}

.ef-team-card:hover .ef-team-card__role {
  transform: translateY(0);
  opacity: 1;
}

/* Social icons row */
.ef-team-card__social {
  display: flex;
  gap: 0.5rem;
  transform: translateY(10px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.35s;
}

.ef-team-card:hover .ef-team-card__social {
  transform: translateY(0);
  opacity: 1;
}

.ef-team-card__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transition: all 0.3s ease;
  text-decoration: none;
}

.ef-team-card__social a:hover {
  background: var(--color-secondary, #d07c39);
  color: #ffffff;
  transform: scale(1.1);
}

.ef-team-card__social a svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Bio button (opens modal) */
.ef-team-card__bio-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
  padding: 0.3rem 0.7rem;
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
  background: rgba(208, 124, 57, 0.3);
  border: 1px solid rgba(208, 124, 57, 0.5);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  transform: translateY(10px);
  opacity: 0;
}

.ef-team-card:hover .ef-team-card__bio-btn {
  transform: translateY(0);
  opacity: 1;
  transition-delay: 0.4s;
}

.ef-team-card__bio-btn:hover {
  background: var(--color-secondary, #d07c39);
  border-color: var(--color-secondary, #d07c39);
  color: #ffffff;
}

.ef-team-card__bio-btn svg {
  width: 12px;
  height: 12px;
}


/* ══════════════════════════════════════════════
   4. BIO MODAL
   ══════════════════════════════════════════════ */

.ef-team-bio-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.ef-team-bio-modal.is-active {
  display: flex;
}

.ef-team-bio-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(57, 17, 14, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: efBioFadeIn 0.3s ease;
}

.ef-team-bio-modal__content {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(57, 17, 14, 0.3);
  animation: efBioSlideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1;
}

[data-theme="dark"] .ef-team-bio-modal__content {
  background: #1a0a08;
  color: #faf6f1;
}

.ef-team-bio-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(57, 17, 14, 0.08);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: var(--color-primary, #39110e);
}

[data-theme="dark"] .ef-team-bio-modal__close {
  background: rgba(250, 246, 241, 0.1);
  color: #faf6f1;
}

.ef-team-bio-modal__close:hover {
  background: rgba(57, 17, 14, 0.15);
  transform: rotate(90deg);
}

.ef-team-bio-modal__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-right: 2rem;
}

.ef-team-bio-modal__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--color-secondary, #d07c39);
}

.ef-team-bio-modal__name {
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-primary, #39110e);
  margin: 0;
}

[data-theme="dark"] .ef-team-bio-modal__name {
  color: #faf6f1;
}

.ef-team-bio-modal__role {
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 0.85rem;
  color: var(--color-secondary, #d07c39);
  margin: 0;
}

.ef-team-bio-modal__body {
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-soft-brown, #8b5a3c);
}

[data-theme="dark"] .ef-team-bio-modal__body {
  color: rgba(250, 246, 241, 0.8);
}

.ef-team-bio-modal__body p {
  margin-bottom: 0.75rem;
}

@keyframes efBioFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes efBioSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}


/* ══════════════════════════════════════════════
   5. TEAM — External Social (below card)
   ══════════════════════════════════════════════
   Keep the external social row for non-hover
   states / mobile fallback
   ══════════════════════════════════════════════ */

.ef-team-card__social-external {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  opacity: 0;
  transform: translateY(5px);
  transition: all 0.5s ease 0.3s;
}

.ef-team-card-wrapper:hover .ef-team-card__social-external {
  opacity: 1;
  transform: translateY(0);
}


/* ══════════════════════════════════════════════
   6. MOBILE — Team responsive
   ══════════════════════════════════════════════ */

@media (max-width: 768px) {
  .ef-team-grid {
    gap: 1rem;
    min-height: auto;
    padding: 1rem 0;
  }

  .ef-team-card {
    width: 120px;
    height: 280px;
    border-radius: 70px;
  }

  .ef-team-card:hover {
    width: 260px;
    height: 320px;
    border-radius: 16px;
  }

  .ef-team-card__name {
    font-size: 1rem;
  }

  .ef-team-card__role {
    font-size: 0.8rem;
  }

  .ef-team-bio-modal__content {
    padding: 1.5rem;
    margin: 1rem;
  }
}

@media (max-width: 480px) {
  .ef-team-grid {
    flex-wrap: wrap;
    justify-content: center;
  }

  .ef-team-card {
    width: 100px;
    height: 240px;
    border-radius: 60px;
  }

  .ef-team-card:hover {
    width: 220px;
    height: 280px;
  }
}


/* ══════════════════════════════════════════════
   7. DARK MODE — Team & Bio Modal
   ══════════════════════════════════════════════ */

[data-theme="dark"] .ef-team-section {
  background: var(--bg-primary, #0d0504);
}

[data-theme="dark"] .ef-team-header h2 {
  color: #ffffff !important;
}

[data-theme="dark"] .ef-team-header p {
  color: rgba(255, 255, 255, 0.65);
}

[data-theme="dark"] .ef-team-card {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .ef-team-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}


/* ══════════════════════════════════════════════
   FINE v2.9.8
   ══════════════════════════════════════════════ */
