/* ═══════════════════════════════════════════════════════════
   LIBRARY CONTENTS PANEL — right-sliding drawer
   YogNeeti · loaded on library.html only

   Shows the full catalogue: folder names, video titles, durations.
   No players, no embeds — every video lives on Teachable. No headline
   stats: the list is the argument, a count is not.

   Visual language matches the "Also here" glass block on the protocol
   pages: cream glass, blur(24px), 1px hairline, 16px radius, and a
   text link rather than a filled button so it never competes with
   Begin Monthly.

   Laws:
     ✓ CSS transitions only — no rAF loop (library.html runs four already)
     ✓ transform + opacity only; never width/left
     ✓ Somatic easing 0.8s cubic-bezier(0.2, 0.8, 0.2, 1)
     ✓ Mobile is a continuous scroll with sticky folder headers, NOT an
       accordion — the panel's whole job is showing everything at once,
       and it is only ~28 rows.
   ═══════════════════════════════════════════════════════════ */

:root {
  --lp-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --lp-dur: 0.8s;
}

/* ─── TRIGGER (sits after vault row 05, on the sage canvas) ─── */
/* ─── "SEE EVERYTHING INSIDE" ──────────────────────────────────────────────
   This opens the entire catalogue — the second most consequential action on
   the page after buying — and it used to be a 15px, weight-300, underlined
   text link stranded in a field of sage, quieter than the row labels above
   it. It was styled to be deferential and ended up invisible.

   It is now the one filled control in the section: cream on sage is the
   page's highest available contrast (13:1 for the label), so it reads as an
   event without a single new colour or a rounded corner. The rest of the
   section's restraint is what gives it its force. */
.lp-trigger-wrap {
  margin-top: clamp(3rem, 5vw, 4.5rem);
  display: flex;
  justify-content: center;
}

.lp-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  min-height: 60px;
  padding: 1.15rem clamp(1.75rem, 4vw, 2.75rem);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #2C2C2C;
  background: var(--cream, #F9F8F2);
  border: 1px solid var(--cream, #F9F8F2);
  /* The one deliberate exception to this page's Zero-Radius Rule. Square
     corners made the page's warmest, most inviting moment read as hard —
     and this is the brand's canonical 16px, the radius every other CTA on
     the site already uses, so it softens toward the house style rather than
     away from it. */
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 10px 34px rgba(20, 24, 19, 0.2);
  transition: background var(--lp-dur) var(--lp-ease),
              color var(--lp-dur) var(--lp-ease),
              transform var(--lp-dur) var(--lp-ease),
              box-shadow var(--lp-dur) var(--lp-ease);
}

.lp-trigger:hover {
  background: transparent;
  color: var(--cream, #F9F8F2);
  transform: translate3d(0, -2px, 0);
  box-shadow: 0 16px 44px rgba(20, 24, 19, 0.3);
}

.lp-trigger:focus-visible { outline: 2px solid var(--cream, #F9F8F2); outline-offset: 5px; }

.lp-trigger__arrow {
  display: inline-block;
  transition: transform var(--lp-dur) var(--lp-ease);
}
.lp-trigger:hover .lp-trigger__arrow { transform: translate3d(4px, 0, 0); }

@media (prefers-reduced-motion: reduce) {
  .lp-trigger:hover { transform: none; }
  .lp-trigger:hover .lp-trigger__arrow { transform: none; }
}


/* ─── SCRIM ─── */
.lp-scrim {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(44, 44, 44, 0.38);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--lp-dur) var(--lp-ease), visibility var(--lp-dur);
}
.lp-scrim.is-open { opacity: 1; visibility: visible; }


/* ─── DRAWER ─── */
.lp-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  width: min(1120px, 94vw);
  display: flex;
  flex-direction: column;
  background: rgba(249, 248, 242, 0.86);
  backdrop-filter: var(--glass-blur-lg) saturate(1.1);
  -webkit-backdrop-filter: var(--glass-blur-lg) saturate(1.1);
  border-left: 1px solid rgba(44, 44, 44, 0.10);
  border-radius: 16px 0 0 16px;
  box-shadow: -24px 0 60px rgba(44, 44, 44, 0.14);
  transform: translate3d(100%, 0, 0);
  visibility: hidden;
  transition: transform var(--lp-dur) var(--lp-ease), visibility var(--lp-dur);
  will-change: transform;
}
.lp-drawer.is-open {
  transform: translate3d(0, 0, 0);
  visibility: visible;
}

.lp-drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.5rem, 4vw, 2.75rem) clamp(1.25rem, 4vw, 3rem) 1.25rem;
  border-bottom: 1px solid rgba(44, 44, 44, 0.10);
}

.lp-drawer__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--charcoal, #2C2C2C);
  margin: 0;
}

.lp-drawer__note {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: rgba(44, 44, 44, 0.78);
  margin: 0.5rem 0 0;
  max-width: 52ch;
}

.lp-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(44, 44, 44, 0.15);
  border-radius: 50%;
  background: none;
  color: var(--charcoal, #2C2C2C);
  cursor: pointer;
  transition: border-color var(--lp-dur) var(--lp-ease), opacity var(--lp-dur) var(--lp-ease);
}
.lp-close:hover { border-color: rgba(44, 44, 44, 0.4); }
.lp-close:focus-visible { outline: 2px solid var(--charcoal, #2C2C2C); outline-offset: 3px; }

.lp-drawer__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 3rem) clamp(3rem, 8vw, 4rem);
}


/* ─── MOBILE: one continuous scroll, sticky folder headers ───
   .lp-col uses display:contents so the groups become direct flex
   children here and --lp-order can put them in reading order. The
   wrapper divs exist only to control the desktop columns below. */
.lp-cols {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.lp-col { display: contents; }

.lp-group { order: var(--lp-order, 1); }

.lp-group__name {
  position: sticky;
  top: 0;
  z-index: 1;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(44, 44, 44, 0.78);
  margin: 0 0 0.75rem;
  padding: 0.75rem 0;
  background: rgba(249, 248, 242, 0.92);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border-bottom: 1px solid rgba(44, 44, 44, 0.12);
}

.lp-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lp-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(44, 44, 44, 0.07);
}
.lp-item:last-child { border-bottom: none; }

.lp-item__title {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--charcoal, #2C2C2C);
}

.lp-item__len {
  flex-shrink: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: rgba(44, 44, 44, 0.6);
  font-variant-numeric: tabular-nums;
}


/* ─── DESKTOP: three hand-balanced columns (8 / 11 / 9) ─── */
@media (min-width: 900px) {
  .lp-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    align-items: start;
  }
  .lp-col {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
  }
  .lp-group { order: 0; }
  .lp-group__name { position: static; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
}


/* ─── BODY LOCK (fallback for non-Lenis) ─── */
body.lp-open { overflow: hidden; }


/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  .lp-drawer {
    transition: opacity 0.3s linear, visibility 0.3s;
    transform: none;
    opacity: 0;
  }
  .lp-drawer.is-open { opacity: 1; }
  .lp-scrim { transition: opacity 0.3s linear, visibility 0.3s; }
  .lp-trigger__label,
  .lp-trigger__arrow,
  .lp-close { transition: none; }
}
