/* ═══════════════════════════════════════════
   TechnoPlusLabs — Theme (Dark / Light / Auto)
   ═══════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --tpl-bg:         #f2f2f7;
  --tpl-surface:    #ffffff;
  --tpl-surface-2:  #f8f9fa;
  --tpl-border:     #e4e4ec;
  --tpl-text:       #1a1a2e;
  --tpl-muted:      #6c757d;
  --tpl-nav-bg:     #ffffff;
  --tpl-shadow:     0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.05);
  --tpl-shadow-lg:  0 4px 24px rgba(112,17,255,.14);
  --tpl-transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

[data-theme="dark"] {
  --tpl-bg:         #0b0b11;
  --tpl-surface:    #14141e;
  --tpl-surface-2:  #1c1c2a;
  --tpl-border:     #252535;
  --tpl-text:       #dcdce8;
  --tpl-muted:      #7878a0;
  --tpl-nav-bg:     #0e0e18;
  --tpl-shadow:     0 1px 3px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.35);
  --tpl-shadow-lg:  0 4px 24px rgba(112,17,255,.28);
}

/* ── Transitions ── */
body,
.navbar,
.card,
footer,
.sidebar-card,
.stats-bar { transition: var(--tpl-transition); }

/* ── Base ── */
body {
  background-color: var(--tpl-bg) !important;
  color: var(--tpl-text) !important;
}

/* ── Navbar ── */
.navbar {
  background-color: var(--tpl-nav-bg) !important;
  border-bottom: 1px solid var(--tpl-border) !important;
  box-shadow: var(--tpl-shadow);
}
.navbar .nav-link         { color: var(--tpl-text) !important; }
.navbar .nav-link:hover,
.navbar .nav-link.active  { color: #7011ff !important; }
.navbar .navbar-toggler   { border-color: var(--tpl-border) !important; }
[data-theme="dark"] .navbar-toggler-icon { filter: invert(1) brightness(1.8); }

/* ── Cards ── */
.card {
  background-color: var(--tpl-surface) !important;
  border: 1px solid var(--tpl-border) !important;
  box-shadow: var(--tpl-shadow) !important;
}
.card { transition: box-shadow .2s ease, transform .2s ease, var(--tpl-transition); }
.card:hover {
  box-shadow: var(--tpl-shadow-lg) !important;
  transform: translateY(-2px);
}
.card-title a { color: var(--tpl-text) !important; }
.card-title a:hover { color: #7011ff !important; }

/* ── Global overrides for dark ── */
.text-dark  { color: var(--tpl-text)  !important; }
.text-muted { color: var(--tpl-muted) !important; }
.bg-white   { background-color: var(--tpl-surface) !important; }

/* ── Footer ── */
footer.bg-white {
  background-color: var(--tpl-nav-bg) !important;
  border-top: 1px solid var(--tpl-border);
}

/* ── Theme toggle button ── */
.btn-theme {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .75rem;
  border: 1px solid var(--tpl-border);
  border-radius: 50rem;
  background: transparent;
  color: var(--tpl-muted);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
  font-family: var(--bs-font-sans-serif);
}
.btn-theme:hover { border-color: #7011ff; color: #7011ff; }
.btn-theme i { font-size: .85rem; }

/* ── Navbar date ── */
.nav-date {
  font-size: .72rem;
  color: var(--tpl-muted);
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--tpl-border);
  border-radius: 50rem;
  padding: .3rem .7rem;
}

/* ── Stats bar ── */
.stats-bar {
  background: var(--tpl-surface);
  border-bottom: 1px solid var(--tpl-border);
  padding: .55rem 0;
}
.stat-item   { display: flex; align-items: center; gap: .35rem; }
.stat-num    { font-size: .95rem; font-weight: 800; line-height: 1; }
.stat-lbl    { font-size: .68rem; color: var(--tpl-muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }

/* ── Section label ── */
.section-label {
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tpl-muted);
  margin-bottom: .85rem;
}

/* ── Sidebar ── */
.sidebar-card {
  background: var(--tpl-surface);
  border: 1px solid var(--tpl-border);
  border-radius: 1rem;
  padding: 1.15rem 1.2rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--tpl-shadow);
}
.sidebar-title {
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tpl-muted);
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--tpl-border);
  margin-bottom: .8rem;
}

/* Category list */
.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .32rem 0;
  border-bottom: 1px solid var(--tpl-border);
  font-size: .85rem;
  font-weight: 500;
  color: var(--tpl-text);
  text-decoration: none;
  transition: color .15s;
}
.category-item:last-child { border-bottom: none; }
.category-item:hover { color: #7011ff; }
.cat-count {
  font-size: .7rem;
  font-weight: 700;
  background: var(--tpl-surface-2);
  color: var(--tpl-muted);
  border: 1px solid var(--tpl-border);
  border-radius: 50rem;
  padding: .05rem .45rem;
}

/* Recent post list */
.recent-post-item {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  padding: .5rem 0;
  border-bottom: 1px solid var(--tpl-border);
}
.recent-post-item:last-child { border-bottom: none; }
.rp-num {
  font-size: .95rem;
  font-weight: 800;
  color: var(--tpl-border);
  line-height: 1.3;
  min-width: 1.4rem;
}
.recent-post-item a {
  font-size: .83rem;
  font-weight: 600;
  color: var(--tpl-text);
  text-decoration: none;
  line-height: 1.35;
  transition: color .15s;
}
.recent-post-item a:hover { color: #7011ff; }
.rp-meta {
  font-size: .7rem;
  color: var(--tpl-muted);
  display: block;
  margin-top: .1rem;
}

/* ── Hero compact ── */
.hero-compact { padding: 2.25rem 0 2rem; }

/* ── Post / Article body ── */
.post-body p,
.post-body li  { color: var(--tpl-text) !important; line-height: 1.85; font-size: 1.05rem; }
.post-body h2  { color: var(--tpl-text) !important; margin-top: 2.25rem; margin-bottom: .85rem; }
.post-body hr  { border-color: var(--tpl-border); opacity: 1; }
[data-theme="dark"] .post-hero { background: linear-gradient(135deg, #7011ff 0%, #ff1170 100%); }
[data-theme="dark"] .breadcrumb-item a { color: rgba(255,255,255,.65); }

/* ── Legal pages ── */
.legal-section { max-width: 760px; margin: 0 auto; }
.legal-section h2 { color: var(--tpl-text); margin-top: 2.25rem; margin-bottom: .6rem; font-size: 1.2rem; }
.legal-section p,
.legal-section li,
.legal-section address { color: var(--tpl-text); line-height: 1.8; font-size: .97rem; }
.legal-section a { color: #7011ff; }
.legal-section .last-updated { font-size: .8rem; color: var(--tpl-muted); margin-bottom: 2rem; }

/* ── Scrollbar (dark mode) ── */
[data-theme="dark"] ::-webkit-scrollbar { width: 6px; background: var(--tpl-bg); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--tpl-border); border-radius: 3px; }
