/* Thole — live sessions player on /mind-recovery. Uses the tokens in site.css. */

.live { background: var(--deep); color: var(--on-deep); }
.live .section-head { margin-left: auto; margin-right: auto; text-align: center; justify-items: center; }
.live .eyebrow { color: var(--accent-on-deep); }
.live .section-head p { color: var(--on-deep-2); }

.lp {
  --lp-bg: #08181D; --lp-line: #1B3B43; --lp-dim: #8FAAAE;
  max-width: 920px; margin: 0 auto; background: var(--lp-bg);
  border: 1px solid var(--lp-line); border-radius: 28px; overflow: hidden;
  color: var(--on-deep);
}
.lp-head {
  display: flex; align-items: center; gap: 10px; padding: 16px 24px;
  border-bottom: 1px solid var(--lp-line);
  font: 600 13px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--teal-on-deep);
}
.lp-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-on-deep); box-shadow: 0 0 0 4px rgba(63,196,207,.18); }
.lp-head .bars { margin-left: auto; display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.lp-head .bars i { width: 3px; background: var(--teal-on-deep); border-radius: 2px; opacity: .85; }
.lp.is-ready .lp-head .bars i { animation: lp-bar 1.4s ease-in-out infinite; }
.lp-head .bars i:nth-child(1) { height: 40%; animation-delay: -.2s; }
.lp-head .bars i:nth-child(2) { height: 90%; animation-delay: -.6s; }
.lp-head .bars i:nth-child(3) { height: 60%; animation-delay: -.9s; }
.lp-head .bars i:nth-child(4) { height: 100%; animation-delay: -.4s; }
.lp-head .bars i:nth-child(5) { height: 70%; animation-delay: -1.1s; }
@keyframes lp-bar { 50% { transform: scaleY(.45); } }
.lp:not(.is-playing-any) .lp-head .bars i { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .lp-head .bars i { animation: none !important; } }

.lp-now { display: grid; grid-template-columns: 1fr 220px; border-bottom: 1px solid var(--lp-line); }
.lp-main { padding: 22px 24px 18px; display: grid; gap: 14px; min-width: 0; }
.lp-top { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.lp-play {
  width: 72px; height: 72px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--gold); color: #1E1A0C; display: grid; place-items: center;
  transition: transform .15s ease;
}
.lp-play:hover { transform: scale(1.04); }
.lp-play svg { width: 30px; height: 30px; }
.lp-play .i-pause { display: none; }
.lp-play.is-playing .i-play { display: none; }
.lp-play.is-playing .i-pause { display: block; }
.lp-play.is-loading { animation: lp-pulse 1s ease-in-out infinite; }
@keyframes lp-pulse { 50% { opacity: .6; } }
.lp-title { font: 600 clamp(18px, 2.2vw, 22px)/1.25 var(--head); margin: 0; overflow-wrap: anywhere; }
.lp-meta { font-size: 15px; color: var(--lp-dim); margin-top: 4px; }

.lp-ctrls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lp-skip {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--lp-line); background: transparent;
  color: var(--on-deep); display: grid; place-items: center; cursor: pointer;
}
.lp-skip:hover { border-color: var(--teal-on-deep); }
.lp-skip svg { width: 26px; height: 26px; }
.lp-tab {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--lp-line); background: transparent; color: var(--on-deep);
  font: 600 15px/1 var(--body); cursor: pointer;
}
.lp-tab svg { width: 18px; height: 18px; }
.lp-tab[aria-expanded="true"] { background: var(--teal-on-deep); border-color: var(--teal-on-deep); color: #08181D; }

/* Waveform scrub bar: a soft, decorative wave in Thole teal; the played part turns gold */
.lp-bar { position: relative; height: 56px; cursor: pointer; touch-action: none; }
.lp-wave { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lp-fill { display: none; }
.lp-times { display: flex; justify-content: space-between; font-size: 14px; color: var(--lp-dim); font-variant-numeric: tabular-nums; margin-top: 4px; }

.lp-list { scrollbar-width: thin; scrollbar-color: #2B5A68 transparent; }
.lp-list::-webkit-scrollbar { width: 8px; }
.lp-list::-webkit-scrollbar-thumb { background: #2B5A68; border-radius: 8px; }
.lp-list::-webkit-scrollbar-track { background: transparent; }

.lp-art { position: relative; background: #0C2329; }
.lp-art img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; }

/* Script: a few lines at a time, the line being spoken highlighted */
.lp-script { border-bottom: 1px solid var(--lp-line); background: #0A1E24; }
.lp-lines {
  position: relative; height: 11.2em; overflow-y: auto; padding: 4.2em 24px; scroll-padding: 4em;
  font-size: 18px; line-height: 1.5;
  -webkit-mask-image: linear-gradient(transparent, #000 28%, #000 72%, transparent);
          mask-image: linear-gradient(transparent, #000 28%, #000 72%, transparent);
  scrollbar-width: none;
}
.lp-lines::-webkit-scrollbar { display: none; }
.lp-lines p {
  margin: 0 0 .5em; color: var(--lp-dim); opacity: .7; cursor: pointer; border-radius: 8px;
  transition: color .25s ease, opacity .25s ease;
}
.lp-lines p:hover { opacity: 1; }
.lp-lines p.is-now { color: var(--on-deep); opacity: 1; font-weight: 600; }
.lp-lines p.is-now::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin: 0 10px 2px 0; vertical-align: middle; }
.lp-lines .lp-empty { cursor: default; text-align: center; opacity: 1; }
.lp-note { padding: 0 24px 12px; font-size: 13px; color: var(--lp-dim); }

/* Session list */
.lp-listhead { display: flex; justify-content: space-between; padding: 14px 24px; font-size: 14px; font-weight: 600; color: var(--on-deep-2); border-bottom: 1px solid var(--lp-line); }
.lp-list { list-style: none; margin: 0; padding: 0; max-height: 352px; overflow-y: auto; }
.lp-list li + li { border-top: 1px solid var(--lp-line); }
.lp-list button {
  width: 100%; display: grid; grid-template-columns: 20px 44px 1fr auto; gap: 14px; align-items: center;
  padding: 12px 24px; background: transparent; border: 0; color: var(--on-deep); text-align: left; cursor: pointer;
  font: inherit;
}
.lp-list button:hover { background: rgba(63,196,207,.07); }
.lp-list li.is-current button { background: rgba(242,193,78,.08); }
.lp-list img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #0C2329; }
.lp-row-ico { width: 0; height: 0; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent var(--gold); justify-self: center; }
.lp-list li.is-playing .lp-row-ico { width: 12px; height: 14px; border: 0; border-left: 4px solid var(--gold); border-right: 4px solid var(--gold); }
.lp-row-text { min-width: 0; display: grid; }
.lp-row-title { font-size: 16px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-row-meta { font-size: 13px; color: var(--lp-dim); }
.lp-row-dur { font-size: 15px; color: var(--on-deep-2); font-variant-numeric: tabular-nums; }

.lp-foot { text-align: center; margin-top: 22px; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--lp-dim, #8FAAAE); }
.lp-foot a { color: var(--teal-on-deep); }
.lp-more { text-align: center; margin-top: 12px; font-size: 16px; color: var(--on-deep-2); }
.lp-more a { color: var(--teal-on-deep); }

/* Before the feed loads, or if it can't */
.lp-off { display: none; padding: 40px 24px; text-align: center; color: var(--on-deep-2); }
.lp.is-offline .lp-off { display: block; }
.lp.is-offline .lp-now, .lp.is-offline .lp-listhead, .lp.is-offline .lp-list, .lp.is-offline .lp-script { display: none; }
.lp:not(.is-ready) .lp-play, .lp:not(.is-ready) .lp-ctrls { opacity: .4; pointer-events: none; }

@media (max-width: 700px) {
  .lp-now { grid-template-columns: 1fr; }
  .lp-art { display: none; }
  .lp-main, .lp-list button, .lp-listhead, .lp-head { padding-left: 16px; padding-right: 16px; }
  .lp-lines { padding-left: 16px; padding-right: 16px; font-size: 17px; }
  .lp-play { width: 60px; height: 60px; }
  .lp-list button { grid-template-columns: 16px 40px 1fr auto; gap: 12px; }
  .lp-list img { width: 40px; height: 40px; }
  .lp-row-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .lp-foot { letter-spacing: .1em; }
  .lp-head { font-size: 12px; letter-spacing: .1em; }
}
