/* -------------------------------------------
   Team Grid – Teachers
   Container: 1140px + 15px horizontal padding
   Desktop: 5 items per row
   Mobile-first: 1 item per row (override later if needed)
------------------------------------------- */

h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 {
  letter-spacing: 0em;
  text-transform: none;
  line-height: 1.2;
}

h1, .h1 {
  font-size: 3em;
}

h2, .h2 {
  font-size: 2.3em;
}

h3, .h3 {
  font-size: 1.75em;
}

h4, .h4 {
  font-size: 1.3em;
}

h5, .h5 {
  font-size: 1em;
}

/* Regular button */
.btn {
  display: inline-block;
  padding: 0.75em 1.5em;
  font-size: 1em;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 50px;
  background-color: #D6B0D8;
  color: #000;
  cursor: pointer;
  transition: background-color .25s ease, transform .2s ease;
}

.btn:hover {
  background-color: #005bb5;
  transform: translateY(-2px);
}

.btn:active {
  background-color: #004a99;
  transform: translateY(0);
}

.btn:focus {
  outline: 2px solid #004a99;
  outline-offset: 2px;
}

/*
** Landing page
*/

.page-template-front-page #page {
  background: #fff;
}

#landing-page .c-segment {
  margin-bottom: 4em;
    padding: 1em 0;
}

.c-segment.is_background {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow-x: hidden;
}

#landing-page .c-segment .c-segment__wrap,
#landing-page .c-segment .container .c-segment__wrap {
  display: flex;
  flex-direction: column;
  gap: 5em;
  align-items: flex-start;
}

#landing-page .c-segment .c-segment__wrap img {
  height: auto;
  width: 100%;
}

#landing-page .c-segment .c-segment__title {
  text-align: center;
}

#landing-page .c-segment .c-segment__wrap > div {
  flex: 1 1 100%;
}

#landing-page .c-segment .c-segment__wrap .c-segment__media {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

#landing-page .c-segment .c-segment__wrap .c-segment__wysiwyg {
  width: 100%;
  max-width: 500px;
}

.c-segment.c-segment_gallery {
  display: grid;
  gap: .75rem;
  grid-template-areas:
        "a a b c"
        "a a d c"
        "a a d e";
  grid-template-columns: repeat(4, 1fr);
}

.c-segment.c-segment_gallery > div.item {
  height: 100%;
}

.c-segment.c-segment_gallery>:nth-child(1) {
    grid-area: a
}

.c-segment.c-segment_gallery>:nth-child(2) {
    grid-area: b
}

.c-segment.c-segment_gallery>:nth-child(3) {
    grid-area: c
}

.c-segment.c-segment_gallery>:nth-child(4) {
    grid-area: d
}

.c-segment.c-segment_gallery>:nth-child(5) {
    grid-area: e
}

.c-segment.c-segment_gallery .col > * {
  max-width: 100%;
  height: auto;
  display: block;
}

.c-segment_gallery .item img, .c-segment_gallery .item video {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.c-segment.c-segment_gallery .c-segment__wysiwyg {
 background: #FAD4A5;
 padding: 80px 25px;
}



/*
** Team page
*/

/* Container with specified max width and side paddings */
.container {
  max-width: 1140px;
  margin: 45px auto;
  padding-left: 15px;
  padding-right: 15px;
  box-sizing: border-box;
}

/* Flex grid wrapper */
.wrap.team-grid {
  --team-gap: 24px;              /* adjust spacing between cards */
  display: flex;
  flex-wrap: wrap;
  gap: var(--team-gap);
  align-items: stretch;           /* keep cards equal height if content differs */
}

.the-cover-content-wrap {
  margin-bottom: 90px;
}

.the-cover-content h1 {
  font-size: 37px;
  line-height: 44px;
  max-width: 800px;
  text-align: center;
  text-transform: none;
  margin: 0 auto 45px;
  display: block;
}

.the-cover-content .cover-description {
  font-size: 21px;
  line-height: 25px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  display: block;
}

/* Card – base (mobile-first: one per row) */
.team-card {
  flex: 1 1 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Photo block with square ratio and cover fit */
.team-card__photo {
  position: relative;
  aspect-ratio: 3 / 4;           /* consistent thumbnails */
  overflow: hidden;
  border-radius: 7px;
  background: #f5f5f5;           /* subtle bg while image loads */
  margin: 0;                     /* reset default figure margin */
}

/* Target both WP-generated <img> and fallback .team-card__photo-img */
.team-card__photo img,
.team-card__photo .team-card__photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: transform .3s ease;
}

/* Slight, accessible hover (no color changes) */
.team-card:hover .team-card__photo img,
.team-card:hover .team-card__photo .team-card__photo-img {
  transform: scale(1.03);
}

.team-card__name {
  line-height: 1.1;
  font-size: 21px;
  margin-bottom: 5px;
  text-transform: none;
}

.team-card__position {
  line-height: 1.4;
  font-size: 16px;
  opacity: .85;
}

.wrap.team-grid {
  /* configurable vertical offset for the stagger effect */
  --stagger-offset: 30px;
}

/*
** Desktop min 1200px
*/

@media (min-width: 1200px) {

  .team-card {
    flex: 0 0 calc((100% - (5 - 1) * var(--team-gap)) / 5);
    max-width: calc((100% - (5 - 1) * var(--team-gap)) / 5);
  }

  .wrap.team-grid .team-card:nth-child(5n + 2),
  .wrap.team-grid .team-card:nth-child(5n + 4) {
    position: relative;               /* keep layout flow intact */
    top: calc(var(--stagger-offset) * -1); /* move up by 30px */
  }

  #landing-page .c-segment .c-segment__wrap,
  #landing-page .c-segment .container .c-segment__wrap {
    flex-direction: row;
  }

  #landing-page .c-segment .c-segment__wrap .c-segment__media {
    width: 40%;
  }

  #landing-page .c-segment .c-segment__wrap .c-segment__wysiwyg {
    width: 60%;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
  }

}

/*
** Desktop min 756px max 1999px
*/

@media (min-width: 756px) and (max-width: 1199.98px) {

  .wrap.team-grid { 
    --stagger-offset: 30px;
  }

  /* 3 columns: width accounts for (3 - 1) gaps */
  .team-card {
    flex: 0 0 calc((100% - (3 - 1) * var(--team-gap)) / 3);
    max-width: calc((100% - (3 - 1) * var(--team-gap)) / 3);
  }

  /* Raise only the middle card in each 3-item row: 2, 5, 8, 11, ... */
  .wrap.team-grid .team-card:nth-child(3n + 2) {
    position: relative;
    top: calc(var(--stagger-offset) * -1);
  }

  /* Make sure other nth-child staggers (e.g., desktop ones) don't leak in */
  .wrap.team-grid .team-card:nth-child(5n + 2),
  .wrap.team-grid .team-card:nth-child(5n + 4) {
    top: 0;            /* reset any inherited desktop rule */
    transform: none;   /* if you used transform variant on desktop */
  }
}


/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .team-card__photo img,
  .team-card__photo .team-card__photo-img {
    transition: none;
  }
}