.team-page,
.profile-page {
  --team-content-max: 1200px;
  --team-space: 64px;
  --team-mobile-space: 25px;
  --team-title-size: 30px;
  overflow: clip;
  background: var(--color-white);
  color: var(--color-deep);
}

.team-shell {
  width: var(--shell);
  margin-inline: auto;
}

.team-section,
.profile-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  padding-block: var(--team-space);
}

.team-shell {
  min-width: 0;
}

.team-eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 16px;
  padding: 4px 12px;
  background: var(--color-gold);
  color: var(--color-deep);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
}

.team-title {
  max-width: 24ch;
  margin: 0;
  color: var(--color-deep);
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.2vw, var(--team-title-size));
  font-weight: 300;
  line-height: 1.4;
  text-wrap: balance;
}

[dir="ltr"] .team-title {
  font-size: clamp(1.4rem, 2vw, var(--team-title-size));
  line-height: 1.3;
}

.team-title-rule {
  display: block;
  width: 62px;
  height: 3px;
  margin-block: 16px 22px;
  background: var(--color-gold);
}

.team-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-block-end: clamp(28px, 5vh, 44px);
  color: var(--color-muted);
  font-size: 0.63rem;
}

.team-breadcrumb a:hover,
.team-breadcrumb a:focus-visible {
  color: var(--color-gold-dark);
}

.team-heading--split {
  display: grid;
  grid-template-columns: minmax(290px, 0.82fr) minmax(0, 1.45fr);
  align-items: center;
  gap: clamp(42px, 7vw, 88px);
  margin-block-end: 34px;
}

.team-heading--split > div:first-child {
  padding-inline-end: clamp(24px, 4vw, 48px);
  border-inline-end: 3px solid var(--color-gold);
}

.team-heading--split > p,
.team-heading--center > p:last-child {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.8rem;
  line-height: 2;
  text-align: justify;
}

.team-heading--center {
  max-width: 760px;
  margin: 0 auto 34px;
  text-align: center;
}

.team-heading--center .team-eyebrow,
.team-heading--center .team-title {
  margin-inline: auto;
}

.team-heading--center > p:last-child {
  margin-block-start: 14px;
  text-align: center;
}

/* Compact hero with a live directory index instead of decorative fake stats. */
.team-hero {
  min-height: min(640px, 100svh);
  padding-block: calc(var(--header-height) + clamp(30px, 5vh, 52px)) clamp(48px, 7vh, 72px);
  background:
    linear-gradient(rgba(249, 247, 241, 0.91), rgba(249, 247, 241, 0.95)),
    url("../images/home/beige-wallpaper.webp") center / cover;
}

.team-hero__grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(56px, 9vw, 120px);
}

.team-hero__content {
  max-width: 570px;
}

.team-hero__content h1,
.profile-hero__content h1 {
  margin: 0;
  color: var(--color-deep);
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw, 2.65rem);
  font-weight: 300;
  line-height: 1.35;
  text-wrap: balance;
}

[dir="ltr"] .team-hero__content h1,
[dir="ltr"] .profile-hero__content h1 {
  font-size: clamp(1.8rem, 2.7vw, 2.45rem);
  line-height: 1.18;
}

.team-hero__content > p:last-child {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.82rem;
  line-height: 2.05;
  text-align: justify;
}

.team-workforce-counters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}

.team-workforce-counters > div {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 104px;
  gap: 16px;
  padding: 19px 21px;
  border: 1px solid rgba(0, 56, 69, 0.09);
  border-block-start: 3px solid var(--color-gold);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 38px rgba(0, 56, 69, 0.075);
}

.team-workforce-counters dd {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  color: var(--color-gold-dark);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.25vw, 1.8rem);
  font-weight: 450;
  line-height: 1;
  text-align: center;
}

.team-workforce-counters dt {
  grid-column: 1;
  grid-row: 1;
  color: var(--color-deep);
  font-size: 0.62rem;
  font-weight: 650;
  line-height: 1.7;
}

/* Full-width people finder integrated with the hero background. */
.team-finder__form {
  position: relative;
  z-index: 4;
  margin-block-start: 34px;
  padding: 12px;
  border-block-start: 3px solid var(--color-gold);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 48px rgba(0, 56, 69, 0.1);
}

.team-finder__control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(0, 56, 69, 0.22);
  background: #fbfaf7;
}

.team-finder__control:focus-within {
  border-color: var(--color-gold-dark);
  box-shadow: 0 0 0 3px rgba(200, 152, 61, 0.15);
}

.team-finder__control input {
  min-width: 0;
  padding: 12px 18px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-deep);
  font: inherit;
}

