:root {
  /* Colors - Enhanced Palette */
  --blog-bg: #fafbfc;
  --blog-surface: #ffffff;
  --blog-text: #1a202c;
  --blog-text-light: #4a5568;
  --blog-muted: #718096;
  --blog-border: #e2e8f0;
  --blog-border-light: #edf2f7;
  --blog-brand: #64B5F6;
  --blog-brand-light: #64B5F6;
  --blog-brand-hover: #5a9aeb;
  --blog-accent: #64B5F6;

  /* Shadows - Modernized */
  --blog-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --blog-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --blog-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --blog-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --blog-shadow-hover: 0 20px 25px -5px rgba(100, 176, 255, 0.12), 0 10px 10px -5px rgba(100, 176, 255, 0.08);

  /* Spacing & Sizing */
  --blog-radius: 12px;
  --blog-radius-sm: 8px;
  --blog-radius-lg: 16px;
  --blog-post-max-width: 840px;
  --blog-container-max: 1400px;

  /* Typography */
  --blog-font-base: 1rem;
  --blog-font-sm: 0.875rem;
  --blog-font-lg: 1.125rem;
  --blog-line-height: 1.7;
}

/* Main Container */
.wrap {
  display: flex;
  gap: 48px;
  max-width: var(--blog-container-max);
  margin: 0 auto;
  margin-top: 115px;
  padding: 48px 24px 80px;
}

/* ========================================
   SIDEBAR
   ======================================== */
.blog-sidebar {
  flex: 0 0 320px;
  max-width: 320px;
  min-width: 280px;
  padding: 8px 20px 28px 0;
  position: sticky;
  top: 20px;
  height: fit-content;
}

/* Search Box */
.blog-search-box {
  width: 100%;
  margin-bottom: 28px;
  background: var(--blog-surface);
  border: 1.5px solid var(--blog-border);
  padding: 20px 18px 16px;
  border-radius: var(--blog-radius);
  box-shadow: var(--blog-shadow-sm);
  transition: all 0.2s;
}

.blog-search-box:focus-within {
  border-color: var(--blog-brand);
  box-shadow: 0 0 0 3px rgba(100, 176, 255, 0.1), var(--blog-shadow);
}

.blog-search-box label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--blog-text);
  margin-bottom: 10px;
  display: block;
  letter-spacing: 0.01em;
}

.blog-search-wrapper {
  position: relative;
}

.blog-search-box input[type="text"] {
  width: 100%;
  padding: 11px 40px 11px 14px;
  border: 1.5px solid var(--blog-border-light);
  border-radius: var(--blog-radius-sm);
  font-size: 0.95rem;
  background: var(--blog-bg);
  box-sizing: border-box;
  transition: all 0.2s;
  font-family: inherit;
}

.blog-search-box input[type="text"]:focus {
  outline: none;
  border-color: var(--blog-brand);
  background: var(--blog-surface);
  box-shadow: 0 0 0 3px rgba(100, 176, 255, 0.08);
}

.blog-search-box input[type="text"]::placeholder {
  color: var(--blog-muted);
  opacity: 0.7;
}

.blog-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--blog-muted);
  cursor: pointer;
  padding: 6px;
  display: none;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s;
}

.blog-search-clear:hover {
  color: var(--blog-text);
  background: var(--blog-border-light);
}

.blog-search-clear.visible {
  display: block;
}

/* Search Results Counter */
.blog-search-counter {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--blog-muted);
  padding: 8px 12px;
  background: var(--blog-bg);
  border-radius: var(--blog-radius-sm);
  text-align: center;
  display: none;
}

.blog-search-counter.visible {
  display: block;
}

/* Result List */
.blog-result-list {
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
}

.blog-result-list.visible {
  display: block;
}

.blog-result-list li {
  background: var(--blog-surface);
  border: 1.5px solid var(--blog-border);
  border-radius: var(--blog-radius-sm);
  margin-bottom: 10px;
  padding: 12px 14px;
  transition: all 0.2s;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--blog-text);
}

.blog-result-list li:hover {
  background: var(--blog-bg);
  border-color: var(--blog-brand);
  transform: translateX(2px);
  box-shadow: var(--blog-shadow-sm);
}

.blog-result-list li.active {
  background: var(--blog-bg);
  border-color: var(--blog-brand);
}

.blog-result-list .no-results {
  background: var(--blog-bg);
  border-style: dashed;
  text-align: center;
  color: var(--blog-muted);
  font-style: italic;
  cursor: default;
}

