/* ==========================================================================
   Leadership team page (team.html)
   Scoped under .tm so it cannot leak into other pages. Shares the palette
   established by css/quality-page.css and css/about-page.css, but sets its own
   rhythm: a centred banner, one large founder feature, then portrait cards.
   ========================================================================== */

.tm,
.tm-hero {
  --tm-navy: #062a4d;
  --tm-navy-2: #0a3f70;
  --tm-blue: #0c549e;
  --tm-cyan: #00a8e8;
  --tm-steel: #f4f7fb;
  --tm-line: #dde5ef;
  --tm-ink: #24313f;
  --tm-mute: #5c6b7c;
}

.tm {
  display: block;
  background: #fff;
  color: var(--tm-ink);
  font-size: 15px;
  line-height: 1.75;
  overflow: hidden;
}

.tm *,
.tm *::before,
.tm *::after,
.tm-hero *,
.tm-hero *::before,
.tm-hero *::after {
  box-sizing: border-box;
}

/* The global sheet points headings at CaviarDreamsBold, which is not loaded on
   this site, so they silently fall back to Arial. Pin an explicit stack. */
.tm h1,
.tm h2,
.tm h3,
.tm-hero h1 {
  font-family: "Trebuchet MS", "Segoe UI", Arial, Helvetica, sans-serif;
}

.tm p {
  margin: 0 0 1.1em;
}

.tm p:last-child {
  margin-bottom: 0;
}

.tm-shell {
  width: 95%;
  max-width: 1200px;
  margin: 0 auto;
}

.tm-band {
  padding: 66px 0;
  background: #fff;
  border-top: 1px solid var(--tm-line);
}
/* 
.tm-band--steel {
  background: var(--tm-steel);
} */

.tm-band--tight {
  padding: 48px 0;
}

/* --- Section heading --------------------------------------------------- */

.tm-eyebrow {
  display: block;
  margin-bottom: 12px;
  color: var(--tm-cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.tm-head {
  max-width: 800px;
  margin: 0 auto 44px;
  text-align: center;
}

/* An intro band whose heading is all there is needs no trailing gap */
.tm-head:last-child {
  margin-bottom: 0;
}

.tm h2.tm-title {
  margin: 0;
  padding: 0;
  color: var(--tm-navy);
  font-size: 30px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  background: none;
  border: 0;
}

.tm-title__rule {
  display: block;
  width: 54px;
  height: 3px;
  margin: 16px auto 0;
  background: var(--tm-cyan);
}

.tm-head p {
  margin: 18px 0 0;
  color: var(--tm-mute);
  font-size: 16px;
}

/* --- Buttons ----------------------------------------------------------- */

.tm-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.tm .tm-btn,
.tm-hero .tm-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  background: var(--tm-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--tm-blue);
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease,
    transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.tm .tm-btn:hover,
.tm .tm-btn:focus,
.tm-hero .tm-btn:hover,
.tm-hero .tm-btn:focus {
  background: var(--tm-navy);
  border-color: var(--tm-navy);
  color: #fff;
  transform: translateY(-2px);
}

.tm .tm-btn--light,
.tm-hero .tm-btn--light {
  background: #fff;
  color: var(--tm-navy);
  border-color: #fff;
}

.tm .tm-btn--light:hover,
.tm .tm-btn--light:focus,
.tm-hero .tm-btn--light:hover,
.tm-hero .tm-btn--light:focus {
  background: var(--tm-cyan);
  border-color: var(--tm-cyan);
  color: #fff;
}

.tm .tm-btn--outline,
.tm-hero .tm-btn--outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

.tm .tm-btn--outline:hover,
.tm .tm-btn--outline:focus,
.tm-hero .tm-btn--outline:hover,
.tm-hero .tm-btn--outline:focus {
  background: #fff;
  border-color: #fff;
  color: var(--tm-navy);
}

/* ==========================================================================
   Banner — centred title over the leadership photograph
   ========================================================================== */

.tm-hero {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Clicks pass through to the banner underneath */
  pointer-events: none;
  /* Deepest through the middle, where the title sits over the group's faces */
  background: linear-gradient(180deg,
      rgba(6, 42, 77, 0.42) 0%,
      rgba(6, 42, 77, 0.72) 52%,
      rgba(6, 42, 77, 0.86) 100%);
  text-align: center;
}

/* .wrapper.row5 * forces max-width:none on every descendant, so the shell
   width has to be reasserted with matching weight. */
.wrapper.row5 .tm-hero__inner {
  width: 95%;
  max-width: 860px !important;
  margin: 0 auto;
}

.wrapper.row5 .tm-hero h1 {
  margin: 0;
  padding: 0;
  color: #fff;
  font-family: "Trebuchet MS", "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 42px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: none;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
  background: none;
  border: 0;
}

.wrapper.row5 .tm-hero__sub {
  max-width: 660px;
  margin: 16px auto 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  line-height: 1.65;
}

/* The banner is a single still, not a slideshow: no prev/next arrows, and
   <picture> has to be blocked out so the .rslides img rules still apply. */
.wrapper.row5 .tm-hero-slider .centered-btns_nav,
.wrapper.row5 .tm-hero-slider .rslides_nav {
  display: none !important;
}

.wrapper.row5 .tm-hero-slider picture {
  display: block;
  width: 100%;
}

/* Match the slider's own offset for the fixed header */
@media screen and (min-width: 1199px) {
  .tm-hero {
    margin-top: 120px;
  }
}

/* ==========================================================================
   Intro band — copy on a dark ground, photograph bleeding off the right edge
   ========================================================================== */

.tm-why {
  position: relative;
  background: #fff;
  color: var(--tm-ink);
  overflow: hidden;
}

/* Sits above the photo and keeps the copy on the site's normal measure */
.tm-why__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 95%;
  max-width: 1200px;
  margin: 0 auto;
}

.tm-why__body {
  padding: 78px 44px 78px 0;
}

.tm-why__eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--tm-cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.tm-why__role {
  margin: 0 0 26px;
  color: var(--tm-mute);
  font-size: 14px;
  font-style: italic;
}

.tm .tm-why__title {
  margin: 0 0 22px;
  padding: 0;
  color: var(--tm-navy);
  font-size: 40px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: none;
  background: none;
  border: 0;
}

.tm .tm-why__text {
  max-width: 520px;
  margin: 0;
  color: var(--tm-mute);
  font-size: 15px;
  line-height: 1.85;
}

/* The photograph occupies the right half of the band and bleeds to the
   viewport edge, so it is positioned against the section rather than the
   centred inner column. */
.tm-why__media {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: 50%;
  margin: 0;
  line-height: 0;
}

.tm-why__media img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: center 42%;
}

