.resources-video-block,
.layout-container .resources-video-block {
  width: 100%;
  max-width: 1038px;
  margin: 0 auto;
}

.resources-video-block__heading,
.layout-container .resources-video-block__heading {
  margin: 0 0 41px;
  padding: 0;
  font-family: Poppins, sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 35.556px;
  letter-spacing: -0.3556px;
  text-align: center;
  text-transform: uppercase;
  color: #4f08b0;
}

.resources-video-block .resources-video,
.layout-container .resources-video-block .resources-video {
  display: grid;
  grid-template-columns: minmax(0, 406fr) minmax(0, 538fr) 94px;
  align-items: stretch;
  width: 100%;
  min-height: 228px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

/* Button reset — the card becomes a <button> when Video URL is set. */
.resources-video-block button.resources-video,
.layout-container .resources-video-block button.resources-video {
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.resources-video-block .resources-video:hover,
.resources-video-block .resources-video:focus-visible,
.layout-container .resources-video-block .resources-video:hover,
.layout-container .resources-video-block .resources-video:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 8, 176, 0.15);
}

.resources-video-block .resources-video:focus-visible,
.layout-container .resources-video-block .resources-video:focus-visible {
  outline: 3px solid rgba(250, 189, 38, 0.6);
  outline-offset: 3px;
}

.resources-video-block .resources-video:hover .resources-video__arrow,
.resources-video-block .resources-video:focus-visible .resources-video__arrow,
.layout-container .resources-video-block .resources-video:hover .resources-video__arrow,
.layout-container .resources-video-block .resources-video:focus-visible .resources-video__arrow {
  background-position: 0 100%;
}

.resources-video-block .resources-video:hover .resources-video__arrow svg,
.resources-video-block .resources-video:focus-visible .resources-video__arrow svg,
.layout-container .resources-video-block .resources-video:hover .resources-video__arrow svg,
.layout-container .resources-video-block .resources-video:focus-visible .resources-video__arrow svg {
  color: #ffffff;
}

.resources-video-block .resources-video__thumbnail,
.layout-container .resources-video-block .resources-video__thumbnail {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #ffffff;
  min-height: 228px;
}

.resources-video-block .resources-video__thumbnail img,
.layout-container .resources-video-block .resources-video__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.resources-video-block .resources-video__play,
.layout-container .resources-video-block .resources-video__play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 80px;
  height: 80px;
  transform: translate(-50%, -50%);
  background: url("../../images/play-button.png") no-repeat center / contain;
  pointer-events: none;
}

.resources-video-block .resources-video__caption,
.layout-container .resources-video-block .resources-video__caption {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  min-width: 0;
  padding: 24px 40px;
  padding-left: 66px;
  background: transparent;
}

.resources-video-block .resources-video__caption-stack,
.layout-container .resources-video-block .resources-video__caption-stack {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.resources-video-block .resources-video__title,
.layout-container .resources-video-block .resources-video__title {
  display: block;
  margin: 0;
  max-width: 316px;
  width: 100%;
  font-family: Poppins, sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 34px;
  letter-spacing: 0;
  text-align: left;
  color: #4f08b0;
  word-break: break-word;
  overflow-wrap: break-word;
}

.resources-video-block .resources-video__title p,
.layout-container .resources-video-block .resources-video__title p {
  margin: 0;
  font: inherit;
  color: inherit;
  line-height: inherit;
}

.resources-video-block .resources-video__captions-note,
.layout-container .resources-video-block .resources-video__captions-note {
  display: block;
  margin: 0;
  padding: 0;
  width: 100%;
  font-family: Poppins, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: left;
  color: #000000;
  white-space: normal;
}

.resources-video-block .resources-video__arrow,
.layout-container .resources-video-block .resources-video__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #4f08b0 0.676%, #21034a 100%);
  background-size: 100% 200%;
  background-position: 0 0;
  transition: background-position 0.3s ease-in-out;
}

.resources-video-block .resources-video__arrow svg,
.layout-container .resources-video-block .resources-video__arrow svg {
  flex-shrink: 0;
  width: 14px;
  height: 26px;
  color: #fabd26;
  transition:
    color 0.3s ease-in-out,
    transform 0.2s ease;
}

@media (max-width: 1023px) and (min-width: 768px) {
  .resources-video-block .resources-video,
  .layout-container .resources-video-block .resources-video {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 72px;
    min-height: 200px;
  }

  .resources-video-block .resources-video__thumbnail,
  .layout-container .resources-video-block .resources-video__thumbnail {
    min-height: 200px;
  }

  .resources-video-block .resources-video__play,
  .layout-container .resources-video-block .resources-video__play {
    width: 64px;
    height: 64px;
  }

  .resources-video-block .resources-video__caption,
  .layout-container .resources-video-block .resources-video__caption {
    padding: 24px 28px;
  }

  .resources-video-block .resources-video__title,
  .layout-container .resources-video-block .resources-video__title {
    font-size: 20px;
    line-height: 28px;
    max-width: 280px;
  }

  .resources-video-block .resources-video__captions-note,
  .layout-container .resources-video-block .resources-video__captions-note {
    font-size: 14px;
  }
}

