/* ============================================================
   LearnHub Theme — Main Stylesheet
   Design: Clean editorial with vibrant green accent system
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ──────────────────────────────────────── */
:root {
  --primary:        #2d8a4e;
  --primary-dark:   #1e6638;
  --primary-light:  #e8f5ee;
  --primary-xlight: #f2faf5;
  --accent:         #ff6b35;
  --accent-light:   #fff3ee;
  --text:           #1a1a2e;
  --text-muted:     #6b7280;
  --text-light:     #9ca3af;
  --border:         #e5e7eb;
  --border-light:   #f3f4f6;
  --bg:             #ffffff;
  --bg-off:         #f9fafb;
  --header-h:       64px;
  --subnav-h:       44px;
  --col-left:       20%;
  --col-mid:        60%;
  --col-right:      20%;
  --radius:         8px;
  --radius-lg:      12px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
  --shadow:         0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:      0 8px 28px rgba(0,0,0,.12);
  --font-body:      'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono:      'JetBrains Mono', 'Courier New', monospace;
  --transition:     150ms ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }

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

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

img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

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

h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

code, pre {
  font-family: var(--font-mono);
  font-size: .875em;
}
pre {
  background: #1e2333;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
}
code {
  background: var(--border-light);
  padding: .15em .4em;
  border-radius: 4px;
  color: var(--primary-dark);
}
pre code { background: none; color: inherit; padding: 0; }

/* ── Layout Shell ───────────────────────────────────────── */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-container {
  display: flex;
  flex: 1;
  width: 100%;
  padding-top: calc(var(--header-h) + var(--subnav-h));
}

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--text);
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 2rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.5px;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.3px;
}
.logo-text span { color: var(--primary); }

/* Main nav */
.main-nav { flex: 1; }

.main-nav > ul {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.main-nav > ul > li { position: relative; }

.main-nav > ul > li > a {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .5rem .85rem;
  font-size: .875rem;
  font-weight: 600;
  color: rgba(255,255,255,.82);
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
}

.main-nav > ul > li > a:hover,
.main-nav > ul > li.current-menu-item > a,
.main-nav > ul > li.current-menu-ancestor > a {
  color: #fff;
  background: rgba(255,255,255,.12);
}

.main-nav > ul > li > a .nav-arrow {
  font-size: .65rem;
  transition: transform var(--transition);
}
.main-nav > ul > li:hover > a .nav-arrow { transform: rotate(180deg); }

/* Dropdown */
.main-nav .sub-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all var(--transition);
  padding: .5rem;
  z-index: 100;
}

.main-nav li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.main-nav .sub-menu li a {
  display: block;
  padding: .5rem .8rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  border-radius: 6px;
}
.main-nav .sub-menu li a:hover { background: var(--primary-light); color: var(--primary-dark); }

/* Header right */
.header-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

.header-search {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  overflow: hidden;
}

.header-search input {
  background: transparent;
  border: none;
  padding: .45rem .75rem;
  font-size: .85rem;
  color: #fff;
  width: 180px;
  outline: none;
  font-family: var(--font-body);
}
.header-search input::placeholder { color: rgba(255,255,255,.5); }

