/**
 * UniMax Blog Components
 *
 * Theme-aware CSS using WordPress CSS custom properties from theme.json.
 * These classes are available for AI-generated blog posts and adapt
 * automatically to any block theme's color palette and typography.
 *
 * Prefix: .ux-  (UniMax)
 */

/* ── Base ────────────────────────────────────────────────────── */

.ux-blog-post {
  font-family: var(--wp--preset--font-family--body, inherit);
  line-height: 1.7;
  color: var(--wp--preset--color--foreground, #1e293b);
}

.ux-blog-post > *:first-child { margin-top: 0; }

/* ── Section Header (emoji + heading) ────────────────────────── */

.ux-section-header {
  font-family: var(--wp--preset--font-family--heading, inherit);
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  font-weight: 700;
  line-height: 1.3;
  margin: 2em 0 0.8em;
  color: var(--wp--preset--color--foreground, #1e293b);
}

.ux-section-header:first-child { margin-top: 0; }

/* ── Comparison Table ────────────────────────────────────────── */

.ux-table-wrap {
  overflow-x: auto;
  margin: 1.5em 0;
  -webkit-overflow-scrolling: touch;
}

.ux-comparison-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--wp--preset--color--border, #e2e8f0);
  font-size: 0.95em;
}

.ux-comparison-table th {
  background: var(--wp--preset--color--primary, #2563eb);
  color: var(--wp--preset--color--background, #fff);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ux-comparison-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--wp--preset--color--border, #e2e8f0);
  vertical-align: top;
}

.ux-comparison-table tr:nth-child(even) {
  background: var(--wp--preset--color--card-bg, rgba(0, 0, 0, 0.02));
}

.ux-comparison-table tr:hover {
  background: var(--wp--preset--color--card-bg, rgba(0, 0, 0, 0.04));
}

/* ── Info Card ───────────────────────────────────────────────── */

.ux-info-card {
  border-left: 4px solid var(--wp--preset--color--accent, #f59e0b);
  background: var(--wp--preset--color--card-bg, #f8fafc);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 1.5em 0;
}

.ux-info-card-title {
  font-weight: 700;
  font-size: 1.05em;
  margin-bottom: 6px;
}

/* ── Key Point (highlight box) ───────────────────────────────── */

.ux-key-point {
  background: color-mix(in srgb, var(--wp--preset--color--primary, #2563eb) 8%, transparent);
  border-left: 4px solid var(--wp--preset--color--primary, #2563eb);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 1.5em 0;
}

.ux-key-point strong:first-child {
  display: block;
  margin-bottom: 4px;
}

/* ── Pros / Cons ─────────────────────────────────────────────── */

.ux-pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 1.5em 0;
}

.ux-pros {
  border-top: 3px solid #22c55e;
  padding: 16px;
  border-radius: 8px;
  background: #f0fdf4;
}

.ux-cons {
  border-top: 3px solid #ef4444;
  padding: 16px;
  border-radius: 8px;
  background: #fef2f2;
}

.ux-pros-title,
.ux-cons-title {
  font-weight: 700;
  font-size: 1.05em;
  margin-bottom: 8px;
}

.ux-pros ul,
.ux-cons ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ux-pros li,
.ux-cons li {
  padding: 4px 0;
}

/* ── FAQ ─────────────────────────────────────────────────────── */

.ux-faq {
  margin: 1.5em 0;
}

.ux-faq-item {
  border-bottom: 1px solid var(--wp--preset--color--border, #e2e8f0);
  padding: 16px 0;
}

.ux-faq-item:last-child { border-bottom: none; }

.ux-faq-q {
  font-weight: 700;
  font-size: 1.05em;
  margin-bottom: 6px;
  color: var(--wp--preset--color--foreground, #1e293b);
}

.ux-faq-a {
  color: var(--wp--preset--color--muted, #64748b);
  line-height: 1.6;
}

/* ── Step Block ──────────────────────────────────────────────── */

.ux-steps {
  margin: 1.5em 0;
}

.ux-step {
  display: flex;
  gap: 16px;
  margin: 16px 0;
  align-items: flex-start;
}

.ux-step-num {
  flex-shrink: 0;
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--wp--preset--color--primary, #2563eb);
  color: var(--wp--preset--color--background, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9em;
}

.ux-step-content {
  flex: 1;
  padding-top: 6px;
}

.ux-step-content strong:first-child {
  display: block;
  margin-bottom: 4px;
}

/* ── Badge / Tag ─────────────────────────────────────────────── */

.ux-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--wp--preset--color--primary, #2563eb);
  color: var(--wp--preset--color--background, #fff);
  vertical-align: middle;
}

.ux-badge--accent {
  background: var(--wp--preset--color--accent, #f59e0b);
}

.ux-badge--success {
  background: #22c55e;
  color: #fff;
}

.ux-badge--danger {
  background: #ef4444;
  color: #fff;
}

.ux-badge--muted {
  background: var(--wp--preset--color--muted, #94a3b8);
  color: #fff;
}

/* ── Blockquote (pull quote) ─────────────────────────────────── */

.ux-blog-post blockquote {
  border-left: 4px solid var(--wp--preset--color--secondary, #64748b);
  margin: 1.5em 0;
  padding: 12px 20px;
  font-style: italic;
  color: var(--wp--preset--color--muted, #64748b);
  background: var(--wp--preset--color--card-bg, rgba(0, 0, 0, 0.02));
  border-radius: 0 8px 8px 0;
}

/* ── Stat Card (numbers / metrics) ───────────────────────────── */

.ux-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin: 1.5em 0;
}

.ux-stat {
  text-align: center;
  padding: 20px 12px;
  border-radius: 12px;
  background: var(--wp--preset--color--card-bg, #f8fafc);
  border: 1px solid var(--wp--preset--color--border, #e2e8f0);
}

.ux-stat-value {
  font-size: 1.8em;
  font-weight: 800;
  color: var(--wp--preset--color--primary, #2563eb);
  line-height: 1.2;
}

.ux-stat-label {
  font-size: 0.85em;
  color: var(--wp--preset--color--muted, #64748b);
  margin-top: 4px;
}

/* ── Emoji List ──────────────────────────────────────────────── */

.ux-emoji-list {
  list-style: none;
  padding: 0;
  margin: 1em 0;
}

.ux-emoji-list li {
  padding: 6px 0;
  padding-left: 0;
}

/* ── CTA Block ───────────────────────────────────────────────── */

.ux-cta {
  background: linear-gradient(135deg,
    var(--wp--preset--color--primary, #2563eb),
    color-mix(in srgb, var(--wp--preset--color--primary, #2563eb) 80%, #000)
  );
  color: var(--wp--preset--color--background, #fff);
  padding: 32px;
  border-radius: 12px;
  text-align: center;
  margin: 2em 0;
}

.ux-cta-title {
  font-family: var(--wp--preset--font-family--heading, inherit);
  font-size: 1.4em;
  font-weight: 700;
  margin-bottom: 8px;
}

.ux-cta-text {
  opacity: 0.9;
  margin-bottom: 16px;
}

.ux-cta-btn {
  display: inline-block;
  padding: 10px 28px;
  border-radius: 8px;
  background: var(--wp--preset--color--background, #fff);
  color: var(--wp--preset--color--primary, #2563eb);
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.2s;
}

.ux-cta-btn:hover { opacity: 0.9; }

/* ── Divider ─────────────────────────────────────────────────── */

.ux-divider {
  border: none;
  height: 1px;
  background: var(--wp--preset--color--border, #e2e8f0);
  margin: 2em 0;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 768px) {
  .ux-pros-cons {
    grid-template-columns: 1fr;
  }

  .ux-comparison-table {
    font-size: 0.85em;
  }

  .ux-comparison-table th,
  .ux-comparison-table td {
    padding: 8px 10px;
  }

  .ux-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .ux-cta {
    padding: 24px 16px;
  }
}

@media (max-width: 480px) {
  .ux-stats {
    grid-template-columns: 1fr;
  }
}
