/* ==========================================================================
   Modern Minimalist Blog Theme Override
   ========================================================================== */

:root {
  /* Colors */
  --bg-color: #f9fafb;
  --bg-surface: #ffffff;
  --text-main: #111827;
  --text-muted: #4b5563;
  --text-light: #9ca3af;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --border-color: #e5e7eb;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --footer-bg: #f3f4f6;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  /* Layout */
  --container-max: 800px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg-color: #0f172a;
    --bg-surface: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --text-light: #94a3b8;
    --primary: #818cf8;
    --primary-hover: #a5b4fc;
    --border-color: #334155;
    --nav-bg: rgba(15, 23, 42, 0.85);
    --footer-bg: #0f172a;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  }
}

html[data-theme="dark"] {
  --bg-color: #0f172a;
  --bg-surface: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-light: #94a3b8;
  --primary: #818cf8;
  --primary-hover: #a5b4fc;
  --border-color: #334155;
  --nav-bg: rgba(15, 23, 42, 0.85);
  --footer-bg: #0f172a;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* Base resets & Typography */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--bg-color);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
  margin-top: 2rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

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

/* Navbar - Glassmorphism */
.navbar-custom {
  background: var(--nav-bg) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color) !important;
  padding: 1rem 2rem;
  box-shadow: var(--shadow-sm);
}

.navbar-custom .navbar-brand {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  color: var(--text-main) !important;
}

.navbar-custom .nav-link {
  font-weight: 500;
  color: var(--text-muted) !important;
  font-size: 1rem;
  margin-left: 1rem;
}

.navbar-custom .nav-link:hover {
  color: var(--primary) !important;
}

/* Header & Jumbotron alternative */
.intro-header {
  background: none !important;
  padding: 6rem 0 3rem 0;
  margin-bottom: 0;
  border: none;
  text-align: center;
}

.intro-header .page-heading h1,
.intro-header .post-heading h1 {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.intro-header .page-subheading,
.intro-header .post-subheading {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2rem;
}

.intro-header .post-meta {
  font-size: 0.95rem;
  color: var(--text-light);
  font-family: var(--font-sans);
  font-weight: 500;
  display: inline-block;
  margin-top: 1rem;
}

hr.small {
  display: none;
}

/* Containers */
.container-md {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Blog Post List (Home) */
.posts-list {
  display: grid;
  gap: 2.5rem;
  margin-top: 2rem;
}

.post-preview {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-preview:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.post-preview > a {
  display: block;
  color: inherit;
}

.post-preview .post-title {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-main);
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.post-preview .post-subtitle {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text-muted);
  margin: 0;
}

.post-preview .post-meta {
  font-size: 0.9rem;
  color: var(--text-light);
  margin: 0;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.post-preview .post-entry {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.post-preview .post-image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.post-read-more {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Tags */
.blog-tags {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.blog-tags span {
  font-size: 0.875rem;
  color: var(--text-light);
  font-weight: 500;
  margin-right: 0.5rem;
}

.blog-tags a {
  background: var(--border-color);
  color: var(--primary);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.blog-tags a:hover {
  background: var(--primary);
  color: white;
}

/* Post Content */
.blog-post {
  background: var(--bg-surface);
  padding: 3rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 3rem;
  font-size: 1.125rem;
}

@media (max-width: 768px) {
  .blog-post {
    padding: 1.5rem;
    font-size: 1.05rem;
  }
}

.blog-post p {
  margin-bottom: 1.5rem;
}

.blog-post img {
  max-width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: 2rem auto;
  display: block;
}

.blog-post blockquote {
  border-left: 4px solid var(--primary);
  background: var(--bg-color);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-style: italic;
}

.blog-post blockquote p:last-child {
  margin-bottom: 0;
}

/* Code Blocks */
.blog-post pre {
  background: #1e1e1e !important;
  color: #e5e5e5 !important;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin: 2rem 0;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.blog-post code {
  font-family: var(--font-mono);
  background: var(--bg-color);
  color: #ec4899;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.blog-post pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Pagination */
.pagination {
  justify-content: center;
  margin: 3rem 0;
  gap: 1rem;
}

.pagination .page-item .page-link {
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  background: var(--bg-surface);
  transition: all 0.2s;
}

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

/* Footer */
footer {
  background: var(--footer-bg);
  padding: 3rem 0;
  text-align: center;
  margin-top: 4rem;
  border-top: 1px solid var(--border-color);
}

footer .text-muted {
  color: var(--text-light) !important;
  font-size: 0.9rem;
}

footer .list-inline {
  margin-bottom: 1.5rem;
}

footer .list-inline-item a {
  color: var(--text-muted);
  font-size: 1.5rem;
  margin: 0 0.5rem;
  transition: color 0.2s;
}

footer .list-inline-item a:hover {
  color: var(--primary);
}

/* Avatar overrides */
.navbar-custom .avatar-container,
.navbar-custom.top-nav-regular .avatar-container {
  position: absolute;
  left: 50%;
  bottom: -50px;
  transform: translateX(-50%);
  margin: 0;
  width: auto;
  text-align: center;
}

.navbar-custom .avatar-container .avatar-img-border,
.navbar-custom.top-nav-regular .avatar-container .avatar-img-border {
  margin-left: 0;
  width: auto;
  box-shadow: none;
  border-radius: 50%;
}

.navbar-custom .avatar-container .avatar-img,
.navbar-custom.top-nav-regular .avatar-container .avatar-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid var(--bg-surface);
  box-shadow: var(--shadow-md);
  object-fit: cover;
  display: block;
}

/* Dropdown Menu overrides */
.navbar-custom .dropdown-menu {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  margin-top: 0.5rem;
  min-width: 12rem;
}

.navbar-custom .dropdown-item {
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  color: var(--text-muted) !important;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.navbar-custom .dropdown-item:hover,
.navbar-custom .dropdown-item:focus {
  background-color: var(--bg-color);
  color: var(--primary) !important;
}

/* Big Image Header override */
.header-section.has-img .big-img {
  height: 400px;
  background-position: center center;
  background-size: cover;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-section.has-img .big-img::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5); /* Overlay */
}

.header-section.has-img .container-md {
  position: relative;
  z-index: 1;
}

.header-section.has-img .page-heading h1,
.header-section.has-img .post-heading h1 {
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header-section.has-img .page-subheading,
.header-section.has-img .post-subheading,
.header-section.has-img .post-meta {
  color: rgba(255,255,255,0.9);
}
