/* =========================================================================
   Team members modal (slider)
   Reference layout originally written with Tailwind, ported to plain CSS.
   ========================================================================= */

:root {
  --team-sand: var(--beige);
  --team-ink: #323232;
}

/* Make the cards look clickable ------------------------------------------- */
.module-about-people .open-team-dialog {
  cursor: pointer;
}
.module-about-people .open-team-dialog:focus-visible {
  outline: clamp(2px, 0.2rem, 0.2rem) solid currentColor;
  outline-offset: 0.6rem;
}

/* Team members grid (replaces the old Flickity carousel) ------------------- */
.module-about-people .team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6.5rem;
  margin-top: 16.6rem;
}
@media screen and (max-width: 768px) {
  .module-about-people .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gutter);
    margin-top: 0;
  }
}
.module-about-people .team-grid > .flex-col {
  padding-bottom: 3rem;
  border-bottom: clamp(1px, 0.1rem, 0.1rem) solid currentColor;
}
@media screen and (max-width: 768px) {
  .module-about-people .team-grid > .flex-col {
    border: 0;
    padding-bottom: 0;
  }
}
.module-about-people .team-grid > .flex-col figure {
  background-color: var(--beige);
}
.module-about-people .team-grid > .flex-col figure img {
  width: 100%;
  height: 100%;
  aspect-ratio: 2/3;
  -o-object-fit: cover;
     object-fit: cover;
}
.module-about-people .team-grid > .flex-col h3 {
  margin-top: 3rem;
}
@media screen and (max-width: 768px) {
  .module-about-people .team-grid > .flex-col h3 {
    margin-top: 1.5rem;
    font-size: 2.2rem;
    letter-spacing: 0.176rem;
  }
  .module-about-people .team-grid > .flex-col h3 + p {
    margin-top: 1.5rem;
  }
}
.module-about-people .team-grid .team-grid-more {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Clickable card hover ----------------------------------------------------- */
.module-about-people .open-team-dialog figure {
  position: relative;
  overflow: hidden;
}
.module-about-people .open-team-dialog figure img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
@media (hover: hover) {
  .module-about-people .open-team-dialog:hover figure img,
  .module-about-people .open-team-dialog:focus-visible figure img {
    transform: scale(1.05);
  }
}
@media (prefers-reduced-motion: reduce) {
  .module-about-people .open-team-dialog figure img {
    transition: none;
  }
  .module-about-people .open-team-dialog:hover figure img,
  .module-about-people .open-team-dialog:focus-visible figure img {
    transform: none;
  }
}

/* Dialog transitions ------------------------------------------------------ */
@keyframes team-dialog-in {
  from {
    opacity: 0;
    transform: translateY(1.6rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes team-dialog-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(1.6rem);
  }
}
@keyframes team-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes team-backdrop-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Dialog ------------------------------------------------------------------ */
.dialog-team {
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  width: 95vw;
  max-width: 144rem;
  max-height: 90dvh;
  border: 0;
  border-radius: 1rem;
  color: var(--team-ink);
  background-color: var(--team-sand);
  overflow: hidden;
}
.dialog-team[open] {
  animation: team-dialog-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.dialog-team.is-closing {
  animation: team-dialog-out 0.20s cubic-bezier(0.4, 0, 1, 1) both;
}
.dialog-team::backdrop {
  background-color: rgba(50, 50, 50, 0.35);
  backdrop-filter: blur(0.75rem);
  animation: team-backdrop-in 0.5s ease both;
}
.dialog-team.is-closing::backdrop {
  animation: team-backdrop-out 0.35s ease both;
}
@media screen and (max-width: 768px) {
  .dialog-team {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
}

.dialog-team .close-team-dialog {
  position: absolute;
  top: 2.4rem;
  right: 2.4rem;
  z-index: 2;
  width: 2.8rem;
  height: 2.8rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--team-ink);
  cursor: pointer;
}
.dialog-team .close-team-dialog::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background-color: currentColor;
  -webkit-mask-size: contain;
          mask-size: contain;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-image: url(../images/_symbols.svg#close);
          mask-image: url(../images/_symbols.svg#close);
}
.dialog-team .close-team-dialog:hover {
  opacity: 0.5;
}

.dialog-team .dialog-team-content {
  height: 100%;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 6.4rem;
}
@media screen and (max-width: 768px) {
  .dialog-team .dialog-team-content {
    max-height: 100dvh;
    padding: 6.4rem 2.4rem 2.4rem;
  }
}

/* Slider ------------------------------------------------------------------ */
.carousel-team {
  width: 100%;
}
.carousel-team .carousel-cell {
  width: 100%;
  margin-right: 4rem;
}
/* Avoid a flash of stacked slides before Flickity initialises */
.carousel-team:not(.flickity-enabled) .carousel-cell:not(:first-child) {
  display: none;
}

/* Slide ------------------------------------------------------------------- */
.team-slide-inner {
  display: flex;
  flex-direction: column;
  gap: 4.8rem;
}
@media screen and (min-width: 769px) {
  .team-slide-inner {
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 6.4rem;
  }
}

.team-slide-media {
  flex: 0 0 auto;
  width: 100%;
}
@media screen and (min-width: 769px) {
  .team-slide-media {
    width: 33%;
    max-width: 32rem;
  }
}
.team-slide-media figure {
  margin: 0;
  aspect-ratio: 2/3;
  border-radius: 1rem;
  overflow: hidden;
  background-color: #fff;
}
.team-slide-media figure img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  display: block;
}

.team-slide-nav {
  margin-top: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.team-slide-nav button {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--team-ink);
  font-size: 1.4rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.team-slide-nav button:hover {
  opacity: 0.5;
}
.team-nav-arrow {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  background-color: currentColor;
  -webkit-mask: url(../images/_symbols.svg#arrow) no-repeat center / contain;
          mask: url(../images/_symbols.svg#arrow) no-repeat center / contain;
}
.team-nav-arrow-prev {
  transform: rotate(180deg);
}

/* Slide content ----------------------------------------------------------- */
.team-slide-content {
  flex: 1 1 auto;
}
.team-slide-content .team-name {
  font-size: 4rem;
  letter-spacing: 0.32rem;
  text-wrap: balance;
}
@media screen and (max-width: 768px) {
  .team-slide-content .team-name {
    font-size: 2.5rem;
    letter-spacing: 0.2rem;
  }
}
.team-slide-content .team-role {
  margin-top: 1.2rem;
  font-size: 1.4rem;
  letter-spacing: 0.2rem;
  text-transform: uppercase;
}
.team-slide-content .team-bio {
  margin-top: 3.2rem;
  font-size: 2.4rem;
  font-weight: 300;
  line-height: 1.3;
}
@media screen and (max-width: 768px) {
  .team-slide-content .team-bio {
    font-size: 1.8rem;
  }
}
.team-slide-content .team-bio p + p {
  margin-top: 1.5rem;
}

.team-slide-extra {
  margin-top: 4rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4.8rem 2.4rem;
}
@media screen and (min-width: 1024px) {
  .team-slide-extra {
    grid-template-columns: repeat(2, 1fr);
  }
}
.team-slide-extra .team-experience,
.team-slide-extra .team-moment {
  font-size: 1.6rem;
  line-height: 1.4;
}
.team-slide-extra .team-experience p + p,
.team-slide-extra .team-moment p + p {
  margin-top: 1.2rem;
}
.team-slide-extra .team-moment h4 {
  margin-bottom: 0.8rem;
  font-weight: 700;
}
