/* La Madone TV in the unified template: rotating audio-reactive screen, channels, then the demos.
   Fonts come from charte.css; the playback hooks are shared with home-tv.js and tv.js. */
body.lm-tv {
  --tv-hair: rgba(255, 255, 255, .09);
  --tv-panel: rgba(255, 255, 255, .035);
  --tv-dim: rgba(244, 242, 248, .66);
  --tv-violet: #8a2be2;
  --tv-bass: 0;
  margin: 0;
  line-height: 1.55;
}
body.lm-tv *, body.lm-tv *::before, body.lm-tv *::after { box-sizing: border-box; }
body.lm-tv [hidden] { display: none !important; }
body.lm-tv img { display: block; max-width: 100%; }
body.lm-tv :is(h1, h2, h3, p) { margin: 0; }
body.lm-tv a { color: inherit; text-underline-offset: .25em; }
body.lm-tv :is(a, button, video):focus-visible { outline: 2px solid var(--tv-violet); outline-offset: 3px; }
body.lm-tv button { cursor: pointer; }

.lm-tv .tv-width { width: min(100% - 2.5rem, 78rem); margin-inline: auto; }
.lm-tv .tv-skip {
  position: fixed; z-index: 60; left: 1rem; top: 1rem;
  padding: .7rem 1rem; border-radius: 999px;
  background: var(--tv-violet); color: #fff;
  transform: translateY(-200%);
}
.lm-tv .tv-skip:focus { transform: none; }

