/* Professional Blog Theme */
/* Custom styling for a modern, clean blog design */

:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary-color: #64748b;
  --accent-color: #0ea5e9;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --border-color: #e2e8f0;
  --code-bg: #1e293b;
  --code-text: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --transition: all 0.2s ease-in-out;
}

/* Base Styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  line-height: 1.7;
  font-size: 1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

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

a:hover {
  color: var(--primary-dark);
}

/* Navbar - Professional Style */
.pro-navbar {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

.pro-navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.pro-navbar .navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pro-navbar .navbar-brand:hover {
  color: var(--primary-color);
}

.pro-navbar .navbar-brand .brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.pro-navbar .nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.pro-navbar .nav-link:hover {
  color: var(--primary-color);
  background-color: var(--bg-tertiary);
}

.pro-navbar .navbar-toggler {
  border: none;
  padding: 0.5rem;
  color: var(--text-primary);
}

.pro-navbar .navbar-toggler:focus {
  box-shadow: none;
}

/* Search Box */
.pro-search-form {
  position: relative;
}

.pro-search-form .form-control {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.5rem 1rem;
  padding-right: 2.5rem;
  font-size: 0.875rem;
  transition: var(--transition);
  width: 200px;
}

.pro-search-form .form-control:focus {
  background-color: var(--bg-primary);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  width: 250px;
}

.pro-search-form .btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-color);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.35rem 0.75rem;
  color: white;
  font-size: 0.75rem;
}

.pro-search-form .btn:hover {
  background: var(--primary-dark);
}

/* Hero Section */
.pro-hero {
  background: linear-gradient(135deg, var(--text-primary) 0%, #334155 100%);
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}

.pro-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.pro-hero-content {
  position: relative;
  z-index: 1;
}

.pro-hero h1 {
  color: white;
  font-size: 2.75rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.pro-hero .subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.25rem;
  font-weight: 400;
  max-width: 600px;
  margin: 0 auto;
}

.pro-hero .category-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  backdrop-filter: blur(10px);
}

/* Main Content Area */
.pro-content {
  padding: 3rem 0;
  background: var(--bg-secondary);
  min-height: 60vh;
}

/* Post Cards */
.pro-post-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.pro-post-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: transparent;
  transform: translateY(-2px);
}

.pro-post-card .category-tag {
  display: inline-block;
  background: var(--bg-tertiary);
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-lg);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  transition: var(--transition);
}

.pro-post-card .category-tag:hover {
  background: var(--primary-color);
  color: white;
}

.pro-post-card .post-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  transition: var(--transition);
}

.pro-post-card .post-title:hover {
  color: var(--primary-color);
}

.pro-post-card .post-meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pro-post-card .post-meta i {
  font-size: 0.75rem;
}

