/* RF Team widget — Reloadux Addons
 * Tokens scoped to .rfteam-root. .team__inner has zero padding so the
 * parent Elementor Section/Column owns all outer spacing — internal
 * padding here would stack with parent padding and double-gap.
 */

/* ---------- Tokens (scoped) ---------- */
.rfteam-root {
  --rf-bg-section: #ffffff;
  --rf-bg-detail: #f7f7f7;
  --rf-bg-card-rest: #e8f3fe;
  --rf-bg-card-active: #1070d7;

  --rf-text-strong: #0e0f10;
  --rf-text-default: #2f2f2f;
  --rf-text-on-color: #ffffff;

  --rf-section-gap: 32px;

  --rf-list-gap: 16px;

  --rf-card-h: 411px;
  --rf-card-rest-w: 188px;
  --rf-card-active-photo-w: 310px;
  --rf-card-radius: 16px;
  --rf-card-pad-top: 32px;
  --rf-card-pad-bottom: 12px;
  --rf-card-pad-x: 12px;

  --rf-detail-pad: 24px;
  --rf-detail-gap: 8px;

  --rf-header-gap: 8px;

  --rf-ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --rf-t-flex: 600ms var(--rf-ease-soft);
  --rf-t-color: 400ms ease;
  --rf-t-fade: 350ms ease;
}

/* ---------- Box-sizing reset for our subtree only ---------- */
.rfteam-root *,
.rfteam-root *::before,
.rfteam-root *::after {
  box-sizing: border-box;
}

.rfteam-root button {
  font-family: inherit;
}

/* ---------- Section ---------- */
.rfteam-root .team__inner {
  margin: 0 auto;
  background: var(--rf-bg-section);
  border-radius: 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--rf-section-gap);
  overflow: clip;
}

/* ---------- Header ---------- */
.rfteam-root .team__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--rf-header-gap);
  text-align: center;
}

.rfteam-root .team__title {
  margin: 0;
  max-width: 720px;
  font-size: 48px;
  line-height: 54px;
  letter-spacing: -0.96px;
  font-weight: 400;
  color: var(--rf-text-strong);
}

.rfteam-root .team__subtitle {
  margin: 0;
  max-width: 662px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 400;
  color: var(--rf-text-default);
}

/* ---------- Member list ---------- */
.rfteam-root .team__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  gap: var(--rf-list-gap);
  width: 100%;
}

/* ---------- Member card ---------- */
.rfteam-root .member {
  flex: 0 0 var(--rf-card-rest-w);
  height: var(--rf-card-h);
  display: flex;
  align-items: stretch;
  gap: 0;
  border-radius: var(--rf-card-radius);
  background: transparent;
  overflow: hidden;
  transition: flex var(--rf-t-flex), background-color var(--rf-t-color),
    gap var(--rf-t-color);
  min-width: 0;
}

.rfteam-root .member.is-active {
  flex: 1 1 0;
  background: var(--rf-bg-detail);
  gap: var(--rf-detail-gap);
}

/* ---------- Photo (the only thing visible when not active) ---------- */
.rfteam-root .member__photo {
  appearance: none;
  border: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;

  flex: 0 0 var(--rf-card-rest-w);
  height: 100%;
  border-radius: var(--rf-card-radius);
  overflow: hidden;
  background: var(--rf-bg-card-rest);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--rf-card-pad-top) var(--rf-card-pad-x) var(--rf-card-pad-bottom);
  transition: flex-basis var(--rf-t-flex), background-color var(--rf-t-color);
}

.rfteam-root .member.is-active .member__photo {
  flex: 0 0 var(--rf-card-active-photo-w);
  background: var(--rf-bg-card-active);
  cursor: default;
}

.rfteam-root .member__photo:focus-visible {
  outline: 2px solid var(--rf-bg-card-active);
  outline-offset: 3px;
}

.rfteam-root .member__photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
  z-index: 0;
}

/* Bottom-vignette overlay. Only used in the rest state — fades out on
   the active card so the brand background reads cleanly. */
.rfteam-root .member__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 49%,
    rgba(0, 0, 0, 0.7) 100%
  );
  pointer-events: none;
  z-index: 1;
  transition: opacity var(--rf-t-fade);
}

.rfteam-root .member.is-active .member__overlay {
  opacity: 0;
}

.rfteam-root .member__caption {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--rf-text-on-color);
  white-space: nowrap;
}

.rfteam-root .member__name {
  display: block;
  font-size: 18px;
  line-height: 26px;
  font-weight: 500;
}

.rfteam-root .member__role {
  display: block;
  font-size: 12px;
  line-height: 18px;
  font-weight: 400;
}

