/**
 * CP Video Section Perf / UX
 * Risk: backup site before deploy.
 */

/* ---- Perf: cheaper hover; one gold-border hover/active ---- */
.cp-video-section .cpv-playlist-card {
  transition: background-color 0.18s ease, border-color 0.18s ease !important;
  transform: none !important;
  will-change: auto;
  contain: layout paint;
  outline: none !important;
}
/* Cancel Elementor :first-child permanent gold; only hover/active use it */
.cp-video-section .cpv-playlist-card:first-child {
  background: rgba(255, 255, 255, 0.13) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}
.cp-video-section .cpv-playlist-card:hover,
.cp-video-section .cpv-playlist-card.is-active,
.cp-video-section .cpv-playlist-card:first-child:hover,
.cp-video-section .cpv-playlist-card:first-child.is-active {
  transform: none !important;
  background: rgba(255, 255, 255, 0.25) !important;
  border-color: rgba(229, 193, 133, 0.78) !important;
  outline: none !important;
  box-shadow: rgba(50, 31, 37, 0.1) 0 10px 30px !important;
}
.cp-video-section .cpv-browse .elementor-button,
.cp-video-section .cpv-join .elementor-button {
  transition: background-color 0.18s ease, color 0.18s ease !important;
  transform: none !important;
}
.cp-video-section .cpv-browse .elementor-button:hover,
.cp-video-section .cpv-join .elementor-button:hover {
  transform: none !important;
}
.cp-video-section .cpv-thumb img,
.cp-video-section .cpv-thumb video,
.cp-video-section .cpv-avatar img,
.cp-video-section .cpv-member-avatar img,
.cp-video-section .elementor-widget-cmsmasters-video__cover-image img {
  content-visibility: auto;
}

/* Membership header: avatar + title one size smaller */
.cp-video-section .cpv-member-avatar,
.cp-video-section .cpv-member-avatar.e-con,
.cp-video-section .elementor-element.cpv-member-avatar {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  flex: 0 0 38px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
}
.cp-video-section .cpv-member-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 50% !important;
}
.cp-video-section .cpv-membership-title .elementor-heading-title {
  font-size: 22px !important;
  line-height: 1.15 !important;
}
.cp-video-section .cpv-membership {
  min-height: 48px !important;
  gap: 10px !important;
  align-items: center !important;
}
.cp-video-section .cpv-alignment-spacer {
  height: 48px !important;
  min-height: 48px !important;
}

/* Mobile: spacing + playlist width tweaks */
@media (max-width: 767px) {
  /* Fig.2 tags/copyright/stats: nudge up toward player */
  .cp-video-section .cpv-featured {
    gap: 10px !important;
    row-gap: 10px !important;
  }
  .cp-video-section .cpv-actions {
    margin-top: 6px !important;
  }

  /* Playlist width: 95% of content width */
  .cp-video-section .cpv-sidebar {
    width: 95% !important;
    max-width: 95% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }
  .cp-video-section .cpv-playlist-list,
  .cp-video-section .cpv-playlist-card {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Keep Join → next section tighter (from 1.4.3) */
  .cp-video-section.elementor-element-8dcb31a,
  .elementor-37787 .elementor-element.elementor-element-8dcb31a {
    padding-bottom: 28px !important;
  }
  .elementor-37787 .elementor-element.elementor-element-e636dfb {
    --padding-top: 56px !important;
    --margin-top: 0px !important;
    padding-top: 56px !important;
    margin-top: 0 !important;
  }
}

/* 证言区：圆点下移避开 member 名；区间距 58px 仍保留 */
html body.elementor-page-37787 .elementor-37787 .elementor-element.elementor-element-d103df1 {
  --padding-bottom: 52px !important;
  --margin-bottom: 58px !important;
  padding-bottom: 52px !important;
  margin-bottom: 58px !important;
}
html body.elementor-page-37787 #cmsmasters-slider-b032df4 .swiper-pagination-wrap {
  margin: 0 0 -36px 0 !important;
}
@media (min-width: 768px) {
  html body.elementor-page-37787 .elementor-37787 .elementor-element.elementor-element-d103df1 {
    --padding-bottom: 66px !important;
    padding-bottom: 66px !important;
  }
  html body.elementor-page-37787 #cmsmasters-slider-b032df4 .swiper-pagination-wrap {
    margin: 0 0 -50px 0 !important;
  }
}
@media (min-width: 1181px) {
  html body.elementor-page-37787 .elementor-37787 .elementor-element.elementor-element-d103df1 {
    --padding-bottom: 72px !important;
    padding-bottom: 72px !important;
  }
  html body.elementor-page-37787 #cmsmasters-slider-b032df4 .swiper-pagination-wrap {
    margin: 0 0 -56px 0 !important;
  }
}

