/* ==========================================================================
   CppDepend Blog theme — matches the cppdepend.com design system
   Colors: #D94F3D (brand red), #111 (text), #5A5A5A (muted), #FAFAF8 (panels)
   Font: Plus Jakarta Sans
   ========================================================================== */

:root {
  --brand: #D94F3D;
  --text: #111111;
  --muted: #5A5A5A;
  --faint: #9B9B9B;
  --bg: #FFFFFF;
  --panel: #FAFAF8;
  --border: rgba(0, 0, 0, .08);
  --radius: 12px;
  --maxw: 1200px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { opacity: .85; }

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

.screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  clip: rect(1px, 1px, 1px, 1px); overflow: hidden;
}

/* ---------- Header (identical to main site) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(8px);
}
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }
.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-logo img { height: 36px; width: auto; display: block; }

.main-nav .nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-actions { display: flex; align-items: center; gap: 12px; }
.btn-pricing {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 8px;
  transition: background .15s;
}
.btn-pricing:hover { background: rgba(0, 0, 0, .05); opacity: 1; color: var(--muted); }
.btn-download {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border-radius: 8px;
  transition: opacity .15s, box-shadow .15s;
}
.btn-download:hover { opacity: .9; box-shadow: 0 4px 14px rgba(217, 79, 61, .35); color: #fff; }
.btn-block { display: block; text-align: center; }

/* ---------- Desktop nav links ---------- */
.main-nav { display: flex; align-items: center; }
.nav-list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-list a, .nav-link {
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 8px;
  transition: color .15s, background .15s;
}
.nav-list a:hover, .nav-list a.active, .nav-list .current-menu-item > a, .nav-link:hover, .nav-link.active {
  color: var(--text);
  background: rgba(0, 0, 0, .05);
  opacity: 1;
}


/* ---------- Mega-menus (identical to main site) ---------- */
.main-nav { display: flex; align-items: center; gap: 1px; }
.mm-btnwrap { display: inline-block; }
.mm-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 500; color: var(--muted);
  border-radius: 8px; transition: color .15s, background .15s;
}
.mm-btn:hover { color: var(--text); background: rgba(0,0,0,.05); }
.mm-chevron { transition: transform .2s; }
.mm-btn[aria-expanded="true"] .mm-chevron { transform: rotate(180deg); }
.mm-panel { display: none; position: absolute; left: 0; right: 0; top: 64px; z-index: 49; border-top: 1px solid rgba(0,0,0,.05); background: #FAFAF8; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.mm-panel.mm-open { display: block; }
.mm-inner { padding-top: 32px; padding-bottom: 32px; }
.mm-grid { display: grid; gap: 32px; grid-template-columns: repeat(3, minmax(200px, 280px)); }
.mm-grid-cols-1 { grid-template-columns: repeat(1, minmax(200px, 280px)); }
.mm-title { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #9B9B9B; margin: 0 0 16px; }
.mm-items { display: flex; flex-direction: column; gap: 4px; }
.mm-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 8px; text-decoration: none; transition: background .15s; }
.mm-item:hover { background: rgba(0,0,0,.05); opacity: 1; }
.mm-icon { margin-top: 2px; flex-shrink: 0; display: inline-flex; }
.mm-label { display: block; font-size: 14px; font-weight: 500; color: #111; line-height: 1.3; }
.mm-desc { display: block; font-size: 12px; color: #9B9B9B; margin-top: 2px; }
.mm-sub-title { padding: 16px 8px 6px; }

/* ---------- Mobile nav ---------- */
.mnav-toggle { display: none; background: none; border: 0; color: var(--text); cursor: pointer; padding: 4px; }
.mnav-panel { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #fff; z-index: 49; overflow-y: auto; max-height: calc(100vh - 64px); padding: 16px 24px 28px; box-shadow: 0 20px 40px rgba(0,0,0,.12); border-top: 1px solid rgba(0,0,0,.06); }
.mnav-panel.open { display: block; }
.mnav-panel .mnav-list { list-style: none; margin: 0; padding: 0; }
.mnav-link, .mnav-panel .mnav-list a { display: block; padding: 12px 8px; font-size: 16px; font-weight: 500; color: var(--text); }
.mnav-cta { color: var(--brand); }

/* ---------- Blog layout ---------- */
.site-main { min-height: 60vh; }

.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 80px;
}

.blog-head { margin-bottom: 36px; }
.blog-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 8px;
}
.blog-title span { color: var(--brand); }
.blog-subtitle { color: var(--muted); font-size: 17px; margin: 0 0 20px; }

/* Search form */
.search-form {
  display: flex;
  align-items: center;
  max-width: 420px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.search-field {
  flex: 1;
  border: 0;
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
.search-submit {
  border: 0;
  background: var(--brand);
  color: #fff;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.search-submit:hover { opacity: .9; }

/* Language filter chips */
.lang-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.lang-chip {
  display: inline-block;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all .15s;
}
.lang-chip:hover {
  color: var(--brand);
  border-color: var(--brand);
  opacity: 1;
}
.lang-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* Language filter chips */
.lang-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.lang-chip {
  display: inline-block;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all .15s;
}
.lang-chip:hover {
  color: var(--brand);
  border-color: var(--brand);
  opacity: 1;
}
.lang-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* Post cards */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}
.post-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, .08);
  transform: translateY(-2px);
}
.post-card-thumb img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.post-card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--faint);
}
.post-cat {
  background: rgba(217, 79, 61, .08);
  color: var(--brand);
  font-weight: 600;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.post-card-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--brand); opacity: 1; }
