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

:root {
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #16a34a;
  --accent-dark: #15803d;
  --bg: #ffffff;
  --bg-soft: #f9fafb;
  --max-prose: 720px;
  --font: system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 1rem;
}

/* Site header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 56px;
}
.site-header .logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
}
.site-header a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.site-header a:hover { color: var(--text); }
.site-header .open-app {
  margin-left: auto;
  background: var(--accent);
  color: #fff !important;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}
.site-header .open-app:hover { background: var(--accent-dark); }

/* Page wrapper */
.article-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 860px) {
  .article-page { grid-template-columns: 1fr; }
  .article-sidebar { order: 2; }
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb li { display: flex; align-items: center; gap: 0.4rem; list-style: none; }
.breadcrumb li + li::before { content: "/"; }

/* Article header */
article > header { margin-bottom: 2rem; }
article > header h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.article-meta {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Prose */
article h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2.5rem 0 0.75rem;
  color: var(--text);
  line-height: 1.3;
}
article h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
  color: var(--text);
}
article p { margin-bottom: 1.1rem; }
article ul, article ol {
  padding-left: 1.5rem;
  margin-bottom: 1.1rem;
}
article li { margin-bottom: 0.4rem; }
article strong { font-weight: 600; }
article a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
article a:hover { color: var(--accent-dark); }

/* Intro lead */
.lead {
  font-size: 1.1rem;
  color: #374151;
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Callout box */
.callout {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.callout strong { color: var(--accent-dark); }

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1.5rem 0;
}
th {
  background: var(--bg-soft);
  text-align: left;
  padding: 0.6rem 0.9rem;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}
td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
@media (max-width: 600px) {
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  td { padding: 0.4rem 0; }
  td::before { content: attr(data-label) ": "; font-weight: 600; }
}

/* FAQ */
.faq { margin-top: 3rem; }
.faq h2 { margin-top: 0; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:first-of-type { border-top: 1px solid var(--border); }
.faq-q {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: var(--font);
}
.faq-q::after { content: "+"; font-size: 1.2rem; flex-shrink: 0; color: var(--accent); }
.faq-item.open .faq-q::after { content: "−"; }
.faq-a {
  display: none;
  padding: 0 0 1rem;
  color: #374151;
  font-size: 0.95rem;
  line-height: 1.65;
}
.faq-item.open .faq-a { display: block; }

/* CTA */
.article-cta {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #86efac;
  border-radius: 12px;
  padding: 1.75rem;
  margin-top: 3rem;
  text-align: center;
}
.article-cta h2 { margin-top: 0; font-size: 1.25rem; }
.article-cta p { color: #374151; margin-bottom: 1.25rem; font-size: 0.95rem; }
.cta-button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
}
.cta-button:hover { background: var(--accent-dark); color: #fff; }

/* Sidebar */
.article-sidebar { position: sticky; top: 72px; }
.sidebar-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.sidebar-box h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.9rem;
}
.sidebar-box ul { list-style: none; padding: 0; }
.sidebar-box li { margin-bottom: 0.5rem; }
.sidebar-box a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.4;
}
.sidebar-box a:hover { color: var(--accent); }

/* Articles index grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.article-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.article-card:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(0,0,0,0.07); }
.article-card .tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.article-card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}
.article-card p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* Page hero (articles index) */
.page-hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 1rem;
}
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; margin-bottom: 0.5rem; }
.page-hero p { color: var(--muted); font-size: 1.05rem; }
.articles-container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem 4rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: underline; }
.site-footer nav { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
