/* THEME-V2 — polish + drawer + dark theme + blog fix + back button. Overrides style.css. */
/* --- Light polish (layout unchanged) --- */
a, button { transition: color .2s ease, background-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.nav-menu a:hover { color: #2563eb; }
/* --- Theme toggle button --- */
.theme-toggle-btn { display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-left: 10px; border-radius: 50%; border: 1px solid #e2e8f0;
  background: #fff; color: #1e293b; cursor: pointer; font-size: 17px; flex: 0 0 auto; }
.theme-toggle-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37,99,235,.25); }
/* Floating toggle for standalone pages without a header (e.g. subject pages) */
.theme-toggle-btn.floating { position: fixed; left: 16px; bottom: 16px; z-index: 9998;
  margin-left: 0; width: 48px; height: 48px; font-size: 19px;
  box-shadow: 0 8px 22px rgba(2,6,23,.35); }
/* --- Left drawer (mobile, <=1200px) --- */
@media (max-width: 1200px) {
  #main-navigation { position: fixed !important; top: 0 !important; left: 0 !important;
    height: 100dvh !important; width: min(300px, 82vw) !important; display: flex !important;
    flex-direction: column !important; gap: 2px !important; padding: 18px 16px !important;
    background: #ffffff !important; box-shadow: 4px 0 30px rgba(0,0,0,.25) !important;
    transform: translateX(-105%) !important; transition: transform .3s ease !important;
    z-index: 10001 !important; overflow-y: auto !important; }
  #main-navigation.active { transform: translateX(0) !important; }
  #main-navigation a { display: flex !important; align-items: center; gap: 12px;
    padding: 11px 12px !important; border-radius: 10px; color: #1e293b !important; }
  #main-navigation a:hover { background: #eef2ff !important; color: #2563eb !important; }
  .theme-nav-icon { display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 9px; font-size: 15px; color: #fff; flex: 0 0 auto;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 3px 8px rgba(124,58,237,.4); }
  .theme-drawer-close { align-self: flex-end; width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid #e2e8f0; background: #fff; font-size: 18px; cursor: pointer; margin-bottom: 8px; }
}
#theme-drawer-overlay { position: fixed; inset: 0; background: rgba(2,6,23,.5);
  z-index: 10000; display: none; }
#theme-drawer-overlay.show { display: block; }
/* --- Back button (injected on inner pages by theme-v2.js) --- */
.theme-back-btn { display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 4px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid #e2e8f0; background: #fff;
  color: #1e293b; font-weight: 600; font-size: 14px; cursor: pointer; }
.theme-back-btn:hover { border-color: #2563eb; color: #2563eb; transform: translateX(-2px); }
/* --- Blog overlap fix: text sits BELOW the cover image, never on top of it --- */
main.main-content .article-cover-container { margin: 0 auto !important; }
main.main-content .article-content-box { margin: 0 auto 60px !important; }
@media (max-width: 768px) {
  main.main-content .article-cover-container { margin: 0 auto !important; }
  main.main-content .article-content-box { margin: 0 15px 40px !important; }
}
/* --- Dark (black) theme — visitor choice, default is light --- */
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] body { background: #0b1220 !important; color: #e5e7eb !important; }
html[data-theme="dark"] .main-navbar { background: #0f172a !important; }
html[data-theme="dark"] .nav-brand, html[data-theme="dark"] .nav-menu a { color: #e5e7eb !important; }
html[data-theme="dark"] .theme-toggle-btn { background: #1e293b !important; color: #facc15 !important; border-color: #334155 !important; }
html[data-theme="dark"] #main-navigation { background: #111827 !important; }
html[data-theme="dark"] #main-navigation a { color: #e5e7eb !important; }
html[data-theme="dark"] #main-navigation a:hover { background: #1e293b !important; color: #93c5fd !important; }
html[data-theme="dark"] .theme-drawer-close { background: #1e293b !important; color: #e5e7eb !important; border-color: #334155 !important; }
html[data-theme="dark"] .theme-back-btn { background: #1e293b !important; color: #e5e7eb !important; border-color: #334155 !important; }
html[data-theme="dark"] .main-footer { background: #0f172a !important; color: #cbd5e1 !important; }
html[data-theme="dark"] .article-header-wrapper, html[data-theme="dark"] .article-content-box { background: #111827 !important; color: #e5e7eb !important; }
html[data-theme="dark"] main [class*="card"] { background: #1e293b !important; color: #e5e7eb !important; border-color: #334155 !important; }
html[data-theme="dark"] main section { background-color: #0b1220 !important; }
html[data-theme="dark"] main section h1, html[data-theme="dark"] main section h2, html[data-theme="dark"] main section h3 { color: #f1f5f9 !important; }
html[data-theme="dark"] main section p { color: #cbd5e1 !important; }
html[data-theme="dark"] a { color: #93c5fd; }
