/* Shared styles for the boost mega-thread renderer (boosts-thread.js).
   Used by /boosts.html (full thread), /ep### (per-episode subset), and
   /meetups (the .embed-note.is-event calendar card).
   Relies on the host page defining the LB color variables on :root —
   --cream, --cream-d, --navy, --navy-l, --orange, --orange-d, --text,
   --muted, --border, --white. */

/* ── Note cards ──────────────────────────────────────────────────── */
.note-list { list-style: none; margin: 0; padding: 0; }
.note-list li { margin: 0; }

.note-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.9rem;
  box-shadow: 0 2px 8px rgba(30,58,95,0.06);
}
.note-card.is-root {
  background: var(--white);
  border-left: 4px solid var(--orange);
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.8rem;
}
.note-card.is-root .note-body { font-size: 1.05rem; }

.note-author {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
  font-size: 0.86rem;
}
.note-author img {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--cream-d);
}
.note-author .author-name {
  font-weight: 700;
  color: var(--navy);
}
/* The author is clickable on a person's note (boosts-thread.js#renderNoteCard):
   an <a> to their OnlyBoosts page or a <button> that copies their npub. Both
   keep the look the plain span had (a wall of blue underlined names would read
   as a list of links rather than as the people who sent these boosts) and earn
   the site's warm underline on hover, the same treatment the calendar card's
   organizer identity has below. */
.note-author a.author-name,
.note-author button.author-name {
  display: inline-block;
  max-width: 100%;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: var(--navy);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.12s;
}
.note-author a.author-name:hover,
.note-author button.author-name:hover,
.note-author a.author-name:focus-visible,
.note-author button.author-name:focus-visible {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.note-author a.author-name:focus-visible,
.note-author button.author-name:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
/* The avatar's clickable wrapper. It exists to carry the click and the
   OnlyBoosts dot (onlyboosts.css positions the dot against it); `.note-author
   img` above still sizes the image inside, so it must not add a box of its
   own or the author row shifts. Round, so the dot's `border-radius: inherit`
   re-clips the image. */
.note-author .note-avatar-link {
  display: flex;
  flex-shrink: 0;
  line-height: 0;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  cursor: pointer;
}
.note-author .author-handle {
  color: var(--muted);
  font-size: 0.78rem;
}
.note-author time {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: italic;
  flex-shrink: 0;
}

/* The meta row: sats, "via <app>", the episode title, off the payment record,
   on every card that has one (boosts-thread.js renderNoteCard). A booster's
   own note says none of that itself. The OnlyBoosts card's row: the sats
   bold in the accent, the app muted beside them ("via" is its own
   separator), the episode as a quiet link that wraps rather than pushing
   anything off the card. */
.note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.6rem;
  margin: -0.15rem 0 0.55rem;
  font-size: 0.84rem;
  line-height: 1.4;
}
.note-meta-sats {
  font-weight: 700;
  color: var(--brand-d, #d97b0e);
  white-space: nowrap;
}
.note-meta-via {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}
.note-meta-ep {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  max-width: 100%;
  word-break: break-word;
}
a.note-meta-ep:hover,
a.note-meta-ep:focus-visible { color: var(--brand-d, #d97b0e); text-decoration: underline; text-underline-offset: 2px; }
/* A Fountain boost sent without a comment is only the trailer, which the
   renderer strips; the strip above already says everything the card has. */
.note-card .note-body:empty { display: none; }

.note-body {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  line-height: 1.7;
  font-size: 0.97rem;
}
.note-body a { color: var(--navy-l); }
.note-body a.nostr-mention { color: var(--orange); font-weight: 600; text-decoration: none; }
.note-body a.nostr-mention:hover { text-decoration: underline; }

/* ── Media and link previews inside a note (link-preview.js) ──────────
   A picture or clip the note links to is painted inline in a bounded box so
   a GIF stays a line in the card and not the card; a page link gets a small card
   (thumbnail, site, title, description) once /api/link-preview answers.
   Both are blocks inside a pre-wrap body, which is why the renderer trims
   the newline on each side of them. The same classes serve the Podcast
   Boosts feed's .pcast-boost-msg on the homepage. */
/* OnlyBoosts' box (a.msg-media in its theme.css): never taller than 200px
   or wider than 280px, whatever the picture's own size, which is what
   answered the 2026-08-21 objection that pictures made the cards too big. */
.note-media {
  display: block;
  width: fit-content;
  max-width: min(100%, 280px);
  margin: 0.4rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
  background: var(--cream-d);
}
.note-media > a { display: block; line-height: 0; }
.note-media img,
.note-media video {
  display: block;
  max-width: 100%;
  max-height: 200px;
  width: auto;
  height: auto;
}
.note-media video { min-width: min(100%, 280px); }

/* A voice boost (or any audio link): voice-player.js. One row across the
   card's text column (Reed, 2026-12-06), so the waveform a host seeks on
   while reading boosts on the show is as wide as the card allows. Inside a
   pre-wrap body, so white-space is reset and the row is a flex box. */
.voice-clip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-sizing: border-box;
  width: 100%;
  margin: 0.45rem 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--cream-d);
  white-space: normal;
  line-height: 1.2;
}
.voice-clip audio { display: none; }
.voice-clip .vc-play,
.voice-clip .vc-save {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
}
.voice-clip .vc-play {
  width: 40px;
  height: 40px;
  background: var(--brand-dd);
  color: #fff;
}
.voice-clip .vc-play:hover { background: var(--brand-ddd); }
.voice-clip .vc-save {
  width: 32px;
  height: 32px;
  background: transparent;
  color: var(--muted);
}
.voice-clip .vc-save:hover { color: var(--text); background: var(--cream); }
.voice-clip .vc-save:disabled { opacity: 0.45; cursor: progress; }
.voice-clip .vc-play:focus-visible,
.voice-clip .vc-save:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.voice-clip .vc-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.voice-clip .vc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
}
.voice-clip .vc-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text);
  font-weight: 600;
}
.voice-clip .vc-label svg { color: var(--orange); }
.voice-clip .vc-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.voice-clip .vc-wave {
  position: relative;
  display: block;
  height: 30px;
}
/* The bars: the muted row, and the played row laid over it and clipped to
   the position (voice-player.js sets the clip-path). */
