.team-section {
  background: #f4f0e9;
  color: #252321;
}

.team-showcase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 26px;
}

.team-section .team-section-heading {
  margin: 0;
  text-align: right;
}

.team-section .team-section-heading .eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  color: #876148;
  font-size: 1rem;
  font-weight: 750;
}

.team-section .team-section-heading .eyebrow::after {
  width: 34px;
  height: 1px;
  background: #876148;
  content: "";
}

.team-section .team-section-heading h2 {
  margin: 0;
  color: #22211f;
  font-size: clamp(2.4rem, 4vw, 3.25rem);
  font-weight: 850;
  line-height: 1.25;
}

.team-section .team-section-heading > p:last-child {
  margin: 8px 0 0;
  color: #77736f;
  font-size: clamp(1.1rem, 1.8vw, 1.55rem);
  line-height: 1.55;
}

.team-slider {
  width: 100%;
  margin-inline: auto;
}

.team-slider-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 16px;
  direction: ltr;
}

.team-slider-viewport {
  min-width: 0;
  container-type: inline-size;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 4px;
  direction: rtl;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  touch-action: pan-x;
  overscroll-behavior-inline: contain;
  cursor: grab;
}

.team-slider-viewport::-webkit-scrollbar {
  display: none;
}

.team-slider-viewport.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.team-section .team-grid {
  display: flex;
  width: max-content;
  align-items: stretch;
  gap: 22px;
  margin: 0;
  direction: rtl;
}

.team-section .team-card {
  flex: 0 0 calc((100vw - 162px) / 4);
  flex-basis: calc((100cqi - 66px) / 4);
  max-width: 360px;
  scroll-snap-align: start;
}

.team-slider-arrow {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 1px solid #85634b;
  border-radius: 50%;
  background: transparent;
  color: #292724;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}

.team-slider-arrow:hover:not(:disabled) {
  background: #876148;
  color: #fff;
}

.team-slider-arrow:disabled {
  opacity: .35;
  cursor: default;
}

.team-slider-arrow:focus-visible,
.team-slider-viewport:focus-visible {
  outline: 3px solid #876148;
  outline-offset: 3px;
}

.team-slider-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin: 24px 0 0;
  color: #b89e89;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .18em;
  direction: ltr;
}

.team-slider-progress {
  display: flex;
  gap: 10px;
}

.team-slider-progress span {
  width: 86px;
  height: 4px;
  border-radius: 99px;
  background: #d9d5cf;
}

.team-slider-progress span.is-active {
  background: #876148;
}

.team-section .team-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .team-section .team-card:hover {
    box-shadow: none;
  }
}

.team-section .team-card-photo {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 10px;
  background: #e6ded4;
}

.team-section .team-card-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
}

.team-section .team-card-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  padding: 18px 2px 0;
  text-align: right;
}

.team-section .team-card-copy h3 {
  margin: 0;
  color: #252321;
  font-size: clamp(1.18rem, 1.55vw, 1.48rem);
  font-weight: 850;
  line-height: 1.45;
}

.team-section .team-card-position {
  display: block;
  min-height: 24px;
  margin: 4px 0 0 !important;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #89674f !important;
  font-size: .98rem;
  font-weight: 750;
  line-height: 1.6;
}

