/* /lawyers: portrait cards with a glass info panel, and a profile dialog.
   Loaded only on that page (lawyers.html, extra_css). */

.team { padding: 40px 0 24px; }
.team--staff { padding-top: 16px; padding-bottom: 72px; }
.team__head { text-align: center; margin: 0 auto 32px; max-width: 640px; }
.team__head h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; color: var(--ink); margin: 0 0 8px; }
.team__head h2 em { font-style: normal; color: var(--brand); }
.team__head p { color: var(--ink-soft); margin: 0; }

.team__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 24px;
}

/* ------------------------------------------------------------- card */

.team-card {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #dcdcea;
  box-shadow: 0 14px 40px rgba(23, 23, 43, 0.14);
  cursor: pointer;
  isolation: isolate;
}
.team-card__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform var(--dur-move) var(--ease-out);
}
/* Keeps the white text readable on light photos whatever the panel does. */
.team-card::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(to bottom, transparent, rgba(15, 15, 35, 0.55));
  pointer-events: none;
  z-index: 0;
}

.team-card__panel {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 16px 18px;
  border-radius: 18px;
  color: #fff;
  /* Touch devices: no blur (10 blurred layers cost frames while scrolling). */
  background: rgba(23, 23, 43, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
@media (hover: hover) and (pointer: fine) {
  .team-card__panel {
    background: rgba(23, 23, 43, 0.42);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
  }
  .team-card:hover .team-card__photo { transform: scale(1.04); }
}

.team-card__name {
  margin: 0 44px 2px 0;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 700;
  color: #fff;
}
.team-card__name span { font-weight: 500; font-size: .85em; opacity: .8; }
.team-card__role { margin: 0; font-size: 13px; color: rgba(255, 255, 255, 0.78); }
.team-card__summary {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.team-card__tags {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.team-card__tags li {
  font-size: 11.5px;
  line-height: 1;
  padding: 6px 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-card__tags .team-card__more { background: transparent; border-style: dashed; }

.team-card__social {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 13px;
  position: relative;
  z-index: 2;
  transition: background var(--dur) ease, color var(--dur) ease;
}
.team-card__social:hover { background: #fff; color: var(--brand); }

.team-card__open {
  position: absolute;
  top: -18px;
  right: 14px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform var(--dur) var(--ease-out), background var(--dur) ease, color var(--dur) ease;
}
.team-card:hover .team-card__open,
.team-card__open:focus-visible {
  background: var(--brand);
  color: #fff;
  transform: rotate(45deg);
}
.team-card__open:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ----------------------------------------------------------- dialog */

html.has-dialog { overflow: hidden; }

.team-dialog {
  padding: 0;
  border: 0;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(23, 23, 43, 0.35);
  overscroll-behavior: contain;
}
.team-dialog::backdrop {
  background: rgba(23, 23, 43, 0.55);
}
.team-dialog[open] { animation: team-dialog-in var(--dur-slow) var(--ease-out); }
.team-dialog[open]::backdrop { animation: team-fade-in var(--dur) ease; }
@keyframes team-dialog-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes team-fade-in { from { opacity: 0; } }

.team-dialog__inner { position: relative; padding: 28px; }
.team-dialog__close {
  position: sticky;
  top: 0;
  float: right;
  margin: -12px -12px 0 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 23, 43, 0.06);
  color: var(--ink);
  cursor: pointer;
  z-index: 1;
}
.team-dialog__close:hover { background: var(--ink); color: #fff; }

.team-dialog__head { display: flex; gap: 20px; align-items: center; margin-bottom: 8px; }
.team-dialog__head img {
  width: 104px;
  height: 130px;
  object-fit: cover;
  object-position: center top;
  border-radius: 16px;
  flex: none;
}
.team-dialog h2 { margin: 0 0 4px; font-size: 22px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.team-dialog h2 span { font-weight: 500; color: var(--ink-soft); font-size: .8em; }
.team-dialog__role { margin: 0; color: var(--brand); font-weight: 600; font-size: 14px; }
.team-dialog__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}
.team-dialog h3 {
  margin: 24px 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.team-dialog p { font-size: 15px; line-height: 1.65; color: var(--ink); margin: 0 0 12px; }
.team-dialog__tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.team-dialog__tags li {
  font-size: 13px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  background: rgba(45, 46, 130, 0.08);
  color: var(--brand);
  font-weight: 500;
}
.team-dialog__list { margin: 0; padding-left: 18px; }
.team-dialog__list li { font-size: 15px; line-height: 1.55; margin-bottom: 6px; list-style: disc; color: var(--ink); }
.team-dialog__cta { margin-top: 24px; }

@media (max-width: 575.98px) {
  .team__grid { grid-template-columns: 1fr; gap: 20px; }
  .team-card { max-width: 420px; width: 100%; margin: 0 auto; }
  /* Phones: a bottom sheet rather than a centred box. */
  .team-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 88dvh;
    margin: auto 0 0;
    border-radius: 24px 24px 0 0;
  }
  .team-dialog[open] { animation-name: team-sheet-in; }
  @keyframes team-sheet-in { from { transform: translateY(100%); } }
  .team-dialog__inner { padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); }
  .team-dialog__head img { width: 80px; height: 100px; }
  .team-dialog h2 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .team-card__photo,
  .team-card__open { transition: none; }
  .team-dialog[open],
  .team-dialog[open]::backdrop { animation: none; }
}

/* Two people: centre the row instead of leaving an empty third column. */
.team--staff .team__grid {
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 416px));
  justify-content: center;
}

/* ------------------------------------------------- lawyer profile page
   website/lawyer.html (/lawyers/<slug>) */

.lawyer-profile { margin-top: 48px; padding-bottom: 24px; }
.lawyer-profile__crumbs { margin-bottom: 28px; }
.lawyer-profile__grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.lawyer-profile__aside {
  position: sticky;
  top: calc(var(--nav-h) + 40px);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--frost-bg);
  box-shadow: var(--frost-shadow);
}
.lawyer-profile__photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; }
.lawyer-profile__facts { padding: 20px 22px 24px; }
.lawyer-profile__name { margin: 0 0 4px; color: var(--ink); font-size: 19px; font-weight: 800; line-height: 1.25; }
.lawyer-profile__name span { color: var(--ink-soft); font-weight: 500; font-size: .85em; }
.lawyer-profile__role { margin: 0 0 12px; color: var(--brand); font-weight: 600; font-size: 14px; }
.lawyer-profile__link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-size: 14px; font-weight: 600; }
.lawyer-profile__cta { margin-top: 18px; }

