.blog-section {
  background: linear-gradient(135deg, #f8fafc 0%, #f0f6ff 50%, #eff5ff 100%);
  position: relative;
  overflow: hidden;
}

.blog-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(27, 79, 153, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  position: relative;
  z-index: 1;
}

/* ==================== BLOG CARDS ==================== */
.blog-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(27, 79, 153, 0.08);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: auto;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.320, 1);
  box-shadow: 
    0 8px 32px rgba(10, 37, 64, 0.08),
    0 2px 8px rgba(27, 79, 153, 0.06);
  position: relative;
}

.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1b4f99 0%, #2d63b4 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-12px);
  box-shadow: 
    0 20px 48px rgba(10, 37, 64, 0.15),
    0 4px 12px rgba(27, 79, 153, 0.12);
  border-color: rgba(27, 79, 153, 0.15);
}

.blog-card:hover::before {
  opacity: 1;
}

/* ==================== BLOG IMAGE ==================== */
.blog-image {
  height: 200px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #e8f0ff 0%, #f0f6ff 100%);
  flex-shrink: 0;
}

.blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.320, 1);
}

.blog-card:hover .blog-image img {
  transform: scale(1.08) rotate(1deg);
}

/* ==================== BLOG CONTENT ==================== */
.blog-content {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow: hidden;
}

.blog-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1b4f99;
  background: linear-gradient(135deg, rgba(27, 79, 153, 0.1), rgba(45, 99, 180, 0.08));
  padding: 6px 12px;
  border-radius: 18px;
  width: fit-content;
  border: 1px solid rgba(27, 79, 153, 0.15);
  transition: all 0.3s ease;
  margin-bottom: 4px;
}

.blog-card:hover .blog-category {
  background: linear-gradient(135deg, rgba(27, 79, 153, 0.15), rgba(45, 99, 180, 0.12));
  border-color: rgba(27, 79, 153, 0.25);
  color: #133a7a;
}

.blog-content h3 {
  font-family: "Poppins", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: #0a2540;
  margin: 4px 0 6px 0;
  transition: color 0.3s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card:hover .blog-content h3 {
  color: #1b4f99;
}

.blog-preview {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #475569;
  font-weight: 400;
  transition: color 0.3s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card:hover .blog-preview {
  color: #334155;
}

/* ==================== READ MORE BUTTON ==================== */
.blog-read-more {
  align-self: flex-start;
  margin-top: auto;
  padding: 11px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, #1b4f99 0%, #2d63b4 100%);
  color: #fff;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
  box-shadow: 0 4px 15px rgba(27, 79, 153, 0.3);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
  font-family: "Poppins", sans-serif;
}

.blog-read-more::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.blog-read-more:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(27, 79, 153, 0.4);
  background: linear-gradient(135deg, #133a7a 0%, #1b4f99 100%);
}

.blog-read-more:hover::before {
  left: 100%;
}

.blog-read-more:active {
  transform: translateY(-2px);
}

/* ==================== EXPANDED CONTENT ==================== */
.blog-full {
  color: #475569;
  line-height: 1.8;
  font-size: 1rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: 
    max-height 0.5s cubic-bezier(0.23, 1, 0.320, 1),
    opacity 0.4s ease,
    transform 0.3s ease;
  transform: translateY(-10px);
}

.blog-card.expanded .blog-full {
  opacity: 1;
  transform: translateY(0);
}

.blog-full p {
  margin-bottom: 16px;
}

/* ==================== MODAL STYLES ==================== */
.blog-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: modalFadeIn 0.3s ease forwards;
}

.blog-modal[hidden] {
  display: none;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.blog-modal-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10, 37, 64, 0.4) 0%, rgba(27, 79, 153, 0.2) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: overlayFadeIn 0.3s ease forwards;
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.blog-modal-content {
  position: relative;
  z-index: 1001;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 28px;
  border: 1px solid rgba(27, 79, 153, 0.12);
  box-shadow: 
    0 25px 60px rgba(10, 37, 64, 0.2),
    0 8px 24px rgba(27, 79, 153, 0.15);
  max-width: 900px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(27, 79, 153, 0.3) transparent;
  animation: modalContentSlideUp 0.5s cubic-bezier(0.23, 1, 0.320, 1) forwards;
}

.blog-modal-content::-webkit-scrollbar {
  width: 6px;
}

.blog-modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.blog-modal-content::-webkit-scrollbar-thumb {
  background: rgba(27, 79, 153, 0.3);
  border-radius: 3px;
}

.blog-modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(27, 79, 153, 0.5);
}

@keyframes modalContentSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.blog-modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 1002;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(27, 79, 153, 0.1);
  color: #1b4f99;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 1px solid rgba(27, 79, 153, 0.15);
}