.team-finder__control button {
  min-width: 84px;
  padding: 10px 20px;
  border: 0;
  background: var(--color-deep);
  color: var(--color-white);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.team-finder__control button:hover,
.team-finder__control button:focus-visible {
  background: var(--color-gold-dark);
}

.team-finder__status {
  margin: 0;
}

.team-finder__results {
  position: absolute;
  inset-inline: 12px;
  inset-block-start: calc(100% - 12px);
  z-index: 8;
  width: auto;
  max-height: 340px;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  border-block-start: 3px solid var(--color-gold);
  background: var(--color-white);
  box-shadow: 0 22px 58px rgba(0, 56, 69, 0.18);
  list-style: none;
}

.team-finder__results[hidden],
.team-finder__results li[hidden] {
  display: none;
}

.team-finder__results a {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-block-end: 1px solid rgba(0, 56, 69, 0.09);
  color: var(--color-deep);
}

.team-finder__results li:last-child a {
  border-block-end: 0;
}

.team-finder__results a:hover,
.team-finder__results a:focus-visible {
  background: #f6f3e9;
}

.team-finder__results strong {
  font-size: 0.7rem;
}

.team-finder__results span {
  color: var(--color-muted);
  font-size: 0.58rem;
  line-height: 1.55;
}

/* Administrative Council: compact square portraits scale cleanly to 10–12 members. */
.team-council {
  min-height: min(720px, calc(100svh - var(--header-height)));
  background:
    linear-gradient(rgba(246, 246, 244, 0.9), rgba(246, 246, 244, 0.96)),
    url("../images/home/grey-wallpaper.webp") center / cover;
}

.team-heading--ruled {
  max-width: 920px;
  padding-block-end: 26px;
  border-block-end: 1px solid rgba(200, 152, 61, 0.72);
}

.team-card-grid {
  display: grid;
  gap: 18px;
}

.team-page--council-2 { --team-council-columns: 2; }
.team-page--council-3 { --team-council-columns: 3; }
.team-page--council-4 { --team-council-columns: 4; }
.team-page--imams-2 { --team-imam-columns: 2; }
.team-page--imams-3 { --team-imam-columns: 3; }
.team-page--imams-4 { --team-imam-columns: 4; }

.team-card-grid--council {
  grid-template-columns: repeat(var(--team-council-columns, 4), minmax(0, 1fr));
  gap: 18px;
}

.team-card-grid--specialists {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.team-card-grid--related {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.person-card {
  min-width: 0;
  border-block-start: 3px solid var(--color-gold);
  background: var(--color-white);
  box-shadow: 0 18px 46px rgba(0, 56, 69, 0.08);
}

.person-card__link {
  display: grid;
  height: 100%;
  color: inherit;
  outline-offset: 4px;
}

.person-card__media {
  position: relative;
  display: grid;
  height: 190px;
  margin: 0;
  place-items: end center;
  overflow: hidden;
  background: #efeee9;
}

.person-card__image {
  position: relative;
  z-index: 1;
  display: block;
  width: min(190px, 100%);
  height: 190px;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  transition: opacity 240ms ease, transform 280ms ease;
}

.person-card__media.is-loaded .person-card__image {
  opacity: 1;
}

.person-card__link:hover .person-card__image,
.person-card__link:focus-visible .person-card__image {
  transform: scale(1.025);
}

.team-media-skeleton {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(100deg, #ddd9d0 28%, #f1eee8 43%, #ddd9d0 58%);
  background-size: 260% 100%;
  animation: team-skeleton 1.35s ease infinite;
  transition: opacity 180ms ease;
}

.is-loaded > .team-media-skeleton,
.is-media-error > .team-media-skeleton {
  opacity: 0;
  pointer-events: none;
}

.person-card__initial,
.profile-hero__initial {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background:
    linear-gradient(rgba(0, 63, 61, 0.93), rgba(0, 63, 61, 0.93)),
    url("../images/home/green-wallpaper.webp") center / cover;
  color: var(--color-gold-bright);
  font-family: var(--font-display);
  font-size: 2.7rem;
  font-weight: 300;
}

.person-card__body {
  display: flex;
  min-height: 240px;
  padding: 24px;
  flex-direction: column;
}

.person-card__group {
  width: fit-content;
  margin: 0 0 13px;
  color: var(--color-gold-dark);
  font-size: 0.57rem;
  font-weight: 600;
  line-height: 1.6;
}

.person-card h3 {
  margin: 0;
  color: var(--color-deep);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.65;
}

.person-card__role {
  margin: 5px 0 0;
  color: var(--color-gold-dark);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.7;
}

.person-card__location {
  margin: 7px 0 0;
  color: var(--color-deep);
  font-size: 0.58rem;
  font-weight: 600;
}

.person-card__summary {
  display: -webkit-box;
  margin: 13px 0 0;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 0.65rem;
  line-height: 1.9;
  text-align: justify;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.person-card__action {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 9px;
  margin-block-start: auto;
  padding-block-start: 18px;
  color: var(--color-deep);
  font-size: 0.62rem;
  font-weight: 700;
}

.person-card__action svg {
  width: 14px;
  height: 14px;
  transition: transform 180ms ease;
}

[dir="rtl"] .person-card__action svg,
[dir="rtl"] .team-empty-state > a svg,
[dir="rtl"] .team-statement .button svg,
[dir="rtl"] .profile-contact .button svg {
  transform: scaleX(-1);
}

.person-card__link:hover .person-card__action svg,
.person-card__link:focus-visible .person-card__action svg {
  transform: translateX(4px);
}

[dir="rtl"] .person-card__link:hover .person-card__action svg,
[dir="rtl"] .person-card__link:focus-visible .person-card__action svg {
  transform: scaleX(-1) translateX(4px);
}

.person-card--council {
  border-block-start-width: 2px;
  box-shadow: 0 14px 34px rgba(0, 56, 69, 0.07);
}

.person-card--council .person-card__media,
.person-card--council .person-card__image {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.person-card--council .person-card__image {
  object-fit: cover;
  object-position: center;
}

.person-card--council .person-card__body {
  min-height: 170px;
  padding: 19px;
}

.person-card--council .person-card__group {
  margin-block-end: 8px;
}

.person-card--council h3 {
  font-size: 0.8rem;
  line-height: 1.6;
}

.person-card--council .person-card__role {
  font-size: 0.6rem;
}

.person-card--council .person-card__action {
  padding-block-start: 10px;
  font-size: 0.55rem;
}

/* Imams directory mirrors the established horizontal square-portrait system. */
.team-directory-section {
  display: block;
  padding-block-end: 0;
  background: var(--color-white);
}

.team-imam-panel {
  margin-block-start: 36px;
  padding-block: 48px;
  background:
    linear-gradient(rgba(246, 246, 244, 0.88), rgba(246, 246, 244, 0.94)),
    url("../images/home/grey-wallpaper.webp") center / cover;
}

.team-card-grid--imams {
  grid-template-columns: repeat(var(--team-imam-columns, 3), minmax(0, 1fr));
  gap: 18px;
}

.person-card--imam {
  border-block-start: 0;
  border-inline-start: 3px solid var(--color-gold);
  box-shadow: none;
}

.person-card--imam .person-card__link {
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  min-height: 140px;
}

.person-card--imam .person-card__media,
.person-card--imam .person-card__image {
  width: 112px;
  height: 112px;
  aspect-ratio: 1;
}

.person-card--imam .person-card__media {
  grid-row: 1;
  margin: 14px;
  place-items: center;
}

.person-card--imam .person-card__image {
  object-fit: cover;
  object-position: center;
}

.person-card--imam .person-card__media {
  grid-column: 1;
}

.person-card--imam .person-card__body {
  grid-row: 1;
  min-width: 0;
  min-height: 140px;
  justify-content: center;
  padding: 15px;
}

.person-card--imam .person-card__body {
  grid-column: 2;
}

.person-card--imam h3 {
  font-size: 0.68rem;
}

.person-card--imam .person-card__group,
.person-card--imam .person-card__role,
.person-card--imam .person-card__location {
  line-height: 1.55;
}

.person-card--imam .person-card__group {
  margin-block-end: 7px;
}

.person-card--imam .person-card__action {
  padding-block-start: 10px;
  font-size: 0.55rem;
}

.person-card__demo {
  width: fit-content;
  margin-block-end: 7px;
  padding: 2px 7px;
  border: 1px solid rgba(200, 152, 61, 0.55);
  color: var(--color-gold-dark);
  font-size: 0.48rem;
  font-weight: 700;
  line-height: 1.55;
}

.team-empty-state {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 150px;
  padding: 28px 32px;
  border-inline-start: 4px solid var(--color-gold);
  background: var(--color-white);
}

.team-empty-state > span {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  background: rgba(0, 63, 61, 0.08);
  color: var(--color-deep);
}

.team-empty-state > span svg {
  width: 23px;
  height: 23px;
}

.team-empty-state h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.84rem;
  line-height: 1.7;
}

.team-empty-state p {
  margin: 6px 0 0;
  color: var(--color-muted);
  font-size: 0.65rem;
  line-height: 1.9;
}

.team-empty-state > a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--color-gold);
  color: var(--color-deep);
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
}

.team-empty-state > a svg {
  width: 14px;
  height: 14px;
}

.person-card[hidden] {
  display: none;
}

/* Specialist cards and working model. */
.team-specialists {
  min-height: min(610px, calc(100svh - var(--header-height)));
  background: var(--color-white);
}

.team-specialists__notice {
  max-width: 660px;
  margin: 0 auto;
  padding: 24px;
  border-block-start: 3px solid var(--color-gold);
  background: #f5f5f3;
  color: var(--color-muted);
  font-size: 0.7rem;
  line-height: 1.9;
  text-align: center;
}

.team-model {
  min-height: min(650px, calc(100svh - var(--header-height)));
  background:
    linear-gradient(rgba(249, 247, 241, 0.91), rgba(249, 247, 241, 0.96)),
    url("../images/home/beige-wallpaper.webp") center / cover;
}

.team-model__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.team-model__grid article {
  position: relative;
  min-height: 230px;
  padding: 28px;
  border-block-start: 3px solid var(--color-gold);
  background: var(--color-white);
}

.team-model__grid article > strong {
  position: absolute;
  inset-block-start: 21px;
  inset-inline-end: 24px;
  color: rgba(0, 63, 61, 0.11);
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.team-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  background: rgba(0, 63, 61, 0.08);
  color: var(--color-deep);
}

.team-icon svg {
  width: 22px;
  height: 22px;
}

.team-model__grid h3 {
  margin: 18px 0 8px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  line-height: 1.7;
}

.team-model__grid p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.66rem;
  line-height: 1.95;
  text-align: justify;
}

/* Statement and CTA share one final, purposeful section. */
.team-statement {
  padding-block: 62px;
  background:
    linear-gradient(rgba(0, 57, 55, 0.94), rgba(0, 57, 55, 0.94)),
    url("../images/home/green-wallpaper.webp") center / cover;
  color: var(--color-white);
}

.team-statement__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  align-items: center;
  gap: clamp(52px, 8vw, 100px);
}

.team-statement blockquote {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 18px;
  margin: 0;
  padding-inline-end: clamp(28px, 5vw, 64px);
  border-inline-end: 1px solid rgba(255, 255, 255, 0.18);
}

.team-statement__quote {
  display: grid;
  width: 42px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(200, 152, 61, 0.65);
  border-inline-start: 4px solid var(--color-gold);
  color: var(--color-gold-bright);
}

.team-statement__quote svg {
  width: 18px;
  height: 18px;
}

.team-statement blockquote > p {
  margin: 0;
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: clamp(0.92rem, 1.5vw, 1.15rem);
  font-weight: 400;
  line-height: 2;
  text-align: justify;
}

.team-statement blockquote footer {
  grid-column: 2;
  display: grid;
  gap: 3px;
  margin-block-start: 12px;
}

.team-statement blockquote footer strong {
  font-size: 0.63rem;
}

.team-statement blockquote footer span {
  color: var(--color-gold-bright);
  font-size: 0.58rem;
}

.team-statement__cta h2,
.profile-contact h2 {
  margin: 0;
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 500;
  line-height: 1.55;
}

.team-statement__cta p,
.profile-contact p {
  margin: 9px 0 20px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.67rem;
  line-height: 1.9;
  text-align: justify;
}

.team-statement .button,
.profile-contact .button {
  width: fit-content;
  min-height: 46px;
  gap: 10px;
  padding: 9px 18px;
  border: 1px solid var(--color-gold);
  border-radius: 0;
  background: var(--color-gold);
  color: var(--color-deep);
  font-size: 0.66rem;
}

.team-statement .button svg,
.profile-contact .button svg {
  width: 15px;
  height: 15px;
}

/* Individual biography page. */
.profile-hero {
  min-height: min(650px, 100svh);
  padding-block: calc(var(--header-height) + clamp(30px, 5vh, 52px)) clamp(48px, 7vh, 72px);
  background:
    linear-gradient(rgba(249, 247, 241, 0.91), rgba(249, 247, 241, 0.96)),
    url("../images/home/beige-wallpaper.webp") center / cover;
}

.profile-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 280px;
  align-items: center;
  gap: clamp(54px, 9vw, 120px);
}

