/* JsonMint — Clean, fast, AdSense-friendly developer tools stylesheet */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #15803d;
  --success-bg: #dcfce7;
  --error: #b91c1c;
  --error-bg: #fee2e2;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

:not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-alt);
  padding: 1px 5px;
  border-radius: 4px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
}

.nav-toggle {
  display: none;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.94rem;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
  text-decoration: none;
}

/* Page Intro */
.hero-compact {
  padding: 28px 0 18px;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.breadcrumb a {
  color: var(--text-muted);
}

.hero-compact h1 {
  margin: 0 0 8px;
  font-size: clamp(1.55rem, 2.5vw, 2.05rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 740px;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 600;
}

/* Tool Card & Workspace */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 18px;
  margin-bottom: 32px;
  min-width: 0;
  max-width: 100%;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn:hover {
  background: var(--surface-alt);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.82rem;
}

.select-input,
.text-input {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text);
  background: var(--surface);
  min-width: 0;
  max-width: 100%;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.editor-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.pane-title {
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.code-area {
  width: 100%;
  min-height: 360px;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
  background: #fcfdff;
  resize: vertical;
  tab-size: 2;
}

.code-area:focus,
.text-input:focus,
.select-input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  border-color: var(--primary);
}

.code-output-box {
  min-height: 360px;
  max-height: 540px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: 0.87rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  font-size: 0.86rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
}

.status-badge.valid {
  background: var(--success-bg);
  color: var(--success);
}

.status-badge.invalid {
  background: var(--error-bg);
  color: var(--error);
}

.status-badge.neutral {
  background: var(--border);
  color: var(--text-muted);
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-top: 12px;
}

.alert-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid #fecaca;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.alert-warn {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid #fde68a;
}

/* Tabs inside tools */
.tab-group {
  display: inline-flex;
  background: var(--surface-alt);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 5px 11px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow);
}

/* JSON Tree View */
.tree-view {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
}

.tree-view details {
  margin-left: 16px;
}

.tree-view summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
}

.tree-leaf {
  margin-left: 20px;
}

.t-key { color: #1e40af; }
.t-str { color: #15803d; }
.t-num { color: #b45309; }
.t-bool { color: #7c3aed; }
.t-null { color: #64748b; font-style: italic; }

/* Editorial Content Sections */
.editorial-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
}

.editorial-section h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.45rem;
  letter-spacing: -0.015em;
}

.editorial-section h3 {
  margin-top: 22px;
  margin-bottom: 8px;
  font-size: 1.12rem;
}

.editorial-section p {
  margin: 0 0 14px;
  color: #1e293b;
  overflow-wrap: break-word;
}

.editorial-section ul,
.editorial-section ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.editorial-section li {
  margin-bottom: 7px;
  overflow-wrap: break-word;
}

.code-snippet {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  overflow-x: auto;
  max-width: 100%;
  width: 100%;
  margin: 10px 0 16px;
}

.two-col-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin: 12px 0 18px;
}

.two-col-compare > div {
  min-width: 0;
  max-width: 100%;
}

/* Tool & Guide Grids */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 16px 0 28px;
}

.mini-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
  color: inherit;
}

.mini-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  text-decoration: none;
}

.mini-card-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 10px;
}

.mini-card h3 {
  margin: 0 0 6px;
  font-size: 1.06rem;
  color: var(--text);
}

.mini-card p {
  margin: 0;
  font-size: 0.91rem;
  color: var(--text-muted);
}

/* Tables */
.data-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0 18px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.91rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: var(--surface-alt);
  font-weight: 700;
  color: var(--text);
}

/* FAQ Accordion */
.faq-list details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 10px;
  background: #fcfdff;
}

.faq-list summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}

.faq-list p {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Author / E-E-A-T Box & Guide Metadata */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 28px;
  min-width: 0;
  max-width: 100%;
}

.author-box > div {
  min-width: 0;
  flex: 1;
}

.author-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
}

.author-box h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.author-box p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.toc-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 18px 0 22px;
}

.toc-box strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.toc-box ul {
  margin: 0;
  padding-left: 18px;
}

.toc-box li {
  margin-bottom: 4px;
  font-size: 0.94rem;
}

/* 2-Column Guide & Tool Layout + Sticky Right Sidebar */
.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 26px;
  align-items: start;
}

.guide-main {
  min-width: 0;
}

.guide-sidebar {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 20px;
  box-shadow: var(--shadow);
}

.sidebar-heading {
  margin: 0 0 18px;
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text);
  position: relative;
  padding-bottom: 8px;
}

.sidebar-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 34px;
  height: 3px;
  border-radius: 99px;
  background: var(--primary);
}

.author-card-center {
  text-align: center;
}

.author-avatar-lg {
  width: 78px;
  height: 78px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  font-weight: 700;
  border: 3px solid #e2e8f0;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18);
  object-fit: cover;
  object-position: center top;
}

.author-avatar-sm {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid #cbd5e1;
}

.author-name-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
}

.author-role {
  margin: 4px 0 10px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.author-bio-short {
  margin: 0 0 16px;
  font-size: 0.89rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.social-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.social-pill:hover {
  transform: translateY(-1px);
  text-decoration: none;
  opacity: 0.92;
}

.social-pill.yt {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.social-pill.ig {
  background: #fdf4ff;
  color: #a21caf;
  border: 1px solid #f5d0fe;
}

.btn-dark-full {
  display: block;
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.92rem;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.btn-dark-full:hover {
  background: #1e293b;
  text-decoration: none;
}

.trending-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.trending-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-decoration: none;
  padding: 4px;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.trending-item:hover {
  background: var(--surface-alt);
  text-decoration: none;
}

.trending-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f1f5f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--primary);
}

.trending-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.trending-cat {
  display: block;
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 2px;
}

.btn-outline-full {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  text-decoration: none;
}

.btn-outline-full:hover {
  background: var(--surface-alt);
  text-decoration: none;
}

@media (max-width: 960px) {
  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-sidebar {
    position: static;
  }
}

/* Diff / Regex Highlights */
.diff-add { background: #dcfce7; color: #166534; display: block; padding: 1px 6px; }
.diff-del { background: #fee2e2; color: #991b1b; display: block; padding: 1px 6px; }
.diff-eq  { color: var(--text-muted); display: block; padding: 1px 6px; }
.regex-mark { background: #fde047; color: #0f172a; border-radius: 3px; padding: 0 2px; font-weight: 600; }

/* Contact Form */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 36px 0 24px;
  margin-top: 40px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.footer-col h4 {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--text);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 6px;
}

.footer-col a {
  color: var(--text-muted);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
}

.hidden {
  display: none !important;
}

.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;
}

@media (max-width: 860px) {
  .editor-grid,
  .two-col-compare,
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    width: 100%;
    padding-bottom: 12px;
    flex-direction: column;
    align-items: flex-start;
  }

  .main-nav.open {
    display: flex;
  }

  .header-inner {
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .editorial-section {
    padding: 20px;
  }
}

@media (max-width: 640px) {
  .container,
  .container-narrow {
    padding: 0 14px;
  }

  .tool-card {
    padding: 14px;
  }

  .code-area,
  .code-output-box {
    min-height: 220px;
  }

  .pane-header {
    flex-wrap: wrap;
  }

  .data-table th,
  .data-table td {
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  .author-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .author-box .social-pills {
    justify-content: center !important;
  }
}

.related-guides-wrap {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.related-guides-wrap .mini-card h4 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  color: var(--text);
}