.lawyer-profile__body h2 {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.lawyer-profile__body h2:not(:first-child) { margin-top: 36px; }
.lawyer-profile__body p { color: var(--ink); font-size: 17px; line-height: 1.75; margin: 0 0 16px; }
.lawyer-profile__body .team-dialog__list li { font-size: 16px; }

.lawyer-profile__others { margin-top: 64px; }
.lawyer-profile__people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 14px;
}
.lawyer-profile__people a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  background: var(--frost-bg);
  color: var(--ink);
  transition: background var(--dur) ease, transform var(--dur) var(--ease-out);
}
.lawyer-profile__people a:hover { background: #fff; transform: translateY(-2px); }
.lawyer-profile__people img { width: 56px; height: 70px; border-radius: 12px; object-fit: cover; object-position: center top; flex: none; }
.lawyer-profile__people span { display: grid; gap: 2px; }
.lawyer-profile__people strong { font-size: 15px; line-height: 1.3; }
.lawyer-profile__people small { color: var(--ink-soft); font-size: 13px; }

@media (max-width: 860px) {
  .lawyer-profile__grid { grid-template-columns: 1fr; gap: 28px; }
  .lawyer-profile__aside { position: static; max-width: 420px; }
}

/* "Full profile" in the dialog on /lawyers */
.team-dialog__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.team-dialog__actions .team-dialog__cta { margin-top: 0; }
.btn-pill--outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(23, 23, 43, 0.25); }
.btn-pill--outline:hover { background: var(--ink); color: #fff; }
