/*
  Styles for /share, the "spread the word" page. Separate from style.css and
  linked on its own so the main site stylesheet stays about the marketing pages.
  Everything here is a class — the site's CSP is `style-src 'self'`, so an inline
  `style=` attribute or a <style> block would simply not apply.
*/

/* The neutral stage a widget preview sits on, so a light card is visible in
   dark mode and a dark one in light mode. */
.preview {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1.25rem;
  margin: 1.25rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background:
    repeating-linear-gradient(45deg, oklch(0.5 0.01 260 / 0.04) 0 8px, transparent 8px 16px),
    var(--surface);
}

.preview img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* The store-badge preview lays its two anchors out with a real gap; the copied
   snippet needs no CSS of its own, but the preview here does. */
.preview.badges {
  gap: 0.75rem;
  flex-wrap: wrap;
}

.preview.badges img {
  height: 2.9rem;
  width: auto;
}

/*
  The "store buttons" banner. Unlike card.svg/banner.svg — one image, one link
  back to the site — this one carries the two official store badges as their own
  direct links, so it cannot be a single image. These rules render the on-page
  preview; the copied snippet ships the same rules inline (scoped the same way)
  so it stands alone on someone else's site.
*/
.nmnm-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 28px;
  width: 100%;
  max-width: 600px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.nmnm-banner .nmnm-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.nmnm-banner .nmnm-brand img {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  flex: none;
}

.nmnm-banner .nmnm-brand em {
  display: block;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1px;
}

.nmnm-banner .nmnm-brand b {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.nmnm-banner .nmnm-brand span {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.nmnm-banner .nmnm-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nmnm-banner .nmnm-badges a {
  display: inline-flex;
}

.nmnm-banner .nmnm-badges img {
  height: 2.5rem;
  width: auto;
  display: block;
}

/* Each variant is a titled block: heading, what it is, preview, then the code. */
.variant {
  margin-top: 2.5rem;
}

.variant h2 {
  margin-bottom: 0.35rem;
}

.variant > p {
  margin-top: 0;
}

/* The code + copy button. The <textarea> is the fallback that always works:
   even with the copy script blocked or absent, a reader can click into it,
   select all and copy. The button is progressive enhancement on top. */
.code {
  position: relative;
}

.code textarea {
  font-family: ui-monospace, 'SF Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  padding: 0.85rem 0.95rem;
  padding-inline-end: 5.5rem;
  width: 100%;
  resize: vertical;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
}

.code textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.copy {
  position: absolute;
  inset-block-start: 0.6rem;
  inset-inline-end: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.1rem;
  padding: 0 0.75rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: 0.5rem;
  cursor: pointer;
}

.copy:hover {
  filter: brightness(1.05);
}

/* "Copy" → "Copied!" without swapping text nodes in script, so the script that
   drives it needs no markup knowledge and stays tiny (and easy to hash). */
.copy .done {
  display: none;
}

.copy[data-copied] .idle {
  display: none;
}

.copy[data-copied] .done {
  display: inline;
}

/* A short "how to use it" line under each code box. */
.how {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.how code {
  font-family: ui-monospace, 'SF Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.85em;
  color: var(--text-muted);
}

/* The variant nav at the top — quick jumps, quiet. */
.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

.jump a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.jump a:hover {
  text-decoration: underline;
}
