/* Student Testimonials (the homepage's last section, above the footer; qis_student_speak.php,
   js/qis-student-speak.js). Each story is an interview still with a broadcast-style lower third, beside
   the student's words; chapter stills and a timeline scrubber switch stories.
   Colour: the type runs indigo -> magenta -> ember, the hues of the background's periwinkle and apricot
   glows taken deep enough to read; amber marks the lower third and the controls.
   Without the script every story shows, stacked. */
.qis-speak {
  --speak-mist: #f4f5ff;
  --speak-ink: #0d1b3e;
  --speak-indigo: #3730a3;
  --speak-magenta: #be185d;
  --speak-ember: #c2410c;
  --speak-plum: #9d174d;
  --speak-body: #45416e;
  --speak-amber: #ffb347;
  --speak-hue: linear-gradient(90deg, var(--speak-indigo) 0%, var(--speak-magenta) 58%, var(--speak-ember) 100%);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 56px 0 52px;
  background: var(--speak-mist);
  color: var(--speak-ink);
  font-family: 'Open Sans', Arial, sans-serif;
}
.qis-speak > .container {
  max-width: 940px;
}
.qis-speak::before,
.qis-speak::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
}
.qis-speak::before {
  z-index: -2;
  background:
    radial-gradient(46% 72% at 90% 14%, rgba(170, 180, 255, .58), rgba(170, 180, 255, 0) 72%),
    radial-gradient(42% 68% at 6% 96%, rgba(255, 201, 163, .66), rgba(255, 201, 163, 0) 72%),
    radial-gradient(32% 52% at 34% 36%, rgba(216, 204, 255, .34), rgba(216, 204, 255, 0) 70%);
}
.qis-speak::after {
  z-index: -1;
  opacity: .3;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .05 0 0 0 0 .1 0 0 0 0 .24 0 0 0 .42 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* Heading: the college's own face, filled with the section's colour run */
.qis-speak .qis-speak__title {
  width: -moz-fit-content;
  width: fit-content;
  margin: 0 0 24px;
  font-family: 'QIS Forward', 'QIS Serif', Georgia, serif;
  font-weight: 800;
  font-size: clamp(26px, 2.6vw, 36px);
  line-height: 1.08;
  letter-spacing: -.02em;
  color: var(--speak-indigo);
  text-align: left;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .qis-speak .qis-speak__title {
    padding-bottom: .06em;
    background: var(--speak-hue);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  .qis-speak .qis-speak__title::selection {
    background: var(--speak-indigo);
    -webkit-text-fill-color: #fff;
  }
}

/* A story: the still beside the words */
.qis-speak__slide {
  display: grid;
  grid-template-columns: minmax(0, 270px) minmax(0, 1fr);
  gap: 44px;
  align-items: center;
}
.qis-speak__slide + .qis-speak__slide {
  margin-top: 44px;
}
.qis-speak.is-live .qis-speak__slides {
  display: grid;
}
/* Transitions start only after the first frames (is-ready), so the switch to one story never flickers. */
.qis-speak.is-live .qis-speak__slide {
  grid-area: 1 / 1;
  margin: 0;
  opacity: 0;
  visibility: hidden;
}
.qis-speak.is-live .qis-speak__slide.is-active {
  opacity: 1;
  visibility: visible;
}
.qis-speak.is-ready .qis-speak__slide {
  transition: opacity .45s ease, visibility 0s linear .45s;
}
.qis-speak.is-ready .qis-speak__slide.is-active {
  transition: opacity .45s ease;
}

/* The interview still */
.qis-speak .qis-speak__still {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  background: #dfe3f5;
  box-shadow: 0 26px 46px -28px rgba(76, 90, 180, .55), 0 2px 6px rgba(76, 90, 180, .12);
}
@supports not (aspect-ratio: 1) {
  .qis-speak .qis-speak__still {
    height: 0;
    padding-top: 125%;
  }
}
.qis-speak__still::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6);
  pointer-events: none;
}
.qis-speak .qis-speak__still img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

/* Lower third: name and first line on an amber bar. It slides in when the section first comes into view
   (is-seen) and again with each story. */
