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

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #555;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --accent-dark: #1d4ed8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --green: #059669;
  --green-bg: #ecfdf5;
  --orange: #d97706;
  --orange-bg: #fffbeb;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 1.5rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.3; }
h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
h2 { font-size: 1.5rem; font-weight: 600; margin: 2rem 0 1rem; }
h3 { font-size: 1.2rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
h4 { font-size: 1.05rem; font-weight: 600; margin: 0.75rem 0 0.25rem; }
p { margin-bottom: 1rem; }
ul, ol { margin: 0.5rem 0 1rem 1.5rem; }
li { margin-bottom: 0.25rem; }

/* === HEADER === */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.site-logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1.15rem; color: var(--text);
  text-decoration: none;
}
.logo-icon { font-size: 1.3rem; }
.site-nav { display: flex; gap: 1.5rem; }
.site-nav a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }

/* === BREADCRUMBS === */
.breadcrumbs {
  font-size: 0.85rem; color: var(--text-secondary);
  padding: 1rem 0 0.5rem; display: flex; flex-wrap: wrap; gap: 0.25rem;
}
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs .sep { margin: 0 0.15rem; }
.breadcrumbs .current { color: var(--text); }

/* === HERO === */
.hero { text-align: center; padding: 3rem 0 2rem; }
.hero h1 { font-size: 2.5rem; max-width: 700px; margin: 0 auto 1rem; }
.hero-sub {
  font-size: 1.1rem; color: var(--text-secondary);
  max-width: 600px; margin: 0 auto 2rem;
}
.hero-search {
  max-width: 500px; margin: 0 auto; position: relative;
}
.hero-search input {
  width: 100%; padding: 0.85rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius); font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.hero-search input:focus { outline: none; border-color: var(--accent); }
.search-results {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-top: 4px;
  box-shadow: var(--shadow-md); display: none; z-index: 10;
}
.search-results.active { display: block; }
.search-results a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem; color: var(--text);
  border-bottom: 1px solid var(--border-light);
  font-weight: 500;
}
.search-results a:hover { background: var(--accent-light); text-decoration: none; }
.search-results a:last-child { border-bottom: none; }

/* === SECTION === */
.section { padding: 2rem 0; }

/* === PROFESSION GRID (homepage) === */
.prof-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem; margin-top: 1rem;
}
.prof-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  text-decoration: none; color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.prof-card:hover {
  border-color: var(--accent); box-shadow: var(--shadow-md); text-decoration: none;
}
.prof-card .prof-icon { font-size: 1.5rem; display: block; margin-bottom: 0.5rem; }
.prof-card h3 { font-size: 0.95rem; margin: 0 0 0.25rem; }
.prof-card p { font-size: 0.8rem; color: var(--text-secondary); margin: 0; }

/* === PROFESSION LIST (index) === */
.prof-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.prof-row {
  display: flex; align-items: flex-start; gap: 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  color: var(--text); text-decoration: none;
  transition: border-color 0.2s;
}
.prof-row:hover { border-color: var(--accent); text-decoration: none; }
.prof-row .prof-icon { font-size: 1.75rem; flex-shrink: 0; margin-top: 0.25rem; }
.prof-row h3 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.prof-row p { margin: 0 0 0.25rem; font-size: 0.9rem; color: var(--text-secondary); }
.prof-row small { font-size: 0.8rem; color: var(--accent); }

/* === ANSWER FIRST (AEO) === */
.answer-first {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0 1.5rem;
  font-size: 1.02rem;
}
.answer-first p { margin: 0; }

/* === AEO BLOCK === */
.aeo-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  margin: 1.5rem 0;
}
.aeo-block h2 { margin-top: 0; }

/* === PAGE HEADER === */
.page-header { padding: 1.5rem 0 0; }
.page-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.updated { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0; }

/* === TOC === */
.toc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  margin: 1.5rem 0; font-size: 0.9rem;
}
.toc strong { margin-right: 0.5rem; }

/* === COMPARISON TABLE === */
.table-wrap { overflow-x: auto; margin: 1rem 0; }
.comparison-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
.comparison-table th {
  background: var(--text); color: white;
  padding: 0.75rem 1rem; text-align: left; font-weight: 600;
  white-space: nowrap;
}
.comparison-table td {
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.comparison-table tr:hover td { background: var(--accent-light); }

/* === TOOL CARDS === */
.tool-cards { display: flex; flex-direction: column; gap: 1rem; margin: 1rem 0; }
.tool-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  position: relative;
}
.tool-card.recommended { border-color: var(--accent); border-width: 2px; }
.tool-card h4 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.tool-card h4 a { color: var(--text); }
.tool-vendor { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.75rem; }
.tool-details { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; font-size: 0.88rem; }
.pros { color: var(--green); }
.cons { color: var(--orange); }
.tool-details strong { display: block; margin-bottom: 0.25rem; color: var(--text); }

/* === TOOL DETAIL (combo pages) === */
.tool-detail {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  margin: 1.5rem 0; position: relative;
}
.tool-detail.recommended { border-color: var(--accent); border-width: 2px; }
.tool-detail h3 { margin-top: 0.5rem; }
.tool-detail h3 small { font-weight: 400; color: var(--text-secondary); }
.tool-detail .pricing {
  font-family: 'JetBrains Mono', monospace; font-size: 0.85rem;
  color: var(--text-secondary); margin-bottom: 1rem;
}
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.detail-grid h4 { font-size: 0.95rem; }
.detail-grid ul { font-size: 0.9rem; }

/* === BADGE === */
.badge {
  display: inline-block; background: var(--accent); color: white;
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  padding: 0.2rem 0.6rem; border-radius: 3px; letter-spacing: 0.02em;
}
.badge.alt { background: var(--text-secondary); }

/* === CONTEXT === */
.context { font-size: 0.92rem; color: var(--text-secondary); margin: 1rem 0; }

/* === FAQ === */
.faq-section { margin: 2rem 0; }
.faq-item {
  border-bottom: 1px solid var(--border); padding: 1rem 0;
}
.faq-item h4 { color: var(--text); font-size: 1rem; margin-bottom: 0.4rem; }
.faq-item p { margin: 0; font-size: 0.95rem; color: var(--text-secondary); }

/* === FOOTER === */
.site-footer {
  background: var(--text); color: #ccc;
  padding: 3rem 0 1.5rem; margin-top: 3rem;
  font-size: 0.85rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-about p { margin-top: 0.5rem; line-height: 1.6; }
.footer-links h4 { color: white; font-size: 0.9rem; margin-bottom: 0.75rem; }
.footer-links a { display: block; color: #94a3b8; margin-bottom: 0.35rem; font-size: 0.82rem; }
.footer-links a:hover { color: white; }
.footer-bottom { border-top: 1px solid #334155; padding-top: 1rem; text-align: center; color: #64748b; }

/* === AD SLOTS === */
.ad-slot {
  background: var(--border-light); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  text-align: center; color: var(--text-secondary);
  font-size: 0.8rem; margin: 1.5rem 0;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  .prof-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .tool-details, .detail-grid { grid-template-columns: 1fr; }
  .comparison-table { font-size: 0.8rem; }
  .site-nav { gap: 1rem; }
  .toc a { display: inline-block; margin: 0.15rem 0; }
}

@media (max-width: 480px) {
  .prof-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
  .hero { padding: 2rem 0 1rem; }
}
