/* HomeLab Starter — base stylesheet
   Plain CSS, no framework, no build step. Mobile-first, system fonts only. */

:root {
  --color-bg: #f7f8fa;
  --color-surface: #ffffff;
  --color-text: #1c2430;
  --color-text-muted: #5b6673;
  --color-accent: #1e6f5c;
  --color-accent-dark: #144c3f;
  --color-border: #e2e5ea;
  --color-header-bg: #10151c;
  --color-header-text: #f2f4f7;
  --color-callout-bg: #eef6f3;
  --color-ad-bg: #f1f0e8;
  --color-ad-border: #cfcabb;
  --max-width: 880px;
  --radius: 8px;
  font-size: 17px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
}

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

img { max-width: 100%; height: auto; display: block; }

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

/* Header / Nav */
.site-header {
  background: var(--color-header-bg);
  color: var(--color-header-text);
}

.site-header .container {
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.site-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-header-text);
  letter-spacing: -0.01em;
}

.site-title span { color: #7fd6bd; }

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--color-header-text);
  font-weight: 500;
  font-size: 0.95rem;
}

.site-nav a:hover { color: #7fd6bd; text-decoration: none; }

/* Hero (homepage) */
.hero {
  background: linear-gradient(180deg, #10151c 0%, #17202b 100%);
  color: var(--color-header-text);
  padding: 56px 0 64px;
}

.hero .container { max-width: 1100px; }

.hero h1 {
  font-size: 2.2rem;
  margin: 0 0 14px;
  max-width: 700px;
  line-height: 1.25;
}

.hero p {
  color: #c3cad4;
  max-width: 620px;
  font-size: 1.08rem;
  margin: 0 0 22px;
}

.hero .btn { margin-right: 12px; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
}

.btn:hover { background: var(--color-accent-dark); text-decoration: none; }

.btn-outline {
  background: transparent;
  border: 1px solid #4a5563;
  color: var(--color-header-text);
}

.btn-outline:hover { background: rgba(255,255,255,0.08); }

/* Main content wrapper */
main { max-width: 1100px; margin: 0 auto; padding: 40px 20px 60px; }

/* Section headings on homepage */
.section-heading {
  font-size: 1.5rem;
  margin: 0 0 8px;
}

.section-sub {
  color: var(--color-text-muted);
  margin: 0 0 26px;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.card .category-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-accent);
  background: var(--color-callout-bg);
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 10px;
  width: fit-content;
}

.card h3 { margin: 0 0 8px; font-size: 1.12rem; line-height: 1.35; }
.card p { color: var(--color-text-muted); font-size: 0.94rem; margin: 0 0 14px; flex-grow: 1; }
.card .read-more { font-weight: 600; font-size: 0.9rem; }

/* Article list page grouped by category */
.category-block { margin-bottom: 40px; }
.category-block h2 { font-size: 1.25rem; border-bottom: 2px solid var(--color-border); padding-bottom: 8px; }

/* Article page */
.article-header { max-width: var(--max-width); margin: 0 auto; padding: 40px 20px 0; }
.article-header .container { padding: 0; }

.breadcrumb { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--color-text-muted); }

.article-header h1 {
  font-size: 2rem;
  line-height: 1.3;
  margin: 0 0 14px;
}

.article-meta {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 24px;
}

article.article-body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 60px;
}

article.article-body h2 {
  font-size: 1.45rem;
  margin: 40px 0 14px;
  line-height: 1.35;
}

article.article-body h3 {
  font-size: 1.15rem;
  margin: 28px 0 10px;
}

article.article-body p { margin: 0 0 18px; }
article.article-body ul, article.article-body ol { margin: 0 0 18px; padding-left: 24px; }
article.article-body li { margin-bottom: 8px; }

article.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 24px;
  font-size: 0.94rem;
}

article.article-body th, article.article-body td {
  border: 1px solid var(--color-border);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}

article.article-body th { background: #eef1f4; }

.callout {
  background: var(--color-callout-bg);
  border-left: 4px solid var(--color-accent);
  padding: 16px 18px;
  border-radius: 4px;
  margin: 0 0 24px;
  font-size: 0.96rem;
}

.callout strong { color: var(--color-accent-dark); }

code, pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88em;
}

code {
  background: #eceff2;
  padding: 2px 6px;
  border-radius: 4px;
}

pre {
  background: #1c2430;
  color: #e7ebef;
  padding: 16px 18px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 0 0 24px;
}

pre code { background: none; padding: 0; color: inherit; }

/* Ad placeholder */
.ad-slot {
  border: 2px dashed var(--color-ad-border);
  background: var(--color-ad-bg);
  color: #7a7460;
  text-align: center;
  padding: 26px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 32px 0;
}

.ad-slot span { display: block; font-weight: 400; text-transform: none; margin-top: 4px; font-size: 0.8rem; }

/* Related articles box */
.related-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 40px 0;
}

.related-box h2 { margin-top: 0; font-size: 1.15rem; }
.related-box ul { margin: 0; padding-left: 20px; }
.related-box li { margin-bottom: 8px; }

/* Author box */
.author-box {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-top: 1px solid var(--color-border);
  padding-top: 24px;
  margin-top: 40px;
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

.author-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

/* Static pages (about/contact/privacy) */
.static-page { max-width: var(--max-width); margin: 0 auto; padding: 48px 20px 60px; }
.static-page h1 { font-size: 1.9rem; margin-bottom: 18px; }
.static-page h2 { font-size: 1.3rem; margin: 32px 0 12px; }
.static-page p { margin: 0 0 16px; }

/* Footer */
.site-footer {
  background: var(--color-header-bg);
  color: #9aa4b2;
  margin-top: 60px;
}

.site-footer .container {
  max-width: 1100px;
  padding-top: 34px;
  padding-bottom: 34px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.88rem;
}

.site-footer a { color: #c3cad4; }
.footer-links ul { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; flex-wrap: wrap; }
.footer-disclosure { max-width: 560px; color: #7c8798; font-size: 0.82rem; margin-top: 10px; }

@media (max-width: 640px) {
  :root { font-size: 16px; }
  .hero h1 { font-size: 1.7rem; }
  .article-header h1 { font-size: 1.6rem; }
  .site-footer .container { flex-direction: column; }
}