/* Fades the photo into the page on its left edge, so the two halves read as
   one band rather than a panel butted against a picture. */
.tm-why__media::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  /* Solid only at the very edge, so the photo's left border is hidden, then
     fading out fast - the picture stays at full strength almost throughout. */
  background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.62) 6%,
      rgba(255, 255, 255, 0.18) 18%, rgba(255, 255, 255, 0) 34%);
  pointer-events: none;
}

/* ==========================================================================
   Team cards — every director, the founder included

   Four across, each led by a landscape photograph of the director at the
   plant. The role sits above the name as a small chip, so a row of cards
   scans by function first and by person second.
   ========================================================================== */

/* Seven people across four columns leaves a short second row; it starts from
   the left so its cards line up under the row above. */
.tm-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 24px;
}

.tm-card {
  position: relative;
  display: flex;
  /* Four across at full width, so seven people fall as 4 + 3 */
  flex: 0 1 calc((100% - 72px) / 4);
  flex-direction: column;
  max-width: 340px;
  background: #fff;
  border: 1px solid var(--tm-line);
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.3, 1),
    box-shadow 0.45s ease, border-color 0.45s ease;
  box-shadow: 0 0 12px rgba(0, 168, 232, 0.12),
    0 4px 12px rgba(45, 91, 125, 0.1);
}

/* --- Landscape photograph ---------------------------------------------- */

.tm-card__photo {
  position: relative;
  /* Landscape window, matching the 3:2 crops */
  aspect-ratio: 3 / 2;
  margin: 0;
  background: var(--tm-steel);
  line-height: 0;
  overflow: hidden;
}

.tm-card__photo img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: center 32%;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* Reads as a photograph rather than a floating cut-out */
.tm-card__photo::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 34%;
  background: linear-gradient(180deg, rgba(6, 42, 77, 0) 0%,
      rgba(6, 42, 77, 0.28) 100%);
  pointer-events: none;
}

/* Tag marking the founder, who otherwise sits level with the others */
.tm-card__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 7px 13px;
  background: var(--tm-cyan);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

/* --- Copy -------------------------------------------------------------- */