.profile-hero__content {
  max-width: 680px;
}

.profile-hero__role {
  margin: 11px 0 0;
  color: var(--color-gold-dark);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.8;
}

.profile-hero__summary {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.8rem;
  line-height: 2;
  text-align: justify;
}

.profile-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-block-start: 20px;
}

.profile-hero__meta span {
  padding: 6px 10px;
  border: 1px solid rgba(0, 63, 61, 0.13);
  background: rgba(255, 255, 255, 0.65);
  color: var(--color-deep);
  font-size: 0.58rem;
}

.profile-hero__portrait {
  position: relative;
  display: grid;
  width: 280px;
  height: 300px;
  margin: 0;
  place-items: end center;
  overflow: hidden;
  border-block-start: 4px solid var(--color-gold);
  background: #efeee9;
  box-shadow: 0 24px 60px rgba(0, 56, 69, 0.12);
}

.profile-hero__image {
  position: relative;
  z-index: 1;
  display: block;
  width: 280px;
  height: 280px;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  transition: opacity 240ms ease;
}

.profile-hero__portrait.is-loaded .profile-hero__image {
  opacity: 1;
}

.profile-biography {
  min-height: min(640px, calc(100svh - var(--header-height)));
  background: var(--color-white);
}

.profile-biography__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: start;
  gap: clamp(52px, 8vw, 100px);
}

