/* Portfolio V191 — consistent, readable motion-work cards. */

/*
 * The portfolio can be opened directly through #video-storytelling.  Legacy
 * reveal observers may not run before the browser restores that hash, so the
 * rail and its cards must own their layout instead of depending on animation
 * classes for visibility or height.
 */
html body.portfolio-page #video-storytelling.showcase-horizontal-rail {
  width: 100% !important;
  min-height: 560px !important;
  height: auto !important;
  padding: 8px 2px 28px !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 18px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory;
}

html body.portfolio-page #video-storytelling > .portfolio-card {
  position: relative !important;
  flex-shrink: 0 !important;
  min-height: 510px !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  scroll-snap-align: start;
}

html.ref-motion-enabled body.portfolio-page #video-storytelling > .portfolio-card.ref-reveal,
html body.portfolio-page #video-storytelling > .portfolio-card.reveal {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  transition: box-shadow .28s ease, border-color .28s ease !important;
}

html body.portfolio-page #video-storytelling > .portfolio-card:not(.portfolio-drama-card-v188):not(.video-gallery-card) {
  display: block !important;
}

html body.portfolio-page #video-storytelling > .video-gallery-card:not(.portfolio-drama-card-v188) {
  flex: 0 0 clamp(260px, 24vw, 310px) !important;
  min-height: 510px !important;
  aspect-ratio: auto !important;
  overflow: hidden !important;
  display: grid !important;
  grid-template-rows: auto 1fr;
  align-self: stretch;
  color: #10203d !important;
  border: 1px solid #d8e2ef !important;
  border-radius: 24px !important;
  background: #ffffff !important;
  box-shadow: 0 22px 54px rgba(28, 59, 103, .13) !important;
}

html body.portfolio-page #video-storytelling > .video-gallery-card:not(.portfolio-drama-card-v188) > video {
  position: static !important;
  inset: auto !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 9 / 16;
  display: block !important;
  object-fit: cover !important;
  object-position: center !important;
  background: #e9eef5 !important;
}

html body.portfolio-page .portfolio-video-gallery > .portfolio-drama-card-v188 {
  flex: 0 0 clamp(260px, 24vw, 310px) !important;
  min-height: 510px !important;
  aspect-ratio: auto !important;
  overflow: hidden !important;
  display: grid !important;
  grid-template-rows: auto 1fr;
  align-self: stretch;
  color: #10203d !important;
  border: 1px solid #d8e2ef !important;
  border-radius: 24px !important;
  background: #ffffff !important;
  box-shadow: 0 22px 54px rgba(28, 59, 103, .13) !important;
}

html body.portfolio-page .portfolio-drama-media-v188 {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #e9eef5;
}

html body.portfolio-page .portfolio-drama-media-v188 video {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: cover !important;
  object-position: center !important;
  background: #e9eef5 !important;
}

html body.portfolio-page .portfolio-drama-badge-v188 {
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 14px;
  min-height: 30px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 999px;
  background: rgba(10, 28, 55, .84) !important;
  box-shadow: 0 9px 24px rgba(10, 28, 55, .22);
  backdrop-filter: blur(10px);
  font-size: .49rem;
  font-weight: 850;
  letter-spacing: .11em;
}

html body.portfolio-page .portfolio-drama-card-v188 .media-label {
  position: static !important;
  inset: auto !important;
  min-height: 108px !important;
  margin: 0 !important;
  padding: 16px 18px 17px !important;
  display: grid !important;
  align-content: center;
  gap: 6px !important;
  color: #10203d !important;
  border: 0 !important;
  border-top: 1px solid #e0e7f0 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

html body.portfolio-page .portfolio-drama-card-v188 .media-label strong,
html body.portfolio-page .portfolio-drama-card-v188 .media-label span {
  color: #10203d !important;
  -webkit-text-fill-color: currentColor !important;
}

html body.portfolio-page .portfolio-drama-card-v188 .media-label strong {
  font-size: .98rem;
  line-height: 1.25;
}

html body.portfolio-page .portfolio-drama-card-v188 .media-label > span {
  color: #5a6b82 !important;
  font-size: .7rem;
  line-height: 1.5;
  letter-spacing: .035em;
  text-align: left;
}

/* All marked video captions use one clean reading hierarchy. */
html body.portfolio-page #video-storytelling > .video-gallery-card .media-label {
  position: static !important;
  inset: auto !important;
  min-height: 116px !important;
  margin: 0 !important;
  padding: 17px 18px 18px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  gap: 7px !important;
  color: #10203d !important;
  border: 0 !important;
  border-top: 1px solid #e0e7f0 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  text-align: left !important;
}

html body.portfolio-page #video-storytelling > .video-gallery-card .media-label strong {
  width: 100%;
  display: block !important;
  color: #10203d !important;
  -webkit-text-fill-color: #10203d !important;
  background: transparent !important;
  font-size: 1.02rem !important;
  font-weight: 820 !important;
  line-height: 1.24 !important;
  letter-spacing: -.018em !important;
  text-transform: none !important;
  text-align: left !important;
}

html body.portfolio-page #video-storytelling > .video-gallery-card .media-label > span {
  width: 100%;
  display: block !important;
  color: #5a6b82 !important;
  -webkit-text-fill-color: #5a6b82 !important;
  background: transparent !important;
  font-size: .7rem !important;
  font-weight: 700 !important;
  line-height: 1.48 !important;
  letter-spacing: .035em !important;
  text-transform: uppercase !important;
  text-align: left !important;
}

html body.portfolio-page #video-storytelling > .video-gallery-card .media-label :where(.id-only, .en-only) {
  background: transparent !important;
  box-shadow: none !important;
}

html body.portfolio-page .portfolio-drama-media-v188 video:focus-visible {
  outline: 3px solid #2168d5;
  outline-offset: -3px;
}

@media (max-width: 700px) {
  html body.portfolio-page #video-storytelling.showcase-horizontal-rail {
    min-height: 540px !important;
    padding-bottom: 22px !important;
  }

  html body.portfolio-page .portfolio-video-gallery > .portfolio-drama-card-v188 {
    flex-basis: min(78vw, 300px) !important;
  }

  html body.portfolio-page #video-storytelling > .video-gallery-card:not(.portfolio-drama-card-v188) {
    flex-basis: min(78vw, 300px) !important;
  }
}
