/* ==========================================================================
   AutoBridge Systems - Page Content Primitives (v1)
   ==========================================================================

   Class set for custom-kind hub pages: layout primitives, typography,
   callouts, grids, steps. All classes prefixed `abs-` so they never collide
   with the existing hero/card/subpage chrome in globals.css.

   This file is loaded by src/app/layout.tsx so every page on share-app sees
   it. Custom-kind page bodies can reference these classes and inherit
   styling from the document level. Brand evolution: edit this file, every
   page that uses the classes picks it up on next deploy without touching
   any DB rows.

   All colors / spacing / radii come from colors_and_type.v2.css tokens.
   ========================================================================== */

/* ---------- Page shell ---------- */

.abs-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 56px;
  width: 100%;
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--fg-primary);
  line-height: 1.65;
}

.abs-page--wide { max-width: 1180px; }
.abs-page--narrow { max-width: 720px; }

.abs-page-back {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: #fff;
}
.abs-back {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  text-decoration: none;
}
.abs-back:hover { color: var(--primary-500); }

.abs-page-footer {
  max-width: 1180px;
  margin: 32px auto 0;
  padding: 24px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

/* ---------- Typography ---------- */

.abs-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand-cyan);
  margin: 0 0 12px;
}

.abs-h1 {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: 0 0 16px;
  color: var(--fg-primary);
}
.abs-h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.2;
  margin: 48px 0 16px;
  color: var(--fg-primary);
}
.abs-h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.3;
  margin: 32px 0 12px;
  color: var(--fg-primary);
}
.abs-h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--fg-primary);
}

.abs-lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg-secondary);
  margin: 0 0 32px;
  max-width: 700px;
}

.abs-grad {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Sections ---------- */

.abs-section {
  margin: 56px 0;
}
.abs-section:first-child { margin-top: 0; }
.abs-section:last-child { margin-bottom: 0; }

.abs-section-header {
  margin-bottom: 24px;
}
.abs-section-header .abs-eyebrow { margin-bottom: 8px; }
.abs-section-header .abs-h2 { margin-top: 0; }

.abs-divider {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: 56px 0;
}

/* ---------- Prose (paragraphs, lists, links inside custom bodies) ---------- */

.abs-prose p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg-secondary);
  margin: 0 0 16px;
}
.abs-prose ul, .abs-prose ol {
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg-secondary);
  margin: 0 0 16px;
  padding-left: 24px;
}
.abs-prose li { margin: 6px 0; }
.abs-prose li > p { margin-bottom: 8px; }
.abs-prose a {
  color: var(--primary-500);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.abs-prose a:hover { color: var(--primary-400); }
.abs-prose strong { color: var(--fg-primary); font-weight: 600; }
.abs-prose code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .92em;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--gray-100);
  color: var(--primary-700);
}
.abs-prose pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--gray-100);
  color: var(--primary-700);
  overflow-x: auto;
  margin: 0 0 16px;
}
.abs-prose pre code { background: none; padding: 0; }

/* ---------- Callouts ---------- */

.abs-callout {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--info-fg);
  background: var(--info-100);
  color: var(--fg-primary);
  margin: 24px 0;
  font-size: 15px;
  line-height: 1.6;
}
.abs-callout strong { font-weight: 700; }
.abs-callout p { margin: 0; }
.abs-callout p + p { margin-top: 8px; }

.abs-callout--note    { border-left-color: var(--info-fg);    background: var(--info-100); }
.abs-callout--success { border-left-color: var(--success-fg); background: var(--success-100); }
.abs-callout--warning { border-left-color: var(--warning-fg); background: var(--warning-100); }
.abs-callout--error   { border-left-color: var(--error-fg);   background: var(--error-100); }

/* ---------- Grids ---------- */

.abs-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 24px 0;
}
.abs-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 24px 0;
}
@media (max-width: 720px) {
  .abs-grid-2, .abs-grid-3 { grid-template-columns: 1fr; }
}

/* ---------- Cards (content cards, not the dark hover-halo landing cards) ---------- */

.abs-card {
  padding: 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  /* Token, not #fff, so cards stay readable if the theme ever goes dark
     (text inherits --fg-primary). In the current light theme this resolves
     to #fff, so no visual change. */
  background: var(--surface-card);
  color: var(--fg-primary);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--motion-duration-base) var(--motion-ease-standard);
}
.abs-card:hover { box-shadow: var(--shadow-card-hover); }
/* Stacked cards must never touch. Adjacent sibling cards get vertical spacing
   so a section with two or more cards reads as separate surfaces without each
   page having to add its own gap. Cards laid out in an abs-grid still rely on
   the grid gap; this is the safety net for plain stacking. */