.profile-biography__text {
  color: var(--color-muted);
  font-size: 0.78rem;
  line-height: 2.1;
  text-align: justify;
}

.profile-biography__text > *:first-child {
  margin-block-start: 0;
}

.profile-biography__text > *:last-child {
  margin-block-end: 0;
}

.profile-facts {
  padding: 28px;
  border-block-start: 4px solid var(--color-gold);
  background: #f5f5f3;
}

.profile-facts > h2 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 0.94rem;
  line-height: 1.7;
}

.profile-facts dl,
.profile-facts dl > div {
  margin: 0;
}

.profile-facts dl > div {
  display: grid;
  gap: 4px;
  padding-block: 13px;
  border-block-start: 1px solid rgba(0, 56, 69, 0.12);
}

.profile-facts dt {
  color: var(--color-gold-dark);
  font-size: 0.56rem;
  font-weight: 700;
}

.profile-facts dd {
  margin: 0;
  color: var(--color-deep);
  font-size: 0.65rem;
  line-height: 1.8;
}

.profile-facts dd a {
  text-decoration: underline;
  text-decoration-color: rgba(200, 152, 61, 0.65);
  text-underline-offset: 4px;
}

.profile-facts__contact {
  display: grid;
  gap: 8px;
  margin-block-start: 18px;
}