/* ---- Playlist meta: duration left, like/comment right ---- */
.cp-video-section .cpv-playlist-meta .elementor-widget-container {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}
.cp-video-section .cpv-playlist-meta .cpv-time {
  flex: 0 0 auto;
}
.cp-video-section .cpv-playlist-meta .cpv-social {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

/* Hide featured player corner duration badge (text + pill box), all viewports */
.cp-video-section .cpv-duration,
.cp-video-section .cpv-duration .elementor-widget-container,
.cp-video-section .cpv-duration .elementor-heading-title {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Featured stats row */
.cp-video-section .cpv-stat {
  display: inline-flex;
  align-items: center;
}
.cp-video-section .cpv-stat .elementor-heading-title,
.cp-video-section .cpv-stat .cpv-social {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.cp-video-section .cpv-stats .cp-comment-link svg {
  fill: currentColor !important;
  stroke: none !important;
}

/* Mobile: copyright + like/comment on same row as tags, right-aligned */
@media (max-width: 767px) {
  .cp-video-section .cpv-actions {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .cp-video-section .cpv-actions > .cpv-tags {
    flex: 0 1 auto !important;
    width: auto !important;
    max-width: 48% !important;
    min-width: 0 !important;
  }
  .cp-video-section .cpv-actions > .cpv-stats {
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: 52% !important;
    min-width: 0 !important;
    margin-left: auto !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }
  .cp-video-section .cpv-stats .cpv-copyright,
  .cp-video-section .cpv-stats .cpv-stat {
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
  }
  .cp-video-section .cpv-stats .cpv-copyright .elementor-heading-title {
    font-size: 11px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }
  .cp-video-section .cpv-stats .cp-rating-link,
  .cp-video-section .cpv-stats .cp-comment-link {
    gap: 3px;
    font-size: 12px;
  }
  .cp-video-section .cpv-stats .cp-rating-link svg,
  .cp-video-section .cpv-stats .cp-comment-link svg {
    width: 13px;
    height: 13px;
  }
}

/* ---- Interactive like / comment ---- */
.cp-video-section .cp-rating-link,
.cp-video-section .cp-rating-link span,
.cp-video-section .cp-comment-link,
.cp-video-section .cp-comment-link span,
.cp-video-section .cpv-stat .cp-rating-link,
.cp-video-section .cpv-stat .elementor-heading-title,
.cp-video-section .cpv-stat .elementor-heading-title a {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  text-decoration: none !important;
}
.cp-video-section .cp-rating-link,
.cp-video-section .cp-comment-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  line-height: 1;
  font-size: inherit;
}
/* Comment bubble is decorative only — not a link */
.cp-video-section .cp-comment-link,
.cp-video-section span.cp-comment-link {
  cursor: default !important;
  pointer-events: none !important;
  text-decoration: none !important;
}
.cp-video-section .cp-rating-link svg,
.cp-video-section .cp-comment-link svg {
  width: 15px;
  height: 15px;
  display: block;
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.cp-video-section .cp-rating-link svg,
.cp-video-section .cp-rating-link svg path {
  color: #fff !important;
  stroke: #fff !important;
}
.cp-video-section .cp-rating-link:not(.cp-liked) svg,
.cp-video-section .cp-rating-link:not(.cp-liked) svg path {
  fill: none !important;
  stroke: #fff !important;
}
.cp-video-section .cp-rating-link.cp-liked svg,
.cp-video-section .cp-rating-link.cp-liked svg path,
.cp-video-section a.cp-rating-link.cp-liked svg,
.cp-video-section a.cp-rating-link.cp-liked svg path {
  fill: #fff !important;
  stroke: #fff !important;
  color: #fff !important;
}
.cp-video-section .cp-comment-link svg,
.cp-video-section .cp-comment-link svg path {
  fill: #fff !important;
  stroke: none !important;
  color: #fff !important;
}
.cp-video-section .cp-rating-link.is-loading,
.cp-video-section .cp-comment-link.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

/* Main player card: rounded rect (no book clip / no drop-shadow) */
.cp-video-section .cpv-player-card,
.cp-video-section .cpv-player-card.e-con,
.elementor .cp-video-section .cpv-player-card {
  padding: 0 !important;
  --padding-top: 0px !important;
  --padding-right: 0px !important;
  --padding-bottom: 0px !important;
  --padding-left: 0px !important;
  border: 0 !important;
  border-width: 0 !important;
  border-style: none !important;
  border-color: transparent !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  outline: none !important;
  overflow: hidden !important;
  gap: 0 !important;
  border-radius: 28px !important;
  filter: none !important;
  contain: layout paint;
}
.cp-video-section .cpv-main-video,
.cp-video-section .cpv-main-video .elementor-widget-container,
.cp-video-section .cpv-main-video .elementor-widget-cmsmasters-video__container,
.cp-video-section .cpv-main-video .elementor-widget-cmsmasters-video__wrap,
.cp-video-section .cpv-main-video .elementor-widget-cmsmasters-video__inner,
.cp-video-section .cpv-main-video .elementor-widget-cmsmasters-video__hosted,
.cp-video-section .cpv-main-video video,
.cp-video-section .cpv-main-video iframe,
.cp-video-section .cpv-main-video img {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  overflow: hidden !important;
  border-radius: 28px !important;
  clip-path: none !important;
  -webkit-clip-path: none !important;
  filter: none !important;
}
.cp-video-section .cpv-main-video::after {
  content: none !important;
  display: none !important;
}
/* 陳浩恩老師|1990創辦水晶宮 下方主视频：圆角 + 16:9 高度 +3% */
.elementor-element-888c9d0,
.elementor-element-888c9d0 .elementor-widget-container,
.elementor-element-888c9d0 .elementor-widget-cmsmasters-video__container,
.elementor-element-888c9d0 .elementor-widget-cmsmasters-video__wrap,
.elementor-element-888c9d0 .elementor-widget-cmsmasters-video__inner,
.elementor-element-888c9d0 .elementor-widget-cmsmasters-video__hosted,
.elementor-element-888c9d0 video,
.elementor-element-888c9d0 iframe,
.elementor-element-888c9d0 img {
  border-radius: 28px !important;
  overflow: hidden !important;
  clip-path: none !important;
  -webkit-clip-path: none !important;
  filter: none !important;
  box-shadow: none !important;
}
.elementor-element-888c9d0::after {
  content: none !important;
  display: none !important;
}
.elementor-element-888c9d0,
.elementor-element-888c9d0 .elementor-widget-cmsmasters-video__wrap,
.cp-video-section .cpv-main-video,
.cp-video-section .cpv-main-video .elementor-widget-cmsmasters-video__wrap {
  aspect-ratio: 16 / 9.27 !important;
}
.elementor-element-888c9d0 video,
.elementor-element-888c9d0 .elementor-widget-cmsmasters-video__hosted,
.elementor-element-888c9d0 iframe,
.elementor-element-888c9d0 img,
.cp-video-section .cpv-main-video video,
.cp-video-section .cpv-main-video .elementor-widget-cmsmasters-video__hosted,
.cp-video-section .cpv-main-video .elementor-wrapper video,
.cp-video-section .cpv-main-video iframe,
.cp-video-section .cpv-main-video .elementor-widget-cmsmasters-video__cover-image img,
.cp-video-section .cpv-main-video img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
  background: transparent !important;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Main play icon: keep triangle, drop white circle ring (play-circle → play) */
.cp-video-section .cpv-main-video .elementor-widget-cmsmasters-video__play-icon svg path,
.cp-video-section .cpv-main-video .e-far-play-circle path {
  d: path("M371.7 238l-176-107c-15.8-8.8-35.7 2.5-35.7 21v208c0 18.4 19.8 29.8 35.7 21l176-101c16.4-9.1 16.4-32.8 0-42z") !important;
}

/* Main player: after playlist click, hide cover/play overlay */
.cp-video-section .cpv-main-video.cpv-direct-play .elementor-widget-cmsmasters-video__cover-image,
.cp-video-section .cpv-main-video.cpv-direct-play .elementor-widget-cmsmasters-video__play-icon,
.cp-video-section .cpv-main-video.cpv-direct-play .elementor-custom-embed-image-overlay,
.cp-video-section .cpv-main-video.cpv-direct-play .elementor-custom-embed-play {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.cp-video-section .cpv-main-video.cpv-direct-play video {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ---- Thumb as video slot (Elementor Video widget friendly) ---- */
.cp-video-section .cpv-thumb {
  overflow: hidden;
  border-radius: 12px;
}
.cp-video-section .cpv-thumb .elementor-widget-container,
.cp-video-section .cpv-thumb .elementor-widget-cmsmasters-video__container,
.cp-video-section .cpv-thumb .elementor-widget-cmsmasters-video__wrap,
.cp-video-section .cpv-thumb .elementor-widget-cmsmasters-video__inner {
  height: 100%;
}
.cp-video-section .cpv-thumb video,
.cp-video-section .cpv-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
}
.cp-video-section .cpv-thumb .elementor-widget-cmsmasters-video__close-button,
.cp-video-section .cpv-thumb .elementor-widget-cmsmasters-video__play-icon {
  display: none !important;
}
.cp-video-section .cpv-playlist-card {
  cursor: pointer;
}

/* Comment modal (shared with existing actions) */
.cp-comments-open {
  overflow: hidden;
}
.cp-wpdiscuz-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cp-wpdiscuz-modal.is-open {
  display: flex;
}
.cp-wpdiscuz-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 18, 21, 0.72);
  backdrop-filter: blur(6px);
}
.cp-wpdiscuz-dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, 94vw);
  height: min(860px, 88vh);
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
}
.cp-wpdiscuz-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.cp-wpdiscuz-close {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #4a3f48;
  color: #fff;
  font: 400 28px/1 sans-serif;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .cp-video-section .cpv-playlist-card,
  .cp-video-section .cpv-browse .elementor-button,
  .cp-video-section .cpv-join .elementor-button {
    transition: none !important;
  }
}

.cp-video-section .cp-comment-link svg{fill:#fff!important;stroke:none!important;opacity:.95}
.cp-video-section .cp-rating-link:not(.cp-liked) svg{fill:none!important;stroke:#fff!important}
.cp-video-section .cp-rating-link.cp-liked svg{fill:#fff!important;stroke:#fff!important;color:#fff!important}

/* Right playlist: no scrollport / no track; slightly compact cards */
.cp-video-section .cpv-sidebar,
.cp-video-section .cpv-playlist-list,
.cp-video-section .cpv-playlist-list.e-con {
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  height: auto !important;
  max-height: none !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-sizing: border-box;
  scrollbar-width: none !important;
  scrollbar-color: transparent transparent !important;
  scrollbar-gutter: auto !important;
}
.cp-video-section .cpv-playlist-list {
  gap: 8px !important;
  row-gap: 8px !important;
  margin-top: 0 !important;
}
.cp-video-section .cpv-sidebar::-webkit-scrollbar,
.cp-video-section .cpv-playlist-list::-webkit-scrollbar,
.cp-video-section .cpv-playlist-list::-webkit-scrollbar-button,
.cp-video-section .cpv-playlist-list::-webkit-scrollbar-thumb,
.cp-video-section .cpv-playlist-list::-webkit-scrollbar-track,
.cp-video-section .cpv-playlist-list::-webkit-scrollbar-corner {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}
.cp-video-section .cpv-playlist-card {
  padding: 8px 10px !important;
  min-height: 0 !important;
  gap: 10px !important;
  align-items: center !important;
  grid-template-columns: 88px minmax(0, 1fr) !important;
}
.cp-video-section .cpv-playlist-card .cpv-thumb,
.cp-video-section .cpv-playlist-card .cpv-thumb.e-con,
.cp-video-section .cpv-playlist-card .elementor-element.cpv-thumb {
  width: 88px !important;
  max-width: 88px !important;
  min-width: 88px !important;
  height: 58px !important;
  min-height: 58px !important;
  flex: 0 0 88px !important;
  align-self: center !important;
}
.cp-video-section .cpv-playlist-title .elementor-heading-title,
.cp-video-section .cpv-playlist-title .elementor-heading-title a {
  font-size: 14px !important;
  line-height: 1.3 !important;
  margin: 0 !important;
  -webkit-line-clamp: 1 !important;
}
.cp-video-section .cpv-playlist-card .cpv-playlist-title,
.cp-video-section .cpv-playlist-card .cpv-playlist-meta,
.cp-video-section .cpv-playlist-card .elementor-widget-heading,
.cp-video-section .cpv-playlist-card .elementor-widget-text-editor {
  margin: 0 !important;
  padding: 0 !important;
}
.cp-video-section .cpv-playlist-meta .elementor-widget-container {
  gap: 8px !important;
  margin-top: 2px !important;
}
.cp-video-section .cpv-playlist-meta .cpv-social {
  gap: 10px !important;
}
.cp-video-section .cpv-playlist-meta .cp-rating-link svg,
.cp-video-section .cpv-playlist-meta .cp-comment-link svg {
  width: 14px;
  height: 14px;
}
body:not(.elementor-editor-active) .cp-video-section .cpv-playlist-card .elementor-widget-cpv-video-url {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* Front: video-url widget is a zero-cost marker only */
.cp-video-section .cpv-video-src,
.cp-video-section .elementor-widget-cpv-video-url:not(.elementor-element-edit-mode) .cpv-video-src {
  display: none !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}
body:not(.elementor-editor-active):not(.elementor-editor-preview) .cp-video-section .cpv-video-src-editor {
  display: none !important;
}

/* Elementor edit/preview: one-line chip, use full card width */
body.elementor-editor-active .cpv-playlist-card > .elementor-widget-cpv-video-url,
body.elementor-editor-active .cpv-playlist-card .elementor-widget-cpv-video-url {
  flex: 1 1 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  order: 99;
}
.cpv-video-src-editor {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  padding: 6px 10px;
  border: 1px dashed #c4a574;
  border-radius: 8px;
  background: rgba(196, 165, 116, 0.18);
  color: #2a2118;
  font-size: 12px;
  line-height: 1.35;
  width: 100%;
  box-sizing: border-box;
}
.cpv-video-src-editor strong {
  flex: 0 0 auto;
  white-space: nowrap;
  margin: 0;
}
.cpv-video-src-editor span {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