.team-section .team-card-bio-preview {
  display: -webkit-box;
  min-height: 4.7em;
  overflow: hidden;
  margin: 12px 0 22px;
  color: #77736f;
  font-size: 1rem;
  line-height: 1.85;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.team-section .team-card-profile-open {
  display: inline-flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 12px 24px;
  border: 0;
  border-top: 1px solid #d1c9bf;
  border-radius: 0;
  background: transparent;
  color: #89674f;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  text-align: start;
  cursor: pointer;
  transition: color .2s ease;
}

.team-section .team-card-profile-open::before {
  position: absolute;
  z-index: 2;
  inset: 0;
  content: "";
  touch-action: pan-x;
}

.team-section .team-card-profile-open:hover {
  color: #36291f;
}

.team-section .team-card-profile-open span {
  font-size: 1.2rem;
  transition: transform .2s ease;
}

.team-section .team-card-profile-open:hover span {
  transform: translateX(-3px);
}

.team-section .team-card-profile-open:focus-visible,
.team-profile-close:focus-visible,
.team-profile-footer a:focus-visible {
  outline: 3px solid var(--gold, #756453);
  outline-offset: 3px;
}

.team-profile-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  width: min(880px, calc(100vw - 48px));
  max-width: none;
  max-height: min(88dvh, calc(100dvh - 40px));
  margin: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 12px;
  background: #fffdf9;
  color: #302820;
  box-shadow: 0 18px 58px rgba(52, 39, 27, .2);
  transform: translate(-50%, -50%);
}

.team-profile-dialog::backdrop {
  background: rgba(43, 35, 27, .2);
  backdrop-filter: blur(1px);
}

.team-profile-shell {
  display: flex;
  max-height: min(88dvh, calc(100dvh - 40px));
  flex-direction: column;
  min-height: 0;
}

.team-profile-header,
.team-profile-footer {
  z-index: 1;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: #f7f2ea;
}

.team-profile-header {
  border-bottom: 1px solid #e9dfd2;
}

.team-profile-header .eyebrow {
  margin: 0;
  color: #866246;
  font-weight: 800;
}

.team-profile-close {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid #d9c6b1;
  border-radius: 50%;
  background: #fffdf9;
  color: #63482f;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

.team-profile-close:hover {
  border-color: #866246;
  background: #866246;
  color: #fffdf9;
}

.team-profile-close span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  line-height: 1;
  transform: translateY(-1px);
}

.team-profile-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.team-profile-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  padding: 22px 24px;
}

.team-profile-photo {
  width: 232px;
  height: 286px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-soft, #ebe3d9);
}

.team-profile-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
}

.team-profile-copy h2 {
  margin: 0;
  color: #30241c;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.35;
  text-align: start;
}

.team-profile-copy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center;
  gap: 10px 14px;
  min-width: 0;
}

.team-profile-position {
  grid-column: 1 / -1;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin: -2px 0 4px;
  padding: 5px 12px;
  border: 1px solid #e6d4c1;
  border-radius: 999px;
  background: #f4eadf;
  color: #765239;
  font-size: .94rem;
  font-weight: 850;
  text-align: start;
}

.team-profile-position::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #a77950;
  content: "";
}

.team-profile-copy section {
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  border-inline-start: 3px solid #a17b5b;
  border-radius: 7px;
  background: #f7f4ef;
  text-align: start;
}

.team-profile-copy .team-profile-bio {
  grid-column: 1 / -1;
  padding: 12px 0 0;
  border: 0;
  border-radius: 0;
  border-top: 1px solid #d9c8b6;
  background: transparent;
}

