/**
 * Single video watch page — YouTube-style layout + theater mode.
 */

body.mp-video-single .entry-hero-container-inner,
body.mp-video-single .hero-section,
body.mp-video-single .entry-header {
  display: none;
}

.mp-video-watch {
  background: var(--mp-cream);
}

/* Player stage */
.mp-video-watch__stage {
  padding: 12px 0 0;
  background: var(--mp-white);
  border-bottom: 1px solid var(--mp-border-light);
  transition: background 0.28s ease;
}

.mp-video-watch__breadcrumb {
  margin-bottom: 14px;
}

.mp-video-watch__player-shell {
  max-width: 100%;
}

.mp-video-watch .mp-video-embed__frame {
  position: relative;
  width: min(100%, calc(min(38vh, 400px) * 16 / 9));
  max-height: min(38vh, 400px);
  margin-inline: auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background: #0b1015;
  box-shadow: 0 16px 40px rgba(7, 31, 70, 0.12);
}

.mp-video-embed.is-gated .mp-video-embed__poster,
.mp-video-embed.is-gated .mp-video-embed__poster--empty {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.mp-video-embed__poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mp-video-embed__poster--empty {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--mp-navy), var(--mp-blue));
}

.mp-video-embed__gate {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: rgba(11, 16, 21, 0.82);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.mp-video-embed__gate-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.mp-video-embed__gate-card {
  max-width: 420px;
  padding: 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  text-align: center;
}

.mp-video-embed__gate-card .mp-member-gate__message {
  color: var(--mp-ink);
}

.mp-video-watch__header .mp-content-byline {
  margin-top: 12px;
  flex-wrap: wrap;
}

.mp-video-watch__header .mp-content-byline__contributors {
  flex: 1 1 100%;
  margin-top: 4px;
}

.mp-video-watch__header .mp-guest-contributors--list {
  width: 100%;
}

.mp-video-embed__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.mp-video-embed__frame--poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mp-video-embed__poster-overlay,
.mp-video-embed__frame--empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 16, 21, 0.72);
  color: #fff;
  text-align: center;
  font-size: 14px;
}

.mp-video-watch__player-bar {
  display: flex;
  justify-content: flex-end;
  width: min(100%, calc(min(38vh, 400px) * 16 / 9));
  margin-inline: auto;
  padding: 8px 0 10px;
}

.mp-video-watch__theater {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--mp-border);
  border-radius: 999px;
  background: var(--mp-white);
  color: var(--mp-navy);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.mp-video-watch__theater-icon {
  flex-shrink: 0;
  color: currentColor;
}

.mp-video-watch__theater:hover,
.mp-video-watch__theater:focus-visible {
  border-color: var(--mp-blue);
  background: rgba(47, 120, 189, 0.1);
  color: var(--mp-blue);
  outline: none;
}

.mp-video-watch__theater[aria-pressed="true"] {
  border-color: var(--mp-navy);
  background: var(--mp-navy);
  color: var(--mp-white);
}

.mp-video-watch__theater[aria-pressed="true"]:hover,
.mp-video-watch__theater[aria-pressed="true"]:focus-visible {
  border-color: var(--mp-deep);
  background: var(--mp-deep);
  color: var(--mp-white);
}

.mp-video-watch__theater:active {
  transform: scale(0.98);
}

/* Main layout */
.mp-video-watch__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  padding: 18px 0 64px;
  align-items: start;
}

.mp-video-watch__title {
  margin: 0;
  color: var(--mp-navy);
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.mp-video-watch__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  color: var(--mp-muted);
  font-size: 13px;
  font-weight: 600;
}

.mp-video-watch__meta span + span::before {
  content: '•';
  margin-right: 14px;
  opacity: 0.55;
}

.mp-video-watch__topics,
.mp-video-watch__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.mp-video-watch__description {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid var(--mp-border-light);
  border-radius: 14px;
  background: var(--mp-white);
  box-shadow: var(--mp-shadow-soft);
}

.mp-video-watch__excerpt {
  margin: 0 0 12px;
  color: var(--mp-ink);
  font-size: 15px;
  line-height: 1.6;
}

.mp-video-watch__content {
  color: var(--mp-ink);
  font-size: 15px;
  line-height: 1.65;
}