.voice-clip .vc-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}
.voice-clip .vc-bars > span {
  flex: 1 1 0;
  min-width: 1px;
  border-radius: 999px;
  background: var(--border);
  background: color-mix(in srgb, var(--muted) 42%, var(--cream-d));
  transition: height 0.25s ease;
}
.voice-clip .vc-played { clip-path: inset(0 100% 0 0); }
.voice-clip .vc-played > span { background: var(--brand-d); }
/* The range input is the seek control, laid over the waveform and
   invisible. */
.voice-clip .vc-seek {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.voice-clip .vc-wave:has(.vc-seek:focus-visible) { outline: 2px solid var(--orange); outline-offset: 3px; }
.link-preview-slot[hidden] { display: none; }
a.link-preview {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0.45rem 0;
  max-width: 540px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--cream-d);
  overflow: hidden;
  text-decoration: none;
  line-height: 1.35;
  white-space: normal;
  transition: border-color 0.12s;
}
a.link-preview:hover { border-color: var(--orange); text-decoration: none; }
a.link-preview .lp-thumb {
  flex: 0 0 104px;
  width: 104px;
  min-height: 78px;
  object-fit: cover;
  background: var(--cream-d);
  border-right: 1px solid var(--border);
}
a.link-preview .lp-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.75rem;
  min-width: 0;
}
a.link-preview .lp-site {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.link-preview .lp-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
a.link-preview:hover .lp-title { text-decoration: underline; }
a.link-preview .lp-desc {
  font-size: 0.78rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 480px) {
  a.link-preview .lp-thumb { flex-basis: 84px; width: 84px; }
  a.link-preview .lp-desc { display: none; }
}

/* ── Embedded notes (kind-1 quoted via nevent/note, NIP-52 calendar) ── */
.embed-note {
  background: var(--cream-d);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin: 0.6rem 0;
  font-size: 0.92rem;
  white-space: normal;
}
.embed-note .embed-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
}
.embed-note .embed-author img {
  width: 24px; height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--cream);
  flex-shrink: 0;
}
.embed-note .embed-author .author-name {
  font-weight: 700;
  color: var(--navy);
}
.embed-note .embed-author time {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.75rem;
  font-style: italic;
}
.embed-note .embed-body {
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.embed-note .embed-footer {
  margin-top: 0.5rem;
  font-size: 0.78rem;
}
.embed-note .embed-footer a {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.embed-note .embed-footer a:hover { color: var(--orange); }

.embed-note.is-missing {
  color: var(--muted);
  font-style: italic;
  font-size: 0.88rem;
  padding: 0.7rem 0.9rem;
}
.embed-note.is-missing a { color: var(--navy-l); margin-left: 0.4rem; }

.embed-note.is-naddr {
  display: flex;
  align-items: center;
  padding: 0.7rem 0.9rem;
}
.embed-note.is-naddr a {
  color: var(--navy-l);
  font-weight: 600;
  text-decoration: none;
}
.embed-note.is-naddr a:hover { color: var(--orange); }

.embed-note.is-event .event-title {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.25;
  color: var(--navy);
  margin-bottom: 0.35rem;
  word-break: break-word;
}
/* Title as a link to the event on mynostr — keep the title look (no green
   underline), warm on hover. */
a.event-title { text-decoration: none; }
a.event-title:hover { color: var(--orange); }

/* Clickable organizer identity (avatar + name) — copies the npub. */
.embed-note .embed-author .author-id {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.embed-note .embed-author button.author-id .author-name { transition: color 0.12s; }
.embed-note .embed-author button.author-id:hover .author-name {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.embed-note.is-event .event-meta {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0.15rem 0;
  word-break: break-word;
}
.embed-note.is-event .event-meta .event-icon {
  flex-shrink: 0;
  width: 1.1rem;
  text-align: center;
  font-style: normal;
}

/* ── Cover thumbnail (NIP-52 `image`) ──
   With a cover image the card becomes a column: an [thumb | content] row
   (.event-top) followed by the full-width action bar, so the bar's dashed
   divider and buttons run under the image too. .event-col holds the
   author / title / meta. */
.embed-note.is-event.has-thumb {
  display: flex;
  flex-direction: column;
}
.embed-note.is-event .event-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.embed-note.is-event .event-thumb {
  flex: 0 0 auto;
  width: 103px;
  height: 103px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--cream);
  border: 1px solid var(--border);
}
.embed-note.is-event .event-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.embed-note.is-event .event-col {
  flex: 1 1 auto;
  min-width: 0;
}

/* The whole-event view's picture: the card's width, above the text. */
.embed-note.is-event .event-hero { margin: 0 0 0.9rem; }
.embed-note.is-event .event-hero img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--cream-d);
}

/* The description under the when / where lines (the homepage's event
   modal asks for it; list cards do not). */
.embed-note.is-event .event-desc {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
  overflow-wrap: anywhere;
}
.embed-note.is-event .event-desc p { margin: 0 0 0.65rem; white-space: pre-wrap; }
.embed-note.is-event .event-desc p:last-child { margin-bottom: 0; }
.embed-note.is-event .event-desc a { color: var(--green-d); text-decoration: underline; text-underline-offset: 2px; }

/* Push the ⋮ menu to the right edge of the author row (calendar cards
   have no timestamp to do it). */
.embed-note.is-event .embed-author .note-more { margin-left: auto; }

/* Event cards keep Renote + Zap right-aligned so they sit in the same
   place whether or not a left-slot control (the versions toggle) is
   present. (Scoped to event cards; the boosts action bar is unaffected.) */
.embed-note.is-event .note-actions { justify-content: flex-end; }

/* ── Featured (boosted) event cards ──
   A boosted event wears a gold border + soft pulsing halo — the same gold
   accent as the top-tier supporter avatars (community-status.css --gold
   #e0a92e), scaled up to a card-wide glow. Set on .is-featured by the
   calendar renderer when Feeds marks the card as boosted. */
.embed-note.is-event.is-featured {
  border-color: #e0a92e;
  box-shadow: 0 0 0 1px rgba(224,169,46,0.55), 0 0 14px 2px rgba(224,169,46,0.28);
  animation: lb-featured-glow 2.6s ease-in-out infinite;
}
@keyframes lb-featured-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(224,169,46,0.55), 0 0 12px 2px rgba(224,169,46,0.22); }
  50%      { box-shadow: 0 0 0 1px rgba(224,169,46,0.75), 0 0 20px 4px rgba(224,169,46,0.40); }
}
@media (prefers-reduced-motion: reduce) {
  .embed-note.is-event.is-featured { animation: none; }
}

