/* marketplace_detail_public.css — below-the-fold styles for the
   anonymous plugin detail page (marketplace_detail_public.html). The
   critical shell / banner / hero rules stay inline in the template
   for first paint; everything else lives here so repeat visitors hit
   the immutable static cache. Bump the ?v= in
   marketplace_detail_public.html on every edit:
     <link rel="stylesheet" href="/static/marketplace_detail_public.css?v=N"/>
 */

  /* Trust pills row (below hero, above two-column body) */
  .mpd-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 0 0 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
  }
  .mpd-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    background: var(--abyss);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
  }
  .mpd-pill strong { color: var(--text); font-weight: 600; }
  .mpd-pill-glyph { color: var(--gold-light); font-size: 0.9em; }
  .mpd-pill-verified {
    color: var(--cyan);
    border-color: rgba(52, 196, 244,0.28);
  }
  .mpd-pill-quality {
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.7rem;
    background: rgba(240, 185, 11, 0.16);
    color: #ffd98a;
    border-color: rgba(240, 185, 11, 0.35);
    text-decoration: none;
  }
  a.mpd-pill-quality:hover { border-color: rgba(240, 185, 11, 0.6); }

  /* Two-column body — main + sticky sidebar */
  .mpd-body {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.75rem;
    align-items: start;
  }
  .mpd-main { min-width: 0; }
  .mpd-sidebar {
    position: sticky;
    top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  /* Install card (sidebar) */
  .mpd-install-card {
    background: var(--depth);
    border: 1px solid var(--gold-dim);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--glow-gold);
  }
  .mpd-price {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
  }
  .mpd-price.free { color: var(--green); }
  .mpd-price.paid { color: var(--gold-light); }
  .mpd-price-note {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    color: var(--muted2);
    margin-bottom: 1rem;
    text-transform: uppercase;
  }
  .mpd-install {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.95rem 1.25rem;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--void);
    text-decoration: none;
    box-shadow: 0 4px 18px rgba(59, 130, 246, 0.22);
    transition: box-shadow 0.18s, transform 0.12s;
  }
  .mpd-install:hover { box-shadow: 0 6px 28px rgba(59, 130, 246, 0.42); }
  .mpd-install:active { transform: translateY(1px); }
  .mpd-install-note {
    display: block;
    margin-top: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted2);
    letter-spacing: 0.04em;
    line-height: 1.5;
  }
  .mpd-install-note a { color: var(--gold-light); text-decoration: none; }
  .mpd-install-note a:hover { color: var(--gold); text-decoration: underline; }

  /* "How installing works" step strip — sets honest expectations about the
     subscription + bot setup gate before the sign-in wall */
  .mpd-steps {
    margin: 1.25rem 0 0;
    padding: 1.25rem 0 0;
    border-top: 1px solid var(--border);
  }
  .mpd-steps-head {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted2);
    margin-bottom: 0.6rem;
  }
  .mpd-steps-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.45;
  }
  .mpd-steps-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
  }
  .mpd-step-num {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--gold-light);
    border: 1px solid var(--gold-dim);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
  }
  .mpd-trust-list {
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 1.25rem 0 0;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--muted);
    line-height: 1.45;
  }
  .mpd-trust-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
  }
  .mpd-trust-list .glyph { color: var(--gold-light); flex-shrink: 0; min-width: 14px; }
  .mpd-trust-list .glyph-verified { color: var(--cyan); }

  /* Read-only plans list (sidebar) — anonymous buyers see cost before sign-in */
  .mpd-plans {
    margin: 1.25rem 0 0;
    padding: 1.25rem 0 0;
    border-top: 1px solid var(--border);
  }
  .mpd-plans-head {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted2);
    margin-bottom: 0.6rem;
  }
  .mpd-plan-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.35rem 0;
  }
  .mpd-plan-row + .mpd-plan-row { border-top: 1px solid var(--border); }
  .mpd-plan-name { font-size: 0.82rem; font-weight: 600; color: var(--text); min-width: 0; }
  .mpd-plan-price {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--gold-light);
    white-space: nowrap;
    flex-shrink: 0;
  }
  .mpd-plan-price.free { color: var(--green); }
  .mpd-plan-trial {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(107,203,139,0.12);
    color: var(--green);
    border: 1px solid rgba(107,203,139,0.3);
    margin-top: 2px;
  }

  /* Summary paragraph (top of main column) */
  .mpd-summary {
    font-family: var(--font-prose);
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--text);
    margin: 0 0 1.5rem;
  }

  /* Screenshots strip (CSS-only horizontal scroll, no JS) */
  .mpd-shots {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.5rem;
    margin: 0 0 1.5rem;
    scrollbar-color: var(--gold-dim) transparent;
  }
  .mpd-shots::-webkit-scrollbar { height: 6px; }
  .mpd-shots::-webkit-scrollbar-track { background: transparent; }
  .mpd-shots::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }
  .mpd-shot {
    flex: 0 0 auto;
    width: 320px; height: 180px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--depth);
    border: 1px solid var(--border);
    scroll-snap-align: start;
    transition: border-color 0.15s ease, transform 0.12s ease;
  }
  .mpd-shot:hover { border-color: var(--gold-dim); transform: translateY(-2px); }
  .mpd-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .mpd-shot { cursor: zoom-in; }

  /* Screenshot lightbox — ported from the logged-in detail page so the
     320x180 tiles are no longer the only way to see a screenshot. */
  .mpd-lightbox {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.88); align-items: center; justify-content: center; cursor: pointer;
  }
  .mpd-lightbox.active { display: flex; }
  .mpd-lightbox img {
    max-width: 90vw; max-height: 90vh; border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5); cursor: default;
  }
  .mpd-lightbox-close {
    position: absolute; top: 20px; right: 24px; font-size: 2rem; color: #fff;
    cursor: pointer; opacity: 0.7; background: none; border: none; line-height: 1;
  }
  .mpd-lightbox-close:hover { opacity: 1; }

  /* Slash-command chips (mono-caps badge language) */
  .mpd-cmds { display: flex; flex-wrap: wrap; gap: 8px; }
  .mpd-cmd-chip {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--abyss);
    color: var(--text);
    border: 1px solid var(--border);
  }

  /* Generic section block */
  .mpd-section { margin-top: 2rem; }
  .mpd-section-head {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.9rem;
    letter-spacing: 0.02em;
  }
  .mpd-description-card {
    background: var(--depth);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.4rem;
  }
  .mpd-description {
    font-family: var(--font-prose);
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--muted);
    white-space: pre-wrap;
    margin: 0;
  }

  /* ── Rendered README / markdown description: bounded scroll card so the
     page stays compact no matter how long the README is. ── */
  .md-readme {
    white-space: normal;
    max-height: 480px;
    overflow-y: auto;
    overflow-wrap: anywhere;
    font-size: 0.96rem;
    line-height: 1.7;
    color: var(--text);
    padding-right: 6px;
    scrollbar-width: thin;
  }
  .md-readme::-webkit-scrollbar { width: 8px; }
  .md-readme::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
  .md-readme > :first-child { margin-top: 0; }
  .md-readme > :last-child { margin-bottom: 0; }
  .md-readme h1, .md-readme h2, .md-readme h3, .md-readme h4 {
    line-height: 1.3; margin: 1.4em 0 0.5em; color: var(--text); font-weight: 700;
  }
  .md-readme h1 { font-size: 1.5rem; padding-bottom: 0.3em; border-bottom: 1px solid var(--border); }
  .md-readme h2 { font-size: 1.25rem; padding-bottom: 0.3em; border-bottom: 1px solid var(--border); }
  .md-readme h3 { font-size: 1.1rem; }
  .md-readme h4 { font-size: 1rem; }
  .md-readme p { margin: 0.7em 0; }
  .md-readme a { color: var(--gold); text-decoration: none; }
  .md-readme a:hover { text-decoration: underline; }
  .md-readme ul, .md-readme ol { margin: 0.7em 0; padding-left: 1.6em; }
  .md-readme li { margin: 0.25em 0; }
  .md-readme img { max-width: 100%; height: auto; border-radius: 6px; }
  .md-readme code {
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
    font-size: 0.86em; background: rgba(127,127,127,0.16); padding: 0.15em 0.4em; border-radius: 4px;
  }
  .md-readme pre {
    background: rgba(127,127,127,0.12); border: 1px solid var(--border);
    border-radius: 8px; padding: 0.9em 1em; overflow-x: auto; margin: 0.8em 0;
  }
  .md-readme pre code { background: none; padding: 0; font-size: 0.84em; }
  .md-readme blockquote { margin: 0.8em 0; padding: 0.3em 1em; border-left: 3px solid var(--border); color: var(--muted); }
  .md-readme hr { border: 0; border-top: 1px solid var(--border); margin: 1.2em 0; }
  .md-readme table { border-collapse: collapse; max-width: 100%; margin: 0.8em 0; font-size: 0.9em; }
  .md-readme th, .md-readme td { border: 1px solid var(--border); padding: 0.4em 0.7em; text-align: left; }
  .md-readme th { background: rgba(127,127,127,0.1); font-weight: 600; }
  .md-readme-fallback { white-space: pre-wrap; word-break: break-word; color: var(--muted); font-size: 0.92rem; }

  /* Rating summary header (above review cards) */
  .mpd-rating-summary {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--depth);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
  }
  .mpd-rating-big {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--gold-light);
    line-height: 1;
  }
  .mpd-rating-meta { display: flex; flex-direction: column; gap: 0.2rem; }
  .mpd-rating-stars {
    color: var(--gold-light);
    letter-spacing: 0.18em;
    font-size: 1.05rem;
  }
  .mpd-rating-count {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--muted2);
    letter-spacing: 0.04em;
  }

  /* Review cards (server-side rendered so crawlers see them) */
  .mpd-reviews { display: flex; flex-direction: column; gap: 1rem; }
  .mpd-review {
    background: var(--depth);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.15rem;
  }
  .mpd-review-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.45rem;
  }
  .mpd-review-stars {
    color: var(--gold-light);
    letter-spacing: 0.15em;
    font-size: 0.95rem;
  }
  .mpd-review-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--muted2);
    letter-spacing: 0.04em;
  }
  .mpd-review-meta b { color: var(--text); font-weight: 600; margin-right: 0.35rem; }
  .mpd-review-verified {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #3fb950;
    background: rgba(63,185,80,0.12);
    border: 1px solid rgba(63,185,80,0.25);
    border-radius: 5px;
    padding: 0.1rem 0.4rem;
    white-space: nowrap;
  }
  .mpd-review-title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text);
    margin: 0 0 0.3rem;
  }
  .mpd-review-body {
    font-family: var(--font-prose);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--muted);
    margin: 0;
  }
  .mpd-review-reply {
    margin: 0.65rem 0 0 1rem; padding: 0.5rem 0.85rem;
    border-left: 2px solid var(--gold-light);
    border-radius: 0 8px 8px 0;
  }
  .mpd-review-reply-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: 0.25rem;
  }
  .mpd-review-reply-body {
    font-family: var(--font-prose);
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--muted);
    margin: 0;
  }

  /* Related plugins — internal link equity */
  .mpd-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.85rem;
  }
  .mpd-related-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem;
    background: var(--depth);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, transform 0.12s ease;
  }
  .mpd-related-card:hover { border-color: var(--gold-dim); transform: translateY(-1px); }
  .mpd-related-icon {
    width: 44px; height: 44px;
    border-radius: 8px;
    flex-shrink: 0;
    background: var(--abyss);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    color: var(--gold-light);
    font-size: 1.1rem;
    overflow: hidden;
  }
  .mpd-related-icon img { width: 100%; height: 100%; object-fit: cover; }
  .mpd-related-body { min-width: 0; }
  .mpd-related-name {
    font-family: var(--font-display);
    font-size: 0.92rem;
    color: var(--text);
    margin: 0 0 0.2rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mpd-related-summary {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--muted2);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Bottom CTA — full-width call-to-action at end of content */
  .mpd-bottom-cta {
    margin: 2.5rem 0 0;
    padding: 2rem 1.5rem;
    background:
      radial-gradient(ellipse at center, rgba(59, 130, 246,0.10), transparent 70%),
      var(--depth);
    border: 1px solid var(--gold-dim);
    border-radius: 14px;
    text-align: center;
  }
  .mpd-bottom-cta-title {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.5rem;
  }
  .mpd-bottom-cta-sub {
    font-family: var(--font-prose);
    color: var(--muted);
    margin: 0 0 1.25rem;
  }
  .mpd-bottom-cta .mpd-install {
    display: inline-flex;
    width: auto;
    padding: 0.9rem 1.75rem;
  }

  /* Responsive — tablet and below */
  @media (max-width: 960px) {
    .mpd-body { grid-template-columns: 1fr; }
    .mpd-sidebar { position: static; order: -1; }
    .mpd-install-card { padding: 1.25rem; }
  }
  @media (max-width: 700px) {
    .mpd-hero-row { grid-template-columns: auto 1fr; gap: 1rem; }
    .mpd-icon, .mpd-icon-avatar {
      width: 72px; height: 72px;
      border-radius: 14px;
      font-size: 1.6rem;
    }
    .mpd-shot { width: 260px; height: 146px; }
    .mpd-rating-summary { gap: 0.85rem; padding: 0.85rem 1rem; }
    .mpd-rating-big { font-size: 2rem; }
  }
  @media (max-width: 480px) {
    .mpd-icon, .mpd-icon-avatar {
      width: 64px; height: 64px;
      border-radius: 12px;
      font-size: 1.4rem;
    }
    .mpd-hero { padding: 1rem; }
    .mpd-shot { width: 220px; height: 124px; }
    .mpd-bottom-cta { padding: 1.5rem 1rem; }
  }

  @media (prefers-reduced-motion: reduce) {
    .mpd-hero::before { animation: none; }
    .mpd-back, .mpd-install, .mpd-related-card, .mpd-shot { transition: none; }
  }

  @media print {
    body.landing::after { display: none; }
    .mpd-hero::before { display: none; }
    .mpd-hero { background: none; border-color: #ccc; }
    .mpd-banner::after { display: none; }
    .mpd-body { display: block; }
    .mpd-sidebar { position: static; }
    .mpd-install-card { box-shadow: none; border-color: #ccc; }
    .mpd-install { background: none; color: #000; border: 1px solid #000; box-shadow: none; }
    .mpd-install::after { content: " - visit yourbot.gg to install"; font-size: 0.85em; }
    .mpd-bottom-cta { background: none; border-color: #ccc; }
    .mpd-shots { overflow: visible; flex-wrap: wrap; }
  }
