/* ==========================================================================
   APILAGEAI — SUB-PAGES SHARED STYLES
   Inherits design tokens from index.css
   ========================================================================== */

/* Page Hero Banner */
.page-hero {
  padding: 96px 0 72px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(0, 117, 235, 0.07), transparent);
  pointer-events: none;
}

body.theme-dark .page-hero::before {
  background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(37, 140, 251, 0.08), transparent);
}

.page-hero-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.page-hero-breadcrumb a {
  color: var(--notion-blue);
  font-weight: 500;
  transition: var(--transition);
}

.page-hero-breadcrumb a:hover { opacity: 0.75; }

.page-hero-breadcrumb span { color: var(--text-tertiary); }

.page-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--notion-blue-soft);
  color: var(--notion-blue);
  border: 1px solid var(--notion-blue-border);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: inline-flex;
}

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 20px;
  max-width: 760px;
}

.page-hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.7;
  margin-bottom: 36px;
}

.page-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.page-hero-stats {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.page-hero-stat-item {
  display: flex;
  flex-direction: column;
}

.page-hero-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.page-hero-stat-label {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Page Content Area */
.page-content {
  padding: 72px 0;
}

/* Card Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.cards-grid-2 {
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
}

/* Info Card */
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.info-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.info-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
  background: var(--bg-secondary);
}

.info-card-icon.blue { background: var(--notion-blue-soft); }
.info-card-icon.red  { background: var(--apilage-red-soft); }

.info-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.info-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.info-card-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
}

.info-card-tag.green  { background: #ecfdf5; color: #059669; }
.info-card-tag.amber  { background: #fffbeb; color: #b45309; }
.info-card-tag.blue   { background: var(--notion-blue-soft); color: var(--notion-blue); }
.info-card-tag.red    { background: var(--apilage-red-soft); color: var(--apilage-red); }
.info-card-tag.purple { background: #f5f3ff; color: #7c3aed; }

body.theme-dark .info-card-tag.green  { background: #052e16; color: #34d399; }
body.theme-dark .info-card-tag.amber  { background: #422006; color: #fbbf24; }
body.theme-dark .info-card-tag.purple { background: #2e1065; color: #a78bfa; }

/* Section title / label */
.section-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--notion-blue);
  margin-bottom: 12px;
}

.section-title-lg {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 580px;
}

/* Divider */
.section-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 56px 0;
}

/* Contributor / Profile Card */
.contributor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.contributor-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

.contributor-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--border-light);
}

.contributor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contributor-info { flex: 1; min-width: 0; }

.contributor-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.contributor-role {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.contributor-score {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  background: var(--notion-blue-soft);
  color: var(--notion-blue);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.score-badge.gold { background: #fffbeb; color: #b45309; }
body.theme-dark .score-badge.gold { background: #422006; color: #fbbf24; }

.contributor-rank {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-tertiary);
  letter-spacing: -0.02em;
  min-width: 32px;
  text-align: right;
}

.rank-1 .contributor-rank { color: #f59e0b; }
.rank-2 .contributor-rank { color: var(--text-secondary); }
.rank-3 .contributor-rank { color: #cd7c2f; }

/* Sub-page FAQ */
.sub-faq-list { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }

.sub-faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.sub-faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 22px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  gap: 16px;
}

.sub-faq-question:hover { background: var(--bg-secondary); }

.sub-faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  color: var(--text-tertiary);
}

.sub-faq-item.open .sub-faq-chevron { transform: rotate(180deg); }

.sub-faq-answer {
  padding: 0 22px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), padding 0.2s ease;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.sub-faq-item.open .sub-faq-answer {
  max-height: 600px;
  padding-bottom: 20px;
}

/* Status indicator */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
  animation: pulse-green 2s infinite;
}

.status-dot.amber { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.status-dot.red   { background: var(--apilage-red); box-shadow: 0 0 0 3px rgba(234,57,67,0.2); }

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
  50%       { box-shadow: 0 0 0 6px rgba(16,185,129,0.1); }
}

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 0; margin-top: 24px; }

.timeline-item {
  display: flex;
  gap: 20px;
  position: relative;
  padding-bottom: 32px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-line-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--notion-blue);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 2px var(--notion-blue);
  flex-shrink: 0;
  margin-top: 4px;
}

.timeline-connector {
  flex: 1;
  width: 2px;
  background: var(--border-light);
  margin-top: 6px;
}

.timeline-content { flex: 1; }

.timeline-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.timeline-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.timeline-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Job card */
.job-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: var(--transition);
}

.job-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

.job-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.job-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.job-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.job-meta-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.job-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-top: 14px;
}

/* Code block */
.code-block {
  background: #0f1117;
  border-radius: var(--radius-md);
  padding: 24px 28px;
  overflow-x: auto;
  position: relative;
}

