/*
Theme Name: AlgoVelgo
Theme URI: https://algovelgo.com
Author: AlgoVelgo Team
Author URI: https://algovelgo.com
Description: A modern, ultra-fast, developer-centric dark theme for tutorials, algorithms, and technology publications.
Version: 1.2.5
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: algovelgo
Tags: dark-mode, developer, tech-blog, tutorials, education, responsive, custom-colors, two-columns, grid-layout
*/

/* -------------------------------------------------------------
   DESIGN TOKENS & CSS VARIABLES
------------------------------------------------------------- */
:root {
  /* Surface & Canvas (OLED Dark) */
  --bg-body:          #08090d;
  --bg-surface:       #0f111a;
  --bg-surface-elev:  #161926;
  --bg-code:          #0c0e14;

  /* High-Contrast Accents */
  --accent-cyan:      #38bdf8;
  --accent-violet:    #a855f7;
  --accent-orange:    #f97316;
  --accent-emerald:   #10b981;
  --accent-amber:     #f59e0b;

  /* Typography */
  --text-primary:     #f8fafc;
  --text-secondary:   #94a3b8;
  --text-muted:       #64748b;
  --text-code:        #e2e8f0;

  /* Borders & Glows */
  --border-subtle:    rgba(255, 255, 255, 0.08);
  --border-active:    rgba(56, 189, 248, 0.35);
  --glow-cyan:        0 0 24px -4px rgba(56, 189, 248, 0.25);
  --glow-violet:      0 0 24px -4px rgba(168, 85, 247, 0.25);

  /* Spacing & Layout */
  --container-max:    1200px;
  --reader-max:       780px;
  --radius-sm:        6px;
  --radius-md:        12px;
  --radius-lg:        16px;
  --radius-pill:      9999px;
}

/* -------------------------------------------------------------
   CSS RESET & BASE STYLES
------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-body);
  color: var(--text-secondary);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* All hyperlinks sky-blue for dark theme compliance */
a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: opacity 0.2s ease, color 0.2s ease;
}

a:hover {
  opacity: 0.85;
}

img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.reader-container {
  width: 100%;
  max-width: var(--reader-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* -------------------------------------------------------------
   READING PROGRESS BAR
------------------------------------------------------------- */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
  width: 0%;
  z-index: 1000;
  transition: width 0.1s ease;
}

/* -------------------------------------------------------------
   CLEAN SITE HEADER & NAVIGATION
------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 9, 13, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 21px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-logo svg {
  width: 28px;
  height: 28px;
  color: var(--accent-cyan);
}

.brand-logo span.accent {
  color: var(--accent-cyan);
}

.main-navigation ul.nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.main-navigation a {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current-category-ancestor > a {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-trigger-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-trigger-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
  box-shadow: var(--glow-cyan);
}

.search-trigger-btn kbd {
  background: var(--bg-surface-elev);
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid var(--border-subtle);
}

/* -------------------------------------------------------------
   HERO SECTION
------------------------------------------------------------- */
.hero-section {
  padding: 70px 0 50px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.hero-content h1 {
  font-size: 46px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.hero-content p {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent-cyan);
  color: #040508 !important;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.45);
  opacity: 1;
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: var(--bg-surface-elev);
}

/* Hero Terminal Box */
.hero-terminal-box {
  background: var(--bg-code);
  border: 1px solid var(--border-active);
  box-shadow: var(--glow-cyan);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.terminal-header {
  background: var(--bg-surface);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-filename {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
}

.terminal-body {
  padding: 22px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-code);
  overflow-x: auto;
}

/* -------------------------------------------------------------
   TOPIC FILTER PILLS
------------------------------------------------------------- */
.topic-filter-bar {
  padding: 28px 0;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-subtle);
  scrollbar-width: none;
}

.topic-filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.filter-pill:hover,
.filter-pill.active {
  background: var(--bg-surface-elev);
  border-color: var(--accent-cyan);
  color: var(--text-primary);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.2);
}

/* -------------------------------------------------------------
   TUTORIALS HUB TRACK CARDS
------------------------------------------------------------- */
.tutorials-hub-header {
  padding: 50px 0 36px;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 44px;
}

.hub-title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.hub-desc {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

.track-cards-section {
  margin-bottom: 60px;
}

.track-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.track-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.track-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-active);
  box-shadow: var(--glow-cyan);
}

