/* ============================================================================
   Subprocessors Page — Dragon Skin v4
   Compact hero + single prose section (mirrors faq / about idioms)
   ============================================================================ */

/* ─────────────── HERO ─────────────── */
.subs-hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(280px, 40vh, 440px);
  /* dark gradient is the fallback; a CMS hero photo (set as background-image
     by subprocessors.js) overrides it. Matches .faq-hero / .about-hero. */
  background: linear-gradient(135deg, #0f1a14 0%, #1C1912 40%, #12100A 100%);
  background-size: cover;
  background-position: center;
}

.subs-hero .hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px 60px;
}

.subs-hero .hero-overlay-title {
  font: var(--cm-w-bold) clamp(32px, 6vw, 72px)/1.05 var(--cm-font-display);
  margin: 0;
}

/* ─────────────── PROSE SECTION ─────────────── */
.subs-section {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) clamp(16px, 5vw, 40px) clamp(60px, 8vw, 100px);
}

/* ─────────────── PROSE BODY (data-content="body") ─────────────── */
.subs-body {
  font: var(--cm-w-regular) clamp(15px, 1.8vw, 17px)/1.7 var(--cm-font-ui);
  color: var(--cm-text-secondary);
}

.subs-body h1,
.subs-body h2,
.subs-body h3 {
  font-family: var(--cm-font-display);
  font-weight: var(--cm-w-bold);
  color: var(--cm-text-primary);
  letter-spacing: 0.02em;
  margin: 1.6em 0 0.6em;
  line-height: 1.15;
}
.subs-body h1 { font-size: clamp(26px, 4vw, 40px); }
.subs-body h2 { font-size: clamp(22px, 3vw, 30px); }
.subs-body h3 { font-size: clamp(18px, 2.4vw, 22px); }
.subs-body > :first-child { margin-top: 0; }

.subs-body p { margin: 0 0 1.2em; }
.subs-body p:last-child { margin-bottom: 0; }

.subs-body ul,
.subs-body ol {
  margin: 0.5em 0 1.2em 1.2em;
  padding: 0;
}
.subs-body li { margin-bottom: 0.55em; }

.subs-body a {
  color: var(--cm-text-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.subs-body a:hover {
  color: color-mix(in srgb, var(--cm-text-link) 80%, #fff);
}

.subs-body strong {
  color: var(--cm-text-primary);
  font-weight: var(--cm-w-bold);
}
.subs-body em { font-style: italic; }

.subs-body code {
  background: var(--cm-bg-elevated);
  border: 1px solid var(--cm-border-subtle);
  border-radius: var(--cm-radius-sm);
  padding: 1px 5px;
  font-size: 0.875em;
}

/* ─────────────── MARKDOWN TABLES ─────────────── */
/* Tables render as direct children of .subs-body with no wrapper element, so
   the table itself becomes the scroll container on narrow viewports. */
.subs-body table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 1.4em;
  font-size: 0.875em;
}
.subs-body table:last-child { margin-bottom: 0; }

.subs-body th,
.subs-body td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--cm-border-subtle);
}

.subs-body thead th {
  background: var(--cm-bg-elevated);
  color: var(--cm-text-primary);
  font-weight: var(--cm-w-bold);
  border-bottom: 1px solid var(--cm-border-subtle);
}

.subs-body tbody tr:last-child td { border-bottom: none; }

/* ─────────────── SKELETON LOADING ─────────────── */
.subs-body.skeleton {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  border-radius: var(--cm-radius-lg);
  background: var(--cm-bg-surface);
}
.subs-body.skeleton > * { visibility: hidden; }
.subs-body.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--cm-bg-elevated) 60%, transparent) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: skeletonPulse 1.6s ease-in-out infinite;
}

@keyframes skeletonPulse {
  0% { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

/* ─────────────── EMPTY STATE ─────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--cm-text-tertiary);
  font: var(--cm-w-medium) 16px/1.5 var(--cm-font-ui);
}

/* ─────────────── RESPONSIVE ─────────────── */
@media (max-width: 600px) {
  .subs-hero .hero-overlay { padding: 64px 18px 48px; }
  .subs-body th,
  .subs-body td { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .subs-body.skeleton::after { animation: none; }
}
