/*
 * Payments Hub — ph-* namespaced stylesheet
 *
 * Boundary: this stylesheet styles ph-* selectors only. No rule here may
 * apply to ce-* (citation_engine) selectors. Do not import from
 * be-editorial.css or any citation-engine CSS.
 *
 * Spec: editorial-os/payments-hub/06-citation-engine-and-data-model.md §2.2,
 *       editorial-os/payments-hub/07-launch-presentation-and-maintenance.md §3.5.
 *
 * Phase 6 build — skeleton; visual polish lands in step 6.7+.
 */

/* ── Layout primitives ─────────────────────────────────────────── */

.ph-hub,
.ph-flagship,
.ph-benchmark,
.ph-methodology {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 96px;
  font-family: var(--be-body-font, system-ui, -apple-system, sans-serif);
  color: #1d1d1f;
  line-height: 1.55;
}

.ph-hub__title,
.ph-flagship__title,
.ph-benchmark__title,
.ph-methodology__title {
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 12px;
}

.ph-hub__last-update,
.ph-flagship__subhead,
.ph-benchmark__subhead,
.ph-methodology__subhead {
  color: #4a4a4f;
  font-size: 1.0625rem;
  margin: 0 0 20px;
  max-width: 68ch;
}

/* ── Trust strip (universal) ──────────────────────────────────── */

.ph-trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  padding: 12px 16px;
  margin: 0 0 32px;
  border: 1px solid #e2e2e6;
  border-radius: 8px;
  background: #fafafb;
  font-size: 0.9375rem;
  color: #2c2c30;
}

.ph-trust-strip__item {
  display: inline-flex;
  align-items: center;
}

.ph-trust-strip__item time {
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}

.ph-trust-strip__methodology a {
  color: #1f4ad6;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 640px) {
  .ph-trust-strip {
    flex-direction: column;
    gap: 6px 0;
  }
}

/* ── Hub home directory ───────────────────────────────────────── */

.ph-hub__charter {
  margin: 0 0 40px;
}

.ph-hub__directory h2 {
  font-size: 1.375rem;
  margin: 0 0 16px;
}

.ph-hub__directory-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.ph-hub__directory-item {
  border: 1px solid #e2e2e6;
  border-radius: 8px;
  padding: 16px 18px;
  background: #fff;
}

.ph-hub__directory-link {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.ph-hub__directory-title {
  font-weight: 600;
  font-size: 1.0625rem;
}

.ph-hub__directory-class {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c6c74;
}

.ph-hub__directory-purpose {
  font-size: 0.9375rem;
  color: #4a4a4f;
  margin: 6px 0 4px;
}

.ph-hub__directory-verified {
  font-size: 0.8125rem;
  color: #6c6c74;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.ph-hub__directory-empty {
  color: #6c6c74;
  font-style: italic;
}

.ph-hub__methodology-link a {
  color: #1f4ad6;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

.ph-hub__footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #e2e2e6;
}

/* ── Article body shared ──────────────────────────────────────── */

.ph-flagship__article,
.ph-benchmark__article,
.ph-methodology__article {
  font-size: 1.0625rem;
  line-height: 1.7;
}

.ph-flagship__article h2,
.ph-benchmark__article h2,
.ph-methodology__article h2 {
  font-size: 1.5rem;
  margin: 40px 0 14px;
  padding-top: 8px;
  border-top: 1px solid #e2e2e6;
}

.ph-flagship__article h3,
.ph-benchmark__article h3,
.ph-methodology__article h3 {
  font-size: 1.1875rem;
  margin: 28px 0 10px;
}

/* ── Hero metric cards (Class A flagship) ─────────────────────── */

.ph-flagship__hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0 40px;
}

.ph-headline-card {
  border: 1px solid #e2e2e6;
  border-radius: 8px;
  padding: 18px 20px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ph-headline-card__label {
  font-size: 0.875rem;
  color: #4a4a4f;
}

.ph-headline-card__value {
  font-size: 1.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.ph-headline-card__period {
  font-size: 0.8125rem;
  color: #6c6c74;
}

.ph-headline-card__attribution {
  font-size: 0.75rem;
  color: #6c6c74;
  margin-top: 4px;
  border-top: 1px solid #f0f0f3;
  padding-top: 6px;
}

/* ── Source attribution line (per metric) ─────────────────────── */

.ph-source-line {
  font-size: 0.875rem;
  color: #4a4a4f;
  margin: 4px 0 0;
}

.ph-source-line__verified {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── Caveats ──────────────────────────────────────────────────── */

.ph-caveat {
  font-size: 0.9375rem;
  font-style: italic;
  color: #4a4a4f;
  margin: 8px 0 16px;
  padding: 0;
  border: 0;
}

/* ── Tables (benchmark / breakdown / comparison) ──────────────── */

.ph-table-wrap {
  overflow-x: auto;
  margin: 16px 0 24px;
  border: 1px solid #e2e2e6;
  border-radius: 8px;
}

.ph-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.ph-table caption {
  caption-side: top;
  text-align: left;
  font-size: 0.875rem;
  color: #4a4a4f;
  padding: 10px 14px;
  background: #fafafb;
  border-bottom: 1px solid #e2e2e6;
}

.ph-table th,
.ph-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f3;
  vertical-align: top;
}

.ph-table thead th {
  background: #f5f5f7;
  font-weight: 600;
  font-size: 0.875rem;
}

.ph-table tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 720px) {
  .ph-table th:first-child,
  .ph-table td:first-child {
    position: sticky;
    left: 0;
    background: inherit;
  }
}

/* Tier marker rows (benchmark only) */
.ph-table tr.ph-row--regulated   { background: #effbf3; }
.ph-table tr.ph-row--negotiated  { background: #fff7e8; }
.ph-table tr.ph-row--scheme-only { background: #f3f3f5; }

/* ── Sources block ────────────────────────────────────────────── */

.ph-sources-block {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #e2e2e6;
}

.ph-sources-block h2 {
  font-size: 1.25rem;
  margin: 0 0 12px;
  border-top: 0;
  padding-top: 0;
}

/* ── Correction notice ────────────────────────────────────────── */

.ph-correction-notice {
  border-left: 3px solid #c44a3b;
  background: #fdf3f1;
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 6px 6px 0;
  font-size: 0.9375rem;
}

/* ── Charts (server-rendered SVG) ─────────────────────────────── */

.ph-chart {
  margin: 16px 0 24px;
}

.ph-chart svg {
  width: 100%;
  height: auto;
  display: block;
}
