
@font-face {
  font-family: 'Redacted';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/assets/fonts/Redacted/Redacted-Regular.woff2') format('woff2');
}

/**
 * Shared skeleton tokens for the market content blocks.
 *
 * Every block concatenates this with its own `style.css` into
 * `makeElement({ style })` — via `./skeleton.ts`, which also prepends the
 * Redacted @font-face — so a block carries everything `[skeleton]` needs and
 * nothing has to be linked globally for the mode to work.
 *
 * The values are the wireframe's grey ramp expressed against `--text` /
 * `--background` rather than the flat hexes it was drawn with, so a skeleton
 * follows the site into dark mode instead of staying a light-mode artifact.
 */
:root {
  /* Redacted has no italic or bold cut — the fallback keeps metrics sane if the
     woff2 is missing, in which case a skeleton degrades to plain grey text. */
  --market-skeleton-font: 'Redacted', var(--font-primary, sans-serif);

  --market-skeleton-heading: color-mix(in srgb, var(--background), var(--text) 70%);
  --market-skeleton-copy: color-mix(in srgb, var(--background), var(--text) 30%);
  --market-skeleton-kicker: color-mix(in srgb, var(--background), var(--text) 24%);
  --market-skeleton-media: color-mix(in srgb, var(--background), var(--text) 38%);
  --market-skeleton-rule: color-mix(in srgb, var(--background), var(--text) 12%);
  --market-skeleton-surface: color-mix(in srgb, var(--background), var(--text) 2%);
}

market-newsletter {
  --newsletter-muted: color-mix(in srgb, var(--background), var(--text) 62%);
  --newsletter-field: color-mix(in srgb, var(--background), var(--text) 24%);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  width: 100%;
  padding: 56px;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  market-newsletter {
    padding: 36px 20px;
  }
}

market-newsletter [headline] {
  margin: 0;
  max-width: 32rem;
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
}

market-newsletter [copy] {
  margin: 0;
  max-width: 36rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--newsletter-muted);
}

market-newsletter [subscribe] {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 520px) {
  market-newsletter [subscribe] {
    width: 100%;
  }
}

/* The label is the field's name, not decoration — hidden visually because the
   placeholder carries it in this layout, but never removed, or the input is
   announced as "edit text, blank". */
market-newsletter [field-label] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

market-newsletter input {
  width: 320px;
  max-width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--newsletter-field);
  border-radius: 8px;
  background: var(--background);
  font-size: 1rem;
  color: var(--text);
}

market-newsletter input:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  market-newsletter input {
    width: 100%;
  }
}

market-newsletter button {
  min-width: 130px;
  height: 44px;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 8px;
  background: var(--text);
  font-size: 1rem;
  font-weight: 700;
  color: var(--background);
  cursor: pointer;
  transition: background ease 300ms;
}

market-newsletter button:hover {
  background: color-mix(in srgb, var(--text), var(--background) 18%);
}

market-newsletter button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  market-newsletter button {
    transition: none;
  }
}

market-newsletter [fine-print] {
  margin: 8px 0 0;
  max-width: 32rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: color-mix(in srgb, var(--background), var(--text) 42%);
}

market-newsletter [status] {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}

market-newsletter :is([headline], [copy], [fine-print], [status]):empty {
  display: none;
}

/* ---------------- SKELETON ---------------- */

market-newsletter[skeleton],
market-newsletter[skeleton] * {
  font-family: var(--market-skeleton-font);
  font-weight: 400;
  letter-spacing: normal;
}

market-newsletter[skeleton] {
  background: var(--market-skeleton-surface);
  pointer-events: none;
  user-select: none;
}

market-newsletter[skeleton] :is([headline], [copy], [fine-print]):empty {
  display: revert;
}

/* An empty input already *is* the wireframe's shape, so the field needs no
   filler — only the browser's disabled tint taking off, which would otherwise
   read as a state rather than as a blank. */
market-newsletter[skeleton] input {
  border-color: var(--market-skeleton-rule);
  background: var(--background);
  opacity: 1;
}

market-newsletter[skeleton] button {
  background: var(--market-skeleton-heading);
  color: var(--background);
  opacity: 1;
}

market-newsletter[skeleton] [headline] {
  color: var(--market-skeleton-heading);
}

market-newsletter[skeleton] [headline]:empty::before {
  content: 'Sign up for the occasional letter';
}

market-newsletter[skeleton] [copy] {
  color: var(--market-skeleton-copy);
}

market-newsletter[skeleton] [copy]:empty::before {
  content: 'One line explaining what lands in the inbox and how often.';
}

market-newsletter[skeleton] [fine-print] {
  color: var(--market-skeleton-kicker);
}

market-newsletter[skeleton] [fine-print]:empty::before {
  content: 'Unsubscribe whenever you like.';
}
