/* ── Dept pill (shared across all pages) ────────────────────── */
.dept-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  white-space: nowrap;
  vertical-align: middle;
  background-color: var(--dept-color, #64748b);
}

/* ── Team grid ───────────────────────────────────────────────── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 48px;
}

@media (max-width: 640px) {
  .team-grid { grid-template-columns: 1fr; }
}

.team-card {
  display: flex;
  flex-direction: row;
  gap: 16px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--c-border);
  background: var(--c-bg-card);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease, box-shadow 0.2s, background 0.3s, border-color 0.3s;
}

.team-card.visible { opacity: 1; transform: none; }
.team-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.07); }

.team-card__avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.team-card__avatar--placeholder {
  background: linear-gradient(135deg, #94a3b8, #64748b);
}

.team-card__right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.team-card__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text-head);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* .team-card__dept-pill → use .dept-pill */
.team-card__right .dept-pill {
  align-self: flex-start;
}

.team-card__also {
  font-size: 12px;
  color: var(--c-text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.team-card__also-label {
  color: var(--c-text-muted);
  font-style: italic;
}

.team-card__also-dept {
  color: var(--c-text-muted);
}

.team-card__links {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.team-card__link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-bg-alt);
  color: var(--c-text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.team-card__link-icon:hover {
  background: var(--c-accent);
  color: #fff;
}

.team-card__link-icon svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.team-card__link-icon--placeholder {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.team-card__link-icon--cv {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.team-card__phone-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.team-card__phone-btn {
  border: none;
  cursor: pointer;
  background: var(--c-bg-alt);
}

.team-card__phone-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--c-text);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}

.team-card__phone-wrap.open .team-card__phone-popup {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ── Department toggle + grid ────────────────────────────────── */
.dept-toggle-row {
  margin-top: 32px;
}

.dept-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  font-size: 17px;
  font-weight: 400;
  color: var(--c-text-muted);
  line-height: 1.65;
  cursor: pointer;
  transition: color 0.15s;
}

.dept-toggle:hover { color: var(--c-text-head); }

.dept-accordion__chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.dept-toggle[aria-expanded="true"] .dept-accordion__chevron {
  transform: rotate(180deg);
}

.dept-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
  width: 100%;
}

.dept-grid[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .dept-grid { grid-template-columns: 1fr; }
  .dept-card--full { grid-column: 1; }
}

.dept-card {
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid;
  background: color-mix(in srgb, var(--dept-color, #64748b) 6%, var(--c-bg-card));
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background 0.3s;
}

.dept-card--full {
  grid-column: 1 / -1;
}

.dept-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dept-card__icon {
  display: inline-flex;
  align-items: center;
  opacity: 0.55;
  flex-shrink: 0;
}

.dept-card__desc {
  font-size: 13px;
  color: var(--c-text);
  line-height: 1.6;
}

.dept-card__desc a {
  color: var(--c-accent);
  text-decoration: none;
}

.dept-card__desc a:hover { text-decoration: underline; }

.dept-card__meta {
  font-size: 11px;
  color: var(--c-text-muted);
}

/* ── Dept card inner layout (subteams) ───────────────────────── */
.dept-card__inner-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.dept-card__inner-box {
  border-radius: 10px;
  border: 1px solid;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--c-text);
  line-height: 1.55;
}

.dept-card__inner-box strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.dept-card__members-bottom {
  font-size: 11px;
  color: var(--c-text-muted);
  margin-top: 2px;
}

/* ── Dept card dark-mode text fix ───────────────────────────── */
[data-theme="dark"] .dept-card__desc {
  color: var(--c-text-head);
}