.header-search button {
  background: transparent;
  border: none;
  padding: .45rem .65rem;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  transition: color var(--transition);
}
.header-search button:hover { color: #fff; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  padding: .45rem 1rem;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

/* Mobile hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: .4rem;
  margin-left: auto;
}

/* ── Sticky Sub-Nav (Tutorial Topics Bar) ───────────────── */
.topics-subnav {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 999;
  height: var(--subnav-h);
  background: var(--primary);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.topics-subnav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.topics-subnav-inner::-webkit-scrollbar { display: none; }

.topics-subnav-inner a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: 0 .9rem;
  height: var(--subnav-h);
  font-size: .8125rem;
  font-weight: 600;
  color: rgba(255,255,255,.82);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  position: relative;
}

.topics-subnav-inner a:hover {
  color: #fff;
  background: rgba(0,0,0,.12);
  border-bottom-color: rgba(255,255,255,.5);
}

.topics-subnav-inner a.active,
.topics-subnav-inner a.current-topic {
  color: #fff;
  background: rgba(0,0,0,.18);
  border-bottom-color: #fff;
}

.topics-subnav-inner a .topic-icon {
  font-size: .95rem;
}

/* ── Three-Column Layout ────────────────────────────────── */
.col-left {
  width: var(--col-left);
  min-width: 200px;
  flex-shrink: 0;
  background: var(--bg-off);
  border-right: 1px solid var(--border);
  min-height: calc(100vh - var(--header-h) - var(--subnav-h));
  position: sticky;
  top: calc(var(--header-h) + var(--subnav-h));
  height: calc(100vh - var(--header-h) - var(--subnav-h));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.col-left::-webkit-scrollbar { width: 4px; }
.col-left::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.col-mid {
  width: var(--col-mid);
  flex: 1;
  padding: 2rem 2.5rem;
  min-width: 0;
}

.col-right {
  width: var(--col-right);
  min-width: 180px;
  flex-shrink: 0;
  background: var(--bg-off);
  border-left: 1px solid var(--border);
  padding: 1.5rem 1rem;
}

/* ── Left Sidebar — Category Menu ──────────────────────── */
.sidebar-section {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.sidebar-section:last-child { border-bottom: none; }

.sidebar-section-title {
  padding: .5rem 1rem .4rem;
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-light);
}

/* Category tree */
.cat-tree { padding: 0 .5rem; }

.cat-item { position: relative; }

.cat-item > .cat-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  user-select: none;
}

.cat-item > .cat-link:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.cat-item > .cat-link.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.cat-item > .cat-link .cat-icon { font-size: 1rem; flex-shrink: 0; }

.cat-item > .cat-link .cat-name { flex: 1; }

.cat-item > .cat-link .cat-toggle {
  font-size: .7rem;
  color: var(--text-light);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.cat-item.open > .cat-link .cat-toggle { transform: rotate(90deg); }
.cat-item > .cat-link.active .cat-toggle { color: rgba(255,255,255,.7); }

/* Sub-categories / posts */
.cat-children {
  display: none;
  margin-left: 1rem;
  border-left: 2px solid var(--border);
  padding-left: .25rem;
  margin-top: .2rem;
  margin-bottom: .2rem;
}
.cat-item.open > .cat-children { display: block; }

.cat-child-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .38rem .65rem;
  font-size: .8125rem;
  font-weight: 400;
  color: var(--text-muted);
  border-radius: 5px;
  text-decoration: none;
  transition: all var(--transition);
}
.cat-child-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.cat-child-link.active {
  color: var(--primary-dark);
  font-weight: 600;
}
.cat-child-link::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background var(--transition);
}
.cat-child-link.active::before,
.cat-child-link:hover::before { background: var(--primary); }

/* ── Homepage Hero ──────────────────────────────────────── */
.hero-banner {
  background: linear-gradient(135deg, #1e2333 0%, #1e6638 100%);
  color: #fff;
  padding: 3.5rem 2.5rem;
  margin: -2rem -2.5rem 2.5rem;
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(45,138,78,.35) 0%, transparent 65%);
  pointer-events: none;
}

.hero-banner::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,107,53,.15) 0%, transparent 65%);
  pointer-events: none;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .3rem .8rem;
  border-radius: 100px;
  margin-bottom: 1.25rem;
}

.hero-banner h1 {
  color: #fff;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero-banner h1 em {
  font-style: normal;
  color: #6ee89a;
}

.hero-banner p {
  font-size: 1rem;
  color: rgba(255,255,255,.75);
  max-width: 520px;
  margin-bottom: 1.75rem;
}

.hero-ctas { display: flex; gap: .75rem; flex-wrap: wrap; }

.btn-hero-primary {
  background: #fff;
  color: var(--primary-dark);
  padding: .7rem 1.4rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.btn-hero-primary:hover { background: var(--primary-light); transform: translateY(-1px); }

.btn-hero-secondary {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  padding: .7rem 1.4rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.btn-hero-secondary:hover { background: rgba(255,255,255,.2); transform: translateY(-1px); }

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.hero-stat { }
.hero-stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.hero-stat-label {
  font-size: .75rem;
  color: rgba(255,255,255,.6);
  margin-top: .2rem;
}

/* ── Homepage Sections ──────────────────────────────────── */
.home-section { margin-bottom: 3.5rem; }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-light);
}

.section-label {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .4rem;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: .25rem .6rem;
  border-radius: 100px;
}

.section-header h2 { margin: 0; }

.section-view-all {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.section-view-all:hover { color: var(--primary-dark); }

/* Topic button grid */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .75rem;
}

.topic-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1rem .75rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all 200ms ease;
  color: var(--text);
  text-align: center;
  cursor: pointer;
}

.topic-btn:hover {
  border-color: var(--primary);
  background: var(--primary-xlight);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(45,138,78,.15);
  color: var(--primary-dark);
}

.topic-btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.topic-btn-label {
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.2;
}

