/* Página /people: o globo fica na coluna do site, em tons de cinza, e a lista segue o estilo da home. */

.globe {
  position: relative;
  aspect-ratio: 1;
  margin: -64px 0 0;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.globe.is-dragging {
  cursor: grabbing;
}

.globe canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* O degradê das bordas é desenhado no próprio canvas (fadeEdges em people.js). */
}

/* A camada das fotos tem empilhamento próprio: a ordem entre fotos fica aqui dentro e o rótulo sempre passa por cima. */
.globe-pins {
  position: absolute;
  inset: 0;
  z-index: 1;
  isolation: isolate;
  pointer-events: none;
}

/* Pin: a foto pequena, com um anel da cor do fundo para descolar dos pontos do mapa. */
.pin {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line), 0 2px 8px rgb(0 0 0 / 0.08);
  color: var(--muted);
  text-decoration: none;
  pointer-events: auto;
  will-change: transform, opacity;
  transition: box-shadow 150ms ease, color 150ms ease;
}

.pin img {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  object-fit: cover;
}

/* Pilha: fotos sobrepostas e a contagem. Ao abrir, as fotos se afastam, crescem e cada uma vira um alvo de clique. */
.pin-group {
  transition: box-shadow 150ms ease, color 150ms ease, padding 180ms cubic-bezier(0.23, 1, 0.32, 1);
}

.pin-group:hover,
.pin-group:focus-within,
.pin-group.is-open {
  z-index: 100000 !important; /* acima das outras fotos enquanto estiver aberta */
  padding: 3px;
}

.pin-person {
  display: block;
  border-radius: 999px;
  transition: margin 180ms cubic-bezier(0.23, 1, 0.32, 1);
}

.pin-person + .pin-person {
  margin-left: -6px;
}

.pin-person + .pin-person img {
  box-shadow: 0 0 0 2px var(--bg);
}

.pin-person img {
  transition: width 180ms cubic-bezier(0.23, 1, 0.32, 1), height 180ms cubic-bezier(0.23, 1, 0.32, 1), opacity 150ms ease;
}

.pin-group:is(:hover, :focus-within, .is-open) .pin-person + .pin-person {
  margin-left: 4px;
}

.pin-group:is(:hover, :focus-within, .is-open) .pin-person img {
  width: 26px;
  height: 26px;
  box-shadow: none;
}

/* Com a pilha aberta, a foto sob o mouse fica cheia e as outras recuam um pouco. */
.pin-group:is(:hover, :focus-within, .is-open):has(.pin-person.is-active) .pin-person:not(.is-active) img {
  opacity: 0.55;
}

.pin-person:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 2px;
}

.pin-group:is(:hover, :focus-within, .is-open) .pin-count {
  display: none;
}

.pin-zoom {
  display: none;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: 4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--hover);
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms ease;
}

.pin-group:is(:hover, :focus-within, .is-open) .pin-zoom:not([hidden]) {
  display: grid;
}

.pin-zoom:hover {
  color: var(--text);
}

.pin-zoom:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .pin-group,
  .pin-person,
  .pin-person img {
    transition: none;
  }
}

.pin-count {
  padding: 0 6px 0 5px;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 20px;
}

.pin:hover,
.pin.is-active {
  color: var(--text);
  box-shadow: 0 0 0 1px var(--focus), 0 2px 8px rgb(0 0 0 / 0.08);
}

.pin:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 2px;
}

/* Rótulo do hover: o mesmo cartão do preview da home, em tamanho de etiqueta. */
.globe-label {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: 0 16px 48px rgb(0 0 0 / 0.16);
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
}

.globe-label[hidden] {
  display: none;
}

.globe-label span {
  display: block;
  color: var(--muted);
}

/* Linha entre o globo e a lista, no lugar dos filtros da home. */
.count {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
}

.zoom {
  display: flex;
  gap: 4px;
}

.zoom button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}

.zoom svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* Lista: cada linha tem o nome (link principal), o que a pessoa faz e um ícone por rede. O local fica só no globo.
   Mostra 6 pessoas e rola por dentro; people.js mede a altura e liga o esfumaçado em cima e embaixo
   conforme ainda houver conteúdo para aquele lado. */
@property --fade-top {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@property --fade-bottom {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

.people-list {
  --fade-size: 56px;
  margin: 0 -10px;
  padding: 0 10px;
  max-height: 300px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  list-style: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent);
  transition: --fade-top 200ms ease, --fade-bottom 200ms ease;
}

.people-list::-webkit-scrollbar {
  display: none;
}

.people-list.fade-top {
  --fade-top: var(--fade-size);
}

.people-list.fade-bottom {
  --fade-bottom: var(--fade-size);
}

.person:last-child {
  border-bottom: 1px solid var(--line);
}

.person {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 104px;
  align-items: center;
  gap: 12px;
  margin: 0 -10px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  border-radius: 6px;
  transition: background-color 150ms ease;
}

.person:hover,
.person:focus-within {
  background: var(--hover);
}

.person a {
  color: inherit;
  text-decoration: none;
  border-radius: 4px;
}

.person a:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 2px;
}

.person .name {
  justify-self: start;
  max-width: 100%;
  padding: 4px 0;
}

.person .name:hover .label {
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: 3px;
}

.person-links {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  margin-right: -6px;
}

.person-links a {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--muted);
  transition: color 150ms ease, background-color 150ms ease;
}

.person-links a:hover {
  color: var(--text);
  background: var(--hover);
}

.person-links svg {
  width: 14px;
  height: 14px;
}

.avatar {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--line);
}

@media (max-width: 640px) {
  .globe {
    margin: -24px -24px 8px;
  }

  /* No celular: nome e função empilhados à esquerda, redes à direita. */
  .person {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name links" "meta links";
    row-gap: 0;
    padding: 8px 10px;
  }

  .person .name {
    grid-area: name;
    padding: 2px 0;
  }

  .person .domain {
    grid-area: meta;
    padding-left: 26px;
    font-size: 13px;
  }

  .person-links {
    grid-area: links;
  }

  .person-links a {
    width: 32px;
    height: 32px;
  }
}
