/* ==========================================================================
   SimpleBlog — Mark's Dev Notebook
   ========================================================================== */

.site-tagline {
  display: block;
  font-size: 0.75rem;
  font-style: italic;
  opacity: 0.65;
  margin-top: 0.1rem;
  letter-spacing: 0.01em;
}

.intro-blurb {
  border-left: 3px solid var(--bs-primary, #0d6efd);
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
  font-size: 1.05rem;
  opacity: 0.9;
}

.post-tags {
  margin-top: 0.25rem;
}

.post-tags .tag {
  display: inline-block;
  font-size: 0.7rem;
  background: rgba(var(--primary-rgb, 13,110,253), 0.1);
  color: var(--bs-primary, #0d6efd);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  margin-right: 0.25rem;
  text-decoration: none;
}

.post-count-note {
  font-size: 0.85rem;
  opacity: 0.6;
  font-style: italic;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   CSS Custom Properties (Variables)
   ========================================================================== */
:root {
  /* Typography */
  --bs-font-sans-serif: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --bs-font-monospace: 'JetBrains Mono', 'SF Mono', Monaco, Inconsolata, 'Roboto Mono', monospace;
  
  /* Custom Colors */
  --primary-rgb: 13, 110, 253;
  --secondary-rgb: 108, 117, 125;
  --success-rgb: 25, 135, 84;
  --info-rgb: 13, 202, 240;
  --warning-rgb: 255, 193, 7;
  --danger-rgb: 220, 53, 69;
  --light-rgb: 248, 249, 250;
  --dark-rgb: 33, 37, 41;
  
  /* Shadows */
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  
  /* Border Radius */
  --border-radius-xl: 1rem;
  --border-radius-2xl: 1.5rem;
  
  /* Transitions */
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease-in-out;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--bs-font-sans-serif);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Typography Enhancements
   ========================================================================== */
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
  font-weight: 700;
  line-height: 1.2;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.5rem;
}

code {
  font-family: var(--bs-font-monospace);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  background-color: rgba(var(--bs-secondary-rgb), 0.1);
  color: var(--bs-secondary);
  font-size: 0.875em;
}

pre {
  background-color: var(--bs-gray-100);
  border-radius: var(--bs-border-radius);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.875rem;
}

blockquote {
  border-left: 4px solid var(--bs-primary);
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--bs-secondary);
}

/* ==========================================================================
   Layout Enhancements
   ========================================================================== */
.main-content {
  min-height: calc(100vh - 200px);
}

.container-fluid {
  padding-left: 2rem;
  padding-right: 2rem;
}

@media (max-width: 768px) {
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ==========================================================================
   Navigation Enhancements
   ========================================================================== */
.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  transition: var(--transition-fast);
}

.navbar-brand:hover {
  transform: translateY(-1px);
}

.navbar-nav .nav-link {
  font-weight: 500;
  transition: var(--transition-fast);
  position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  transform: translateY(-1px);
}

.navbar-nav .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background-color: currentColor;
  border-radius: 50%;
}

/* Theme Switcher */
.theme-icon-active {
  transition: var(--transition-fast);
}

/* ==========================================================================
   Card Enhancements
   ========================================================================== */
.card {
  border: none;
  transition: var(--transition-base);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
}

.hover-shadow {
  transition: var(--transition-base);
}

.hover-shadow:hover {
  box-shadow: var(--shadow-lg) !important;
}

.card-title a {
  color: inherit;
  transition: var(--transition-fast);
}

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

/* Stretched Link Enhancement */
.stretched-link::after {
  transition: var(--transition-fast);
}

/* ==========================================================================
   Button Enhancements
   ========================================================================== */
.btn {
  font-weight: 500;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--bs-primary) 0%, rgba(var(--primary-rgb), 0.8) 100%);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.9) 0%, rgba(var(--primary-rgb), 0.7) 100%);
  box-shadow: var(--shadow);
}

/* ==========================================================================
   Badge Enhancements
   ========================================================================== */
.badge {
  font-weight: 500;
  letter-spacing: 0.025em;
  padding: 0.375rem 0.75rem;
}

/* ==========================================================================
   Form Enhancements
   ========================================================================== */
.form-control, .form-select {
  border: 2px solid var(--bs-gray-200);
  transition: var(--transition-fast);
}

.form-control:focus, .form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(var(--primary-rgb), 0.15);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.hover-opacity-100:hover {
  opacity: 1 !important;
}

.hover-scale {
  transition: var(--transition-fast);
}

.hover-scale:hover {
  transform: scale(1.1);
}

.text-gradient {
  background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-info) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, var(--bs-primary) 0%, rgba(var(--primary-rgb), 0.8) 100%);
}

.bg-gradient-secondary {
  background: linear-gradient(135deg, var(--bs-secondary) 0%, rgba(var(--secondary-rgb), 0.8) 100%);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-icon {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* ==========================================================================
   Post Content Styling
   ========================================================================== */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.post-content h1 { font-size: 2rem; }
.post-content h2 { font-size: 1.75rem; }
.post-content h3 { font-size: 1.5rem; }
.post-content h4 { font-size: 1.25rem; }
.post-content h5 { font-size: 1.125rem; }
.post-content h6 { font-size: 1rem; }

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--bs-border-radius);
  box-shadow: var(--shadow-sm);
  margin: 1.5rem 0;
}

.post-content table {
  width: 100%;
  margin-bottom: 1.5rem;
  border-collapse: collapse;
}

.post-content table th,
.post-content table td {
  padding: 0.75rem;
  border: 1px solid var(--bs-gray-200);
}

.post-content table th {
  background-color: var(--bs-gray-50);
  font-weight: 600;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
  .display-4 {
    font-size: 2rem;
  }
  
  .display-5 {
    font-size: 1.75rem;
  }
  
  .display-6 {
    font-size: 1.5rem;
  }
  
  .hero-icon {
    margin-top: 2rem;
  }
  
  .post-content h1 { font-size: 1.75rem; }
  .post-content h2 { font-size: 1.5rem; }
  .post-content h3 { font-size: 1.25rem; }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */
[data-bs-theme="dark"] {
  --bs-gray-100: #1a1d20;
  --bs-gray-200: #2d3238;
  --bs-gray-300: #404448;
}

[data-bs-theme="dark"] .bg-light {
  background-color: var(--bs-gray-100) !important;
}

[data-bs-theme="dark"] .text-muted {
  opacity: 0.7;
}

[data-bs-theme="dark"] .border {
  border-color: var(--bs-gray-200) !important;
}

[data-bs-theme="dark"] code {
  background-color: var(--bs-gray-200);
  color: var(--bs-light);
}

[data-bs-theme="dark"] pre {
  background-color: var(--bs-gray-100);
}

[data-bs-theme="dark"] .post-content table th,
[data-bs-theme="dark"] .post-content table td {
  border-color: var(--bs-gray-200);
}

[data-bs-theme="dark"] .post-content table th {
  background-color: var(--bs-gray-100);
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
  .navbar, .btn, .dropdown, .shadow, .shadow-sm, .shadow-lg {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }
  
  p, li {
    orphans: 3;
    widows: 3;
  }
}

/* ==========================================================================
   Animation Classes
   ========================================================================== */
.fade-in {
  animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--bs-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 9999;
}

.skip-link:focus {
  top: 0;
}

/* Focus styles */
.btn:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

/* ==========================================================================
   Performance Optimizations
   ========================================================================== */
/* Images will use lazy loading via HTML loading="lazy" attribute */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