/* ── Per-card overflow (⋮) menu ──
   Duplicated from boost-actions.css so the shared calendar renderer gets
   its menu on pages that don't load the boost action bar (Meetups,
   Community Feeds). Keep the two in sync if either changes. */
.note-more { position: relative; flex-shrink: 0; }
.note-more-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font: inherit;
  line-height: 1;
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s, color 0.15s;
}
.note-more-btn:hover,
.note-more-btn[aria-expanded="true"] {
  background: rgba(247,147,26,0.12);
  color: var(--orange);
}
.note-more-btn .lb-icon { font-size: 1.2rem; line-height: 1; }
.note-more-menu {
  position: absolute;
  top: calc(100% + 0.3rem);
  right: 0;
  min-width: 190px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(30,58,95,0.18);
  padding: 0.3rem;
  z-index: 50;
}
.note-more-menu[hidden] { display: none; }
.note-more-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  padding: 0.5rem 0.65rem;
  border-radius: 5px;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.note-more-item:hover { background: rgba(247,147,26,0.12); color: var(--orange); }

/* The per-card action bar (.note-actions) lives in boost-actions.css —
   pages that load the mutation handlers also load its styles. */

/* ── Note footer + reply tree ───────────────────────────────────── */
.note-footer {
  margin-top: 0.7rem;
  font-size: 0.78rem;
}
.note-footer a {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.note-footer a:hover { color: var(--orange); }
/* A ledger card's footer (a boost with no note on Nostr): where the Nostr
   link sits on every other card, in the same quiet type. */
.note-footer .note-offline {
  color: var(--muted);
  letter-spacing: 0.04em;
  cursor: help;
}

.replies-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--orange);
  display: inline-block;
}
.replies-empty {
  color: var(--muted);
  font-style: italic;
  padding: 1rem 0;
}

.reply-children {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  border-left: 2px solid var(--cream-d);
  padding-left: 0.9rem;
}

@media (max-width: 600px) {
  .note-card { padding: 0.95rem 1rem; }
  .note-card.is-root { padding: 1.15rem 1.15rem; }
  .reply-children { padding-left: 0.6rem; }

  /* Featured event cards: stack the action bar on phones. Give the "Featured
     by …" cluster the full row so it left-aligns (like desktop) and forces
     Repost + Zap onto the line below, together and left-aligned. Scoped to
     .is-featured so non-featured cards keep their right-aligned single row. */
  .embed-note.is-event.is-featured .note-actions { justify-content: flex-start; }
  .embed-note.is-event.is-featured .note-actions-left {
    flex-basis: 100%;
    margin-right: 0;
  }
}
