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

:root {
  --brand:       #2563eb;
  --brand-dark:  #1d4ed8;
  --brand-light: #eff6ff;
  --text:        #111827;
  --text-muted:  #6b7280;
  --text-light:  #9ca3af;
  --bg:          #ffffff;
  --bg-alt:      #f9fafb;
  --border:      #e5e7eb;
  --radius:      8px;
  --radius-lg:   14px;
  --shadow:      0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:   0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg:   0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --font-sans:   'Inter', system-ui, sans-serif;
  --font-serif:  'Merriweather', Georgia, serif;
  --max-width:   1100px;
}

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

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.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; }

.logo-text {
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.site-nav { display: flex; gap: 0.25rem; }

.site-nav a {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}

.site-nav a:hover {
  background: var(--bg-alt);
  color: var(--text);
  text-decoration: none;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.hero .accent {
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--brand);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.15s;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background: var(--brand-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-ghost:hover {
  background: var(--bg-alt);
  color: var(--text);
  text-decoration: none;
}

/* ── Category Cards ───────────────────────────────────────────────────────── */
.featured-cats {
  padding: 3.5rem 0;
  background: var(--bg);
}

.featured-cats h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.cat-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}

.cat-card:hover {
  border-color: var(--brand);
  background: var(--brand-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.cat-icon { font-size: 1.75rem; margin-bottom: 0.25rem; }
.cat-card h3 { font-size: 1rem; font-weight: 700; }
.cat-card p  { font-size: 0.82rem; color: var(--text-muted); line-height: 1.4; }

/* ── Posts Grid ───────────────────────────────────────────────────────────── */
.latest-posts {
  padding: 3.5rem 0 5rem;
  background: var(--bg-alt);
}

.latest-posts h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand);
}

.post-card-body { padding: 1.35rem; flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }

.post-card-category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
  background: var(--brand-light);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  width: fit-content;
}

.post-card h3 { font-size: 1rem; font-weight: 700; line-height: 1.4; }
.post-card h3 a { color: var(--text); text-decoration: none; }
.post-card h3 a:hover { color: var(--brand); }
.post-card p  { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; flex: 1; }

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.read-more { color: var(--brand); font-weight: 600; }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 3rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── Archive / Category Pages ─────────────────────────────────────────────── */
.archive-page { padding: 3rem 0 5rem; }

.archive-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.archive-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.archive-header p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
}

.empty-archive {
  text-align: center;
  padding: 4rem 0;
  color: var(--text-muted);
  font-size: 1.05rem;
  grid-column: 1 / -1;
}

/* ── Article / Post Page ──────────────────────────────────────────────────── */
.post-page { padding: 3rem 0 5rem; }

.post-header { margin-bottom: 2rem; max-width: 760px; }

.post-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand);
  background: var(--brand-light);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.post-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.85rem;
  color: var(--text);
}

.post-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.post-intro {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
  border-left: 3px solid var(--brand);
  padding-left: 1rem;
}

.affiliate-disclosure {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  color: #92400e;
  margin-bottom: 2rem;
  max-width: 760px;
}

/* ── Article Content ──────────────────────────────────────────────────────── */
.post-content {
  max-width: 760px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}

.post-content h2 {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--text);
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}

.post-content h3 {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}

.post-content p { margin-bottom: 1.35rem; }

.post-content ul, .post-content ol {
  margin: 0 0 1.35rem 1.5rem;
}

.post-content li { margin-bottom: 0.4rem; }

.post-content a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.post-content a:hover { color: var(--brand-dark); }

.post-content strong { font-weight: 700; color: var(--text); }

.post-content blockquote {
  border-left: 4px solid var(--brand);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--brand-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-muted);
}

.post-content code {
  background: var(--bg-alt);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: monospace;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.post-content th {
  background: var(--bg-alt);
  padding: 0.65rem 1rem;
  text-align: left;
  font-weight: 600;
  border: 1px solid var(--border);
}

.post-content td {
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  vertical-align: top;
}

.post-content tr:nth-child(even) td { background: var(--bg-alt); }

/* ── Tags ─────────────────────────────────────────────────────────────────── */
.post-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 2rem; }

.tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--text);
  color: #d1d5db;
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand .logo-text {
  font-size: 1.1rem;
  display: block;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #9ca3af;
}

.footer-links h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #e5e7eb;
  margin-bottom: 0.75rem;
}

.footer-links a {
  display: block;
  font-size: 0.85rem;
  color: #9ca3af;
  text-decoration: none;
  margin-bottom: 0.4rem;
  transition: color 0.15s;
}

.footer-links a:hover { color: #fff; text-decoration: none; }

.footer-bottom {
  font-size: 0.78rem;
  color: #6b7280;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.disclosure { font-style: italic; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .hero { padding: 3rem 0 2.5rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .posts-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
}
