/* PUNTO! v2.5.11.2 — Universal Video Layout Lock.
   This file deliberately has its own versioned URL: earlier hotfixes deployed
   new video JS without the companion .pv-* layout rules, causing enormous
   unloaded posters and tiny native-size YouTube iframes.
   All providers use the SAME size before and after activation. */

.page-lesson [data-universal-video],
.page-lesson .pv-host {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: min(100%, 920px);
  min-width: 0;
  margin: 16px auto 12px;
}
.page-lesson .pv-wrap,
.page-lesson .pv-wrap * { box-sizing: border-box; }
.page-lesson .pv-wrap { display: grid; gap: 12px; width: 100%; min-width: 0; }

/* Intrinsic frame height is reserved before anyone contacts YouTube.
   Neither poster dimensions nor the iframe's default 300x150 may size it. */
.page-lesson .pv-wrap .pv-video {
  display: block;
  position: relative;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #16283a;
  border-radius: 14px;
  isolation: isolate;
}

/* YouTube's IFrame API may replace/re-size the iframe. Force it back into
   the same reserved video frame on every breakpoint. */
.page-lesson .pv-video > iframe,
.page-lesson .pv-video .pv-iframe,
.page-lesson .pv-video > video,
.page-lesson .pv-video .ls-media-player {
  position: absolute !important;
  display: block;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0;
  object-fit: contain;
}

/* Privacy-first poster stays inside the aspect-ratio frame and uses no iframe. */
.page-lesson .pv-video > .pv-consent,
.page-lesson .pv-video > .pv-loading,
.page-lesson .pv-video > .pv-error {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
}
.page-lesson .pv-video .pv-consent {
  display: flex;
  justify-content: center;
  align-items: center;
  isolation: isolate;
  padding: 0;
  overflow: hidden;
}
.page-lesson .pv-video .pv-consent > img {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  opacity: .40;
  pointer-events: none;
}
.page-lesson .pv-video .pv-consent::after {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(90deg, rgba(12,28,43,.90), rgba(12,28,43,.58));
  pointer-events: none;
}
.page-lesson .pv-video .pv-consent-body {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  max-height: 100%;
  overflow-y: auto;
  padding: clamp(14px, 3vw, 26px);
  text-align: center;
  color: #fff;
}
.page-lesson .pv-consent-body strong {
  display: block;
  font-size: clamp(.96rem, 1.6vw, 1.15rem);
  margin: 0 0 7px;
  color: #fff;
}
.page-lesson .pv-consent-body p {
  margin: 0 auto 12px;
  color: #e5edf4;
  font-size: clamp(.72rem, 1.25vw, .9rem);
  line-height: 1.43;
}
.page-lesson .pv-consent-body button,
.page-lesson .pv-error button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 17px;
  background: #eea368;
  border: 0;
  border-radius: 9px;
  color: #1b2e40;
  font: inherit;
  font-size: .88rem;
  font-weight: 800;
  cursor: pointer;
}
.page-lesson .pv-consent-body a,
.page-lesson .pv-error a {
  display: inline-block;
  margin: 5px 3px 0;
  padding: 8px 6px;
  color: #fff;
  font-size: .78rem;
  text-underline-offset: 3px;
}
.page-lesson .pv-video .pv-loading,
.page-lesson .pv-video .pv-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 16px;
  text-align: center;
  color: #fff;
  background: #16283a;
}
.page-lesson .pv-video .pv-error p { color: #fff; margin: 0; font-size: .86rem; }
.page-lesson .pv-video.pv-has-error .pv-error { z-index: 2; background: #16283af0; }

.page-lesson .pv-provider { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:5px 0; }
.page-lesson .pv-provider span { font-size:.84rem; font-weight:700; color:#516779; margin-right:4px; }
.page-lesson .pv-provider button { border:1px solid #becdd5; border-radius:999px; background:#fff; color:#254054; min-height:40px; padding:8px 14px; cursor:pointer; font-size:.85rem; font-weight:700; }
.page-lesson .pv-provider button[aria-pressed="true"] { background:var(--ls-accent,#a85f3e); border-color:var(--ls-accent,#a85f3e); color:#fff; }
.page-lesson .pv-wrap .ls-video-chapters { max-width:100%; min-width:0; }
.page-lesson .pv-wrap .ls-video-resume { max-width:100%; min-width:0; }
.page-lesson .pv-wrap :is(button,a):focus-visible { outline:3px solid #ed9b56; outline-offset:3px; }

/* Smaller controls on phones while retaining accessible touch targets. */
@media (max-width: 560px) {
  .page-lesson .pv-host { margin: 12px auto; }
  .page-lesson .pv-wrap .pv-video { border-radius: 10px; }
  .page-lesson .pv-video .pv-consent-body { padding: 8px 10px; }
  .page-lesson .pv-consent-body strong { font-size: .9rem; margin-bottom: 3px; }
  .page-lesson .pv-consent-body p { font-size: .7rem; line-height: 1.24; margin-bottom: 4px; }
  .page-lesson .pv-consent-body button { padding: 6px 10px; min-height: 42px; font-size: .75rem; }
  .page-lesson .pv-consent-body a { margin-top: 0; padding: 5px; font-size: .69rem; }
  .page-lesson .pv-provider button { min-height:44px; }
}
@media (max-width: 340px) {
  .page-lesson .pv-consent-body p { font-size: .64rem; }
  .page-lesson .pv-consent-body strong { font-size: .82rem; }
  .page-lesson .pv-consent-body a { font-size: .65rem; }
}
