/* === TEAM PAGE STYLES === */

/* Grid */
.people-grid {
  display: grid;
  grid-template-columns: repeat(3, auto);
  column-gap: 3.5rem;
  row-gap: 1.5rem;
  justify-content: center;
}

@media (max-width: 900px) {
  .people-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .people-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 1rem;
    row-gap: 1rem;
  }
}

/* Card */
.person {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  max-width: 350px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.person:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.person a {
  cursor: inherit;
}

/* Photo */
.person-photo {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  display: block;
  background: #f5f5f5;

  /* enable stacking for hover swap */
  position: relative;
}

.person-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 25%;
  backface-visibility: hidden;
  transition: opacity .25s ease, filter .25s ease, transform .25s ease;
}

/* Default image = first child, greyscale on */
.person-photo img:first-child {
  filter: grayscale(100%);
  position: relative;
  z-index: 1;
}

/* Fun image = last child, hidden by default on top */
.person-photo img:last-child {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 2;
  pointer-events: none;
}

/* Reveal fun image on hover or keyboard focus */
.person:hover .person-photo img:last-child,
.person:focus-within .person-photo img:last-child {
  opacity: 1;
}

/* Hide normal while fun is visible and remove greyscale */
.person:hover .person-photo img:first-child,
.person:focus-within .person-photo img:first-child {
  opacity: 0;
  filter: grayscale(0%);
}



/* Meta info container */
.person-meta {
  flex: 1;
  padding: 1rem;
  padding-bottom: 1.8rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Name */
.person-meta h3.name {
  margin: 0;
  line-height: 1.4;
  color: #c00;
  text-align: center;
}

/* Desktop and tablets: one line */
@media (min-width: 601px) {
  .person-meta h3.name .word { display: inline; }
  .person-meta h3.name .word:not(:last-child)::after { content: " "; }
}

/* Mobile: one word per line */
@media (max-width: 600px) {
  .person-meta h3.name .word {
    display: block;
    text-align: center;
    line-height: 1.4;
    padding-bottom: 2px;
  }
}

/* Role */
.person-meta .role {
  margin: 0.1rem 0 0 0;
  color: #666;
  font-size: 0.95rem;
  text-align: center;
  line-height: 1.3;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(2 * 1.3em);
}

/* Chevron */
.person-meta::after {
  content: "\f054";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0.3rem;
  font-size: 0.85rem;
  color: #c00;
}

/* Team search bar, hover and focus highlight */
input[type="search"],
input[type="text"]{
  border: 2px solid #e6e6e6;
  border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input[type="search"]:hover,
input[type="search"]:focus,
input[type="text"]:hover,
input[type="text"]:focus{
  border-color: #c41212;
  box-shadow: 0 0 0 3px rgba(196,18,18,.15);
  outline: none;
}

/* === Team page header area === */
.content-people .people-lead,
.content-people .people-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 14px;
}

.people-lead h1 {
  color: #c00;
  font-weight: 700;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
  margin: 70px 0 8px;
  position: relative;
  display: inline-block;
  padding-bottom: 8px;
}

.people-lead h1::after {
  content: "";
  display: block;
  width: 160px;
  height: 4px;
  background: #111;
  border-radius: 2px;
  margin-top: 8px;
}

.people-intro {
  max-width: 62ch;
  color: #6a6a6a;
  font-size: 1.12rem;
  line-height: 1.8;
  margin: 8px 0 18px;
}

.people-search-wrap { margin: 14px 0 24px; }
.people-search {
  display: block;
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  background: #f6f6f6;
  border: 1px solid #e4e4e4;
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04) inset;
}

.people-search:hover,
.people-search:focus {
  border-color: #c41212;
  box-shadow: 0 0 0 3px rgba(196,18,18,.15);
  outline: none;
}

.content-people .people-grid { margin-top: 24px; margin-bottom: 72px; }

@media (max-width: 600px) {
  .people-lead h1 { font-size: 2.1rem; }
  .people-lead h1::after { width: 140px; height: 3px; }
  .people-intro { font-size: 1.02rem; line-height: 1.65; }
  .people-search { padding: 12px 14px; }
}

/* Squares override for team cards, integrated */
@supports (aspect-ratio: 1 / 1) {
  .people-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }
  @media (max-width: 900px) {
    .people-grid {
      grid-template-columns: repeat(2, minmax(200px, 1fr));
    }
  }
  @media (max-width: 600px) {
    .people-grid {
      grid-template-columns: repeat(2, 1fr);
      column-gap: 1rem;
      row-gap: 1rem;
    }
  }

/* change this for box sizing*/
  .person {
    aspect-ratio: 2 / 3;
    display: grid;
    grid-template-rows: 1fr auto;
    height: auto;
	
  }

  .person-photo {
    width: 100%;
    height: 100%;
    grid-row: 1;
    aspect-ratio: auto;
  }


/* fun image hidden until hover */
.person-photo img:last-child {
  opacity: 0;
  pointer-events: none;
}

/* hover/focus swap with no size change */
.person:hover .person-photo img:last-child,
.person:focus-within .person-photo img:last-child { opacity: 1; }

.person:hover .person-photo img:first-child,
.person:focus-within .person-photo img:first-child {
  opacity: 0;
  filter: grayscale(0%);
}


  .person-meta {
    grid-row: 2;
    min-height: 72px;
  }
}

/* Optional subtle white frame */
.people-grid .person-photo {
  background: #fff;
  padding: 8px;
  box-sizing: border-box;
}



/* Trim meta a bit for balance */
.people-grid .person-meta {
  min-height: 64px;
  padding-bottom: 1.4rem;
}

/* Do not force contain anymore, the hover swap uses cover for a clean crossfade */

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .person-photo img {
    transition: none;
  }
}

.person-photo img:last-child {
  padding: 8px; /* match whatever your .person-photo padding is */
}