/* Who We Are team grid: [pine_team] shortcode, see inc/team.php */

/* The modal is moved to <body> by team.js, so it needs the tokens too */
.pine-team,
.pt-modal {
  --pt-green: #347735;
  --pt-forest: #004d23;
  --pt-sage: #b0cd8a;
  --pt-ink: #141617;
  --pt-ink-soft: #53565a;
  --pt-grey-bg: #f0f0f0;
  --pt-line: #e1e4e1;
  --pt-radius: 6px;
  font-family: "Poppins", Arial, Helvetica, sans-serif;
  color: var(--pt-ink);
}

.pine-team h3 {
  font-family: inherit;
  letter-spacing: 0;
  text-transform: none;
}

/* Department filter */
.pt-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
}

.pt-pill {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border: 1px solid #cfd3cf;
  border-radius: 19px;
  background: #fff;
  color: var(--pt-ink);
  font: 500 14px/1 "Poppins", Arial, Helvetica, sans-serif;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;

  &:hover {
    border-color: var(--pt-green);
    color: var(--pt-green);
  }

  &.is-on {
    background: var(--pt-green);
    border-color: var(--pt-green);
    color: #fff;
  }

  &:focus-visible {
    outline: 3px solid var(--pt-sage);
    outline-offset: 2px;
  }
}

/* Grid of compact flip cards */
.pt-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
}

.pt-person {
  display: grid;
  perspective: 1200px;
  cursor: pointer;

  &[hidden] {
    display: none;
  }

  &:focus-visible {
    outline: 3px solid var(--pt-sage);
    outline-offset: 3px;
    border-radius: var(--pt-radius);
  }
}

.pt-inner {
  position: relative;
  display: grid;
  transition: transform 0.6s cubic-bezier(0.3, 0.7, 0.3, 1);
  transform-style: preserve-3d;
}

@media (hover: hover) {
  .pt-person:hover .pt-inner,
  .pt-person:focus-visible .pt-inner {
    transform: rotateY(180deg);
  }
}

.pt-face {
  grid-area: 1 / 1;
  overflow: hidden;
  border-radius: var(--pt-radius);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 2px 12px rgba(20, 22, 23, 0.08);
}

.pt-front {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--pt-line);
}

.pt-photo {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--pt-grey-bg);

  img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
  }
}

.pt-nameplate {
  flex: 1;
  min-height: 68px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 12px;
  background: var(--pt-forest);
  color: #fff;
  text-align: center;

  h3 {
    margin: 0;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
  }

  span {
    display: block;
    margin-top: 3px;
    color: var(--pt-sage);
    font-size: 12px;
    line-height: 1.35;
  }
}

.pt-back {
  display: flex;
  flex-direction: column;
  padding: 20px 18px 18px;
  background: var(--pt-forest);
  color: #fff;
  transform: rotateY(180deg);

  h3 {
    margin: 0;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
  }

  .pt-role {
    margin: 2px 0 12px;
    color: var(--pt-sage);
    font-size: 12px;
  }

  p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    line-height: 1.55;
    -webkit-line-clamp: 7;
    -webkit-box-orient: vertical;
  }
}

.pt-more {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  color: var(--pt-sage);
  font-size: 13px;
  font-weight: 600;
}

.pt-person:hover .pt-more {
  color: #fff;
}

/* Full bio modal */
.pt-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(14, 26, 17, 0.6);

  &[hidden] {
    display: none;
  }
}

body.pt-modal-open {
  overflow: hidden;
}

.pt-dialog {
  position: relative;
  width: 100%;
  max-width: 920px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.pt-dialog-body {
  display: grid;
  grid-template-columns: 340px 1fr;
  max-height: calc(100vh - 48px);

  .pt-photo {
    aspect-ratio: auto;
    min-height: 280px;
  }
}

.pt-copy {
  padding: 34px 36px 36px;
  overflow-y: auto;

  h3 {
    margin: 0;
    padding-right: 36px;
    color: var(--pt-ink);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.3;
  }

  .pt-role {
    margin: 4px 0 18px;
    color: var(--pt-ink-soft);
    font-size: 17px;
    font-weight: 700;
  }

  .pt-bio p {
    margin: 0 0 14px;
    color: var(--pt-ink);
    font-size: 15px;
    line-height: 1.7;

    &:last-child {
      margin-bottom: 0;
    }
  }
}

.pt-quote {
  position: relative;
  margin: 22px 0 0;
  padding: 22px 24px 20px;
  overflow: hidden;
  border-radius: 12px;
  background: #f1f6ed;

  &::before {
    content: "\201C";
    position: absolute;
    top: -18px;
    right: 18px;
    color: var(--pt-sage);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 150px;
    font-weight: 700;
    line-height: 1;
    opacity: 0.7;
    pointer-events: none;
  }

  blockquote {
    position: relative;
    margin: 0;
    padding: 0 64px 0 0;
    border: 0;
    background: none;
    color: var(--pt-forest);
    font-size: 18px;
    font-style: normal;
    font-weight: 500;
    line-height: 1.5;
  }

  figcaption {
    position: relative;
    margin-top: 10px;
    color: var(--pt-ink-soft);
    font-size: 14px;
    font-weight: 600;
  }
}

.pt-q-label {
  position: relative;
  display: block;
  margin-bottom: 8px;
  color: var(--pt-green);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pt-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--pt-grey-bg);
  color: var(--pt-ink);
  cursor: pointer;

  &:hover {
    background: #e3e7e3;
  }
}

@media (max-width: 1100px) {
  .pt-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .pt-filter {
    justify-content: flex-start;
    margin-bottom: 24px;
  }

  .pt-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 700px) {
  .pt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .pt-nameplate {
    min-height: 60px;
    padding: 8px;

    h3 {
      font-size: 14px;
    }
  }

  .pt-dialog-body {
    grid-template-columns: 1fr;
    overflow-y: auto;

    .pt-photo {
      min-height: 0;
      aspect-ratio: 4 / 3;
    }
  }

  .pt-copy {
    padding: 24px 22px 28px;
    overflow: visible;

    h3 {
      font-size: 22px;
    }
  }
}
