/* WM Blog Seeder — styles for article elements the theme doesn't cover. */

.article-body .wmbs-table-wrap {
  overflow-x: auto;
  margin: 1.75rem 0;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 14px;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.55;
  min-width: 540px;
}
.article-body th,
.article-body td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}
.article-body thead th {
  background: var(--c-p50, #f7f3fe);
  color: var(--color-heading, #111);
  font-weight: 700;
  white-space: nowrap;
}
.article-body tbody tr:last-child td { border-bottom: 0; }
.article-body tbody tr:nth-child(even) td { background: #fbfbfd; }

/* Key takeaways box */
.article-body .wmbs-takeaways {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--c-p100, #eadefc);
  border-left: 4px solid var(--c-teal, #00c9b1);
  border-radius: 12px;
  background: var(--c-p50, #f7f3fe);
}
.article-body .wmbs-takeaways > p:first-child {
  margin-top: 0;
  font-weight: 800;
  color: var(--color-heading, #111);
}
.article-body .wmbs-takeaways ul { margin-bottom: 0; }

/* Callout (tips, warnings, "not legal advice") */
.article-body .wmbs-note {
  margin: 1.5rem 0;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--color-border, #e2e8f0);
  font-size: 0.93rem;
}

/* Inline CTA linking to a related extension */
.article-body .wmbs-cta {
  margin: 2rem 0;
  padding: 1.3rem 1.4rem;
  border-radius: 14px;
  background: linear-gradient(140deg, #f7f3fe 0%, #eadefc 70%, rgba(0, 201, 177, 0.10) 100%);
  border: 1px solid var(--c-p100, #eadefc);
}
.article-body .wmbs-cta p { margin-bottom: 0.4rem; }
.article-body .wmbs-cta p:last-child { margin-bottom: 0; }

/* ── Related extensions box ─────────────────────────────────────
   Live WooCommerce product cards inserted before the FAQ section. */
.article-body .wmbs-related {
  margin: 2.75rem 0 2.5rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border-radius: 18px;
  background: linear-gradient(140deg, #f7f3fe 0%, #f1e9fd 60%, rgba(0, 201, 177, 0.07) 100%);
  border: 1px solid var(--c-p100, #eadefc);
}
.article-body .wmbs-related__head { margin-bottom: 1.1rem; }
.article-body .wmbs-related__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  line-height: 1.3;
}
.article-body .wmbs-related__intro {
  margin: 0;
  font-size: 0.92rem;
  color: var(--color-muted, #64748b);
}
/* Layout responds to the box's own width (container query), not the
   viewport — the post column is narrower than the screen when the blog
   sidebar is showing. Narrow: compact horizontal rows. Wide: one row of
   2 or 3, or a 2x2 grid for 4, so there's never an orphan card. */
.article-body .wmbs-related { container-type: inline-size; container-name: wmbsrel; }
.article-body .wmbs-related__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.article-body .wmbs-ext {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.article-body .wmbs-ext:hover {
  transform: translateY(-2px);
  border-color: var(--c-p200, #d9bdff);
  box-shadow: 0 10px 26px rgba(112, 64, 168, 0.12);
}
.article-body .wmbs-ext__media {
  display: block;
  aspect-ratio: 3 / 2;
  background: #eadefc;
  overflow: hidden;
}
.article-body .wmbs-ext__media img,
.article-body .wmbs-ext__img {
  display: block;
  width: 100%;
  height: 100%;
  /* contain, not cover: the product images carry text (name, tagline,
     tier). Their #eadefc background matches .wmbs-ext__media, so any
     letterboxing is invisible. */
  object-fit: contain;
  margin: 0;
  border-radius: 0;
}
.article-body .wmbs-ext__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.9rem 1rem 1rem;
}
.article-body .wmbs-ext__name {
  margin: 0 0 0.35rem;
  font-size: 0.98rem;
  line-height: 1.35;
}
.article-body .wmbs-ext__name a {
  color: var(--color-heading, #111);
  text-decoration: none;
}
.article-body .wmbs-ext__name a:hover { color: var(--c-p700, #5c2f8c); }
.article-body .wmbs-ext__desc {
  margin: 0 0 0.8rem;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--color-muted, #64748b);
  flex: 1;
}
.article-body .wmbs-ext__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border, #e2e8f0);
}
.article-body .wmbs-ext__price {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--c-p700, #5c2f8c);
}
.article-body .wmbs-ext__price del { font-weight: 400; color: var(--color-muted, #64748b); margin-right: 4px; }
.article-body .wmbs-ext__free {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #007a6c;
  background: #d6faf4;
  border: 1px solid #00c9b1;
}
.article-body .wmbs-ext__btn {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--c-p700, #5c2f8c);
  text-decoration: none;
  white-space: nowrap;
}
.article-body .wmbs-ext__btn:hover { color: var(--c-teal, #00c9b1); }
.article-body .wmbs-related__all {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
}
.article-body .wmbs-related__all a { color: var(--c-p700, #5c2f8c); text-decoration: none; }
.article-body .wmbs-related__all a:hover { color: var(--c-teal, #00c9b1); }

/* Narrow container: horizontal card — thumbnail left, text right. */
.article-body .wmbs-ext { flex-direction: row; }
.article-body .wmbs-ext__media { flex: 0 0 38%; aspect-ratio: auto; min-height: 100%; }
.article-body .wmbs-ext__body { padding: 0.8rem 0.95rem 0.85rem; }

@container wmbsrel (min-width: 640px) {
  .article-body .wmbs-related__grid--n2,
  .article-body .wmbs-related__grid--n4 { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .article-body .wmbs-related__grid--n3 { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .article-body .wmbs-related__grid--n2 .wmbs-ext,
  .article-body .wmbs-related__grid--n3 .wmbs-ext,
  .article-body .wmbs-related__grid--n4 .wmbs-ext { flex-direction: column; }
  .article-body .wmbs-related__grid--n2 .wmbs-ext__media,
  .article-body .wmbs-related__grid--n3 .wmbs-ext__media,
  .article-body .wmbs-related__grid--n4 .wmbs-ext__media { flex: none; aspect-ratio: 3 / 2; min-height: 0; }
}

/* Very small screens: stack the card vertically again. */
@container wmbsrel (max-width: 360px) {
  .article-body .wmbs-ext { flex-direction: column; }
  .article-body .wmbs-ext__media { flex: none; aspect-ratio: 3 / 2; }
}

@media (max-width: 480px) {
  .article-body .wmbs-related__all { text-align: center; }
}