.post-card-excerpt { color: var(--muted); font-size: 14.5px; margin: 0; flex: 1; }
.post-card-time { font-size: 12.5px; color: var(--faint); }

/* Pagination */
.pagination { margin-top: 44px; }
.pagination .nav-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pagination .page-numbers {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.pagination .page-numbers.current {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.pagination .page-numbers:hover:not(.current) { background: var(--panel); opacity: 1; }

/* ---------- Single post ---------- */
.page-wrap { max-width: 820px; padding-top: 48px; padding-bottom: 80px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--faint);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); opacity: 1; }
.breadcrumb .current { color: var(--brand); }

.single-head { margin-bottom: 28px; }
.single-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 12px 0 0;
}
.single-thumb { margin: 0 0 32px; border-radius: var(--radius); overflow: hidden; }

.entry-content { font-size: 17px; line-height: 1.75; color: #2b2b2b; }
.entry-content h2 { font-size: 26px; font-weight: 700; margin: 40px 0 16px; letter-spacing: -.01em; }
.entry-content h3 { font-size: 21px; font-weight: 700; margin: 32px 0 12px; }
.entry-content h4 { font-size: 18px; font-weight: 600; margin: 24px 0 10px; }
.entry-content p { margin: 0 0 20px; }
.entry-content ul, .entry-content ol { margin: 0 0 20px; padding-left: 24px; }
.entry-content li { margin-bottom: 8px; }
.entry-content blockquote {
  margin: 28px 0;
  padding: 20px 24px;
  background: var(--panel);
  border-left: 4px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
  font-style: italic;
}
.entry-content pre {
  background: #0F0F0F;
  color: #e6e6e6;
  padding: 18px 20px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}
.entry-content code {
  background: rgba(0, 0, 0, .06);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: .92em;
}
.entry-content pre code { background: none; padding: 0; }
.entry-content img { border-radius: 10px; }
.entry-content table { border-collapse: collapse; width: 100%; margin: 24px 0; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; font-size: 15px; }
.entry-content th { background: var(--panel); font-weight: 600; }

.post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 36px 0 0; }
.tag {
  font-size: 13px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
}
.tag:hover { color: var(--brand); border-color: var(--brand); opacity: 1; }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 14.5px;
  font-weight: 500;
}

/* ---------- Sidebar ---------- */
.blog-sidebar .widget {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 24px;
}
.widget-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 14px;
}
.widget-list, .widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.widget-list li, .widget ul li {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
}
.widget-list li:last-child, .widget ul li:last-child { border-bottom: 0; }
.widget-list a, .widget ul a { color: var(--text); }
.widget-list a:hover, .widget ul a:hover { color: var(--brand); opacity: 1; }
.widget-cta p { font-size: 14px; color: var(--muted); margin: 0 0 14px; }

/* ---------- Comments ---------- */
.comments-area { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.comments-title { font-size: 22px; font-weight: 700; margin: 0 0 24px; }
.comment-list { list-style: none; margin: 0 0 32px; padding: 0; }
.comment-list .comment { padding: 18px 0; border-bottom: 1px solid var(--border); }
.comment-list .children { list-style: none; padding-left: 32px; }
.comment-author { font-weight: 600; font-size: 14.5px; }
.comment-metadata { font-size: 12.5px; color: var(--faint); }
.comment-content { font-size: 15px; margin-top: 8px; }
.comment-reply-link { font-size: 13px; font-weight: 600; }
.comment-form label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 15px;
  margin-bottom: 14px;
}
.comment-form .submit {
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 22px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

/* ---------- No results / 404 ---------- */
.no-results { text-align: center; padding: 48px 0; }
.no-results h2 { font-size: 24px; margin: 0 0 8px; }
.no-results p { color: var(--muted); }
.no-results .search-form { margin: 20px auto 0; }
.error-404 { text-align: center; }
.error-404 .btn-download, .error-404 .btn-pricing { display: inline-block; margin: 8px 6px 20px; }
.error-404 .search-form { margin: 0 auto; }

/* ---------- Footer (identical to main site) ---------- */
.site-footer {
  background: #F7F7F5;
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}
.footer-brand p { font-size: 14px; color: var(--muted); line-height: 1.6; max-width: 260px; }
.footer-logo img { height: 32px; width: auto; margin-bottom: 16px; }
.footer-col h4 { font-size: 14px; font-weight: 600; margin: 0 0 16px; color: var(--text); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 12px; }
.footer-col a { font-size: 14px; color: var(--muted); }
.footer-col a:hover { color: var(--text); opacity: 1; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  font-size: 13px;
  color: var(--faint);
}
.footer-bottom p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1023.98px) {
  .main-nav, .header-actions { display: none; }
  .mm-panel { display: none !important; }
  .mnav-toggle { display: block; }
  .blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar { order: 2; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .mnav-toggle, .mnav-panel { display: none !important; }
}
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .header-inner { padding: 0 16px; }
}