.tm-card__body {
  position: relative;
  flex: 1;
  padding: 20px 20px 24px;
}

/* Role first, as a chip: a row of cards scans by function */
.tm-card__role {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 10px;
  background: rgba(0, 168, 232, 0.1);
  color: var(--tm-blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
  transition: background 0.35s ease, color 0.35s ease;
}

.tm .tm-card__name {
  margin: 0;
  padding: 0;
  color: var(--tm-navy);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
  text-transform: none;
  background: none;
  border: 0;
  transition: color 0.35s ease;
}

.tm-card blockquote {
  position: relative;
  margin: 14px 0 0;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--tm-line);
  color: var(--tm-mute);
  font-size: 13.5px;
  font-style: italic;
  line-height: 1.72;
}

/* Clamped to four lines on the card; the full text lives in the dialog.
   The clamp sits on the inner span so the blockquote keeps its rule and
   accent, which -webkit-box would otherwise swallow. */
.tm-card__text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Read more --------------------------------------------------------- */

.tm .tm-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--tm-blue);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.3s ease;
}

.tm .tm-more i {
  font-size: 10px;
  transition: transform 0.3s ease;
}

.tm .tm-more:hover,
.tm .tm-more:focus-visible {
  color: var(--tm-navy);
}

.tm .tm-more:hover i {
  transform: translateX(4px);
}

/* Short accent riding the rule above the quote */
.tm-card blockquote::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--tm-cyan);
  transition: width 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* --- Hover ------------------------------------------------------------- */

.tm-card:hover,
.tm-js .tm-card.is-revealed:hover {
  transform: translateY(-8px);
  border-color: rgba(12, 84, 158, 0.3);
  /* The resting shadow, deepened - same two colours so the lift reads as the
     same light source rather than a different effect. */
  box-shadow: 0 0 18px rgba(0, 168, 232, 0.2),
    0 12px 28px rgba(45, 91, 125, 0.18);
}

.tm-card:hover .tm-card__photo img {
  transform: scale(1.05);
}

.tm-card:hover .tm-card__role {
  background: var(--tm-blue);
  color: #fff;
}

.tm-card:hover .tm-card__name {
  color: var(--tm-blue);
}

.tm-card:hover blockquote::before {
  width: 100%;
}

/* --- Scroll reveal ------------------------------------------------------

   Gated behind .tm-js, which the page sets on <html> before the cards are
   parsed. With scripting off nothing is ever hidden. */

.tm-js .tm-card {
  opacity: 0;
  transform: translateY(30px) scale(0.985);
  transition: opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1),
    box-shadow 0.45s ease, border-color 0.45s ease;
}

.tm-js .tm-card.is-revealed {
  opacity: 1;
  transform: none;
}

/* Cascade across each row of four */
.tm-js .tm-card:nth-child(4n + 2) {
  transition-delay: 0.08s;
}

.tm-js .tm-card:nth-child(4n + 3) {
  transition-delay: 0.16s;
}

.tm-js .tm-card:nth-child(4n + 4) {
  transition-delay: 0.24s;
}

@keyframes tm-fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.tm-js .tm-head {
  animation: tm-fade-up 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

/* ==========================================================================
   Profile dialog — the full text behind "Read more"
   ========================================================================== */

.tm-modal[hidden] {
  display: none;
}

.tm-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tm-modal__backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(6, 42, 77, 0.72);
  /* No fill mode on purpose: the resting state is fully visible, so the
     dialog is never left half-faded if the animation does not run. */
  animation: tm-fade 0.25s ease;
}

.tm-modal__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 660px;
  max-height: calc(100vh - 48px);
  background: #fff;
  overflow: auto;
  box-shadow: 0 30px 70px rgba(6, 42, 77, 0.4);
  animation: tm-pop 0.32s cubic-bezier(0.2, 0.7, 0.3, 1);
}

@keyframes tm-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes tm-pop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.tm .tm-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: rgba(255, 255, 255, 0.92);
  border: 0;
  color: var(--tm-navy);
  font-size: 17px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.tm .tm-modal__close:hover,
.tm .tm-modal__close:focus-visible {
  background: var(--tm-blue);
  color: #fff;
}

.tm-modal__photo {
  margin: 0;
  aspect-ratio: 3 / 2;
  background: var(--tm-steel);
  line-height: 0;
  overflow: hidden;
}

.tm-modal__photo img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: center 32%;
}

.tm-modal__body {
  padding: 26px 30px 32px;
}

