/* ===== AI Dev Toolkit — SEO Content Site v2 ===== */
/* 2026-06-29 redesign: enhanced UX, mobile-first, AdSense ready */

:root {
  --bg: #ffffff;
  --bg-alt: #f8f9fb;
  --text: #1a1a2e;
  --text-light: #5a5a7a;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --code-bg: #1e293b;
  --code-text: #e2e8f0;
  --border: #e5e7eb;
  --green: #16a34a;
  --orange: #ea580c;
  --red: #dc2626;
  --tag-bg: #eff6ff;
  --tag-text: #1e40af;
  --max-width: 1080px;
  --content-width: 740px;
  --sidebar-width: 300px;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ===== Navigation (sticky + glass) ===== */
.nav {
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.nav-logo {
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-logo::before {
  content: "⚡";
  font-size: 18px;
}
.nav-logo span { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-light);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--accent); }

/* ===== Layout ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Hero / Homepage ===== */
.hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
  text-align: center;
}
.hero h1 {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -1.5px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #1a1a2e 0%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 18px;
  color: var(--text-light);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.6;
}
.hero .hero-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}
.hero-tags span {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  transition: background 0.15s;
}
.hero-tags span:hover { background: #dbeafe; }

/* ===== Section Title ===== */
.section-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===== Article Grid (Homepage — 2-column on wide, 1-col on narrow) ===== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.article-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: #cbd5e1;
}
.article-card .card-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent);
  margin-bottom: 8px;
}
.article-card h2 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
  flex: 1;
}
.article-card .card-meta {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ===== Layout with Sidebar (Article pages) ===== */
.content-wrapper {
  display: flex;
  gap: 40px;
  padding: 40px 0 64px;
}
.main-content {
  flex: 1;
  min-width: 0;
}
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
}

/* ===== Table of Contents (sidebar) ===== */
.toc {
  position: sticky;
  top: 80px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}
.toc h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.toc ul {
  list-style: none;
}
.toc ul li {
  margin-bottom: 6px;
}
.toc ul li a {
  font-size: 13px;
  color: var(--text-light);
  text-decoration: none;
  display: block;
  padding: 4px 0;
  transition: color 0.15s;
}
.toc ul li a:hover { color: var(--accent); }

/* ===== AdSense Placeholder (sidebar) ===== */
.ad-placeholder {
  background: #fafbfc;
  border: 2px dashed #e2e8f0;
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 24px;
  position: sticky;
  top: 380px;
}
.ad-placeholder span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #94a3b8;
}

/* ===== Article Page Header ===== */
.article-header {
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  position: relative;
}
.article-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--accent);
  border-radius: 0 0 4px 0;
}
.article-header .article-category {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 10px;
}
.article-header h1 {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.8px;
  margin-bottom: 14px;
}
.article-header .article-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ===== Article Body ===== */
.article-body h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
  scroll-margin-top: 80px;
}
.article-body h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 30px 0 12px;
  color: #2c3e50;
  scroll-margin-top: 80px;
}
.article-body p {
  margin-bottom: 18px;
  color: #333;
}
.article-body ul, .article-body ol {
  margin: 14px 0 22px 24px;
}
.article-body li {
  margin-bottom: 10px;
  font-size: 15px;
}
.article-body a {
  color: var(--accent);
  text-decoration: underline;
}
.article-body strong {
  color: var(--text);
}
.article-body code {
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 13.5px;
  color: var(--orange);
}
.article-body pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 20px 24px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 18px 0;
  font-size: 14px;
  line-height: 1.65;
}
.article-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 14px;
}
.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 14px 22px;
  margin: 24px 0;
  background: #f8fafc;
  border-radius: 0 10px 10px 0;
  color: #555;
  font-size: 15px;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 16px 0 24px;
}
.article-body th {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid #ddd;
  background: #fafbfc;
  font-size: 13px;
  font-weight: 600;
  color: #555;
}
.article-body td {
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
}

/* ===== FAQ Section ===== */
.faq-section {
  margin: 40px 0;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.faq-section h2 { border-bottom: none; }
.faq-item {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  background: var(--bg-alt);
}
.faq-item h3 {
  font-size: 16px;
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--text);
  cursor: default;
}
.faq-item p { font-size: 14px; color: #555; margin-bottom: 0; }

/* ===== CTA Box ===== */
.cta-box {
  background: linear-gradient(135deg, var(--accent-light), #dbeafe);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 24px;
  margin: 36px 0;
  text-align: center;
}
.cta-box h3 { font-size: 18px; margin-top: 0; margin-bottom: 10px; }
.cta-box p { font-size: 14px; color: #555; margin-bottom: 16px; }

/* ===== Callout Box (info / warning) ===== */
.callout {
  background: #eff6ff;
  border-left: 4px solid var(--accent);
  padding: 14px 20px;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  color: #1e40af;
}
.callout code { background: #dbeafe; color: #1e40af; }
.callout.callout-warning {
  background: #fffbeb;
  border-left-color: var(--orange);
  color: #92400e;
}
.callout.callout-warning code { background: #fef3c7; color: #92400e; }

/* ===== Code Block Copy Button ===== */
.code-block-wrapper {
  position: relative;
  margin: 18px 0;
}
.code-block-wrapper pre {
  margin: 0;
}
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}
.code-block-wrapper:hover .copy-btn {
  opacity: 1;
}
.copy-btn:hover {
  background: rgba(255,255,255,0.22);
  color: #fff;
}
.copy-btn.copied {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  opacity: 1;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin: 24px 0 0;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ===== Related Section ===== */
.related-section {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding-top: 28px;
}
.related-section h3 {
  font-size: 18px;
  margin-bottom: 16px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.related-card {
  display: block;
  text-decoration: none;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  transition: box-shadow 0.15s;
  color: inherit;
}
.related-card:hover { box-shadow: var(--shadow-sm); }
.related-card h4 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 4px;
}
.related-card span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
}

/* ===== Footer ===== */
.footer {
  border-top: 2px solid var(--border);
  margin-top: 60px;
  padding: 32px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.footer a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s;
}
.footer a:hover { color: var(--accent); }
.footer .disclaimer {
  font-size: 11px;
  color: #cbd5e1;
  margin-top: 12px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .content-wrapper {
    flex-direction: column;
    gap: 24px;
  }
  .sidebar {
    width: 100%;
    order: 2;
  }
  .toc { position: static; }
  .ad-placeholder { position: static; }
  .article-header h1 { font-size: 28px; }
  .article-body h2 { font-size: 22px; }
  .hero h1 { font-size: 30px; }
}

@media (max-width: 640px) {
  .hero { padding: 36px 0 28px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 15px; }
  .article-header h1 { font-size: 24px; }
  .article-body h2 { font-size: 20px; }
  .nav-links { gap: 14px; }
  .article-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .content-wrapper { padding: 24px 0 48px; }
}

/* ===== Print ===== */
@media print {
  .nav, .sidebar, .footer, .related-section { display: none; }
  .content-wrapper { display: block; }
}