.mp-video-watch__description-body.is-collapsed {
  max-height: 96px;
  overflow: hidden;
  position: relative;
}

.mp-video-watch__description-body.is-collapsed::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--mp-white));
  pointer-events: none;
}

.mp-video-watch__description-toggle {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mp-blue);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* Sidebar */
.mp-video-watch__sidebar {
  position: sticky;
  top: calc(var(--mp-header-height, 72px) + 16px);
}

body.admin-bar .mp-video-watch__sidebar {
  top: calc(var(--mp-header-height, 72px) + 48px);
}

.mp-video-watch__sidebar-title {
  margin: 0 0 12px;
  color: var(--mp-navy);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mp-video-watch__sidebar-empty {
  margin: 0;
  color: var(--mp-muted);
  font-size: 14px;
}

.mp-video-related {
  display: grid;
  gap: 10px;
}

.mp-video-related__item {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.16s ease;
}

.mp-video-related__item:hover {
  background: rgba(23, 37, 79, 0.04);
}

.mp-video-related__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--mp-light);
}

.mp-video-related__thumb img,
.mp-video-related__thumb-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mp-video-related__thumb-placeholder {
  background: linear-gradient(135deg, var(--mp-light), #e8edf4);
}

.mp-video-related__duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.mp-video-related__copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.mp-video-related__title {
  color: var(--mp-navy);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mp-video-related__meta {
  color: var(--mp-muted);
  font-size: 12px;
  line-height: 1.4;
}

/* Theater mode */
body.mp-video-theater {
  overflow-x: hidden;
}

body.mp-video-theater .mp-video-watch__stage {
  padding-top: 0;
  background: #0b1015;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

body.mp-video-theater .mp-video-watch__stage-inner {
  width: 100%;
  max-width: none;
  padding-inline: 0;
}

body.mp-video-theater .mp-video-watch__breadcrumb {
  display: none;
}

body.mp-video-theater .mp-video-watch__player-shell {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

body.mp-video-theater .mp-video-embed__frame {
  width: 100%;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
}

body.mp-video-theater .mp-video-watch__player-bar {
  width: min(var(--mp-max), calc(100% - var(--mp-gutter) * 2));
}

body.mp-video-theater .mp-video-watch__player-bar {
  width: min(var(--mp-max), calc(100% - var(--mp-gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--mp-gutter);
}

body.mp-video-theater .mp-video-watch__theater {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: var(--mp-white);
}

body.mp-video-theater .mp-video-watch__theater:hover,
body.mp-video-theater .mp-video-watch__theater:focus-visible {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.18);
  color: var(--mp-white);
}

body.mp-video-theater .mp-video-watch__theater[aria-pressed="true"] {
  border-color: var(--mp-white);
  background: var(--mp-white);
  color: var(--mp-navy);
}

body.mp-video-theater .mp-video-watch__theater[aria-pressed="true"]:hover,
body.mp-video-theater .mp-video-watch__theater[aria-pressed="true"]:focus-visible {
  border-color: var(--mp-cream);
  background: var(--mp-cream);
  color: var(--mp-navy);
}

body.mp-video-theater .mp-video-watch__layout {
  grid-template-columns: 1fr;
  max-width: 920px;
}

body.mp-video-theater .mp-video-watch__sidebar {
  position: static;
}

body.mp-video-theater .mp-video-related__item {
  grid-template-columns: 220px minmax(0, 1fr);
}

@media (max-width: 1080px) {
  .mp-video-watch__layout {
    grid-template-columns: 1fr;
  }

  .mp-video-watch__sidebar {
    position: static;
  }

  .mp-video-related__item {
    grid-template-columns: 140px minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .mp-video-watch__stage {
    padding-top: 12px;
  }

  .mp-video-watch .mp-video-embed__frame {
    width: 100%;
    max-height: min(34vh, 240px);
    border-radius: 10px;
  }

  .mp-video-watch__player-bar {
    width: 100%;
  }

  body.mp-video-theater .mp-video-embed__frame {
    border-radius: 0;
  }

  .mp-video-related__item {
    grid-template-columns: 120px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mp-video-watch__stage,
  .mp-video-watch__theater,
  .mp-video-related__item {
    transition: none;
  }
}