.blog-modal-close:hover {
  background: rgba(27, 79, 153, 0.2);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 4px 12px rgba(27, 79, 153, 0.2);
}

.blog-modal-close:active {
  transform: rotate(90deg) scale(0.95);
}

.blog-modal-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: stretch;
  max-height: 80vh;
}

.blog-modal-image {
  background: linear-gradient(135deg, #e8f0ff 0%, #f0f6ff 100%);
  overflow: hidden;
  border-radius: 28px 28px 0 0;
  height: 320px;
}

.blog-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.blog-modal-text {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(27, 79, 153, 0.3) transparent;
}

.blog-modal-text::-webkit-scrollbar {
  width: 6px;
}

.blog-modal-text::-webkit-scrollbar-track {
  background: transparent;
}

.blog-modal-text::-webkit-scrollbar-thumb {
  background: rgba(27, 79, 153, 0.3);
  border-radius: 3px;
}

.blog-modal-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.blog-modal-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1b4f99;
  background: linear-gradient(135deg, rgba(27, 79, 153, 0.12), rgba(45, 99, 180, 0.08));
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid rgba(27, 79, 153, 0.2);
}

.blog-modal-date {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.blog-modal-title {
  font-family: "Poppins", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  color: #0a2540;
  margin: 8px 0;
}

.blog-modal-description {
  font-size: 1.05rem;
  line-height: 1.9;
  color: #475569;
  margin-bottom: 16px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.blog-modal-back-btn {
  margin-top: auto;
  padding: 14px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(27, 79, 153, 0.1), rgba(45, 99, 180, 0.08));
  color: #1b4f99;
  transition: all 0.3s ease;
  border: 1.5px solid rgba(27, 79, 153, 0.2);
  font-family: "Poppins", sans-serif;
  letter-spacing: 0.5px;
  align-self: flex-start;
}

.blog-modal-back-btn:hover {
  background: linear-gradient(135deg, rgba(27, 79, 153, 0.15), rgba(45, 99, 180, 0.12));
  border-color: rgba(27, 79, 153, 0.4);
  transform: translateX(-4px);
  box-shadow: 0 4px 12px rgba(27, 79, 153, 0.15);
}

.blog-modal-back-btn:active {
  transform: translateX(-2px);
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Desktop: 3 columns */
@media (min-width: 1025px) {
  .blog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
  }
}

/* Tablet: 2 columns */
@media (max-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .blog-image {
    height: 190px;
  }

  .blog-content h3 {
    font-size: 1.1rem;
  }

  .blog-preview {
    font-size: 0.88rem;
  }

  .blog-modal-inner {
    grid-template-columns: 1fr;
    max-height: 85vh;
  }

  .blog-modal-image {
    border-radius: 28px 28px 0 0;
    height: 300px;
  }

  .blog-modal-text {
    padding: 36px 32px;
  }

  .blog-modal-title {
    font-size: 1.75rem;
  }
}

/* Tablet small: 2 columns */
@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .blog-card {
    border-radius: 16px;
  }

  .blog-image {
    height: 180px;
  }

  .blog-content {
    padding: 20px 18px;
    gap: 10px;
  }

  .blog-content h3 {
    font-size: 1.05rem;
  }

  .blog-preview {
    font-size: 0.85rem;
  }

  .blog-read-more {
    padding: 10px 20px;
    font-size: 0.85rem;
  }

  .blog-modal-content {
    border-radius: 20px;
    max-height: 90vh;
  }

  .blog-modal-close {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    top: 16px;
    right: 16px;
  }

  .blog-modal-inner {
    max-height: 90vh;
  }

  .blog-modal-image {
    height: 240px;
    border-radius: 20px 20px 0 0;
  }

  .blog-modal-text {
    padding: 28px 20px;
    gap: 16px;
  }

  .blog-modal-title {
    font-size: 1.5rem;
  }

  .blog-modal-description {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .blog-card {
    border-radius: 14px;
  }

  .blog-image {
    height: 160px;
  }

  .blog-content {
    padding: 18px 16px;
  }

  .blog-content h3 {
    font-size: 1rem;
  }

  .blog-category {
    font-size: 0.65rem;
    padding: 5px 10px;
  }

  .blog-read-more {
    padding: 9px 18px;
    font-size: 0.85rem;
  }

  .blog-preview {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  .blog-modal {
    padding: 12px;
  }

  .blog-modal-content {
    border-radius: 16px;
  }

  .blog-modal-inner {
    border-radius: 16px;
  }

  .blog-modal-image {
    height: 200px;
    border-radius: 16px 16px 0 0;
  }

  .blog-modal-text {
    padding: 20px 16px;
  }

  .blog-modal-title {
    font-size: 1.3rem;
  }

  .blog-modal-description {
    font-size: 0.9rem;
    line-height: 1.7;
  }

  .blog-modal-close {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    top: 12px;
    right: 12px;
  }
}