.track-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.track-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.track-icon {
  font-size: 28px;
  line-height: 1;
}

.track-name {
  font-size: 21px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.track-level-badge {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid;
  white-space: nowrap;
}

.track-desc {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 18px;
}

.track-meta {
  margin-bottom: 22px;
}

.track-count-badge {
  display: inline-block;
  background: rgba(56, 189, 248, 0.08);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.2);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.track-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: var(--accent-cyan);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14.5px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.track-btn:hover {
  background: var(--accent-cyan);
  color: #040508 !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
  opacity: 1;
}

/* -------------------------------------------------------------
   ARTICLE CARDS GRID
------------------------------------------------------------- */
.section-headline-group {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 44px 0 28px;
}

.section-headline {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 60px;
}

.article-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-active);
  box-shadow: var(--glow-cyan);
}

.card-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-category-badge {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.2);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.card-read-time {
  font-size: 12px;
  color: var(--text-muted);
}

.card-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.card-title a {
  color: var(--text-primary);
}

.card-title a:hover {
  color: var(--accent-cyan);
}

.card-excerpt {
  font-size: 14.5px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.55;
}

.card-cta {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* -------------------------------------------------------------
   SINGLE ARTICLE / TUTORIAL READER
------------------------------------------------------------- */
.single-post-header {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 36px;
}

.breadcrumbs {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--accent-cyan);
}

.post-title {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.post-meta-row {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 600;
}

.post-author img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.entry-content {
  font-size: 17px;
  line-height: 1.8;
  color: #cbd5e1;
}

.entry-content p {
  margin-bottom: 24px;
}

.entry-content h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 48px;
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}

.entry-content h3 {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 36px;
  margin-bottom: 14px;
}

.entry-content ul,
.entry-content ol {
  margin-bottom: 24px;
  padding-left: 28px;
}

.entry-content li {
  margin-bottom: 8px;
}

.entry-content blockquote {
  border-left: 3px solid var(--accent-cyan);
  background: var(--bg-surface);
  padding: 18px 24px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 32px 0;
  font-style: italic;
  color: var(--text-primary);
}

.code-container {
  position: relative;
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin: 28px 0;
  overflow: hidden;
}

.code-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
}

.copy-code-btn {
  background: var(--bg-surface-elev);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-code-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

.entry-content pre {
  padding: 20px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-code);
}

.entry-content code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-surface);
  color: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.entry-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* -------------------------------------------------------------
   SEARCH MODAL (CMD+K)
------------------------------------------------------------- */
.search-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 100px 20px 20px;
}

.search-modal-overlay.active {
  display: flex;
}

.search-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-active);
  box-shadow: var(--glow-cyan);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  overflow: hidden;
}

.search-modal-header {
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
}

.search-modal-input {
  width: 100%;
  background: transparent;
  border: none;
  padding: 20px 24px;
  font-size: 18px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
}

.search-modal-footer {
  padding: 14px 24px;
  background: var(--bg-code);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* -------------------------------------------------------------
   SITE FOOTER
------------------------------------------------------------- */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 60px 0 36px;
  margin-top: 90px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.footer-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  max-width: 360px;
  line-height: 1.6;
}

.footer-heading {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 18px;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 14px;
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

.footer-bottom {
  padding-top: 28px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* -------------------------------------------------------------
   RESPONSIVE MEDIA QUERIES
------------------------------------------------------------- */
@media (max-width: 992px) {
  .hero-section {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .track-cards-grid {
    grid-template-columns: 1fr;
  }
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }
  .main-navigation ul.nav-menu {
    gap: 14px;
  }
  .main-navigation a {
    font-size: 13.5px;
    padding: 4px 6px;
  }
  .hero-content h1 {
    font-size: 32px;
  }
  .hub-title {
    font-size: 28px;
  }
  .post-title {
    font-size: 28px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