@media (max-width: 767px) {
  .resources-video-block__heading,
  .layout-container .resources-video-block__heading {
    margin: 0 0 19px;
    font-size: 16px;
    line-height: 28px;
    letter-spacing: -0.4px;
  }

  .resources-video-block .resources-video,
  .layout-container .resources-video-block .resources-video {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) 68px;
    min-height: 420px;
    width: 100%;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.5);
  }

  .resources-video-block .resources-video__thumbnail,
  .layout-container .resources-video-block .resources-video__thumbnail {
    position: relative;
    min-height: 0;
    width: 100%;
    height: auto;
    aspect-ratio: 342.54 / 190;
    overflow: hidden;
  }

  .resources-video-block .resources-video__thumbnail img,
  .layout-container .resources-video-block .resources-video__thumbnail img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: fill;
    object-position: center;
  }

  .resources-video-block .resources-video__play,
  .layout-container .resources-video-block .resources-video__play {
    width: 64px;
    height: 64px;
  }

  .resources-video-block .resources-video__caption,
  .layout-container .resources-video-block .resources-video__caption {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 40px 21px 19px;
    padding-right: 40px;
    background: #ffffff;
  }

  .resources-video-block .resources-video__caption-stack,
  .layout-container .resources-video-block .resources-video__caption-stack {
    gap: 5px;
    width: 100%;
  }

  .resources-video-block .resources-video__title,
  .layout-container .resources-video-block .resources-video__title {
    max-width: none;
    width: 100%;
    font-size: 20px;
    line-height: 28px;
  }

  .resources-video-block .resources-video__arrow,
  .layout-container .resources-video-block .resources-video__arrow {
    min-height: 68px;
    height: 68px;
    width: 100%;
  }

  .resources-video-block .resources-video__arrow svg,
  .layout-container .resources-video-block .resources-video__arrow svg {
    width: 12px;
    height: auto;
  }
}

/* ---------------------------------------------------------------------------
   Video modal — shown when the card has a Video URL.
   Styling mirrors the video-tabs modal (purple-bordered white card).
   JS mounts this on document.body while open, so the vars live on the modal
   node itself (it leaves .resources-video-block when teleported) and the
   z-index has to beat the header (1000) and sticky ISI (99999).
   --------------------------------------------------------------------------- */
.resources-video__modal {
  --rv-purple: #4f08b0;
  --rv-lilac: #b2b2ff;
  --rv-white: #ffffff;
  --rv-gray: #444444;
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  overscroll-behavior: none;
  touch-action: none;
  isolation: isolate;
}

.resources-video__modal[hidden] {
  display: none;
}

.resources-video__modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.resources-video__modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 1136px);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
  background: var(--rv-white);
  border: 2px solid var(--rv-purple);
  border-radius: 44.444px;
  padding: 56px 72px 48px;
  box-sizing: border-box;
  box-shadow: 0 24px 64px rgba(33, 3, 74, 0.28);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.resources-video__modal-dialog::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Dialog is focused on open for a11y — suppress UA focus ring (reads as a 2nd border). */
.resources-video__modal-dialog:focus,
.resources-video__modal-dialog:focus-visible {
  outline: none;
  box-shadow: 0 24px 64px rgba(33, 3, 74, 0.28);
}

.resources-video__modal-close {
  position: absolute;
  top: 30px;
  right: 42px;
  width: 24.8889px;
  height: 24.8889px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--rv-purple);
  cursor: pointer;
  z-index: 20;
  line-height: 0;
  overflow: visible;
  pointer-events: auto;
}

.resources-video__modal-close svg {
  display: block;
  width: 24.8889px;
  height: 24.8889px;
  max-width: none;
  overflow: visible;
  pointer-events: none;
}

.resources-video__modal-close:hover,
.resources-video__modal-close:focus-visible {
  filter: brightness(1.08);
  opacity: 0.85;
}

.resources-video__modal-close:focus-visible {
  outline: 2px solid var(--rv-lilac);
  outline-offset: 4px;
}

.resources-video__modal-player {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  background: #000;
  overflow: hidden;
}

.resources-video__modal-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.resources-video__modal-content {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  margin-top: 10px;
  min-height: 0;
  overflow: auto;
  text-align: center;
  /* Keep scroll, hide scrollbar (matches video-tabs modal) */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.resources-video__modal-content::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.resources-video__modal-captions {
  margin: 0;
  color: var(--rv-gray);
  font-family: Poppins, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  text-align: center;
}

html.resources-video-modal-open,
html.resources-video-modal-open body {
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
}

html.resources-video-modal-open body.resources-video-modal-open {
  position: fixed;
  inset: 0 0 0 0;
  width: 100%;
}

@media (max-width: 767px) {
  .resources-video__modal {
    padding: 16px 20px;
  }

  .resources-video__modal-dialog {
    border-radius: 24px;
    padding: 48px 16px 20px;
  }

  .resources-video__modal-close {
    top: 16px;
    right: 16px;
    width: 20px;
    height: 20px;
  }

  .resources-video__modal-close svg {
    width: 20px;
    height: 20px;
  }

  .resources-video__modal-content {
    margin-top: 20px;
  }

  .resources-video__modal-captions {
    font-size: 14px;
    line-height: 22px;
  }
}
