/* /shared.css — Shared styles for json.express content pages */

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

html {
  color-scheme: light dark;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: light-dark(#1f2328, #e6edf3);
  background: light-dark(#f6f8fa, #0d1117);
  min-height: 100vh;
}

/* === Layout === */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.page--wide {
  max-width: 960px;
}

/* === Typography === */
h1 {
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  line-height: 1.2;
}

h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 40px 0 16px;
}

h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 32px 0 12px;
}

p { margin-bottom: 12px; }

a {
  color: light-dark(#0969da, #58a6ff);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

code {
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  font-size: 13px;
  padding: 2px 6px;
  background: light-dark(#f3f4f6, #21262d);
  border-radius: 4px;
}

pre {
  background: light-dark(#f3f4f6, #161b22);
  border: 1px solid light-dark(#d0d7de, #30363d);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0;
}

pre code {
  padding: 0;
  background: transparent;
  font-size: 14px;
  line-height: 1.5;
}

/* === Navigation === */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
}

.nav-logo {
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -1px;
  color: inherit;
  text-decoration: none;
}
.nav-logo:hover { text-decoration: none; }

.nav-logo .brace {
  color: light-dark(#0969da, #58a6ff);
}

.nav-links {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

/* === Back link === */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: light-dark(#656d76, #8b949e);
  text-decoration: none;
  transition: color 0.15s;
}
.back:hover { color: light-dark(#1f2328, #e6edf3); text-decoration: none; }

/* === Cards === */
.card {
  padding: 20px;
  background: light-dark(#ffffff, #161b22);
  border: 1px solid light-dark(#d0d7de, #30363d);
  border-radius: 10px;
  transition: border-color 0.15s;
}
.card:hover {
  border-color: light-dark(#0969da, #58a6ff);
}

/* === CTA Button === */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: light-dark(#0969da, #238636);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}
.cta:hover { opacity: 0.9; text-decoration: none; color: #fff; }

.cta--secondary {
  background: light-dark(#f3f4f6, #21262d);
  color: light-dark(#1f2328, #e6edf3);
  border: 1px solid light-dark(#d0d7de, #30363d);
}
.cta--secondary:hover { color: light-dark(#1f2328, #e6edf3); }

/* === Feature grid === */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.feature-card {
  padding: 16px;
  background: light-dark(#ffffff, #161b22);
  border: 1px solid light-dark(#d0d7de, #30363d);
  border-radius: 10px;
}

.feature-card-icon {
  font-size: 20px;
  margin-bottom: 8px;
}

.feature-card-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.feature-card-desc {
  font-size: 14px;
  color: light-dark(#656d76, #8b949e);
  line-height: 1.5;
}

/* === Interactive demo area === */
.demo {
  background: light-dark(#f3f4f6, #0d1117);
  border: 1px solid light-dark(#d0d7de, #30363d);
  border-radius: 10px;
  padding: 20px;
  margin: 24px 0;
}

.demo-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: light-dark(#656d76, #8b949e);
  margin-bottom: 8px;
}

.demo textarea,
.demo-input {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  font-size: 14px;
  line-height: 1.5;
  background: light-dark(#ffffff, #161b22);
  color: inherit;
  border: 1px solid light-dark(#d0d7de, #30363d);
  border-radius: 6px;
  resize: vertical;
}

.demo-query {
  width: 100%;
  padding: 10px 12px;
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  font-size: 14px;
  background: light-dark(#ffffff, #161b22);
  color: inherit;
  border: 1px solid light-dark(#d0d7de, #30363d);
  border-radius: 6px;
  margin-top: 8px;
}

.demo-toolbar {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.demo-btn {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  background: light-dark(#0969da, #238636);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.demo-btn:hover { opacity: 0.9; }

.demo-btn--secondary {
  background: light-dark(#f3f4f6, #21262d);
  color: light-dark(#1f2328, #e6edf3);
  border: 1px solid light-dark(#d0d7de, #30363d);
}

.demo-output {
  margin-top: 12px;
  padding: 12px;
  background: light-dark(#ffffff, #161b22);
  border: 1px solid light-dark(#d0d7de, #30363d);
  border-radius: 6px;
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  font-size: 14px;
  min-height: 80px;
  white-space: pre-wrap;
  overflow-x: auto;
  word-break: break-word;
}

.demo-stats {
  margin-top: 8px;
  font-size: 13px;
  color: light-dark(#656d76, #8b949e);
}

.demo-status {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  margin-top: 12px;
}

.demo-status--valid {
  background: light-dark(#dafbe1, #0d1f0d);
  color: light-dark(#116329, #3fb950);
  border: 1px solid light-dark(#aceebb, #238636);
}

.demo-status--invalid {
  background: light-dark(#ffebe9, #1f0d0d);
  color: light-dark(#82071e, #f85149);
  border: 1px solid light-dark(#ffcecb, #da3633);
}

/* === Diff table (for /compare) === */
.diff-summary {
  display: flex;
  gap: 16px;
  margin: 16px 0;
  font-size: 14px;
  font-weight: 500;
}

.diff-added { color: light-dark(#116329, #3fb950); }
.diff-removed { color: light-dark(#82071e, #f85149); }
.diff-changed { color: light-dark(#7d4e00, #d29922); }

.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}

.diff-table th {
  text-align: left;
  padding: 8px 12px;
  background: light-dark(#f3f4f6, #161b22);
  border: 1px solid light-dark(#d0d7de, #30363d);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: light-dark(#656d76, #8b949e);
}

.diff-table td {
  padding: 6px 12px;
  border: 1px solid light-dark(#d0d7de, #30363d);
  font-family: "SF Mono", "Fira Code", monospace;
  word-break: break-all;
}

.diff-table tr.diff-row-added { background: light-dark(#dafbe1, #0d1f0d); }
.diff-table tr.diff-row-removed { background: light-dark(#ffebe9, #1f0d0d); }
.diff-table tr.diff-row-changed { background: light-dark(#fff8c5, #1f1d0d); }

.diff-type-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.diff-type-added { background: light-dark(#aceebb, #238636); color: light-dark(#116329, #fff); }
.diff-type-removed { background: light-dark(#ffcecb, #da3633); color: light-dark(#82071e, #fff); }
.diff-type-changed { background: light-dark(#fce49f, #9e6a03); color: light-dark(#7d4e00, #fff); }

/* === Compare layout === */
.compare-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .compare-inputs { grid-template-columns: 1fr; }
}

/* === Footer === */
.footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid light-dark(#d0d7de, #30363d);
  font-size: 13px;
  color: light-dark(#656d76, #8b949e);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* === Related tools === */
.related-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.related-tool-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: light-dark(#f3f4f6, #21262d);
  border: 1px solid light-dark(#d0d7de, #30363d);
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.related-tool-link:hover {
  border-color: light-dark(#0969da, #58a6ff);
  text-decoration: none;
}

/* === Blog list === */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.blog-post-card {
  display: block;
  padding: 20px;
  background: light-dark(#ffffff, #161b22);
  border: 1px solid light-dark(#d0d7de, #30363d);
  border-radius: 10px;
  transition: border-color 0.15s;
  text-decoration: none;
  color: inherit;
}
.blog-post-card:hover {
  border-color: light-dark(#0969da, #58a6ff);
  text-decoration: none;
}

.blog-post-date {
  font-size: 13px;
  color: light-dark(#656d76, #8b949e);
}

.blog-post-title {
  font-size: 18px;
  font-weight: 600;
  margin: 4px 0 8px;
  color: inherit;
}

.blog-post-excerpt {
  font-size: 14px;
  color: light-dark(#656d76, #8b949e);
  line-height: 1.5;
}

/* === Article === */
.article {
  line-height: 1.7;
}

.article-meta {
  font-size: 14px;
  color: light-dark(#656d76, #8b949e);
  margin-bottom: 32px;
}

.article h2 { margin-top: 48px; }
.article h3 { margin-top: 32px; }
.article img {
  max-width: 100%;
  border-radius: 8px;
  margin: 16px 0;
}
.article ul, .article ol {
  margin: 12px 0;
  padding-left: 24px;
}
.article li {
  margin-bottom: 6px;
}

/* Code blocks inside articles and general content */
.article pre.shiki {
  border: 1px solid light-dark(#d0d7de, #30363d);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0;
}

.article pre.shiki code {
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

/* Shiki dual theme support — switch to dark colors in dark mode */
@media (prefers-color-scheme: dark) {
  .shiki,
  .shiki span {
    color: var(--shiki-dark) !important;
    background-color: var(--shiki-dark-bg) !important;
    font-style: var(--shiki-dark-font-style) !important;
    font-weight: var(--shiki-dark-font-weight) !important;
    text-decoration: var(--shiki-dark-text-decoration) !important;
  }
}

.article code {
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  font-size: 13px;
  padding: 2px 6px;
  background: light-dark(#f3f4f6, #21262d);
  border-radius: 4px;
  color: light-dark(#0550ae, #79c0ff);
}

/* === Breadcrumb === */
.breadcrumb {
  font-size: 13px;
  color: light-dark(#656d76, #8b949e);
  margin-bottom: 24px;
}
.breadcrumb a {
  color: light-dark(#656d76, #8b949e);
}
.breadcrumb a:hover { color: light-dark(#1f2328, #e6edf3); }

/* === SEO-hidden h1 === */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* === Section divider (from about page) === */
.section {
  margin-bottom: 56px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: light-dark(#656d76, #8b949e);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid light-dark(#d0d7de, #30363d);
}

/* === Tree view styles (for /tree landing page) === */
.tree-container {
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  font-size: 14px;
  line-height: 1.5;
}

.tree-container .tree-toggle { cursor: pointer; }
.tree-container .tree-arrow { display: inline-block; width: 14px; font-size: 10px; transition: transform 0.15s; }
.tree-container .tree-arrow.collapsed { transform: rotate(-90deg); }
.tree-container .tree-key { color: light-dark(#6639ba, #d2a8ff); }
.tree-container .tree-preview { color: light-dark(#656d76, #8b949e); font-size: 12px; }
.tree-container .tree-children { margin-left: 20px; border-left: 1px solid light-dark(#d0d7de, #30363d); padding-left: 8px; }
.tree-container .tree-children.collapsed { display: none; }
.tree-container .tree-value-string { color: light-dark(#0a3069, #a5d6ff); }
.tree-container .tree-value-number { color: light-dark(#0550ae, #79c0ff); }
.tree-container .tree-value-boolean { color: light-dark(#cf222e, #ff7b72); }
.tree-container .tree-value-null { color: light-dark(#656d76, #8b949e); }

/* === JSON syntax highlighting (for /viewer landing page) === */
.json-output {
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.json-output .json-key { color: light-dark(#6639ba, #d2a8ff); }
.json-output .json-string { color: light-dark(#0a3069, #a5d6ff); }
.json-output .json-number { color: light-dark(#0550ae, #79c0ff); }
.json-output .json-boolean { color: light-dark(#cf222e, #ff7b72); }
.json-output .json-null { color: light-dark(#656d76, #8b949e); }
.json-output .json-bracket { color: light-dark(#656d76, #8b949e); }


/* === TypeScript syntax highlighting === */
.ts-output {
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.ts-output .ts-keyword { color: light-dark(#cf222e, #ff7b72); }
.ts-output .ts-interface-name { color: light-dark(#116329, #3fb950); }
.ts-output .ts-property { color: light-dark(#0550ae, #79c0ff); }
.ts-output .ts-type { color: light-dark(#6639ba, #d2a8ff); }
.ts-output .ts-punctuation { color: light-dark(#656d76, #8b949e); }

/* === Tagline === */
.tagline {
  font-size: 18px;
  color: light-dark(#656d76, #8b949e);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* === Quick-pick buttons (for /query page) === */
.quick-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.quick-pick {
  padding: 4px 10px;
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  font-size: 12px;
  background: light-dark(#f3f4f6, #21262d);
  color: light-dark(#656d76, #8b949e);
  border: 1px solid light-dark(#d0d7de, #30363d);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.quick-pick:hover {
  border-color: light-dark(#0969da, #58a6ff);
  color: light-dark(#1f2328, #e6edf3);
}

/* === Content table === */
.content-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.content-table th {
  text-align: left;
  padding: 10px 12px;
  background: light-dark(#f3f4f6, #161b22);
  border: 1px solid light-dark(#d0d7de, #30363d);
  font-weight: 600;
  font-size: 13px;
  color: light-dark(#656d76, #8b949e);
}

.content-table td {
  padding: 8px 12px;
  border: 1px solid light-dark(#d0d7de, #30363d);
}

.content-table code {
  font-size: 12px;
}

/* === CTA Banner === */
.cta-banner {
  margin: 40px 0;
  padding: 24px;
  background: light-dark(#f3f4f6, #161b22);
  border: 1px solid light-dark(#d0d7de, #30363d);
  border-radius: 10px;
  text-align: center;
}

.cta-banner p {
  color: light-dark(#656d76, #8b949e);
  font-size: 14px;
  margin-bottom: 16px;
}

/* === About page: Hero === */
.hero { margin-bottom: 64px; }
.hero-logo {
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  font-size: clamp(32px, 8vw, 48px);
  font-weight: 700;
  letter-spacing: -2px;
  margin-bottom: 8px;
  white-space: nowrap;
}
.hero-logo .brace { color: light-dark(#0969da, #58a6ff); }
.hero-tagline {
  font-size: 20px;
  color: light-dark(#656d76, #8b949e);
  font-weight: 400;
}
.hero-card {
  width: 100%;
  max-width: 600px;
  margin-top: 24px;
  border-radius: 10px;
  border: 1px solid light-dark(#d0d7de, #30363d);
}

/* === About page: Ideas grid === */
.ideas { display: grid; gap: 12px; }
.idea {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: light-dark(#ffffff, #161b22);
  border: 1px solid light-dark(#d0d7de, #30363d);
  border-radius: 10px;
  transition: border-color 0.15s;
}
.idea:hover { border-color: light-dark(#0969da, #58a6ff); }
.idea-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: light-dark(#f3f4f6, #21262d);
  border-radius: 8px;
}
.idea-content { min-width: 0; }
.idea-title { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.idea-desc { font-size: 14px; color: light-dark(#656d76, #8b949e); line-height: 1.5; }

/* === About page: Author card === */
.author {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: light-dark(#ffffff, #161b22);
  border: 1px solid light-dark(#d0d7de, #30363d);
  border-radius: 12px;
}
.author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid light-dark(#d0d7de, #30363d);
}
.author-info { min-width: 0; }
.author-name { font-weight: 600; font-size: 18px; margin-bottom: 4px; }
.author-bio { font-size: 14px; color: light-dark(#656d76, #8b949e); margin-bottom: 8px; }
.author-links { display: flex; gap: 16px; }
.author-links a {
  font-size: 13px;
  color: light-dark(#0969da, #58a6ff);
  text-decoration: none;
}
.author-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* === About page: Feedback buttons === */
.feedback-links { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.feedback-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: light-dark(#f3f4f6, #21262d);
  border: 1px solid light-dark(#d0d7de, #30363d);
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.feedback-link:hover { border-color: light-dark(#0969da, #58a6ff); }

/* === About page: Tools list === */
.tools-list { display: grid; gap: 8px; }
.tool-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: light-dark(#ffffff, #161b22);
  border: 1px solid light-dark(#d0d7de, #30363d);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.tool-item:hover { border-color: light-dark(#0969da, #58a6ff); }
.tool-name { font-weight: 600; font-size: 14px; }
.tool-desc { font-size: 13px; color: light-dark(#656d76, #8b949e); }

/* === Responsive === */
@media (max-width: 640px) {
  .nav-links { gap: 12px; font-size: 13px; }
  .features { grid-template-columns: 1fr; }
  .page { padding: 40px 16px 60px; }
  .author { flex-direction: column; text-align: center; }
  .author-links { justify-content: center; }
}