.abs-card + .abs-card { margin-top: var(--space-4); }
.abs-card .abs-h3 { margin-top: 0; }
.abs-card p:last-child { margin-bottom: 0; }
.abs-card a {
  color: var(--primary-500);
  text-decoration: none;
  font-weight: 600;
}
.abs-card a:hover { text-decoration: underline; }

.abs-card--link {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
}
.abs-card--link:hover {
  border-color: var(--brand-cyan);
}

/* ---------- Step list (numbered phases / sequence) ---------- */

.abs-step-list {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  counter-reset: abs-step;
}
.abs-step-list > li {
  counter-increment: abs-step;
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.abs-step-list > li:last-child { border-bottom: 0; }
.abs-step-list > li::before {
  content: counter(abs-step);
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.abs-step-list .abs-step-body { flex: 1; }
.abs-step-list .abs-step-body > :first-child { margin-top: 0; }
.abs-step-list .abs-step-body > :last-child { margin-bottom: 0; }

/* ---------- Meta list (label/value pairs, like hero-meta but for content) ---------- */

.abs-meta-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 24px;
  margin: 16px 0 24px;
  font-size: 15px;
}
.abs-meta-list dt {
  font-weight: 600;
  color: var(--fg-tertiary);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .04em;
  padding-top: 4px;
}
.abs-meta-list dd {
  margin: 0;
  color: var(--fg-primary);
}

/* ---------- Pills + buttons ---------- */

.abs-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--sky-100);
  color: var(--primary-500);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.4;
}
.abs-pill--brand {
  background: var(--brand-gradient-pill);
  color: #fff;
}
.abs-pill--success { background: var(--success-100); color: var(--success-fg); }
.abs-pill--warning { background: var(--warning-100); color: var(--warning-fg); }
.abs-pill--error   { background: var(--error-100);   color: var(--error-fg); }

.abs-btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  background: var(--brand-gradient-pill);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  box-shadow: var(--shadow-pill-btn);
  transition: transform var(--motion-duration-fast) var(--motion-ease-standard);
}
.abs-btn:hover { transform: translateY(-1px); }
.abs-btn--ghost {
  background: transparent;
  color: var(--primary-500);
  border: 1px solid var(--primary-500);
  box-shadow: none;
}
.abs-btn--ghost:hover {
  background: var(--primary-500);
  color: #fff;
}

/* ---------- Tables ---------- */

.abs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
}
.abs-table th, .abs-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.abs-table th {
  font-weight: 600;
  color: var(--fg-tertiary);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .04em;
  background: var(--gray-50);
}
.abs-table tr:hover td { background: var(--gray-50); }

/* ---------- Quote ---------- */

.abs-quote {
  border-left: 4px solid var(--brand-cyan);
  padding: 8px 0 8px 20px;
  margin: 24px 0;
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg-secondary);
  font-style: italic;
}
.abs-quote cite {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  font-style: normal;
  color: var(--fg-tertiary);
  font-weight: 600;
  letter-spacing: .02em;
}

/* ---------- Hero (dark variant for landing pages) ---------- */

.abs-hero {
  background: var(--gradient-hero-dark), var(--gradient-safe-fallback);
  color: #fff;
  padding: 80px 24px 96px;
  position: relative;
  overflow: hidden;
}
.abs-hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.abs-hero-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand-cyan-bright);
  margin: 0 0 16px;
}
.abs-hero-title {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.05;
  margin: 0 0 20px;
  color: #fff;
}
.abs-hero-title .abs-grad {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.abs-hero-lede {
  font-size: 20px;
  line-height: 1.5;
  color: rgba(255,255,255,.85);
  max-width: 720px;
  margin: 0 0 28px;
}
.abs-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  font-size: 14px;
  color: rgba(255,255,255,.75);
}
.abs-hero-meta b { color: #fff; font-weight: 600; display: block; margin-bottom: 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-cyan-bright); }

@media (max-width: 720px) {
  .abs-hero { padding: 56px 20px 72px; }
  .abs-hero-title { font-size: 36px; }
  .abs-hero-lede { font-size: 17px; }
  .abs-h1 { font-size: 30px; }
  .abs-h2 { font-size: 22px; }
}
