/* Product content shared styles (used in editor + runtime)
   Theme tokens are provided via --pp-* (bridged by the appp). */

/* Spacing scale (kept modest; tuned for product pages) */
.pp-content {
  --space-1: 0.5rem; /* 8px */
  --space-2: 0.75rem; /* 12px */
  --space-3: 1rem; /* 16px */
  --space-4: 1.5rem; /* 24px */
  --space-5: 2rem; /* 32px */
  --space-6: 3rem; /* 48px */
}

/* Layout */
.pp-content .product-container {
  max-width: 940px;
  margin: 0 auto;
  background: var(--pp-bg);
  color: var(--pp-fg);
  font-family:
    "Inter",
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Noto Sans,
    Ubuntu,
    Cantarell,
    Helvetica Neue,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
}

/* Gentle vertical rhythm between top-level blocks */
.pp-content .product-container > * + * {
  margin-top: var(--space-5);
}
@media (min-width: 768px) {
  .pp-content .product-container > * + * {
    margin-top: var(--space-6);
  }
}

/* Typography (Tailwind-inspired scale) */
.pp-content h1 {
  font-weight: 700;
  font-size: 2.25rem; /* text-4xl */
  line-height: 2.5rem;
  margin-bottom: 0.75rem;
}
@media (min-width: 768px) {
  .pp-content h1 {
    font-size: 3rem;
    line-height: 1;
  } /* md:text-5xl */
}

.pp-content h2 {
  font-weight: 700;
  font-size: 1.5rem; /* text-2xl */
  line-height: 2rem;
  margin: 2rem 0 0.75rem;
}
@media (min-width: 768px) {
  .pp-content h2 {
    font-size: 1.875rem;
    line-height: 2.25rem;
  } /* md:text-3xl */
}

.pp-content h3 {
  font-weight: 600;
  font-size: 1.25rem; /* text-xl */
  line-height: 1.75rem;
  margin: 1.25rem 0 0.5rem;
}

.pp-content p {
  margin: 0 0 1rem;
}
.pp-content .text-muted {
  color: var(--pp-muted-foreground);
}

/* Text utilities */
.pp-content .text-center {
  text-align: center;
}
.pp-content .narrow-copy {
  max-width: 65ch;
}

/* UI helpers */
.pp-content .feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
  /* margin: 5rem 0; */
}
.pp-content .feature-card {
  background: var(--pp-card);
  border: 1px solid var(--pp-border);
  border-radius: 0.5rem;
  padding: 1rem;
}
.pp-content .callout-box {
  background: color-mix(in oklab, var(--pp-accent), transparent 85%);
  border-left: 4px solid var(--pp-accent);
  padding: 0.75rem 1rem;
  margin: var(--space-2) 0;
  border-radius: 0.375rem;
}

/* Utilities */

/* Center content horizontally */
.pp-content .centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Lists and figures spacing */
.pp-content ul,
.pp-content ol {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-4);
}
.pp-content li + li {
  margin-top: var(--space-1);
}
.pp-content figure {
  margin: var(--space-4) 0;
}
.pp-content figcaption {
  margin-top: var(--space-2);
  color: var(--pp-muted-foreground);
  font-size: 0.925rem;
}

/* Side-by-side layouts for product pages */
.pp-content .sbs {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  align-items: center;
  margin: 5rem 0;
}
.pp-content .sbs > .sbs-media img,
.pp-content .sbs > .sbs-media video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.5rem;
}
@media (min-width: 768px) {
  .pp-content .sbs {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
  }
  .pp-content .sbs.sbs-reverse {
    direction: rtl; /* flip visual order without affecting text direction inside */
  }
  .pp-content .sbs.sbs-reverse > * {
    direction: ltr;
  }
}
.pp-content .sbs .sbs-copy h2,
.pp-content .sbs .sbs-copy h3 {
  margin-top: 0;
}

/* Video helpers */
.pp-content .video-wrap {
  border-radius: 0.75rem;
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    color-mix(in oklab, var(--pp-accent), transparent 60%),
    transparent
  );
  padding: 2px; /* thin token-driven frame */
}
.pp-content .video-inner {
  border-radius: 0.65rem;
  overflow: hidden;
  background: var(--pp-card);
}
.pp-content .video-inner video,
.pp-content .video-inner iframe {
  display: block;
  width: 100%;
  height: auto;
}
/* 16:9 responsive frame for iframes if needed */
.pp-content .aspect-video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
}
.pp-content .aspect-video > iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Social embeds (X/Twitter, Bluesky)
   The official loader scripts render each post as its own iframe and control
   its internal sizing — we only normalize the outer wrapper. Center embeds so
   stacked copy-paste looks tidy by default. */
.pp-content .twitter-tweet,
.pp-content .bluesky-embed {
  margin-left: auto;
  margin-right: auto;
}
/* Let grid/flex children shrink. Grid/flex items default to `min-width: auto`,
   which lets a wide embed (Bluesky) refuse to shrink and drop to its own row
   while a narrower one (a tweet) sits two-up in the same container. Resetting
   to 0 lets both share columns evenly. */
.pp-content .feature-grid > *,
.pp-content .sbs > * {
  min-width: 0;
}
/* Safety net for copy-pasted embeds: keep any iframe (e.g. a YouTube embed with
   its default width="560") inside its container instead of overflowing the page.
   For a fully responsive 16:9 video, wrap the iframe in
   <div class="video-inner aspect-video">. */
.pp-content iframe {
  max-width: 100%;
}
