* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f7fb;
  color: #222;
  line-height: 1.6;
}

.container {
  max-width: 1150px;
  margin: auto;
  padding: 0 16px;
}

/* Header */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e6e9f0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  position: relative;
}

.logo {
  font-weight: 800;
  font-size: 22px;
  text-decoration: none;
  color: #1d4ed8;
}

.menu {
  display: flex;
  align-items: center;
  gap: 18px;
}

.menu a {
  text-decoration: none;
  color: #222;
  font-weight: 600;
  transition: 0.2s ease;
}

.menu a:hover {
  color: #1d4ed8;
}

.nav-dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 34px;
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e6e9f0;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  padding: 10px;
  z-index: 999;
}

.nav-dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: 9px 10px;
  color: #374151;
  border-radius: 8px;
  font-size: 14px;
}

.dropdown-menu a:hover {
  background: #eef4ff;
  color: #1d4ed8;
}

.dropdown-sub {
  margin-left: 10px;
  border-left: 2px solid #eef2ff;
}

.hamburger {
  display: none;
  background: #1d4ed8;
  color: #fff;
  border: 0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 22px;
  cursor: pointer;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 24px;
  padding: 24px 0;
}

.content {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
}

.sidebar .card {
  position: static;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #1d4ed8, #0f172a);
  color: #fff;
  border-radius: 18px;
  padding: 36px;
  margin-bottom: 22px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 36px;
}

.hero p {
  margin: 0;
  font-size: 17px;
}

/* Cards */
.card,
.post-card {
  background: #fff;
  border: 1px solid #e6e9f0;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.post-card {
  margin-bottom: 18px;
  display: grid;
  gap: 10px;
  padding: 24px 28px;
  transition: 0.2s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

.post-card img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 14px;
}

.post-card h2 {
  margin: 0 0 12px;
}

.post-card h2 a {
  text-decoration: none;
  color: #111827;
  transition: 0.2s ease;
}

.post-card h2 a:hover {
  color: #1d4ed8;
}

.post-card p {
  margin: 0 0 14px;
}

.readmore {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
  transition: 0.2s ease;
}

.readmore:hover {
  text-decoration: underline;
}

.badge {
  display: inline-block;
  width: fit-content;
  background: #eaf1ff;
  color: #1d4ed8;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.badge a {
  color: #1d4ed8;
}

/* Category header */
.category-header {
  margin-bottom: 18px;
}

.category-header h1 {
  margin: 0;
  font-size: 34px;
}

.category-header p {
  margin: 6px 0 0;
  color: #6b7280;
}

/* Sidebar category list */
.cat-list,
.cat-list ul {
  list-style: none;
  padding-left: 0;
}

.cat-list ul {
  padding-left: 16px;
  margin-top: 6px;
}

.cat-list li {
  margin: 8px 0;
}

.cat-list a {
  text-decoration: none;
  color: #374151;
  transition: 0.2s ease;
}

.cat-list a:hover {
  color: #1d4ed8;
  padding-left: 4px;
}

.cat-list a.active {
  color: #1d4ed8;
  font-weight: 600;
}

/* Single post/page */
.single-post h1 {
  font-size: 34px;
  margin: 8px 0;
}

.date {
  color: #6b7280;
  margin-bottom: 16px;
}

.featured {
  width: 100%;
  border-radius: 16px;
  margin: 16px 0;
}

.post-content h2 {
  font-size: 26px;
  margin: 12px 0 0px;
  color: #111827;
}

.post-content h3 {
  font-size: 21px;
  margin: 10px 0 0px;
  color: #111827;
}

.post-content img {
  max-width: 100%;
  height: auto;
}

/* Code block */
.post-content pre {
  position: relative;
  background: #f8fafc;
  color: #111827;
  border: 1px solid #e5e7eb;
  padding: 16px;
  border-radius: 12px;
  overflow: auto;
  font-size: 14px;
}

.post-content pre code {
  color: #111827;
  background: transparent;
}

.post-content code {
  background: #eef2ff;
  color: #111827;
  padding: 2px 6px;
  border-radius: 6px;
}

.post-content pre::after {
  content: attr(data-lang);
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 11px;
  color: #6b7280;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Related posts */
.related-posts {
  margin-top: 30px;
}

.related-posts h3 {
  margin-bottom: 15px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.related-card {
  background: #fff;
  border: 1px solid #e6e9f0;
  border-radius: 12px;
  padding: 14px;
  transition: 0.2s ease;
}

.related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.related-card h4 {
  margin: 0;
  font-size: 15px;
}

.related-card a {
  text-decoration: none;
  color: #111827;
}

.related-card a:hover {
  color: #1d4ed8;
}

/* Search */
.search-card {
  margin-bottom: 18px;
}

.search-form {
  display: flex;
  gap: 8px;
}

.search-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e5e7eb;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.search-form button {
  flex-shrink: 0;
  border: 0;
  background: #1d4ed8;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.search-form button:hover {
  background: #1e40af;
}

mark {
  background: #fef3c7;
  color: #92400e;
  padding: 1px 4px;
  border-radius: 4px;
}

/* Footer */
.footer {
  background: #0f172a;
  color: #fff;
  padding: 22px 0;
  margin-top: 30px;
}

.footer-inner {
  text-align: center;
}

.footer-links {
  margin-bottom: 10px;
}

.footer-links a {
  color: #cbd5f5;
  text-decoration: none;
  margin: 0 8px;
  font-size: 14px;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-copy {
  font-size: 13px;
  color: #9ca3af;
}

/* Mobile */
@media (max-width: 850px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .nav {
    height: 66px;
  }

  .hamburger {
    display: block;
  }

  .menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    border-bottom: 1px solid #e6e9f0;
    padding: 12px 16px;
    gap: 0;
  }

  .menu.show {
    display: flex;
  }

  .menu a {
    display: block;
    margin: 8px 0;
  }

  .nav-dropdown {
    width: 100%;
  }

  .dropdown-menu {
    display: none;
    position: static;
    box-shadow: none;
    border: 0;
    padding: 0 0 0 12px;
  }

  .nav-dropdown.active .dropdown-menu {
    display: block;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .sidebar {
    position: static;
  }

  .hero {
    padding: 28px 22px;
    border-radius: 16px;
  }

  .hero h1 {
    font-size: 28px;
    line-height: 1.25;
  }

  .card,
  .post-card {
    padding: 20px 18px;
    border-radius: 14px;
  }

  .single-post h1 {
    font-size: 30px;
    line-height: 1.25;
  }

  .related-posts h3 {
    margin-left: 0;
    font-size: 22px;
  }
}

@media (max-width: 500px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .logo {
    font-size: 20px;
  }

  .hamburger {
    padding: 7px 11px;
  }

  .card,
  .post-card {
    padding: 18px 16px;
  }

  .search-form {
    flex-direction: column;
  }

  .search-form button {
    width: 100%;
  }

  .footer-links a {
    display: inline-block;
    margin: 4px 6px;
  }
}

.card {
  transition: 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.dropdown-menu {
  top: 100%;
}

.nav-dropdown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0;
}

.pagination a {
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 8px 13px;
  border-radius: 9px;
  text-decoration: none;
  color: #111827;
  font-weight: 600;
}

.pagination a:hover,
.pagination a.active {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}


.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  background: #fff;
}

.post-content th,
.post-content td {
  border: 1px solid #e5e7eb;
  padding: 10px 12px;
  text-align: left;
}

.post-content th {
  background: #f8fafc;
  font-weight: 700;
}


.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 14px 0;
}