.code-block pre {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: #e2e8f0;
  white-space: pre;
}

.code-tag {
  display: inline-block;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.code-label {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 11px;
  font-weight: 700;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tok-kw   { color: #f472b6; }
.tok-str  { color: #86efac; }
.tok-key  { color: #93c5fd; }
.tok-val  { color: #fde68a; }
.tok-cmt  { color: #6b7280; }

/* Legal prose */
.prose-section { max-width: 780px; }

.prose-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--border-light);
}

.prose-section h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.prose-section p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.prose-section ul {
  margin: 12px 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prose-section ul li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  list-style: disc;
  padding-left: 4px;
}

.prose-section .last-updated {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Two-column layout */
.two-col-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

/* Highlight box */
.highlight-box {
  background: var(--notion-blue-soft);
  border: 1px solid var(--notion-blue-border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-top: 40px;
}

.highlight-box h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--notion-blue);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.highlight-box p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Steps */
.steps-list {
  counter-reset: steps;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}

.step-item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--notion-blue);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.step-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* System status */
.status-table {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 24px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: var(--bg-card);
  gap: 16px;
  border-bottom: 1px solid var(--border-light);
}

.status-row:last-child { border-bottom: none; }

.status-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.status-row-detail {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.status-label {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: var(--radius-full);
}

.status-label.operational { background: #ecfdf5; color: #059669; }
.status-label.degraded    { background: #fffbeb; color: #b45309; }
.status-label.outage      { background: var(--apilage-red-soft); color: var(--apilage-red); }

body.theme-dark .status-label.operational { background: #052e16; color: #34d399; }
body.theme-dark .status-label.degraded    { background: #422006; color: #fbbf24; }

/* Ambassador card */
.ambassador-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.ambassador-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
  transform: translateY(-3px);
}

.ambassador-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--notion-blue), #7c3aed);
}

.ambassador-emoji { font-size: 40px; margin-bottom: 14px; }

.ambassador-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.ambassador-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--notion-blue);
  margin-bottom: 40px;
  transition: var(--transition);
}

.back-link:hover { opacity: 0.75; }

/* CTA strip */
.cta-strip {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 64px;
}

.cta-strip-text h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.cta-strip-text p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .two-col-layout { grid-template-columns: 1fr; gap: 32px; }
  .cards-grid-2   { grid-template-columns: 1fr; }
  .page-hero h1   { font-size: 1.75rem; }
  .page-hero-stats { gap: 20px; }
}

@media (max-width: 640px) {
  .page-hero { padding: 64px 0 48px; }
  .page-content { padding: 48px 0; }
  .cta-strip { padding: 28px 24px; }
}

/* Responsive Data Table Styles */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  margin: 28px 0;
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.content-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14.5px;
}

.content-table thead {
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-medium);
}

.content-table th {
  padding: 16px 20px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  white-space: nowrap;
}

.content-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  line-height: 1.6;
  vertical-align: top;
}

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

.content-table tbody tr:hover {
  background: var(--bg-secondary);
}

.content-table td strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Scenario Card for Case Studies */
.scenario-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scenario-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.scenario-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scenario-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--notion-blue-soft);
  color: var(--notion-blue);
  font-weight: 800;
  font-size: 14px;
}

.scenario-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.scenario-block {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  border-left: 3px solid var(--notion-blue);
}

.scenario-example {
  background: rgba(0, 117, 235, 0.04);
  border: 1px dashed var(--notion-blue-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 14px;
  font-style: italic;
  color: var(--text-primary);
}

body.theme-dark .scenario-example {
  background: rgba(37, 140, 251, 0.06);
}

.scenario-supports {
  font-size: 13.5px;
  color: var(--text-tertiary);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.scenario-supports strong {
  color: var(--notion-blue);
}

/* Callout Box */
.callout-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--notion-blue);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 24px 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.callout-box.warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
  color: #78350f;
}

body.theme-dark .callout-box.warning {
  background: #422006;
  color: #fef3c7;
}

.callout-box.danger {
  border-left-color: var(--apilage-red);
  background: var(--apilage-red-soft);
  color: var(--text-primary);
}

/* Sub-page Footer Layout */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  padding: 64px 0 24px 0;
  margin-top: 64px;
}

.footer-container,
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-col-brand {
  display: flex;
  flex-direction: column;
}

.footer-col {
  display: flex;
  flex-direction: column;
}

.footer-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 13.5px;
  color: var(--text-secondary);
  transition: var(--transition);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-social-links,
.social-links-footer {
  display: flex;
  gap: 14px;
  color: var(--text-secondary);
  align-items: center;
  margin-top: 6px;
}

@media (max-width: 900px) {
  .footer-container,
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 600px) {
  .footer-container,
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

