/*
 * trocp-page.css
 * Shared stylesheet for component/tool library pages.
 *
 * Contains: design tokens, reset, body/typography defaults,
 * and all documentation-level classes (comp-header, demo-container,
 * api-table, code-block, etc.).
 *
 * Usage:
 *   <link rel="stylesheet" href="trocp-page.css">
 *
 * Each standalone page in the library iframe links this file
 * so they share a consistent visual language without duplicating CSS.
 */


/* ─── Design Tokens ─── */

:root {
  --ink: #2c2c2c;
  --ink-mid: #444;
  --ink-light: #888;
  --ink-muted: #999;
  --ink-faint: #aaa;
  --paper: #ffffff;
  --paper-warm: #faf9f7;
  --paper-field: #f5f4f2;
  --accent: #8b7355;
  --accent-hover: #6d5a43;
  --accent-glow: rgba(139,115,85,0.08);
  --accent-light: rgba(139,115,85,0.15);
  --burgundy: #8b4a4a;
  --navy: #4a5a6b;
  --green: #4a6b5a;
  --gold: #b8a060;
  --border: #e2e0dc;
  --border-light: #ece8e2;
  --border-divider: #f0eeeb;
  --border-heavy: #d4d0c8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(44,36,24,0.06);
  --radius: 8px;
  --radius-sm: 6px;
  --font-serif: 'Crimson Pro', Georgia, serif;
  --font-mono: 'JetBrains Mono', Menlo, monospace;
}


/* ─── Reset & Base ─── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-serif);
  background: var(--paper-field);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  padding: 48px 64px 120px;
  max-width: 900px;
}


/* ─── Component Header ─── */

.comp-header {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.comp-header .comp-tag-display {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 12px;
}

.comp-header h2 {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
  color: var(--ink);
}

.comp-header p {
  font-size: 16px;
  color: var(--ink-mid);
  line-height: 1.7;
  margin: 0;
}

.comp-header .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
  margin-top: 10px;
}

.status-badge.built {
  background: rgba(74,107,90,0.1);
  color: var(--green);
}

.status-badge.planned {
  background: rgba(139,115,85,0.1);
  color: var(--accent);
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-badge.built::before { background: var(--green); }
.status-badge.planned::before { background: var(--accent); }


/* ─── Sections ─── */

.comp-section {
  margin-bottom: 40px;
}

.comp-section h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.comp-section p {
  margin-bottom: 12px;
  color: var(--ink-mid);
  line-height: 1.75;
}


/* ─── Demo Container ─── */

.demo-container {
  background: var(--paper);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}

.demo-header {
  padding: 10px 18px;
  background: var(--paper-field);
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demo-body {
  padding: 32px 28px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-placeholder {
  color: var(--ink-light);
  font-style: italic;
  font-size: 14px;
  text-align: center;
}


/* ─── Code Block ─── */

.code-block {
  background: var(--paper);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}

.code-block-header {
  padding: 8px 18px;
  background: var(--paper-field);
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-block pre {
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  overflow-x: auto;
  margin: 0;
  background: none;
}

.code-block pre .tag { color: var(--burgundy); }
.code-block pre .attr { color: var(--navy); }
.code-block pre .str { color: var(--green); }
.code-block pre .kw { color: var(--accent); }
.code-block pre .comment { color: var(--ink-muted); }


/* ─── API Table ─── */

.api-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.api-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  padding: 10px 16px;
  border-bottom: 2px solid var(--border);
}

.api-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--ink-mid);
  vertical-align: top;
}

.api-table tr:last-child td {
  border-bottom: none;
}

.api-table tbody tr:hover {
  background: var(--accent-glow);
}

.api-table code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--paper-field);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}


/* ─── Events List ─── */

.event-list {
  margin: 12px 0;
}

.event-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

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

.event-item code {
  flex-shrink: 0;
}

.event-item p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-mid);
  margin: 0;
}


/* ─── Inline Code ─── */

code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--paper-field);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}


/* ─── Responsive ─── */

@media (max-width: 700px) {
  body {
    padding: 32px 20px 80px;
  }

  .comp-header h2 {
    font-size: 24px;
  }
}
