/* ═══════════════════════════════════════════
   MERIDIAN — library.css
   Library page, meditation cards, courses
═══════════════════════════════════════════ */

/* ── Library page ── */
.lib-page { background: var(--surf); min-height: 100vh; padding-top: var(--nav-h); }

.lib-header {
  background: var(--paper); padding: 36px 52px 0;
  border-bottom: 1px solid var(--div);
}

.lib-top {
  display: flex; align-items: flex-end;
  justify-content: space-between; padding-bottom: 28px;
}

.lib-title { font-family: 'Cormorant Garamond', serif; font-size: 36px; font-weight: 300; }
.lib-title em { font-style: italic; color: var(--warm); }
.lib-title-sub { font-size: 14px; color: var(--muted); margin-top: 5px; font-weight: 300; }

/* ── Streak ── */
.streak-wrap { display: flex; align-items: center; gap: 14px; }
.streak-box {
  border: 1px solid rgba(200,169,110,.3); border-radius: var(--radius);
  padding: 11px 18px; display: flex; align-items: center; gap: 10px;
  background: var(--warm-dim);
}
.streak-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px; font-weight: 300; color: var(--warm); line-height: 1;
}
.streak-lbl { font-size: 11px; color: var(--muted); font-weight: 300; }
.streak-fire { font-size: 20px; }

/* ── Tabs ── */
.lib-tabs { display: flex; gap: 0; border-top: 1px solid var(--div); }
.lib-tab {
  padding: 14px 22px; font-size: 13px; color: var(--muted);
  border: none; background: none; cursor: pointer; font-family: 'DM Sans', sans-serif;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .2s;
}
.lib-tab:hover { color: var(--ink); }
.lib-tab.on { color: var(--ink); font-weight: 500; border-bottom-color: var(--ink); }

/* ── Library body ── */
.lib-body { padding: 28px 52px 60px; }

/* ── Section header ── */
.lib-sec-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; margin-top: 28px;
}
.lib-sec-hd h3 { font-size: 15px; font-weight: 500; }
.lib-sec-hd a { font-size: 12px; color: var(--muted); text-decoration: none; transition: color .2s; }
.lib-sec-hd a:hover { color: var(--ink); }

/* ── Meditation cards grid ── */
.med-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.med-card {
  background: var(--paper); border: 1px solid var(--div);
  border-radius: 6px; overflow: hidden; cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.med-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.med-card.locked { cursor: default; opacity: .75; }
.med-card.med-playing { border-color: var(--warm); box-shadow: 0 0 0 2px rgba(200,169,110,.25); }

.med-thumb {
  height: 110px; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.lock-ov {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  background: rgba(14,13,11,.18);
}

.med-body { padding: 12px; }
.med-tag { font-size: 10px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.med-name { font-size: 14px; font-weight: 500; margin-bottom: 4px; line-height: 1.3; }
.med-dur { font-size: 11px; color: var(--muted); }
.paid-badge {
  background: var(--warm-dim); color: #7a5c1e;
  padding: 2px 6px; border-radius: 3px; font-size: 9px;
  font-weight: 600; letter-spacing: .08em;
}

.med-prog { height: 2px; background: var(--div); border-radius: 1px; margin-top: 8px; }
.med-prog-f { height: 100%; background: var(--warm); border-radius: 1px; }

/* ── Today's recommendation card ── */
.today-card {
  background: var(--deep); border-radius: 8px;
  padding: 28px 32px; display: grid; grid-template-columns: 1fr auto;
  gap: 24px; align-items: center; margin-bottom: 28px;
}
.today-label {
  font-size: 10px; font-weight: 500; letter-spacing: .18em;
  text-transform: uppercase; color: rgba(200,169,110,.65); margin-bottom: 10px;
}
.today-title {
  font-family: 'Cormorant Garamond', serif; font-size: 26px;
  font-weight: 300; color: var(--paper); margin-bottom: 6px;
}
.today-meta { font-size: 13px; color: rgba(245,242,236,.45); }
.today-play {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--warm); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s; flex-shrink: 0;
}
.today-play:hover { background: #b8954e; }

/* ── Mood picker ── */
.mood-row {
  background: var(--paper); border: 1px solid var(--div);
  border-radius: 6px; padding: 22px 24px; margin-bottom: 28px;
}
.mood-q { font-size: 14px; font-weight: 500; margin-bottom: 14px; }
.mood-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.mood-btn {
  padding: 8px 16px; border: 1px solid var(--div);
  border-radius: 20px; font-size: 13px; background: transparent;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: all .2s; color: var(--ink);
}
.mood-btn:hover { border-color: var(--warm); background: var(--warm-dim); }
.mood-btn.sel { background: var(--warm); border-color: var(--warm); color: var(--deep); font-weight: 500; }
.mood-res {
  margin-top: 14px; padding: 12px 16px;
  background: var(--info-bg); border-radius: var(--radius);
  font-size: 13px; color: var(--info-c); display: none; line-height: 1.6;
}

/* ── Course modules ── */
.course-mod {
  border: 1px solid var(--div); border-radius: 6px;
  overflow: hidden; margin-bottom: 12px;
}
.cm-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; cursor: pointer; background: var(--paper);
  transition: background .15s;
}
.cm-hd:hover { background: var(--warm-dim); }
.cm-left { display: flex; align-items: center; gap: 14px; }
.cm-num { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 300; color: var(--warm-l); }
.cm-t { font-size: 14px; font-weight: 500; }
.cm-s { font-size: 12px; color: var(--muted); font-weight: 300; margin-top: 2px; }
.cm-right { display: flex; align-items: center; gap: 12px; }
.cm-arrow { color: var(--muted); transition: transform .2s; }
.cm-arrow.open { transform: rotate(180deg); }
.cm-badge {
  font-size: 10px; font-weight: 500; padding: 3px 9px;
  border-radius: 3px; letter-spacing: .08em;
}
.cm-badge.free { background: var(--info-bg); color: var(--info-c); }
.cm-badge.paid {
  background: var(--warm-dim); color: #7a5c1e;
  display: flex; align-items: center; gap: 4px;
}

.cm-lessons { display: none; border-top: 1px solid var(--div); }
.cm-lessons.open { display: block; }

.cm-lesson {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px; border-bottom: 1px solid var(--div);
  transition: background .15s;
}
.cm-lesson:last-child { border-bottom: none; }
.cm-lesson.avail { cursor: pointer; }
.cm-lesson.avail:hover { background: var(--warm-dim); }
.cm-lesson.lck { opacity: .55; cursor: default; }

.lp {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--div); display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  background: transparent;
}
.l-info { flex: 1; }
.l-t { font-size: 13px; font-weight: 500; }
.l-m { font-size: 11px; color: var(--muted); margin-top: 2px; }
.done-check {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--sage); display: flex; align-items: center; justify-content: center;
}
.next-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--warm);
  box-shadow: 0 0 0 3px rgba(200,169,110,.25);
}

