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

:root {
  --bg-primary: #1a1a2e;
  --bg-card: #16213e;
  --bg-hover: #1f2b47;
  --text-primary: #e0e0e0;
  --text-muted: #8892a4;
  --accent: #e94560;
  --accent-hover: #ff6b81;
  --link: #5c9ce6;
  --link-hover: #7db8f0;
  --border: #2a3554;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--link-hover);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}

h1 { font-size: 2.2rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.6rem; margin: 2rem 0 1rem; color: var(--accent); }
h3 { font-size: 1.25rem; margin: 1.5rem 0 0.75rem; }

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

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}

.site-logo:hover { color: var(--accent); }

.logo-icon { font-size: 1.6rem; }

.main-nav {
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.main-nav a:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Layout */
.site-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2.5rem;
}

.main-content {
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}

.sidebar {
  grid-column: 2;
  grid-row: 1;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-section {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1.25rem;
  border: 1px solid var(--border);
}

.sidebar-section h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  color: var(--accent);
  font-family: var(--font-body);
}

.sidebar-nav,
.sidebar-related {
  list-style: none;
}

.sidebar-nav li,
.sidebar-related li {
  margin-bottom: 0.5rem;
}

.sidebar-nav a,
.sidebar-related a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.sidebar-nav a:hover,
.sidebar-related a:hover {
  color: var(--accent);
}

/* Article (Single) */
.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-category a {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.2rem 0.75rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.article-category a:hover {
  color: #fff;
  background: var(--accent-hover);
}

.article-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.article-meta {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.last-updated {
  margin-left: 1rem;
}

.article-content {
  font-size: 1.05rem;
}

.article-content p {
  margin-bottom: 1.25rem;
}

.article-content ul,
.article-content ol {
  margin: 1rem 0 1.25rem 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--bg-card);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--text-muted);
}

.article-content strong {
  color: #fff;
}

.article-tags {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.tag {
  display: inline-block;
  background: var(--bg-card);
  color: var(--text-muted);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-size: 0.8rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
}

.tag:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.article-disclaimer {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* List / Grid */
.list-header {
  margin-bottom: 2rem;
}

.list-header p {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card-category a {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.card h2 {
  font-size: 1.2rem;
  margin: 0 0 0.75rem;
}

.card h2 a {
  color: #fff;
}

.card h2 a:hover {
  color: var(--accent);
}

.card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Related Articles */
.related-articles {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-articles h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.related-articles ul {
  list-style: none;
}

.related-articles li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.related-articles li:last-child {
  border-bottom: none;
}

.related-articles a {
  color: #fff;
  font-weight: 500;
}

.related-articles a:hover {
  color: var(--accent);
}

.related-articles p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Homepage */
.home-hero {
  text-align: center;
  padding: 3rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.home-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.home-hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 2px solid var(--accent);
  margin-top: 3rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.footer-nav a {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-nav a:hover {
  color: var(--accent);
}

.footer-disclaimer {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.pagination-prev,
.pagination-next {
  display: inline-block;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.pagination-prev:hover,
.pagination-next:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.pagination-info {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Tag Cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.tag-cloud-item {
  display: inline-block;
  background: var(--bg-card);
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.tag-cloud-item:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.tag-count {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.article-count {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Mobile */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .nav-toggle { display: block; }

  .main-nav.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--accent);
    gap: 0.75rem;
  }

  .site-container {
    grid-template-columns: 1fr;
  }

  .main-content {
    grid-column: 1;
    grid-row: 2;
  }

  .sidebar {
    grid-column: 1;
    grid-row: 1;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-section {
    flex: 1 1 250px;
  }

  .home-hero h1 { font-size: 1.8rem; }
  h1 { font-size: 1.7rem; }

  .article-grid {
    grid-template-columns: 1fr;
  }
}