.profile-facts__contact a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid rgba(0, 56, 69, 0.14);
  background: var(--color-white);
  font-size: 0.59rem;
}

.profile-facts__contact svg {
  width: 13px;
  height: 13px;
}

.profile-related {
  min-height: min(620px, calc(100svh - var(--header-height)));
  background:
    linear-gradient(rgba(246, 246, 244, 0.91), rgba(246, 246, 244, 0.96)),
    url("../images/home/grey-wallpaper.webp") center / cover;
}

.profile-contact {
  padding-block: 52px;
  background:
    linear-gradient(rgba(0, 57, 55, 0.94), rgba(0, 57, 55, 0.94)),
    url("../images/home/green-wallpaper.webp") center / cover;
}

.profile-contact__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.profile-contact p {
  margin-block-end: 0;
}

/* Progressive enhancement: content stays visible without JavaScript. */
.team-enhanced [data-team-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 460ms ease, transform 460ms ease;
}

.team-enhanced [data-team-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@keyframes team-skeleton {
  to { background-position: -180% 0; }
}

@media (max-width: 1080px) {
  .team-hero__grid,
  .profile-hero__grid {
    gap: 54px;
  }

  .team-page--council-4 { --team-council-columns: 3; }
  .team-page--imams-4 { --team-imam-columns: 3; }

  .team-card-grid--specialists,
  .team-card-grid--related {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .team-shell {
    width: var(--shell);
  }

  .team-section,
  .profile-section {
    min-height: 0;
    padding-block: var(--team-mobile-space);
  }

  .team-hero,
  .profile-hero {
    min-height: 0;
    padding-block: calc(var(--header-height) + 20px) 22px;
  }

  .team-hero__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .team-hero__content {
    max-width: none;
  }

  .team-finder__form {
    margin-block-start: 28px;
  }

  .team-page { --team-council-columns: 2; --team-imam-columns: 2; }

  .team-directory-section {
    padding-block-end: 0;
  }

  .team-heading--split {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .team-heading--split > div:first-child {
    padding-inline-end: 0;
    padding-block-end: 22px;
    border-inline-end: 0;
    border-block-end: 3px solid var(--color-gold);
  }

  .team-empty-state {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .team-empty-state > a {
    grid-column: 2;
    width: fit-content;
  }

  .team-statement__grid,
  .profile-biography__grid {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .team-statement blockquote {
    padding-inline-end: 0;
    padding-block-end: 32px;
    border-inline-end: 0;
    border-block-end: 1px solid rgba(255, 255, 255, 0.18);
  }

  .profile-hero__grid {
    grid-template-columns: minmax(0, 1fr) 220px;
  }

  .profile-hero__portrait {
    width: 220px;
    height: 240px;
  }

  .profile-hero__image {
    width: 220px;
    height: 220px;
  }
}

@media (max-width: 680px) {
  .team-shell {
    width: var(--shell);
  }

  .team-eyebrow {
    margin-block-end: 13px;
  }

  .team-title,
  [dir="ltr"] .team-title {
    font-size: clamp(1.3rem, 6vw, 1.65rem);
  }

  .team-hero__content h1,
  .profile-hero__content h1,
  [dir="ltr"] .team-hero__content h1,
  [dir="ltr"] .profile-hero__content h1 {
    font-size: clamp(1.6rem, 8vw, 2rem);
  }

  .team-breadcrumb {
    margin-block-end: 18px;
  }

  .team-hero__content > p:last-child,
  .team-heading--split > p,
  .team-heading--center > p:last-child,
  .profile-hero__summary,
  .profile-biography__text {
    font-size: 0.72rem;
    line-height: 1.9;
  }

  .team-workforce-counters { gap: 10px; }

  .team-workforce-counters > div {
    min-height: 82px;
    gap: 9px;
    padding: 14px;
  }

  .team-card-grid--council,
  .team-card-grid--specialists,
  .team-card-grid--related {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 14px;
    padding-block-end: 12px;
    overflow-x: auto;
    scroll-snap-type: inline mandatory;
    scrollbar-color: var(--color-gold) rgba(0, 56, 69, 0.08);
    scrollbar-width: thin;
  }

  .team-card-grid--council .person-card,
  .team-card-grid--specialists .person-card,
  .team-card-grid--related .person-card {
    width: 82vw;
    min-width: 82vw;
    scroll-snap-align: start;
  }

  .team-card-grid--council .person-card {
    width: min(76vw, 290px);
    min-width: min(76vw, 290px);
  }

  .team-card-grid--specialists {
    display: grid;
    grid-template-columns: minmax(0, 320px);
    justify-content: center;
    overflow: visible;
  }

  .team-card-grid--specialists .person-card {
    width: 100%;
    min-width: 0;
    scroll-snap-align: none;
  }

  .team-finder__form {
    margin-block-start: 22px;
    padding: 9px;
  }

  .team-finder__control {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  .team-finder__control button {
    min-width: 0;
    padding-inline: 12px;
  }

  .team-finder__results {
    inset-inline: 9px;
    width: auto;
  }

  .person-card--compact .person-card__media,
  .person-card--compact .person-card__image {
    height: 165px;
  }

  .person-card--compact .person-card__image {
    width: min(165px, 100%);
  }

  .person-card--compact .person-card__body {
    min-height: 225px;
    padding: 21px;
  }

  .team-card-grid--imams {
    grid-template-columns: 1fr;
  }

  .person-card--imam .person-card__link {
    grid-template-columns: 150px minmax(0, 1fr);
    min-height: 150px;
  }

  .person-card--imam .person-card__media,
  .person-card--imam .person-card__image {
    width: 124px;
    height: 124px;
  }

  .person-card--imam .person-card__media {
    margin: 13px;
  }

  .person-card--imam .person-card__body {
    min-height: 150px;
    padding: 16px;
  }

  .team-empty-state {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px;
  }

  .team-empty-state > a {
    grid-column: auto;
    width: 100%;
    justify-content: center;
    white-space: normal;
  }

  .team-model__grid {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 14px;
    padding-block-end: 12px;
    overflow-x: auto;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
  }

  .team-model__grid article {
    width: 82vw;
    min-width: 82vw;
    min-height: 220px;
    scroll-snap-align: center;
  }

  .team-statement {
    padding-block: 23px;
  }

  .team-statement blockquote {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 14px;
  }

  .team-statement__quote {
    width: 36px;
    height: 34px;
  }

  .team-statement blockquote > p {
    font-size: 0.82rem;
    line-height: 1.9;
  }

  .team-statement .button,
  .profile-contact .button {
    width: 100%;
    justify-content: center;
  }

  .profile-hero__grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .profile-hero__portrait {
    order: -1;
    width: 170px;
    height: 190px;
    margin-inline: auto;
  }

  .profile-hero__image {
    width: 170px;
    height: 170px;
  }

  .profile-facts {
    padding: 24px;
  }

  .profile-contact__inner {
    display: grid;
    gap: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-media-skeleton {
    animation: none;
  }

  .team-enhanced [data-team-reveal],
  .person-card__image,
  .person-card__action svg {
    transition: none;
  }
}


/* Compact directory navigation, semantic roster, and reusable relationships. */
.team-directory-controls {
  display: none;
}

.team-roster {
  overflow-x: auto;
  border-block-start: 3px solid var(--color-gold);
  background: var(--color-white);
  box-shadow: 0 18px 46px rgba(0, 56, 69, 0.07);
}

.team-roster table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.team-roster th,
.team-roster td {
  padding: 19px 22px;
  border-block-end: 1px solid rgba(0, 63, 61, 0.11);
  text-align: start;
  vertical-align: middle;
}

.team-roster thead th {
  background: var(--color-deep);
  color: var(--color-white);
  font-size: 0.58rem;
  font-weight: 700;
}

.team-roster tbody th {
  color: var(--color-deep);
  font-size: 0.68rem;
  font-weight: 650;
}

.team-roster tbody td {
  color: var(--color-muted);
  font-size: 0.63rem;
  line-height: 1.75;
}

.team-roster tbody tr:last-child > * {
  border-block-end: 0;
}

.team-roster tbody tr:hover {
  background: #f8f7f2;
}

.team-roster a {
  padding-block-end: 3px;
  border-block-end: 1px solid var(--color-gold);
}

.team-roster__mobile-context {
  display: none;
}

.team-committees {
  background:
    linear-gradient(rgba(249, 247, 241, 0.92), rgba(249, 247, 241, 0.96)),
    url("../images/home/beige-wallpaper.webp") center / cover;
}

.team-committee-directory {
  border-block-start: 3px solid var(--color-gold);
  background: var(--color-white);
  box-shadow: 0 18px 48px rgba(0, 56, 69, 0.07);
}

.team-committee {
  border-block-end: 1px solid rgba(0, 63, 61, 0.12);
}

.team-committee:last-child {
  border-block-end: 0;
}

.team-committee summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 42px;
  align-items: center;
  gap: 24px;
  min-height: 96px;
  padding: 20px 24px;
  color: var(--color-deep);
  cursor: pointer;
  list-style: none;
}

.team-committee summary::-webkit-details-marker {
  display: none;
}

.team-committee summary > span:first-child {
  display: grid;
  gap: 4px;
}

.team-committee summary small {
  color: var(--color-gold-dark);
  font-size: 0.54rem;
  font-weight: 700;
}

.team-committee summary strong {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
}

.team-committee__summary-meta {
  color: var(--color-muted);
  font-size: 0.58rem;
  white-space: nowrap;
}

.team-committee__toggle {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(0, 63, 61, 0.16);
  color: var(--color-deep);
}

.team-committee__toggle svg {
  width: 15px;
  height: 15px;
  transition: transform 180ms ease;
}

.team-committee[open] .team-committee__toggle svg {
  transform: rotate(45deg);
}

.team-committee__body {
  display: grid;
  grid-template-columns: minmax(190px, 0.4fr) minmax(0, 1fr);
  gap: 32px;
  padding: 4px 24px 28px;
}

.team-committee__mosques {
  display: flex;
  align-content: start;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.team-committee__mosques a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid rgba(0, 63, 61, 0.16);
  color: var(--color-deep);
  font-size: 0.55rem;
  font-weight: 650;
}

.team-committee__members {
  margin: 0;
  border-block-start: 1px solid rgba(0, 63, 61, 0.12);
}

.team-committee__members > div {
  display: grid;
  grid-template-columns: minmax(130px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  padding: 12px 0;
  border-block-end: 1px solid rgba(0, 63, 61, 0.1);
}

.team-committee__members dt {
  color: var(--color-gold-dark);
  font-size: 0.55rem;
  font-weight: 700;
}

.team-committee__members dd {
  margin: 0;
  color: var(--color-deep);
  font-size: 0.62rem;
  font-weight: 650;
}

.team-committee__members a {
  padding-block-end: 3px;
  border-block-end: 1px solid var(--color-gold);
}

.team-partners {
  background: var(--color-white);
}

.team-partner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block-start: 1px solid rgba(0, 63, 61, 0.14);
  border-inline-start: 1px solid rgba(0, 63, 61, 0.14);
}

.team-partner {
  position: relative;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 18px;
  min-height: 164px;
  padding: 24px;
  border-block-end: 1px solid rgba(0, 63, 61, 0.14);
  border-inline-end: 1px solid rgba(0, 63, 61, 0.14);
  background: var(--color-white);
  color: var(--color-deep);
}

a.team-partner:hover,
a.team-partner:focus-visible {
  background: #f8f7f2;
}

.team-partner__logo {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  overflow: hidden;
  background: #f2f2ef;
}

.team-partner__logo img {
  width: 100%;
  height: 100%;
  padding: 10px;
  object-fit: contain;
}

.team-partner__logo > strong {
  color: var(--color-gold-dark);
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 400;
}

.team-partner__content {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.team-partner__content small {
  color: var(--color-gold-dark);
  font-size: 0.52rem;
  font-weight: 700;
}

.team-partner__content > strong {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.6;
}

.team-partner__content > span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 0.56rem;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.team-partner__external {
  color: var(--color-gold-dark);
}

.team-partner__external svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 1080px) {
  .team-partner-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .team-imam-panel {
    margin-block-start: 24px;
    padding-block: 24px 28px;
  }

  .team-directory-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-block-end: 12px;
  }

  .team-directory-controls p,
  .team-directory-controls > div {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
  }

  .team-directory-controls p {
    color: var(--color-muted);
    font-size: 0.58rem;
  }

  .team-directory-controls p strong {
    color: var(--color-deep);
    font-size: 0.72rem;
  }

  .team-directory-controls button {
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(0, 63, 61, 0.2);
    background: var(--color-white);
    color: var(--color-deep);
    cursor: pointer;
  }

  .team-directory-controls button:hover,
  .team-directory-controls button:focus-visible {
    border-color: var(--color-gold);
    background: var(--color-gold);
  }

  .team-directory-controls button:disabled {
    opacity: 0.35;
    cursor: default;
  }

  .team-directory-controls button svg {
    width: 14px;
    height: 14px;
  }

  [dir="ltr"] [data-team-directory-prev] svg,
  [dir="rtl"] [data-team-directory-next] svg {
    transform: rotate(180deg);
  }

  [dir="ltr"] [data-team-directory-next] svg,
  [dir="rtl"] [data-team-directory-prev] svg {
    transform: none;
  }

  .team-card-grid--imams {
    display: flex;
    grid-template-columns: none;
    width: 100%;
    gap: 12px;
    padding-block: 2px 10px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 6%;
    scroll-snap-type: inline mandatory;
    scrollbar-color: var(--color-gold) rgba(0, 56, 69, 0.08);
    scrollbar-width: thin;
  }

  .team-card-grid--imams .person-card {
    width: min(84vw, 390px);
    min-width: min(84vw, 390px);
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }

  .team-card-grid--imams .person-card[aria-current="true"] {
    box-shadow: 0 14px 32px rgba(0, 56, 69, 0.08);
  }

  .team-specialists {
    min-height: 0;
  }

  .team-roster {
    margin-inline: 0;
  }

  .team-roster th,
  .team-roster td {
    padding: 15px 13px;
  }

  .team-roster thead th {
    font-size: 0.52rem;
  }

  .team-roster tbody th,
  .team-roster tbody td {
    font-size: 0.58rem;
    line-height: 1.65;
  }

  .team-roster th:nth-child(1),
  .team-roster td:nth-child(1) {
    width: 54%;
  }

  .team-roster th:nth-child(2),
  .team-roster td:nth-child(2) {
    width: 46%;
  }

  .team-roster th:nth-child(3),
  .team-roster td:nth-child(3) {
    display: none;
  }

  .team-roster__mobile-context {
    display: block;
    margin-block-start: 5px;
    color: var(--color-muted);
    font-size: 0.48rem;
    font-weight: 500;
  }

  .team-committee summary {
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 12px;
    min-height: 82px;
    padding: 16px;
  }

  .team-committee__summary-meta {
    grid-column: 1;
    font-size: 0.5rem;
  }

  .team-committee__toggle {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 38px;
    height: 38px;
  }

  .team-committee__body {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 16px 20px;
  }

  .team-committee__members > div {
    grid-template-columns: minmax(105px, 0.55fr) minmax(0, 1fr);
    gap: 12px;
  }

  .team-partner-grid {
    grid-template-columns: 1fr;
  }

  .team-partner {
    grid-template-columns: 72px minmax(0, 1fr) 16px;
    min-height: 132px;
    gap: 14px;
    padding: 18px;
  }

  .team-partner__logo {
    width: 72px;
    height: 72px;
  }
}

@media (max-width: 430px) {
  .team-card-grid--imams .person-card {
    width: 88vw;
    min-width: 88vw;
  }

  .person-card--imam .person-card__link {
    grid-template-columns: 116px minmax(0, 1fr);
  }

  .person-card--imam .person-card__media,
  .person-card--imam .person-card__image {
    width: 96px;
    height: 96px;
  }

  .person-card--imam .person-card__body {
    padding: 13px 12px;
  }
}


/* Profile detail alignment and shared visual language. */
.profile-page .places-tag {
  width: fit-content;
  margin-block-end: 14px;
  padding: 7px 12px;
  background: var(--color-gold);
  color: var(--color-deepest);
  font-size: .58rem;
  font-weight: 700;
  line-height: 1.4;
}
.profile-page .profile-hero__content,
.profile-page .profile-biography__content,
.profile-page .profile-facts { min-width: 0; }
.profile-page .profile-facts { align-self: start; width: 100%; }
@media (max-width: 700px) {
  .profile-page .profile-hero {
    min-height: 0 !important;
    padding-block: calc(var(--header-height) + 20px) 34px !important;
  }
  .profile-page .profile-hero__grid {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 26px !important;
  }
  .profile-page .profile-hero__portrait {
    order: 0 !important;
    width: min(100%, 280px) !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    margin-inline: auto !important;
  }
  .profile-page .profile-hero__image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    object-position: center bottom;
  }
  .profile-page .profile-hero__content {
    order: 1;
    width: 100%;
    max-width: none;
  }
  .profile-page .profile-biography__grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 26px !important;
  }
  .profile-page .profile-biography,
  .profile-page .profile-related { min-height: 0; }
}