.topic-btn-count {
  font-size: .7rem;
  color: var(--text-light);
}

/* Topic icon color variants */
.icon-python  { background: #fff3cd; }
.icon-ml      { background: #e8d5f5; }
.icon-sql     { background: #d1e8ff; }
.icon-html    { background: #ffe4d4; }
.icon-css     { background: #d4e6ff; }
.icon-js      { background: #fff9c4; }
.icon-java    { background: #ffe4e4; }
.icon-c       { background: #e4f0ff; }
.icon-cpp     { background: #e4f4ff; }
.icon-react   { background: #d4f2ff; }
.icon-node    { background: #d4f0d4; }
.icon-php     { background: #e8d5f0; }
.icon-ds      { background: #fde8d0; }
.icon-ai      { background: #e0f0e8; }
.icon-default { background: var(--primary-light); }

/* Project cards */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.project-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 200ms ease;
  text-decoration: none;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.project-card-header {
  padding: 1.25rem 1rem .75rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.project-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.project-card-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.project-card-body {
  padding: 0 1rem 1.25rem;
  flex: 1;
}

.project-card-desc {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: .75rem;
}

.project-card-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.project-tag {
  font-size: .7rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: .2rem .55rem;
  border-radius: 100px;
}

/* Exercise list */
.exercise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .75rem;
}

.exercise-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all var(--transition);
  background: var(--bg);
}
.exercise-card:hover {
  border-color: var(--primary);
  background: var(--primary-xlight);
  transform: translateX(3px);
}

.exercise-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.exercise-info { min-width: 0; }
.exercise-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.exercise-count {
  font-size: .72rem;
  color: var(--text-light);
}

/* ── Right Sidebar — Ads & Widgets ──────────────────────── */
.col-right .widget { margin-bottom: 1.5rem; }

.widget-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-light);
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

/* Google Ad slot */
.ad-slot {
  background: var(--border-light);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-light);
  font-size: .75rem;
  min-height: 250px;
  padding: 1rem;
  overflow: hidden;
}

.ad-slot ins { display: block; width: 100%; }

.ad-label {
  font-size: .65rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .5rem;
}

/* Trending topics widget */
.trending-list { }
.trending-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  transition: all var(--transition);
}
.trending-item:last-child { border-bottom: none; }
.trending-item:hover .trending-name { color: var(--primary); }

.trending-rank {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.trending-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  transition: color var(--transition);
}

/* ── Article / Post Content ─────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb .sep { color: var(--border); }

.post-header { margin-bottom: 2rem; }

.post-cats {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}

.post-cat-badge {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--primary);
  color: #fff;
  padding: .25rem .65rem;
  border-radius: 100px;
  text-decoration: none;
}

.post-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: .75rem;
  line-height: 1.25;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--text-muted);
}

.post-meta-item {
  display: flex;
  align-items: center;
  gap: .3rem;
}

.post-feat-img {
  width: 100%;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  object-fit: cover;
  max-height: 360px;
}

/* Article body */
.entry-content { font-size: .9375rem; line-height: 1.75; }

.entry-content h2 { margin: 2rem 0 .75rem; }
.entry-content h3 { margin: 1.5rem 0 .6rem; }
.entry-content h4 { margin: 1.25rem 0 .5rem; }

.entry-content ul,
.entry-content ol {
  margin: .75rem 0 1rem 1.5rem;
}
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: .3rem; }

.entry-content blockquote {
  border-left: 4px solid var(--primary);
  padding: .75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--primary-xlight);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-muted);
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .875rem;
}
.entry-content th {
  background: var(--text);
  color: #fff;
  padding: .65rem 1rem;
  text-align: left;
  font-weight: 600;
}
.entry-content td {
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
}
.entry-content tr:nth-child(even) td { background: var(--bg-off); }

/* Try It button */
.try-it-box {
  background: var(--primary-xlight);
  border: 1.5px solid var(--primary-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.try-it-label { font-size: .9rem; font-weight: 600; color: var(--primary-dark); }
.try-it-btn {
  background: var(--primary);
  color: #fff;
  padding: .5rem 1.2rem;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  transition: background var(--transition);
}
.try-it-btn:hover { background: var(--primary-dark); color: #fff; }

/* Post nav */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-light);
}

.post-nav-link {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  text-decoration: none;
  transition: all var(--transition);
}
.post-nav-link:hover { border-color: var(--primary); background: var(--primary-xlight); }

.post-nav-dir {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-light);
  margin-bottom: .3rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.post-nav-title { font-size: .9rem; font-weight: 600; color: var(--text); }
.post-nav-link:hover .post-nav-title { color: var(--primary-dark); }
.post-nav-link.next { text-align: right; }
.post-nav-link.next .post-nav-dir { justify-content: flex-end; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: #12161f;
  color: rgba(255,255,255,.65);
  padding: 3.5rem 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding: 0 1.5rem 3rem;
  max-width: 100%;
}

.footer-brand .site-logo { margin-bottom: 1rem; }
.footer-brand p { font-size: .875rem; line-height: 1.65; max-width: 280px; }

.footer-col-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #fff;
  margin-bottom: 1rem;
}

.footer-links { display: flex; flex-direction: column; gap: .5rem; }
.footer-links a {
  font-size: .85rem;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom-text { font-size: .8rem; }

.footer-bottom-links {
  display: flex;
  gap: 1.25rem;
}
.footer-bottom-links a {
  font-size: .8rem;
  color: rgba(255,255,255,.5);
  text-decoration: none;
}
.footer-bottom-links a:hover { color: #fff; }

/* ── Utility: Page Header ───────────────────────────────── */
.page-header-bar {
  background: linear-gradient(90deg, var(--text) 0%, #1e4030 100%);
  padding: 2.5rem 2.5rem 2rem;
  margin: -2rem -2.5rem 2.5rem;
  color: #fff;
}
.page-header-bar h1 { color: #fff; margin-bottom: .5rem; }
.page-header-bar p { color: rgba(255,255,255,.7); font-size: .95rem; }

/* ── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: all var(--transition);
}
.page-numbers:hover,
.page-numbers.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Comments ────────────────────────────────────────────── */
.comments-section { margin-top: 3rem; padding-top: 2rem; border-top: 2px solid var(--border-light); }
.comments-title { margin-bottom: 1.5rem; }

.comment {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
}
.comment:last-child { border-bottom: none; }

.comment-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .5rem;
}
.comment-avatar { border-radius: 50%; }
.comment-author-name { font-weight: 600; font-size: .9rem; }
.comment-date { font-size: .78rem; color: var(--text-light); }

.comment-form textarea,
.comment-form input {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .9rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition);
  margin-bottom: .75rem;
  outline: none;
}
.comment-form textarea:focus,
.comment-form input:focus { border-color: var(--primary); }
.comment-form textarea { resize: vertical; min-height: 120px; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1200px) {
  :root {
    --col-left:  22%;
    --col-mid:   56%;
    --col-right: 22%;
  }
}

@media (max-width: 1024px) {
  .main-container { flex-wrap: wrap; }

  .col-left {
    width: 260px;
    min-width: 0;
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .col-left.mobile-open { display: block; }

  .col-mid {
    width: 100%;
    order: 2;
    padding: 1.5rem;
  }

  .col-right {
    width: 100%;
    order: 3;
    border-left: none;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
  }
  .col-right .widget { margin-bottom: 0; flex: 1 1 240px; }

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

@media (max-width: 768px) {
  .main-nav { display: none; }
  .main-nav.mobile-open {
    display: block;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--text);
    overflow-y: auto;
    z-index: 998;
    padding: 1rem;
  }
  .main-nav.mobile-open > ul { flex-direction: column; }
  .main-nav.mobile-open > ul > li > a { font-size: 1rem; padding: .75rem 1rem; }

  .menu-toggle { display: flex; }
  .header-search { display: none; }

  .hero-banner { padding: 2.5rem 1.5rem; }
  .col-mid { padding: 1.25rem; }
  .hero-banner { margin: -1.25rem -1.25rem 2rem; }
  .page-header-bar { margin: -1.25rem -1.25rem 2rem; padding: 2rem 1.25rem 1.5rem; }
  .post-nav { grid-template-columns: 1fr; }

  .topic-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .topics-subnav-inner a { padding: 0 .65rem; font-size: .75rem; }
  .hero-stats { gap: 1.25rem; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .project-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Skip link (accessibility) ───────────────────────────── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--primary);
  color: #fff;
  padding: .5rem 1rem;
  border-radius: 0 0 6px 6px;
  font-size: .85rem;
  font-weight: 600;
  z-index: 9999;
  transition: top var(--transition);
}
.skip-link:focus { top: 0; }

/* ── Screen reader only ────────────────────────────────────  */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── WP align classes ──────────────────────────────────────  */
.alignleft { float: left; margin: .5rem 1.5rem 1rem 0; }
.alignright { float: right; margin: .5rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 1.5rem auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: .8rem; color: var(--text-muted); text-align: center; margin-top: .4rem; }