/* Post Detail Page */
.pro-article-header {
  background: linear-gradient(135deg, var(--text-primary) 0%, #334155 100%);
  padding: 4rem 0;
  position: relative;
}

.pro-article-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.pro-article-header .content {
  position: relative;
  z-index: 1;
}

.pro-article-header h1 {
  color: white;
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.pro-article-header .meta {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.pro-article-header .meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pro-article-header .category-link {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: var(--transition);
}

.pro-article-header .category-link:hover {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

/* Article Content */
.pro-article {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 2.5rem;
  margin-top: -2rem;
  position: relative;
  z-index: 2;
}

.pro-article .summary {
  font-size: 1.1875rem;
  line-height: 1.7;
  color: var(--text-secondary);
  border-left: 4px solid var(--primary-color);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin-bottom: 2rem;
}

/* Code Blocks */
.pro-code-block {
  background: var(--code-bg);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  position: relative;
}

.pro-code-block::before {
  content: '';
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

.pro-code-block pre {
  margin: 0;
  background: transparent;
  color: var(--code-text);
  font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.pro-code-block code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.code-language-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================
   Code Window — editor-style code presentation
   ============================================================ */
.code-window {
  background: #0f172a;
  border: 1px solid #1e2a44;
  border-radius: var(--radius-lg);
  margin: 1.75rem 0;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.code-window__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: linear-gradient(180deg, #1b2740, #151d30);
  border-bottom: 1px solid #1e2a44;
}

.code-window__dots {
  display: inline-flex;
  gap: 0.45rem;
}

.code-window__dots span {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.code-window__dots span:nth-child(1) { background: #ff5f56; }
.code-window__dots span:nth-child(2) { background: #ffbd2e; }
.code-window__dots span:nth-child(3) { background: #27c93f; }

.code-window__lang {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #94a3b8;
  text-transform: lowercase;
}

.code-window__copy {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #cbd5e1;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.code-window__copy:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.code-window__copy.is-copied {
  background: rgba(39, 201, 63, 0.18);
  border-color: rgba(39, 201, 63, 0.4);
  color: #4ade80;
}

.code-window__body {
  margin: 0;
  padding: 0;
  overflow-x: auto;
  background: transparent;
}

/* Custom scrollbar for the code body */
.code-window__body::-webkit-scrollbar { height: 8px; }
.code-window__body::-webkit-scrollbar-track { background: transparent; }
.code-window__body::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
.code-window__body::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Pygments server-rendered highlighted_code table */
.code-window .highlight { background: transparent; margin: 0; }
.code-window .highlighttable { border-collapse: collapse; }
.code-window .highlighttable td { padding: 0; border: 0; vertical-align: top; }
.code-window .highlighttable pre {
  margin: 0;
  padding: 1.1rem 0;
  font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
  font-size: 0.85rem;
  line-height: 1.65;
  background: transparent;
  white-space: pre;
}
.code-window td.linenos {
  position: sticky;
  left: 0;
  background: #0f172a;
  border-right: 1px solid #1e2a44;
}
.code-window td.linenos pre {
  padding-left: 1.1rem;
  padding-right: 1rem;
  text-align: right;
  color: #475569;
  -webkit-user-select: none;
  user-select: none;
}
.code-window td.code { width: 100%; }
.code-window td.code pre {
  padding-left: 1rem;
  padding-right: 1.25rem;
  color: #e2e8f0;
}

/* Compact preview variant for list cards */
.code-window--preview {
  position: relative;
  margin: 1rem 0 0;
  box-shadow: var(--shadow-md);
}

.code-window--preview .code-window__body {
  max-height: 11rem;
  overflow: hidden;
}

.code-window--preview .code-window__body .highlighttable pre {
  font-size: 0.8rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.code-window--preview::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.5rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0), #0f172a);
  pointer-events: none;
}

/* Social Share Buttons */
.pro-social-share {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
}

.pro-social-share .share-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.pro-social-share .share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  transition: var(--transition);
}

.pro-social-share .share-btn:hover {
  transform: translateY(-2px);
}

.pro-social-share .share-btn.twitter:hover {
  background: #1da1f2;
  color: white;
}

.pro-social-share .share-btn.facebook:hover {
  background: #4267B2;
  color: white;
}

.pro-social-share .share-btn.linkedin:hover {
  background: #0077b5;
  color: white;
}

/* Related Posts */
.pro-related-posts {
  padding: 2rem 0;
}

.pro-related-posts h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.pro-related-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition);
  height: 100%;
}

.pro-related-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: transparent;
}

.pro-related-card .card-img {
  height: 140px;
  object-fit: cover;
  width: 100%;
}

.pro-related-card .card-body {
  padding: 1rem;
}

.pro-related-card .card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
  transition: var(--transition);
}

.pro-related-card:hover .card-title {
  color: var(--primary-color);
}

/* Pagination */
.pro-pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 0;
}

.pro-pagination .page-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  transition: var(--transition);
}

.pro-pagination .page-link:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* Footer */
.pro-footer {
  background: var(--text-primary);
  padding: 3rem 0 2rem;
  margin-top: auto;
}

.pro-footer .footer-content {
  text-align: center;
}

.pro-footer .social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pro-footer .social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  transition: var(--transition);
}

.pro-footer .social-link:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-3px);
}

.pro-footer .copyright {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
}

.pro-footer .copyright a {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.pro-footer .copyright a:hover {
  color: white;
}

/* Utility Classes */
.container-narrow {
  max-width: 800px;
  margin: 0 auto;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .pro-hero {
    padding: 3rem 0;
  }

  .pro-hero h1 {
    font-size: 2rem;
  }

  .pro-hero .subtitle {
    font-size: 1rem;
  }

  .pro-article-header h1 {
    font-size: 1.75rem;
  }

  .pro-article {
    padding: 1.5rem;
    margin-top: -1rem;
    border-radius: var(--radius-lg);
  }

  .pro-post-card {
    padding: 1.25rem;
  }

  .pro-post-card .post-title {
    font-size: 1.125rem;
  }

  .pro-search-form .form-control {
    width: 150px;
  }

  .pro-search-form .form-control:focus {
    width: 180px;
  }

  .pro-related-card .card-img {
    height: 120px;
  }

  .code-window .highlighttable pre {
    font-size: 0.78rem;
  }

  .pro-article .summary {
    font-size: 1.0625rem;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeInUp 0.5s ease-out forwards;
}

/* Search Autocomplete (vanilla) */
.search-suggestions {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  left: auto;
  width: 360px;
  max-width: min(360px, calc(100vw - 2rem));
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px -8px rgb(15 23 42 / 0.25), 0 0 0 1px rgb(15 23 42 / 0.02);
  z-index: 1050;
  transform-origin: top right;
  animation: suggestPop 0.14s ease-out;
}

@keyframes suggestPop {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.search-suggestions[hidden] { display: none; }

.search-suggestions__item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.search-suggestions__item + .search-suggestions__item {
  margin-top: 2px;
}

.search-suggestions__icon {
  flex: 0 0 auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color 0.12s ease;
}

.search-suggestions__label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-suggestions__label mark {
  background: transparent;
  color: var(--primary-color);
  font-weight: 700;
  padding: 0;
}

.search-suggestions__item:hover,
.search-suggestions__item.is-active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.search-suggestions__item:hover .search-suggestions__icon,
.search-suggestions__item.is-active .search-suggestions__icon {
  color: var(--primary-color);
}

.search-suggestions::-webkit-scrollbar { width: 8px; }
.search-suggestions::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