/* ---------- Detail panel (only visible when active) ---------- */
.rfteam-root .member__detail {
  flex: 1 1 0;
  min-width: 0;
  padding: var(--rf-detail-pad);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  pointer-events: none;
}

.rfteam-root .member__detail > * {
  margin: 0;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity var(--rf-t-fade), transform var(--rf-t-fade);
}

.rfteam-root .member.is-active .member__detail {
  pointer-events: auto;
}

.rfteam-root .member.is-active .member__detail > * {
  opacity: 1;
  transform: translateX(0);
  /* Stagger the fade-in so it appears after the card has started expanding. */
  transition-delay: 250ms;
}

.rfteam-root .member__quote {
  font-size: 20px;
  line-height: 28px;
  color: var(--rf-text-default);
}

.rfteam-root .member__cta {
  font-size: 16px;
  line-height: 22px;
  color: var(--rf-text-default);
}

/* ---------- Tablet + Mobile ----------
   The 4-up horizontal layout doesn't fit iPad portrait/landscape with
   reasonable card proportions, so the stacked layout extends up to
   the tablet breakpoint. A narrower phone-only block follows. */
@media (max-width: 1024px) {
  .rfteam-root .team__inner {
    border-radius: 0;
    gap: 40px;
  }

  .rfteam-root .team__title {
    font-size: 36px;
    line-height: 44px;
    letter-spacing: -0.5px;
  }

  .rfteam-root .team__subtitle {
    font-size: 16px;
    line-height: 22px;
  }

  .rfteam-root .team__header {
    gap: 16px;
  }

  /* Cards stack vertically and fill the full width of the parent —
     no widget-level cap on tablet so the layout uses whatever space
     the parent column gives it. The narrower phone block below
     re-introduces a 346px cap for actual phones. */
  .rfteam-root .team__list {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 16px;
  }

  /* Card grows from photo-only (rest) to photo + detail (active).
     Card height is auto so it adapts to whatever the photo + detail
     panel sum to. Detail panel uses max-height + padding-block
     transition for the smooth open/close animation. */
  .rfteam-root .member {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    flex-direction: column;
    gap: 0;
    transition: background-color var(--rf-t-color);
  }

  .rfteam-root .member.is-active {
    flex: 0 0 auto;
    background: var(--rf-bg-detail);
    gap: 0;
  }

  /* Photo holds a portrait 3:4 aspect ratio so typical headshots show
     in full rather than being cropped to a head-and-shoulders sliver.
     Matches the desktop active card's 310:411 proportion. */
  .rfteam-root .member__photo {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    aspect-ratio: 25 / 24;
    transition: background-color var(--rf-t-color);
  }

  .rfteam-root .member.is-active .member__photo {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    aspect-ratio: 25 / 24;
    background: var(--rf-bg-card-active);
  }

  /* Detail panel collapses to 0 in rest state and expands when the
     card is active. max-height (with a generous cap) + padding-block
     transitions give a smooth open/close. */
  .rfteam-root .member__detail {
    flex: 0 0 auto;
    width: 100%;
    max-height: 0;
    padding-block: 0;
    padding-inline: 16px;
    gap: 24px;
    overflow: hidden;
    transition: max-height var(--rf-t-flex), padding-block var(--rf-t-color);
  }

  .rfteam-root .member.is-active .member__detail {
    max-height: 600px;
    padding-block: 16px;
  }

  /* Mobile typography — DemiBold name and Medium role */
  .rfteam-root .member__name {
    font-weight: 600;
    line-height: 22px;
  }

  .rfteam-root .member__role {
    font-weight: 500;
    line-height: 12px;
  }

  /* Mobile detail text: 14/20 */
  .rfteam-root .member__quote {
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
  }

  .rfteam-root .member__cta {
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
  }

  /* Subtle vertical slide-in for the text on mobile (matches the
     vertical expansion direction). */
  .rfteam-root .member__detail > * {
    transform: translateY(-6px);
  }

  .rfteam-root .member.is-active .member__detail > * {
    transform: translateY(0);
  }
}

/* ---------- Phone ----------
   Capped at 600px (not 768px) so the 346px title/list caps inside this
   block don't engage at iPad portrait, where the section is wide
   enough to gutter heavily around them. */
@media (max-width: 600px) {
  .rfteam-root .team__title {
    font-size: 32px;
    line-height: 40px;
    letter-spacing: -0.32px;
    max-width: 346px;
  }

  .rfteam-root .team__subtitle {
    font-size: 14px;
    line-height: 20px;
    max-width: 302px;
  }

  .rfteam-root .team__list {
    max-width: 346px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .rfteam-root .member,
  .rfteam-root .member__photo,
  .rfteam-root .member__photo-img,
  .rfteam-root .member__overlay,
  .rfteam-root .member__detail,
  .rfteam-root .member__detail > * {
    transition: none;
  }
}
