/* ============================================================
   Universal Modder — Content Site Stylesheet
   Clean, readable, AdSense-friendly technical blog layout
   ============================================================ */

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

:root {
  --c-bg: #ffffff;
  --c-bg-alt: #f6f8fa;
  --c-bg-code: #f0f2f5;
  --c-text: #1f2328;
  --c-text-soft: #57606a;
  --c-border: #d0d7de;
  --c-accent: #0969da;
  --c-accent-dark: #0550ae;
  --c-accent-light: #ddf4ff;
  --c-success: #1a7f37;
  --c-warn: #9a6700;
  --c-footer-bg: #0d1117;
  --c-footer-text: #c9d1d9;
  --maxw: 1100px;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 3px 12px rgba(0,0,0,.08);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg);
}

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

img, svg { max-width: 100%; height: auto; }

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

/* --- Header / Nav --- */
.site-header {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 100;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.brand {
  font-size: 20px; font-weight: 700; color: var(--c-text);
  display: flex; align-items: center; gap: 8px;
}
.brand:hover { text-decoration: none; }
.brand .logo-dot {
  width: 28px; height: 28px; border-radius: 6px;
  background: linear-gradient(135deg, #0969da, #8250df);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 800;
}
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  padding: 6px 12px; border-radius: 6px; font-size: 14px;
  color: var(--c-text-soft); font-weight: 500;
}
.main-nav a:hover { background: var(--c-bg-alt); text-decoration: none; color: var(--c-text); }
.main-nav a.active { background: var(--c-accent-light); color: var(--c-accent-dark); }

/* --- Ad slot placeholder (hidden by default; uncomment to show during development) --- */
.ad-slot {
  display: none; /* hidden until AdSense code is placed */
  background: repeating-linear-gradient(45deg, #fafbfc, #fafbfc 10px, #f0f2f5 10px, #f0f2f5 20px);
  border: 1px dashed var(--c-border);
  border-radius: var(--radius);
  align-items: center; justify-content: center;
  color: var(--c-text-soft); font-size: 12px; letter-spacing: .5px;
  text-transform: uppercase; margin: 24px auto;
  min-height: 90px; max-width: 970px;
}
.ad-slot.billboard { min-height: 120px; }
.ad-slot.in-article { max-width: 728px; min-height: 100px; }

/* --- Hero (homepage) --- */
.hero {
  background: linear-gradient(180deg, var(--c-accent-light) 0%, var(--c-bg) 100%);
  padding: 60px 0 40px;
  text-align: center;
}
.hero h1 {
  font-size: 42px; line-height: 1.2; font-weight: 800;
  letter-spacing: -0.5px; margin-bottom: 16px;
}
.hero h1 .accent { color: var(--c-accent); }
.hero p.lede {
  font-size: 19px; color: var(--c-text-soft); max-width: 720px;
  margin: 0 auto 28px;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 10px 22px; border-radius: 6px;
  font-weight: 600; font-size: 15px; transition: all .15s;
}
.btn-primary { background: var(--c-accent); color: #fff; }
.btn-primary:hover { background: var(--c-accent-dark); text-decoration: none; }
.btn-outline { border: 1px solid var(--c-border); color: var(--c-text); background: #fff; }
.btn-outline:hover { background: var(--c-bg-alt); text-decoration: none; }

/* --- Stats row --- */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  max-width: 720px; margin: 36px auto 0;
}
.stat-card {
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 16px; text-align: center; box-shadow: var(--shadow-sm);
}
.stat-card .num { font-size: 28px; font-weight: 800; color: var(--c-accent); }
.stat-card .label { font-size: 13px; color: var(--c-text-soft); margin-top: 2px; }

/* --- Article / content area --- */
.content-wrap { padding: 40px 0 60px; }
.article-body h2 {
  font-size: 28px; font-weight: 700; margin: 40px 0 16px;
  padding-bottom: 8px; border-bottom: 1px solid var(--c-border);
}
.article-body h3 { font-size: 22px; font-weight: 600; margin: 28px 0 12px; }
.article-body p { margin-bottom: 16px; }
.article-body ul, .article-body ol { margin: 0 0 16px 24px; }
.article-body li { margin-bottom: 6px; }
.article-body code {
  background: var(--c-bg-code); padding: 2px 6px; border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}
.article-body pre {
  background: var(--c-footer-bg); color: #e6edf3; padding: 16px 20px;
  border-radius: var(--radius); overflow-x: auto; margin: 16px 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px; line-height: 1.5;
}
.article-body pre code { background: none; padding: 0; color: inherit; }

/* --- Feature cards grid --- */
.card-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  margin: 24px 0;
}
.card {
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card .card-icon {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--c-accent-light); display: flex; align-items: center;
  justify-content: center; margin-bottom: 12px; font-size: 20px;
}
.card h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.card p { font-size: 14px; color: var(--c-text-soft); margin: 0; }

/* --- Step / loop timeline --- */
.loop-steps { margin: 24px 0; }
.loop-step {
  padding: 16px 0 16px 36px;
  border-left: 2px solid var(--c-border);
  margin-left: 12px;
  position: relative;
}
.loop-step::before {
  content: attr(data-step);
  position: absolute; left: -15px; top: 18px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--c-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 0 0 3px var(--c-bg);
}
.loop-step h4 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.loop-step p { font-size: 15px; color: var(--c-text-soft); margin: 0; }

/* --- Comparison table --- */
.compare-table {
  width: 100%; border-collapse: collapse; margin: 24px 0;
  font-size: 15px; background: #fff; border: 1px solid var(--c-border);
  border-radius: var(--radius); overflow: hidden;
}
.compare-table th, .compare-table td {
  padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--c-border);
}
.compare-table th { background: var(--c-bg-alt); font-weight: 600; }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table .yes { color: var(--c-success); font-weight: 700; }
.compare-table .partial { color: var(--c-warn); }

/* --- Callout / notice --- */
.callout {
  background: var(--c-accent-light); border-left: 4px solid var(--c-accent);
  padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0;
  margin: 20px 0; font-size: 15px;
}
.callout.warn { background: #fff8c5; border-color: var(--c-warn); }
.callout strong { display: block; margin-bottom: 4px; }

/* --- Related links / post list --- */
.related-section { margin: 40px 0; }
.related-section h2 { font-size: 22px; margin-bottom: 16px; }
.post-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.post-card {
  display: block; padding: 20px; border: 1px solid var(--c-border);
  border-radius: var(--radius); background: #fff; color: var(--c-text);
  transition: all .15s;
}
.post-card:hover { border-color: var(--c-accent); box-shadow: var(--shadow-sm); text-decoration: none; }
.post-card .tag {
  display: inline-block; font-size: 12px; font-weight: 600;
  color: var(--c-accent); background: var(--c-accent-light);
  padding: 2px 8px; border-radius: 4px; margin-bottom: 8px;
}
.post-card h3 { font-size: 16px; margin-bottom: 6px; }
.post-card p { font-size: 14px; color: var(--c-text-soft); margin: 0; }

/* --- Breadcrumb --- */
.breadcrumb {
  font-size: 13px; color: var(--c-text-soft); margin-bottom: 20px;
}
.breadcrumb a { color: var(--c-text-soft); }
.breadcrumb a:hover { color: var(--c-accent); }

/* --- FAQ --- */
.faq-item {
  border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 12px; background: #fff;
}
.faq-item h4 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.faq-item p { font-size: 15px; color: var(--c-text-soft); margin: 0; }

/* --- Footer --- */
.site-footer {
  background: var(--c-footer-bg); color: var(--c-footer-text);
  padding: 40px 0 24px; margin-top: 40px; font-size: 14px;
}
.site-footer a { color: var(--c-footer-text); }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
  margin-bottom: 24px;
}
.footer-grid h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 6px; }
.footer-bottom {
  border-top: 1px solid #21262d; padding-top: 20px;
  text-align: center; color: #8b949e; font-size: 13px;
}
.disclaimer {
  background: var(--c-bg-alt); padding: 12px 16px; border-radius: var(--radius);
  font-size: 12px; color: var(--c-text-soft); margin-top: 16px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero h1 { font-size: 32px; }
  .hero p.lede { font-size: 17px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .post-list { grid-template-columns: 1fr; }
  .main-nav { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero { padding: 40px 0 24px; }
  .hero h1 { font-size: 26px; }
  .card-grid { grid-template-columns: 1fr; }
  .article-body h2 { font-size: 24px; }
  .footer-grid { grid-template-columns: 1fr; }
  .compare-table { font-size: 14px; }
  .compare-table th, .compare-table td { padding: 8px 10px; }
}