/* ── Filter buttons ── */
.filter-btn {
  padding: 6px 15px; border: 1px solid var(--div);
  border-radius: var(--radius); font-size: 12px; background: var(--surf);
  cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all .2s;
}
.filter-btn.active { background: var(--ink); color: white; border-color: var(--ink); }

/* ── Plan / calendar tab ── */
.plan-tab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 24px; }
.plan-stat-box { background: var(--paper); border: 1px solid var(--div); border-radius: 6px; padding: 22px 24px; }
.pstat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pstat-n { font-family: 'Cormorant Garamond', serif; font-size: 32px; font-weight: 300; }
.pstat-l { font-size: 11px; color: var(--muted); margin-top: 2px; }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 10px;
}
.cal-day {
  aspect-ratio: 1; border-radius: 4px; display: flex;
  align-items: center; justify-content: center; font-size: 10px;
}

/* ── Insights ── */
.insights-box { background: var(--paper); border: 1px solid var(--div); border-radius: 6px; padding: 22px 24px; }
.insight-ta {
  width: 100%; min-height: 80px; padding: 10px 14px;
  border: 1px solid var(--div); border-radius: var(--radius);
  font-size: 13px; font-family: 'DM Sans', sans-serif;
  resize: vertical; outline: none; color: var(--ink);
}
.insight-ta:focus { border-color: var(--warm); }
.insight-entry { padding: 14px 0; border-bottom: 1px solid var(--div); }
.insight-entry:last-child { border-bottom: none; }
.insight-date { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.insight-text { font-size: 13px; line-height: 1.7; }

/* ── Upgrade banners ── */
.upgrade-banner {
  border: 1px solid rgba(200,169,110,.3);
  border-radius: 6px; padding: 20px 24px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; background: var(--warm-dim); margin-top: 20px;
}
.upg-t { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.upg-s { font-size: 12px; color: var(--muted); }

.indiv-promo {
  background: var(--deep); border-radius: 8px; padding: 28px 32px;
  display: grid; grid-template-columns: 1fr auto; gap: 24px;
  align-items: center; margin-top: 24px;
}
.indiv-t { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 300; color: var(--paper); margin-bottom: 8px; }
.indiv-t em { font-style: italic; color: var(--warm); }
.indiv-s { font-size: 13px; color: rgba(245,242,236,.45); margin-bottom: 14px; }
.indiv-feats { display: flex; gap: 10px; flex-wrap: wrap; }
.indiv-ft {
  font-size: 11px; background: rgba(200,169,110,.12);
  color: rgba(200,169,110,.8); padding: 4px 10px; border-radius: 3px;
}
.indiv-old { font-size: 11px; color: rgba(245,242,236,.3); text-decoration: line-through; margin-bottom: 4px; }
.indiv-price {
  font-family: 'Cormorant Garamond', serif; font-size: 40px;
  font-weight: 300; color: var(--paper); line-height: 1;
}
.indiv-price sup { font-size: 16px; vertical-align: super; font-family: 'DM Sans', sans-serif; }
.indiv-pd { font-size: 12px; color: rgba(245,242,236,.35); margin-bottom: 14px; }

@media (max-width: 900px) {
  .lib-body { padding: 20px 16px 60px; }
  .lib-header { padding: 20px 16px 0; }
  .lib-top { flex-direction: column; align-items: flex-start; gap: 14px; }
  .plan-tab-grid { grid-template-columns: 1fr; }
  .today-card { grid-template-columns: 1fr; }
  .indiv-promo { grid-template-columns: 1fr; }
}
