/* Scope everything to the staff section */
.staff-grid .staff-bio {
  display: none; /* hidden source text for the dropdown */
}

.staff-grid .wp-block-stackable-column {
  cursor: pointer;
}

.staff-grid .wp-block-stackable-column:focus {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 12px;
}

/* The row-wide dropdown panel */
.staff-grid .staff-row-tooltip {
  --staff-tooltip-bg: var(--theme-palette-color-8, #0f1220);
  --staff-tooltip-fg: #d1b46a;

  position: relative;
  margin-top: 14px;
  background: var(--staff-tooltip-bg);
  color: var(--staff-tooltip-fg);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 12px 35px rgba(0,0,0,.25);

  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height .25s ease, opacity .2s ease, transform .2s ease;
}

.staff-grid .staff-row-tooltip.is-open {
  opacity: 1;
  transform: translateY(0);
}

/* Little arrow pointing to the clicked head */
.staff-grid .staff-row-tooltip::before {
  content: "";
  position: absolute;
  top: -10px;
  left: calc(var(--arrow-left, 24px) - 10px);
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid var(--staff-tooltip-bg);
}

/* Panel layout */
.staff-grid .staff-row-tooltip__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.staff-grid .staff-row-tooltip__who {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: baseline;
}

.staff-grid .staff-row-tooltip__name {
  font-weight: 700;
}

.staff-grid .staff-row-tooltip__role {
  opacity: .85;
  font-size: .95em;
}

.staff-grid .staff-row-tooltip a {
  color: var(--staff-tooltip-fg);
  text-decoration: underline;
}

.staff-grid .staff-row-tooltip__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: .85;
}

.staff-grid .staff-row-tooltip__close:hover {
  opacity: 1;
}

/* Force child text to inherit the light tooltip color even if theme styles inject colors */
.staff-grid .staff-row-tooltip :is(p, span, div, strong, em, a, li, h1, h2, h3, h4, h5, h6),
.staff-grid .staff-row-tooltip,
.staff-grid .staff-row-tooltip * {
  color: #d1b46a !important;
}

@media (max-width: 900px) {
  .staff-grid .wp-block-stackable-columns {
    gap: 18px 14px;
  }

  .staff-grid .wp-block-stackable-column {
    width: 100% !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: visible;
  }

  .staff-grid .staff-row-tooltip {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
  }

  .staff-grid .staff-row-tooltip.is-mobile {
    width: 100%;
    margin-top: 12px;
  }

  .staff-grid .staff-row-tooltip::before {
    display: none;
  }

  .staff-grid .staff-row-tooltip__top {
    align-items: center;
  }
}
