/* =========================
   Team Professionals (tp)
   Current target: Divi (ETmodules icons OK for now)
   ========================= */

:root {
  --tp-red: #EA4D55;
  --tp-text: #2C3154;
  --tp-muted: rgba(0, 0, 0, .55);
  --tp-backdrop: rgba(0, 0, 0, .55);
}

/* ---------- Grid ---------- */
.tp-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content:center;
  gap: 30px;
  align-items:stretch;
}

/* ---------- Card (default layout baseline) ---------- */
.tp-card {
  text-align: left;
  max-width: 245px;
  padding-inline: 10px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
}

.tp-img {
  max-height: 280px;
}

.tp-img img {
  width: 100%;
  height: 100%;
  max-height: 280px;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.tp-name {
  margin-top: 20px;
  margin-bottom: 7px;
  padding-bottom: 0;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 600;
  color: var(--tp-text);
}

/* Name link trigger (circle layout uses <a> inside h3) */
.tp-name a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease-in-out;
}

.tp-name a:hover {
  color: var(--tp-red);
}

.tp-role {
  margin-bottom: 15px;
  color: var(--tp-text);
  font-size: 16px;
  text-transform:uppercase;
  font-weight: 300;
  line-height: 1.2;
}

/* ---------- CTA Bar (renders only if button="true") ---------- */
.tp-bar {
  margin-top: auto;
  background: var(--tp-red);
  padding: 10px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: rgb(0 0 0 / 25%) 0 0 11px 0;
}

/* the text link inside the bar */
.tp-open-text {
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
}

/* ---------- Plus Button ---------- */
.tp-plus {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;
  overflow: visible;
  isolation: isolate;
}

/* infinite outlined ring ping */
.tp-plus::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 0px solid rgba(0, 0, 0, .75);
  opacity: .9;
  transform: scale(.65);
  z-index: -1;
  pointer-events: none;
  animation: tp-ping 1.4s ease-out infinite;
}

@keyframes tp-ping {
  0% {
    transform: scale(.65);
    opacity: .85;
    border-width: 0;
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
    border-width: 8px;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
    border-width: 0;
  }
}

.tp-plus:hover::after {
  animation-duration: 1.1s;
}

@media (prefers-reduced-motion: reduce) {
  .tp-plus::after {
    animation: none;
  }
}

/* ---------- Icons row (renders only if social_links="true") ---------- */
.tp-icons {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

/* Icons (Divi ETmodules for now) */
.tp-ic {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tp-red);
  text-decoration: none;
  position: relative;
}

.tp-ic::before {
  font-family: "ETmodules";
  speak: none;
  font-style: normal;
  font-size: 16px;
  font-weight: 400;
  color: #fff;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.tp-fb::before { content: "\e093"; }
.tp-li::before { content: "\e0cb"; }
.tp-em::before { content: "\e076"; }
.tp-web::before { content: "\e02c"; }

/* =========================
   Circle layout overrides
   Enabled by: .tp-grid[data-layout="circle"]
   ========================= */

.tp-grid[data-layout="circle"] .tp-card {
  text-align: center;
}

/* Circle avatar */
.tp-grid[data-layout="circle"] .tp-img {
  width: 190px;
  height: 190px;
  max-height: none;
  margin: 0 auto 18px;
  border-radius: 999px;
  overflow: hidden;
}

.tp-grid[data-layout="circle"] .tp-img img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-radius: 0;
}

/* Circle typography */
.tp-grid[data-layout="circle"] .tp-name {
  margin-top: 0;
  font-weight:600;
  text-transform: uppercase;
}

.tp-grid[data-layout="circle"] .tp-role {
  margin-bottom: 0;
  font-weight: 300;
  text-transform: uppercase;
}

/* If social links are enabled in circle layout, center them */
.tp-grid[data-layout="circle"] .tp-icons {
  justify-content: center;
  margin-top: 14px;
  margin-bottom: 0;
}

/* If button is enabled in circle layout, keep spacing sane */
.tp-grid[data-layout="circle"] .tp-bar {
  margin-top: 18px;
}

/* ---------- Modal ---------- */
.tp-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
}

.tp-modal[aria-hidden="false"] {
  display: block;
}

.tp-backdrop {
  position: fixed;
  inset: 0;
  background: var(--tp-backdrop);
  z-index: 99998;
}

/* IMPORTANT: ensure panel fits on mobile */
.tp-modal-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100vw - 50px);
  max-width: 900px;
  height: calc(100vh - 50px);
  max-height: 500px;
  overflow: hidden;
  background: #fff;
  padding: 10px;
  border-radius: 5px;
  z-index: 99999;
}

/* close button visibility */
.tp-close {
  position: absolute;
  top: 2px;
  right: 3px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: var(--tp-text);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  z-index: 9999;
  transition: background 0.3s ease-in-out;
}

.tp-close:hover {
  background: var(--tp-red);
}

.tp-modal-grid {
  display: grid;
  grid-template-columns: 35% 65%;
  height: 100%;
}

.tp-modal-left img {
  width: 100%;
  height: 100% !important;
  max-height: 480px;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-radius: 3px;
}

.tp-modal-right {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.tp-modal_header {
  flex: 0 0 auto;
  padding: 10px 25px;
  background: #fff;
  z-index: 2;
}

.tp-modal-title {
  font-weight: 600;
  text-transform: uppercase;
  color: #222;
  font-size: 32px;
  margin-bottom: 0;
  padding-bottom: 0;
}

.tp-modal-icons {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

/* scrollable description */
.tp-modal-bio {
  font-size: 15px;
  font-weight: 400;
  color: var(--tp-text);
  flex: 1 1 auto;
  overflow: auto;
  padding: 0 25px;
  -webkit-overflow-scrolling: touch;
}

/* ---------- Responsive cards ---------- */
@media (max-width: 1400px) {
  .tp-card { width: 33.33%; }
}

@media (max-width: 980px) {
  .tp-card { width: 50%; }

  .tp-grid[data-layout="circle"] .tp-img {
    width: 140px;
    height: 140px;
  }
	.tp-name {
		font-size: 22px;
	}
}

@media (max-width: 767px) {
  /* keep wrapping; do NOT force column */
  .tp-card {
    width: 100%;
    text-align: center;
  }

  .tp-icons {
    justify-content: center;
  }

  .tp-grid[data-layout="circle"] .tp-img {
    width: 130px;
    height: 130px;
  }
	.tp-name {
		font-size: 20px;
	}

  .tp-modal-panel {
    top: 25px;
    left: 25px;
    transform: none;
    height: calc(100vh - 50px);
    max-height: 740px;
  }

  .tp-modal-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .tp-modal-left img {
    max-height: 280px;
    height: auto;
  }

  .tp-modal-title {
    font-size: 24px;
  }

  .tp-modal_header {
    padding: 10px 10px;
  }

  .tp-modal-bio {
    padding: 0 15px 0px;
  }
}

/* prevent background scroll when modal open */
html.tp-modal-open,
html.tp-modal-open body {
  overflow: hidden !important;
}