
:root {
  --primary: #0066cc;
  --primary-dark: #004999;
  --accent: #e8f4fd;
  --text: #1a1a2e;
  --muted: #666;
  --border: #e0e0e0;
  --bg: #ffffff;
  --card-bg: #fafafa;
  --max-width: 1100px;
  --font-body: 'Georgia', 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

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

/* ── Header ── */
.site-header {
  background: var(--bg);
  border-bottom: 2px solid var(--primary);
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 65px;
}
.site-logo {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.site-logo span { color: var(--text); }
.site-nav { display: flex; gap: 24px; align-items: center; }
.site-nav a {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
.site-nav a:hover, .site-nav a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  text-decoration: none;
}
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #0066cc 0%, #004999 60%, #003380 100%);
  color: white;
  text-align: center;
  padding: 70px 20px 60px;
}
.hero h1 {
  font-family: var(--font-sans);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}
.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 28px;
  font-family: var(--font-sans);
}
.hero-cta {
  display: inline-block;
  background: white;
  color: var(--primary);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: 30px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); text-decoration: none; color: var(--primary); }

/* ── Page wrapper ── */
.page-wrapper { max-width: var(--max-width); margin: 0 auto; padding: 40px 20px 60px; }

/* ── Section heading ── */
.section-heading {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Post grid ── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-bottom: 48px;
}

/* ── Post card ── */
.post-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,102,204,0.12);
}
.card-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--accent);
}
.card-image-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--accent) 0%, #d0e8f8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}
.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.card-tag {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  background: var(--accent);
  padding: 3px 9px;
  border-radius: 20px;
  text-decoration: none;
}
.card-tag:hover { background: var(--primary); color: white; text-decoration: none; }
.card-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
  color: var(--text);
}
.card-title a { color: inherit; }
.card-title a:hover { color: var(--primary); text-decoration: none; }
.card-excerpt {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
  font-family: var(--font-sans);
}
.card-meta {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-read-more {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
}

/* ── Tag pills row ── */
.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}
.tag-pill {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 25px;
  border: 2px solid var(--primary);
  color: var(--primary);
  transition: all 0.2s;
}
.tag-pill:hover, .tag-pill.active {
  background: var(--primary);
  color: white;
  text-decoration: none;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  border: 2px solid var(--border);
  color: var(--text);
  transition: all 0.2s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.pagination .current { background: var(--primary); color: white; border-color: var(--primary); }

/* ── Single post ── */
.post-header {
  max-width: 760px;
  margin: 40px auto 0;
  padding: 0 20px;
  text-align: center;
}
.post-header .post-tags { margin-bottom: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.post-header h1 {
  font-family: var(--font-sans);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 16px;
}
.post-header .post-meta {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 28px;
}
.post-feature-image {
  max-width: 900px;
  margin: 0 auto 40px;
  padding: 0 20px;
}
.post-feature-image img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.post-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px 60px;
}
.post-content h1, .post-content h2 {
  font-family: var(--font-sans);
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 0.6em;
  line-height: 1.3;
  color: var(--text);
}
.post-content h1 { font-size: 1.8rem; }
.post-content h2 { font-size: 1.45rem; border-bottom: 2px solid var(--accent); padding-bottom: 6px; }
.post-content h3 { font-family: var(--font-sans); font-size: 1.2rem; font-weight: 600; margin-top: 1.5em; margin-bottom: 0.5em; color: var(--text); }
.post-content p { margin-bottom: 1.4em; }
.post-content ul, .post-content ol { padding-left: 28px; margin-bottom: 1.4em; }
.post-content li { margin-bottom: 0.5em; }
.post-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 1.5em 0; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.post-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 12px 20px;
  margin: 1.5em 0;
  background: var(--accent);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--muted);
}
.post-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.9rem; font-family: var(--font-sans); }
.post-content th { background: var(--primary); color: white; padding: 10px 14px; text-align: left; }
.post-content td { padding: 9px 14px; border-bottom: 1px solid var(--border); }
.post-content tr:nth-child(even) { background: var(--accent); }
.post-content a { color: var(--primary); font-weight: 500; }
.post-content .kg-card { margin: 2em 0; }
.post-content .kg-image-card img { width: 100%; }
.post-content .kg-width-wide { width: 100%; }
.post-content .kg-callout-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--accent);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  margin: 1.5em 0;
}
.post-content .kg-callout-emoji { font-size: 1.5rem; }
.post-content .kg-callout-text { flex: 1; }

/* ── Related posts ── */
.related-posts {
  background: var(--accent);
  padding: 40px 20px;
  margin-top: 40px;
}
.related-inner { max-width: var(--max-width); margin: 0 auto; }

/* ── Tag page ── */
.tag-header {
  background: linear-gradient(135deg, #0066cc, #004999);
  color: white;
  padding: 50px 20px 40px;
  text-align: center;
}
.tag-header h1 { font-family: var(--font-sans); font-size: 2rem; font-weight: 800; }
.tag-header p { opacity: 0.85; font-family: var(--font-sans); margin-top: 8px; }

/* ── Footer ── */
.site-footer {
  background: #1a1a2e;
  color: #ccc;
  padding: 48px 20px 28px;
  font-family: var(--font-sans);
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}
.footer-brand h3 { color: white; font-size: 1.1rem; margin-bottom: 10px; }
.footer-brand p { font-size: 0.88rem; line-height: 1.7; color: #999; }
.footer-col h4 { color: white; font-size: 0.9rem; font-weight: 700; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #999; font-size: 0.88rem; transition: color 0.2s; }
.footer-col a:hover { color: white; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 24px;
  text-align: center;
  font-size: 0.82rem;
  color: #666;
}
.disclaimer {
  background: #f8f4e8;
  border: 1px solid #e8d8a0;
  border-left: 4px solid #c8a800;
  padding: 16px 20px;
  border-radius: 6px;
  margin: 32px 0;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: #666;
  line-height: 1.6;
}
.disclaimer strong { color: #8a6900; }

/* ── Sidebar layout for post ── */
.post-layout {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}
.sidebar { position: sticky; top: 85px; }
.sidebar-widget {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
  margin-bottom: 24px;
}
.sidebar-widget h4 {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}
.sidebar-post { display: flex; gap: 12px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.sidebar-post:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.sidebar-post img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.sidebar-post-title { font-family: var(--font-sans); font-size: 0.82rem; font-weight: 600; line-height: 1.35; color: var(--text); }
.sidebar-post-title a { color: inherit; }
.sidebar-post-title a:hover { color: var(--primary); text-decoration: none; }
.sidebar-post-date { font-family: var(--font-sans); font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

/* ── Breadcrumb ── */
.breadcrumb {
  max-width: var(--max-width);
  margin: 16px auto 0;
  padding: 0 20px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb span { color: var(--muted); }

/* ── 404 ── */
.not-found {
  text-align: center;
  padding: 100px 20px;
  font-family: var(--font-sans);
}
.not-found h1 { font-size: 5rem; color: var(--primary); font-weight: 900; }
.not-found h2 { font-size: 1.5rem; margin-bottom: 16px; }
.not-found p { color: var(--muted); margin-bottom: 28px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .post-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .site-nav { display: none; }
  .nav-toggle { display: block; }
  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 65px;
    left: 0; right: 0;
    background: white;
    padding: 16px 20px;
    border-bottom: 2px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 99;
  }
  .post-grid { grid-template-columns: 1fr; }
  .hero { padding: 50px 20px 40px; }
  .page-wrapper { padding: 24px 16px 48px; }
}