.blog-result-list .no-results:hover {
  transform: none;
  box-shadow: none;
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */
.blog-main-content {
  flex: 1 1 0;
  min-width: 0;
}

/* Page Header */
header.page-head {
  padding: 0 0 24px 0;
  margin-bottom: 32px;
  border-bottom: 2px solid var(--blog-border-light);
}

header.page-head h1 {
  margin: 0 0 8px 0;
  color: var(--blog-text);
  font-weight: 800;
  font-size: 2.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

header.page-head .subtitle {
  margin: 0;
  color: var(--blog-text-light);
  font-size: 1.125rem;
  line-height: 1.6;
}

/* ========================================
   BLOG POST LIST
   ======================================== */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Blog Post Card */
article.post {
  background: var(--blog-surface);
  border: 1.5px solid var(--blog-border);
  border-radius: var(--blog-radius-lg);
  overflow: hidden;
  box-shadow: var(--blog-shadow);
  position: relative;
  max-width: var(--blog-post-max-width);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

article.post:hover {
  transform: translateY(-4px);
  box-shadow: var(--blog-shadow-hover);
  border-color: var(--blog-brand-light);
}

/* Featured Image */
article.post .featured-image {
  width: 100%;
  height: 320px;
  overflow: hidden;
  background: var(--blog-border-light);
  position: relative;
}

article.post .featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

article.post:hover .featured-image img {
  transform: scale(1.05);
}

article.post .featured-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
  pointer-events: none;
}

/* Post Content */
.post-content-wrapper {
  padding: 32px 36px 36px;
}

/* Post Header */
.post-header {
  margin-bottom: 16px;
}

article.post h2 {
  margin: 0 0 12px 0;
  color: var(--blog-text);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

article.post h2 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

article.post h2 a:hover {
  color: var(--blog-brand);
}

/* Post Meta */
.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 0.875rem;
  color: var(--blog-muted);
}

.post-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-meta-item svg,
.post-meta-item i {
  font-size: 0.95em;
  opacity: 0.8;
}

.post-meta .author {
  font-weight: 500;
  color: var(--blog-text-light);
}

.post-meta .read-time {
  color: var(--blog-brand);
  font-weight: 500;
}

/* Post Teaser */
article.post .teaser {
  color: var(--blog-text-light);
  margin-bottom: 18px;
  font-size: 1.05rem;
  line-height: var(--blog-line-height);
  font-weight: 400;
}

/* Post Content */
article.post .content {
  color: var(--blog-text);
  line-height: var(--blog-line-height);
  font-size: var(--blog-font-base);
}

article.post .content p {
  margin: 0 0 16px 0;
}

article.post .content p:last-child {
  margin-bottom: 0;
}

article.post .content.truncated {
  max-height: 120px;
  overflow: hidden;
  position: relative;
}

article.post .content.truncated::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--blog-surface));
}

/* Read More Button */
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 10px 20px;
  background: var(--blog-brand);
  color: white;
  text-decoration: none;
  border-radius: var(--blog-radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.read-more:hover {
  background: var(--blog-brand-hover);
  transform: translateX(2px);
  box-shadow: var(--blog-shadow-md);
}

.read-more svg,
.read-more i {
  transition: transform 0.2s;
}

.read-more:hover svg,
.read-more:hover i {
  transform: translateX(3px);
}

/* Blog Gallery (for images in content) */
article.post .blog-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

article.post .blog-gallery figure {
  margin: 0;
  background: var(--blog-border-light);
  border-radius: var(--blog-radius);
  overflow: hidden;
  box-shadow: var(--blog-shadow-sm);
}

article.post .blog-gallery img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

article.post .blog-gallery figcaption {
  font-size: 0.85rem;
  color: var(--blog-text-light);
  padding: 10px 14px;
  background: var(--blog-surface);
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty {
  color: var(--blog-text-light);
  background: var(--blog-surface);
  border: 2px dashed var(--blog-border);
  padding: 60px 40px;
  border-radius: var(--blog-radius-lg);
  text-align: center;
  max-width: var(--blog-post-max-width);
  margin: 40px auto;
}

.empty-icon {
  font-size: 3rem;
  color: var(--blog-muted);
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty h3 {
  margin: 0 0 8px 0;
  color: var(--blog-text);
  font-size: 1.5rem;
  font-weight: 600;
}

.empty p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--blog-muted);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1200px) {
  .wrap {
    flex-direction: column;
    gap: 0;
    padding: 32px 24px 60px;
  }

  .blog-sidebar {
    flex: none;
    max-width: 100%;
    padding: 0 0 32px 0;
    margin-bottom: 16px;
    position: static;
    border-bottom: 2px solid var(--blog-border-light);
  }

  .blog-main-content {
    min-width: 0;
  }

  .post-list {
    gap: 28px;
  }
}

@media (max-width: 768px) {
  :root {
    --blog-font-base: 0.95rem;
  }

  .wrap {
    padding: 24px 16px 48px;
  }

  header.page-head h1 {
    font-size: 2rem;
  }

  header.page-head .subtitle {
    font-size: 1rem;
  }

  article.post .featured-image {
    height: 200px;
  }

  .post-content-wrapper {
    padding: 24px 20px 28px;
  }

  article.post h2 {
    font-size: 1.35rem;
  }

  article.post .teaser {
    font-size: 0.95rem;
  }

  .post-meta {
    font-size: 0.8rem;
    gap: 12px;
  }

  article.post:hover {
    transform: translateY(-2px);
  }

  .blog-result-list li {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  header.page-head h1 {
    font-size: 1.75rem;
  }

  .post-content-wrapper {
    padding: 20px 16px 24px;
  }

  article.post h2 {
    font-size: 1.25rem;
  }

  .empty {
    padding: 40px 24px;
  }
}