.team-profile-copy section h3 {
  margin: 0 0 5px;
  color: var(--green, #594a3a);
  font-size: 1rem;
}

.team-profile-copy section p,
.team-profile-copy section ul {
  margin: 0;
  color: var(--text-2, #69716c);
  font-size: 15px;
  line-height: 1.7;
}

.team-profile-copy section ul {
  padding-inline-start: 1.25rem;
}

.team-profile-footer {
  display: block;
  min-height: 0;
  padding: 12px 24px 16px;
  border-top: 1px solid #e9dfd2;
}

.team-profile-footer .button {
  display: flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  font-size: 1.05rem;
  font-weight: 800;
}

@media (max-width: 1023px) and (min-width: 768px) {
  .team-section .team-card {
    flex-basis: calc((100vw - 140px) / 3);
    flex-basis: calc((100cqi - 44px) / 3);
  }
}

@media (max-width: 767px) and (min-width: 640px) {
  .team-section .team-grid {
    gap: 18px;
  }

  .team-section .team-card {
    flex-basis: calc((100vw - 66px) / 2);
    flex-basis: calc((100cqi - 18px) / 2);
  }

  .team-profile-dialog {
    width: min(720px, calc(100vw - 32px));
    max-height: 92dvh;
  }

  .team-profile-shell {
    max-height: 92dvh;
  }

  .team-profile-layout {
    grid-template-columns: 172px minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
  }

  .team-profile-photo {
    width: 172px;
    height: 214px;
  }

  .team-profile-copy {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .team-profile-copy h2,
  .team-profile-position,
  .team-profile-copy .team-profile-bio {
    grid-column: 1;
  }

  .team-profile-copy h2 {
    font-size: 25px;
  }

  .team-profile-copy section {
    padding: 10px 12px;
  }
}

@media (max-width: 639px) {
  .team-showcase-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
  }

  .team-section .team-section-heading h2 {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }

  .team-section .team-section-heading > p:last-child {
    max-width: 220px;
    margin-top: 5px;
    font-size: .95rem;
    line-height: 1.5;
  }

  .team-section .team-section-heading .eyebrow {
    margin-bottom: 7px;
    font-size: .88rem;
  }

  .team-slider-controls {
    gap: 8px;
  }

  .team-slider-arrow {
    width: 42px;
    height: 42px;
    font-size: 1.5rem;
  }

  .team-section .section-heading {
    margin-bottom: 0;
  }

  .team-slider-arrow {
    border-radius: 50%;
  }

  .team-section .team-grid {
    gap: 16px;
  }

  .team-section .team-card {
    flex-basis: calc(100vw - 32px);
    flex-basis: 100cqi;
  }

  .team-section .team-card-photo {
    aspect-ratio: 1 / 1;
  }

  .team-slider-pagination {
    gap: 16px;
    margin-top: 18px;
    font-size: .85rem;
  }

  .team-slider-progress {
    gap: 5px;
  }

  .team-slider-progress span {
    width: 32px;
    height: 3px;
  }

  .team-section .team-card-copy {
    padding-top: 14px;
  }

  .team-section .team-card-bio-preview {
    min-height: 3.7em;
    margin: 10px 0 16px;
    line-height: 1.75;
    -webkit-line-clamp: 2;
  }

  .team-section .team-card-profile-open {
    min-height: 54px;
    padding: 10px 18px;
  }

  .team-profile-dialog {
    inset: 50% auto auto 50%;
    width: min(430px, calc(100vw - 24px));
    height: auto;
    max-width: none;
    max-height: calc(100dvh - 24px);
    margin: 0;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 14px;
    transform: translate(-50%, -50%);
  }

  .team-profile-shell {
    height: auto;
    max-height: calc(100dvh - 24px);
  }

  .team-profile-header,
  .team-profile-footer {
    padding: 9px 14px;
  }

  .team-profile-header {
    min-height: 54px;
  }

  .team-profile-close {
    width: 36px;
    height: 36px;
  }

  .team-profile-layout {
    grid-template-columns: clamp(88px, 28vw, 112px) minmax(0, 1fr);
    align-items: start;
    gap: 9px 14px;
    padding: 15px 14px 16px;
  }

  .team-profile-photo {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    margin: 0;
  }

  .team-profile-copy h2 {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    font-size: clamp(20px, 6.2vw, 24px);
    line-height: 1.3;
    text-align: start;
  }

  .team-profile-position {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    justify-self: start;
    margin: 0 0 2px;
    padding: 4px 10px;
    font-size: .84rem;
    text-align: start;
  }

  .team-profile-copy {
    display: contents;
  }

  .team-profile-copy section,
  .team-profile-copy .team-profile-bio {
    grid-column: 1 / -1;
  }

  .team-profile-copy .team-profile-bio {
    margin-top: 3px;
    padding-top: 12px;
  }

  .team-profile-copy section {
    padding: 10px 12px;
  }

  .team-profile-copy section p,
  .team-profile-copy section ul {
    font-size: 14px;
    line-height: 1.65;
  }

  .team-profile-footer .button {
    width: 100%;
    justify-content: center;
    min-height: 52px;
    padding: 12px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-section .team-card,
  .team-section .team-card-profile-open,
  .team-slider-arrow {
    transition: none;
  }

  .team-slider-viewport {
    scroll-behavior: auto;
  }
}
