
@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-product-carousel {
  position: relative;
  display: block;
  padding-top: 60px;
  padding-bottom: 60px;
}
@media (max-width: 768px) {
  market-product-carousel header {
    padding-bottom: 15px;
  }
}
market-product-carousel header > *:empty {
  display: none;
}

market-product-carousel header {
  text-align: center;
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}

market-product-carousel header span {
  line-height: 1.25;
  font-size: 1.5rem;
  text-transform: uppercase;
  font-weight: 600;
}

market-product-carousel header h2 {
  font-weight: 700;
  font-size: 2rem;
}

market-product-carousel header p {
  font-weight: 400;
  line-height: 1.5rem;
  font-size: 16px;
  max-width: 640px;
}

@media (max-width: 768px) {
  market-product-carousel header p {
    font-size: 14px;
    line-height: 20px;
  }
}

market-product-carousel [viewport] {
  position: relative;
  margin-top: 45px;
}

market-product-carousel [carousel] {
  display: flex;
  justify-content: flex-start;
  gap: 30px;
  padding: 0 30px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

market-product-carousel:not([overflowing]) [carousel] {
  justify-content: center;
}

market-product-carousel [carousel]::-webkit-scrollbar {
  /* display: none; */
  background: var(--text);
}

@media (max-width: 768px) {
  market-product-carousel [carousel] {
    gap: 15px;
    padding: 0 15px;
    padding-bottom: 30px;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  market-product-carousel [carousel] {
    scroll-behavior: auto;
  }
}

/* ---------------- ARROWS ---------------- */
market-product-carousel [viewport] > button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: var(--background);
  color: var(--text);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--text) 20%, transparent);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

market-product-carousel [viewport] > button svg {
  width: 24px;
  height: 24px;
}

market-product-carousel [viewport] > button[prev] {
  left: 15px;
}

market-product-carousel [viewport] > button[next] {
  right: 15px;
}

market-product-carousel [viewport] > button:disabled {
  opacity: 0 !important;
  pointer-events: none;
}

/* Fade in on hover (desktop with a fine pointer only) */
@media (hover: hover) and (pointer: fine) {
  market-product-carousel [viewport]:hover > button:not(:disabled) {
    opacity: 1;
  }
}

/* Hide arrows entirely on touch / mobile */
@media (hover: none), (max-width: 768px) {
  market-product-carousel [viewport] > button {
    display: none;
  }
}

market-product-carousel [carousel] [product] {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
  min-width: 22vw;
  max-width: 25vw;
  text-align: center;
}

@media (max-width: 768px) {
  market-product-carousel [carousel] [product] {
    min-width: 55vw;
    max-width: 55vw;
  }
}

market-product-carousel [carousel] [product] [media] {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1/1;
  border-radius: 10px;
  background: color-mix(in srgb, var(--background), var(--text) 8%);
  overflow: hidden;
  width: 100%;
}

market-product-carousel [carousel] [product] [media] svg-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

market-product-carousel [carousel] [product] [media] svg-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

market-product-carousel [carousel] [product] [media] svg-img svg {
  width: 45px;
  height: 45px;
}

market-product-carousel [carousel] [product] [badge] {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--background);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

market-product-carousel [carousel] [product] h3 {
  line-height: 22px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  market-product-carousel [carousel] [product] h3 {
    font-size: 12px;
    line-height: 18px;
  }
}

market-product-carousel [carousel] [product] p {
  font-size: 14px;
  line-height: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

market-product-carousel [carousel] [product] [cta] {
  margin-top: auto;
  width: 100%;
  padding: 16px 24px;
  border-radius: 10px;
  background: var(--text);
  color: var(--background);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
}

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

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

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

market-product-carousel[skeleton] header > *:empty {
  display: revert;
}

/* The arrows are disabled so nothing can reach them, but they are still the
   drawing of a control — dimming them would say the row had run out. */
market-product-carousel[skeleton] [viewport] > button:disabled {
  color: var(--market-skeleton-copy);
  opacity: 1;
}

market-product-carousel[skeleton] [carousel] [product] [media] {
  background: var(--market-skeleton-media);
}

market-product-carousel[skeleton] header :is(span, h2) {
  color: var(--market-skeleton-heading);
}

market-product-carousel[skeleton] header p {
  color: var(--market-skeleton-copy);
}

market-product-carousel[skeleton] header span:empty::before {
  content: 'This week';
}

market-product-carousel[skeleton] header h2:empty::before {
  content: 'What people are buying';
}

market-product-carousel[skeleton] header p:empty::before {
  content: 'One line saying how the row was picked, and how often it changes.';
}

market-product-carousel[skeleton] [product] h3 {
  color: var(--market-skeleton-heading);
}

market-product-carousel[skeleton] [product]:nth-child(3n + 1) h3:empty::before {
  content: 'A product';
}

market-product-carousel[skeleton] [product]:nth-child(3n + 2) h3:empty::before {
  content: 'A longer product name';
}

market-product-carousel[skeleton] [product]:nth-child(3n + 3) h3:empty::before {
  content: 'Shorter';
}

market-product-carousel[skeleton] [product] p {
  color: var(--market-skeleton-copy);
}

market-product-carousel[skeleton] [product] p:empty::before {
  content: 'Two lines about the cloth and the cut, and nothing about the discount.';
}

market-product-carousel[skeleton] [product] [cta] {
  background: var(--market-skeleton-heading);
  color: var(--background);
}

market-product-carousel[skeleton] [product] [cta]:empty::before {
  content: 'Get the details · £120.00';
}