.qis-speak .qis-speak__lower {
  position: absolute;
  left: 0;
  bottom: 16px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: calc(100% - 18px);
  padding: 8px 14px 9px 12px;
  background: var(--speak-amber);
  color: var(--speak-ink);
  text-align: left;
}
.qis-speak__name {
  font-family: 'QIS Forward', 'QIS Serif', Georgia, serif;
  font-weight: 800;
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: -.005em;
}
.qis-speak__line {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: #243050;
}
.qis-speak.is-live .qis-speak__lower {
  clip-path: inset(0 100% 0 0);
}
.qis-speak.is-seen .qis-speak__slide.is-active .qis-speak__lower {
  clip-path: inset(0 0 0 0);
}
.qis-speak.is-ready .qis-speak__slide.is-active .qis-speak__lower {
  transition: clip-path .6s cubic-bezier(.2, .8, .2, 1) .2s;
}

/* Play (only when the story has a video) */
.qis-speak .qis-speak__play {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--speak-ink);
  cursor: pointer;
  transition: background-color .2s;
}
.qis-speak__play svg {
  width: 19px;
  height: 19px;
  margin-left: 3px;
  fill: currentColor;
}
.qis-speak .qis-speak__play:hover,
.qis-speak .qis-speak__play:focus-visible {
  background: var(--speak-amber);
}

/* The student's words: the first paragraph leads in indigo, the second follows lighter; the opening
   quotation mark hangs in the margin so the text keeps a straight left edge. */
.qis-speak__words {
  min-width: 0;
}
.qis-speak .qis-speak__quote {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 15px;
}
.qis-speak .qis-speak__quote p,
.qis-speak .qis-speak__from {
  text-align: left !important;
  hyphens: manual;
  text-wrap: pretty;
}
.qis-speak .qis-speak__quote p {
  max-width: 62ch;
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--speak-body);
}
.qis-speak .qis-speak__quote p:first-child {
  max-width: 31em;
  margin-bottom: 14px;
  font-size: 17.5px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -.005em;
  color: var(--speak-indigo);
}
.qis-speak .qis-speak__quote p:last-child {
  margin-bottom: 0;
}
.qis-speak__mark {
  color: var(--speak-magenta);
  font-weight: 700;
}
/* A zero-width box whose right-to-left content spills leftwards: the mark hangs, yet stays in the text. */
.qis-speak__mark--open {
  display: inline-block;
  width: 0;
  direction: rtl;
  text-indent: .07em;
}
.qis-speak .qis-speak__from {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--speak-plum);
}
.qis-speak .qis-speak__from::before {
  content: "";
  flex: none;
  width: 24px;
  height: 3px;
  border-radius: 3px;
  background: var(--speak-hue);
}