.tm-modal__role {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 11px;
  background: rgba(0, 168, 232, 0.1);
  color: var(--tm-blue);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.tm .tm-modal__name {
  margin: 0;
  padding: 0;
  color: var(--tm-navy);
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  text-transform: none;
  background: none;
  border: 0;
}

.tm .tm-modal__panel blockquote {
  position: relative;
  margin: 16px 0 0;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--tm-line);
  color: var(--tm-mute);
  font-size: 15px;
  font-style: italic;
  line-height: 1.85;
}

.tm .tm-modal__panel blockquote::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 54px;
  height: 2px;
  background: var(--tm-cyan);
}

/* Stops the page behind scrolling while the dialog is open */
body.tm-modal-open {
  overflow: hidden;
}

@media screen and (max-width: 560px) {
  .tm-modal {
    padding: 14px;
  }

  .tm-modal__body {
    padding: 20px 20px 26px;
  }

  .tm .tm-modal__name {
    font-size: 21px;
  }
}

/* ==========================================================================
   Closing strip — deliberately lighter than the About page's photo CTA
   ========================================================================== */

.tm-strip {
  padding: 44px 0;
  background: var(--tm-navy);
  color: rgba(255, 255, 255, 0.86);
}

.tm-strip__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  align-items: center;
  justify-content: space-between;
}

.tm .tm-strip h2 {
  margin: 0 0 6px;
  padding: 0;
  color: #fff;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  text-transform: none;
  background: none;
  border: 0;
}

.tm-strip p {
  margin: 0;
  font-size: 15px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Four landscape cards need roughly 1200px to stay readable */
@media screen and (max-width: 1200px) {
  .tm-card {
    flex-basis: calc((100% - 48px) / 3);
  }
}

@media screen and (max-width: 1024px) {
  .tm-band {
    padding: 52px 0;
  }

  .tm-why__body {
    padding: 60px 30px 60px 0;
  }

  .tm .tm-why__title {
    font-size: 32px;
  }

  .tm-card {
    flex-basis: calc((100% - 24px) / 2);
  }

  .wrapper.row5 .tm-hero h1 {
    font-size: 32px;
  }
}

@media screen and (max-width: 860px) {
  /* Too narrow to split: the photo becomes a band above the copy */
  .tm-why__inner {
    grid-template-columns: 1fr;
  }

  .tm-why__media {
    position: relative;
    width: 100%;
    height: 260px;
  }

  .tm-why__media::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.75) 82%, #fff 100%);
  }

  .tm-why__body {
    padding: 34px 0 56px;
  }

  .tm .tm-why__text {
    max-width: none;
  }
}

@media screen and (max-width: 767px) {
  .tm {
    font-size: 14.5px;
  }

  .tm-band {
    padding: 40px 0;
  }

  .tm h2.tm-title {
    font-size: 24px;
  }

  .wrapper.row5 .tm-hero h1 {
    font-size: 23px;
  }

  .wrapper.row5 .tm-hero__sub {
    font-size: 14px;
  }

  .tm-strip__inner {
    display: block;
  }

  .tm-strip .tm-btns {
    margin-top: 20px;
  }
}

@media screen and (max-width: 560px) {
  /* One card per row: centre it, or the 340px cap leaves it hugging the
     left edge with dead space down the right. */
  .tm-grid {
    justify-content: center;
  }

  .tm-card {
    flex-basis: 100%;
    max-width: 380px;
  }

  .tm-btns .tm-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tm-card,
  .tm-card__photo img,
  .tm-card__role,
  .tm-card blockquote::before,
  .tm .tm-card__name,
  .tm .tm-btn,
  .tm-hero .tm-btn,
  .tm-js .tm-card {
    transition: none !important;
  }

  .tm-js .tm-head,
  .tm-modal__backdrop,
  .tm-modal__panel {
    animation: none !important;
  }

  .tm .tm-more,
  .tm .tm-more i,
  .tm .tm-modal__close {
    transition: none !important;
  }

  .tm .tm-more:hover i {
    transform: none;
  }

  /* Reveal targets must not be left invisible when motion is suppressed */
  .tm-js .tm-card {
    opacity: 1;
    transform: none;
  }

  .tm-card:hover,
  .tm-js .tm-card.is-revealed:hover,
  .tm .tm-btn:hover,
  .tm-hero .tm-btn:hover {
    transform: none;
  }

  .tm-card:hover .tm-card__photo img {
    transform: none;
  }
}