/* ---------- Head ---------- */
.lm-tv .ltv-hero { padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(2rem, 4vw, 3rem); }
.lm-tv .ltv-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 3rem; align-items: end; margin-bottom: clamp(1.25rem, 3vw, 2rem);
}
.lm-tv .ltv-head h1 { font-size: clamp(3rem, 7vw, 6rem); line-height: .95; }
.lm-tv .ltv-intro { max-width: 46ch; color: var(--tv-dim); font-size: 1.05rem; }
.lm-tv .ltv-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.lm-tv .ltv-listen[aria-pressed="true"] { background: var(--tv-violet); color: #fff; }

/* ---------- Screen ---------- */
.lm-tv .ltv-player { --tv-bass: 0; }
.lm-tv .ltv-screen {
  position: relative; isolation: isolate; overflow: hidden;
  aspect-ratio: 16 / 9; border-radius: 14px;
  background: #050507; border: 1px solid var(--tv-hair);
  box-shadow: 0 0 calc(18px + var(--tv-bass) * 60px) rgb(138 43 226 / calc(.12 + var(--tv-bass) * .35));
  transition: box-shadow .12s linear;
}
.lm-tv :is(.ltv-poster, .ltv-video) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lm-tv .ltv-video { opacity: 0; transition: opacity .8s ease; }
.lm-tv .ltv-video.is-live { opacity: 1; }
.lm-tv .ltv-player[data-beat] .ltv-video.is-live { transform: scale(calc(1 + var(--tv-bass) * .025)); }
.lm-tv .ltv-screen::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgb(9 9 12 / 45%), transparent 22%, transparent 70%, rgb(9 9 12 / 70%));
}
.lm-tv :is(.ltv-onair, .ltv-beat) {
  position: absolute; z-index: 2; top: clamp(.7rem, 2vw, 1.1rem);
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: 34px; padding: .35rem .8rem; border-radius: 999px;
  background: rgb(9 9 12 / 62%); border: 1px solid var(--tv-hair);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: #fff; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.lm-tv .ltv-onair { left: clamp(.7rem, 2vw, 1.1rem); }
.lm-tv .ltv-onair-dot { width: .5rem; height: .5rem; border-radius: 50%; background: #ff3b5c; animation: ltv-blink 1.6s ease-in-out infinite; }
.lm-tv .ltv-beat { right: clamp(.7rem, 2vw, 1.1rem); }
.lm-tv .ltv-beat[aria-pressed="true"] { border-color: rgb(138 43 226 / 70%); }
@keyframes ltv-blink { 50% { opacity: .25; } }

/* ---------- Live equaliser ---------- */
.lm-tv .ltv-eq {
  display: grid; grid-template-columns: repeat(24, 1fr); align-items: end; gap: 4px;
  height: clamp(42px, 6vw, 64px); margin-top: .9rem; padding: 0 2px;
}
.lm-tv .ltv-eq i {
  display: block; height: 100%; border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, #fff, var(--tv-violet) 55%, rgb(138 43 226 / 45%));
  transform-origin: bottom; transform: scaleY(calc(.08 + var(--level, 0) * .92));
  transition: transform .08s linear;
}
.lm-tv .ltv-player:not([data-beat]) .ltv-eq i { transform: scaleY(.08); }

/* ---------- Channel selector ---------- */
.lm-tv .ltv-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1rem; }
.lm-tv .ltv-moods { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--tv-panel); border: 1px solid var(--tv-hair); }
.lm-tv :is(.ltv-moods button, .ltv-next) {
  min-height: 40px; padding: .4rem 1rem; border: 0; border-radius: 999px;
  background: transparent; color: var(--tv-dim);
  font-size: .85rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.lm-tv .ltv-moods button[aria-pressed="true"] { background: var(--tv-violet); color: #fff; }
.lm-tv :is(.ltv-moods button, .ltv-next):hover { color: #fff; }
.lm-tv .ltv-next { border: 1px solid var(--tv-hair); color: #fff; }
.lm-tv .ltv-channels {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .6rem;
  margin: 1rem 0 0; padding: 0; list-style: none;
}
.lm-tv .ltv-channels button {
  display: grid; gap: .1rem; width: 100%; padding: .75rem .9rem; text-align: left;
  border: 1px solid var(--tv-hair); border-radius: 12px; background: var(--tv-panel); color: #fff;
  transition: border-color .15s, background-color .15s;
}
.lm-tv .ltv-channels button:hover { border-color: rgb(138 43 226 / 60%); }
.lm-tv .ltv-channels button[aria-pressed="true"] { border-color: var(--tv-violet); background: rgb(138 43 226 / 18%); }
.lm-tv .ltv-ch { font-size: .7rem; font-weight: 700; letter-spacing: .12em; color: var(--tv-dim); }
.lm-tv .ltv-channels button[aria-pressed="true"] .ltv-ch { color: #cfa6ff; }
.lm-tv .ltv-channels strong { font-size: .95rem; font-weight: 700; }
.lm-tv .ltv-channels small { font-size: .78rem; color: var(--tv-dim); text-transform: capitalize; }

/* ---------- Demos & creations ---------- */
.lm-tv .ltv-section-title { margin: 1rem 0 1.25rem; font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; letter-spacing: -.01em; }
.lm-tv .tv-feature {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 1fr);
  border: 1px solid var(--tv-hair); border-radius: 14px; overflow: hidden; background: var(--tv-panel);
}
.lm-tv .tv-player-shell { min-width: 0; background: #050507; border-right: 1px solid var(--tv-hair); }
.lm-tv .tv-player-top {
  display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 1rem;
  border-bottom: 1px solid var(--tv-hair); font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--tv-dim);
}
.lm-tv .tv-player-top span:first-child { color: #cfa6ff; }
.lm-tv .tv-stage { position: relative; display: grid; place-items: center; isolation: isolate; aspect-ratio: 16 / 10; overflow: hidden; scroll-margin-top: 5rem; background: #050507; }
.lm-tv .tv-stage[data-tv-format="landscape"] { aspect-ratio: 16 / 9; }
.lm-tv .tv-ambient { position: absolute; inset: -10%; z-index: -1; width: 120%; height: 120%; object-fit: cover; filter: blur(32px) saturate(.75); opacity: .3; pointer-events: none; }
.lm-tv .tv-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.lm-tv .tv-feature-copy { align-self: center; padding: clamp(1.25rem, 3vw, 2.2rem); min-width: 0; }
.lm-tv .tv-meta { display: flex; gap: .65rem; font-size: .85rem; font-weight: 700; color: #cfa6ff; }
.lm-tv .tv-meta span + span { padding-left: .65rem; border-left: 1px solid var(--tv-hair); color: var(--tv-dim); font-variant-numeric: tabular-nums; }
.lm-tv .tv-feature h2 { margin: .7rem 0 .9rem; font-size: clamp(1.5rem, 2.6vw, 2.2rem); line-height: 1.1; font-weight: 700; text-wrap: balance; }
.lm-tv .tv-description { max-width: 40ch; color: var(--tv-dim); }
.lm-tv .tv-video-language { margin-top: .7rem; font-size: .8rem; color: var(--tv-dim); }
.lm-tv .tv-actions { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; margin-top: 1.2rem; }
.lm-tv .tv-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 44px; padding: .65rem 1.2rem; border: 0; border-radius: 999px;
  background: #fff; color: #09090c; font-size: .9rem; font-weight: 700; text-decoration: none;
}
.lm-tv .tv-button:hover { background: #ece4ff; }
.lm-tv #tv-play::before { content: ''; border-block: 6px solid transparent; border-left: 9px solid currentColor; }
.lm-tv #tv-play[aria-pressed="true"]::before { width: 9px; height: 12px; border: 0; border-inline: 3px solid currentColor; }
.lm-tv .tv-button--outline { background: transparent; color: #fff; border: 1px solid var(--tv-hair); }
.lm-tv .tv-button--outline:hover { background: rgb(255 255 255 / 6%); }
.lm-tv :is(.tv-product-link, .tv-open-source) { display: inline-flex; align-items: center; min-height: 44px; font-size: .9rem; font-weight: 700; color: #cfa6ff; }
.lm-tv .tv-status { margin-top: .5rem; font-size: .85rem; color: var(--tv-dim); }
.lm-tv .tv-status:empty { display: none; }

.lm-tv .tv-collection { padding: 2.5rem 0; }
.lm-tv .tv-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.1rem; }
.lm-tv .tv-section-heading h2 { font-size: 1.4rem; font-weight: 700; }
.lm-tv .tv-section-heading p { margin-top: .3rem; color: var(--tv-dim); }
.lm-tv .tv-section-heading > span { flex-shrink: 0; font-size: .85rem; color: var(--tv-dim); }
.lm-tv .tv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.lm-tv .tv-card {
  display: block; min-width: 0; overflow: hidden; text-decoration: none;
  border: 1px solid var(--tv-hair); border-radius: 12px; background: var(--tv-panel);
  transition: border-color .15s, transform .15s;
}
.lm-tv .tv-card:hover { border-color: rgb(138 43 226 / 60%); transform: translateY(-2px); }
.lm-tv .tv-card[aria-current="true"] { border-color: var(--tv-violet); box-shadow: 0 0 0 1px var(--tv-violet); }
.lm-tv .tv-card-picture { position: relative; display: grid; place-items: center; isolation: isolate; overflow: hidden; aspect-ratio: 4 / 3; background: #120d18; border-bottom: 1px solid var(--tv-hair); }
.lm-tv .tv-card-ambient { position: absolute; inset: -10%; z-index: -1; width: 120%; height: 120%; object-fit: cover; filter: blur(20px); opacity: .3; }
.lm-tv .tv-card-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.lm-tv .tv-card-play {
  position: absolute; left: .9rem; bottom: .9rem; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%; background: rgb(9 9 12 / 70%); border: 1px solid rgb(255 255 255 / 30%);
}
.lm-tv .tv-card-play::after { content: ''; margin-left: 3px; border-block: 6px solid transparent; border-left: 9px solid #fff; }
.lm-tv .tv-card-duration { position: absolute; right: .9rem; bottom: 1rem; padding: .1rem .45rem; border-radius: 4px; background: rgb(9 9 12 / 80%); font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.lm-tv .tv-card-copy { padding: .95rem 1.05rem 1.15rem; }
.lm-tv .tv-card-name { font-size: .8rem; font-weight: 700; letter-spacing: .06em; color: #cfa6ff; }
.lm-tv .tv-card-copy h3 { margin: .25rem 0 .45rem; font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.lm-tv .tv-card-copy > p:last-child { font-size: .8rem; color: var(--tv-dim); }

.lm-tv .tv-studio { display: flex; justify-content: space-between; align-items: center; gap: 2rem; padding: 2rem 0 2.6rem; border-top: 1px solid var(--tv-hair); }
.lm-tv .tv-eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--tv-dim); }
.lm-tv .tv-studio h2 { margin: .5rem 0; font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 700; }
.lm-tv .tv-studio > div > p:last-child { max-width: 52ch; color: var(--tv-dim); }
.lm-tv .tv-studio-actions { display: flex; flex-direction: column; align-items: center; gap: .3rem; flex-shrink: 0; }
.lm-tv .tv-footer { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding: 1.4rem 0 2rem; border-top: 1px solid var(--tv-hair); }
.lm-tv .tv-footer strong { font-size: 1rem; font-weight: 700; letter-spacing: .08em; }
.lm-tv .tv-footer p { margin-top: .25rem; font-size: .85rem; color: var(--tv-dim); }
.lm-tv .tv-footer a { display: flex; align-items: center; min-height: 44px; font-size: .85rem; color: var(--tv-dim); }

@media (max-width: 61rem) {
  .lm-tv .ltv-head { grid-template-columns: 1fr; align-items: start; }
  .lm-tv .tv-feature { grid-template-columns: 1fr; }
  .lm-tv .tv-player-shell { border-right: 0; border-bottom: 1px solid var(--tv-hair); }
  .lm-tv .tv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 44rem) {
  .lm-tv .tv-width { width: calc(100% - 2rem); }
  .lm-tv .ltv-screen { aspect-ratio: 4 / 3; border-radius: 12px; }
  .lm-tv .ltv-eq { gap: 2px; }
  .lm-tv .ltv-controls { flex-direction: column; align-items: stretch; }
  .lm-tv .ltv-moods button { flex: 1; padding-inline: .5rem; }
  .lm-tv .ltv-channels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lm-tv .tv-grid { grid-template-columns: 1fr; }
  .lm-tv .tv-stage, .lm-tv .tv-stage[data-tv-format="landscape"] { aspect-ratio: 16 / 10; }
  .lm-tv .tv-studio, .lm-tv .tv-footer { flex-direction: column; align-items: flex-start; }
  .lm-tv .tv-studio-actions { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .lm-tv .ltv-onair-dot { animation: none; }
  .lm-tv :is(.ltv-video, .ltv-eq i, .tv-card, .ltv-screen) { transition: none; }
  .lm-tv .ltv-video.is-live { transform: none !important; }
  .lm-tv .tv-card:hover { transform: none; }
}