/* Chapters, arrows and the timeline scrubber (shown once the script runs) */
.qis-speak__nav {
  display: none;
}
/* The arrows sit right after the chapter stills, clear of the site's floating buttons on the right. */
.qis-speak.is-live .qis-speak__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 26px;
}
.qis-speak__chapters {
  position: relative;
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  gap: 8px;
  margin: -6px -4px;
  padding: 6px 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.qis-speak__chapters::-webkit-scrollbar {
  display: none;
}
.qis-speak .qis-speak__chapter {
  flex: none;
  width: 48px;
  height: 60px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #dfe3f5;
  cursor: pointer;
  opacity: .62;
  scroll-snap-align: start;
  transition: opacity .2s, box-shadow .2s;
}
.qis-speak__chapter img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.qis-speak .qis-speak__chapter:hover {
  opacity: 1;
}
.qis-speak .qis-speak__chapter[aria-current="true"] {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--speak-mist), 0 0 0 4px var(--speak-amber);
}
.qis-speak__arrows {
  flex: none;
  display: flex;
  gap: 8px;
}
.qis-speak .qis-speak__arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(13, 27, 62, .16);
  border-radius: 50%;
  background: rgba(255, 255, 255, .6);
  color: var(--speak-ink);
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.qis-speak__arrow svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.qis-speak .qis-speak__arrow:hover {
  border-color: var(--speak-ink);
  background: var(--speak-ink);
  color: var(--speak-amber);
}
.qis-speak .qis-speak__chapter:focus-visible,
.qis-speak .qis-speak__arrow:focus-visible,
.qis-speak .qis-speak__play:focus-visible,
.qis-speak .qis-speak__close:focus-visible {
  outline: 3px solid var(--speak-ink);
  outline-offset: 3px;
  opacity: 1;
}
.qis-speak__scrub {
  flex: 1 0 100%;
  display: flex;
  gap: 6px;
}
.qis-speak__seg {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(13, 27, 62, .12);
}
.qis-speak__seg i {
  display: block;
  height: 100%;
  background: var(--speak-amber);
  transform: scaleX(0);
  transform-origin: left center;
}
.qis-speak__seg.is-done i {
  transform: scaleX(1);
}
.qis-speak.is-timing .qis-speak__seg.is-active i {
  animation: qis-speak-fill 12s linear forwards;
}
.qis-speak.is-held .qis-speak__seg.is-active i {
  animation-play-state: paused;
}
@keyframes qis-speak-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Video player */
.qis-speak .qis-speak__player {
  width: min(960px, 94vw);
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #000;
  overflow: visible;
}
.qis-speak__player::backdrop {
  background: rgba(8, 14, 32, .78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.qis-speak__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: inherit;
  overflow: hidden;
}
.qis-speak__frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.qis-speak .qis-speak__close {
  position: absolute;
  top: -18px;
  right: -18px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--speak-amber);
  color: var(--speak-ink);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.qis-speak__close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

@media (max-width: 991px) {
  .qis-speak__slide {
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    gap: 32px;
  }
  .qis-speak .qis-speak__quote p:first-child {
    font-size: 16.5px;
  }
  .qis-speak .qis-speak__quote p {
    font-size: 14.5px;
  }
}
@media (max-width: 767px) {
  .qis-speak {
    padding: 40px 0 36px;
  }
  .qis-speak .qis-speak__title {
    margin-bottom: 16px;
  }
  /* Rows stay at the top; a shorter story leaves its spare height below the words. */
  .qis-speak__slide {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    align-content: start;
  }
  /* The still becomes a small portrait and the lower third reaches out past its edge, so every face
     stays whole and the words start sooner. */
  .qis-speak .qis-speak__still {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: end;
    aspect-ratio: auto;
    border-radius: 0;
    overflow: visible;
    background: none;
    box-shadow: none;
  }
  .qis-speak__still::after {
    display: none;
  }
  .qis-speak .qis-speak__still img {
    position: static;
    grid-column: 1;
    grid-row: 1;
    width: 112px;
    height: 140px;
    border-radius: 12px;
    background: #dfe3f5;
    box-shadow: 0 16px 30px -18px rgba(76, 90, 180, .6), 0 1px 4px rgba(76, 90, 180, .14);
  }
  .qis-speak .qis-speak__still img:not([src]) {
    display: none;
  }
  .qis-speak .qis-speak__lower {
    position: relative;
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    bottom: auto;
    max-width: calc(100% + 22px);
    margin: 0 0 14px -22px;
  }
  .qis-speak .qis-speak__play {
    top: 10px;
    right: auto;
    left: 62px;
    width: 40px;
    height: 40px;
  }
  .qis-speak .qis-speak__quote p:first-child {
    font-size: 16px;
  }
  .qis-speak .qis-speak__quote p {
    font-size: 14.5px;
    line-height: 1.6;
  }
  .qis-speak.is-live .qis-speak__nav {
    margin-top: 20px;
  }
  .qis-speak__arrows {
    display: none;
  }
  .qis-speak .qis-speak__chapter {
    width: 44px;
    height: 55px;
    border-radius: 9px;
  }
  .qis-speak .qis-speak__close {
    top: -54px;
    right: 0;
  }
}
@supports not (aspect-ratio: 1) {
  @media (max-width: 767px) {
    .qis-speak .qis-speak__still {
      height: auto;
      padding-top: 0;
    }
  }
}
@media (forced-colors: active) {
  .qis-speak .qis-speak__title {
    background: none;
    color: CanvasText;
    -webkit-text-fill-color: currentColor;
  }
}
@media (prefers-reduced-motion: reduce) {
  .qis-speak *,
  .qis-speak *::before,
  .qis-speak *::after {
    transition: none !important;
    animation: none !important;
  }
  .qis-speak.is-live .qis-speak__lower {
    clip-path: none;
  }
  .qis-speak__seg.is-active i {
    transform: scaleX(1);
  }
}
