/* ==========================================================================
   Health Insights Blog Styles - Dr. Kunal Patel
   Matching Reference Layout, Filter Buttons, Card Design, Mobile Dropdown & Modal
   ========================================================================== */

/* ==========================================================================
   Blog Hero Banner (Soft blue background with medical aesthetic)
   ========================================================================== */
.blog-hero-section {
  position: relative;
  background: linear-gradient(135deg, #ebf3fd 0%, #f4f8fe 50%, #e8f2fc 100%);
  padding: 68px 0 54px;
  overflow: hidden;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

.blog-hero-bg-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 52%;
  background-image: url('/assets/images/services-hero-bg.jpg');
  background-position: center right;
  background-size: cover;
  opacity: 0.12;
  mask-image: linear-gradient(to left, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-image: linear-gradient(to left, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}

.blog-hero-container {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}

.blog-hero-title {
  font-size: clamp(2.3rem, 4.2vw, 3.1rem);
  font-weight: 800;
  color: #0b2545;
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin-bottom: 12px;
}

.blog-hero-subtitle {
  font-size: clamp(1.02rem, 1.8vw, 1.15rem);
  color: #475569;
  line-height: 1.55;
  max-width: 640px;
  margin: 0 auto;
  font-weight: 450;
}

/* ==========================================================================
   Search & Filter Bar Container
   ========================================================================== */
.blog-controls-section {
  padding: 36px 0 16px;
  background: #ffffff;
}

.blog-controls-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* Search Bar (Matching Reference Image) */
.blog-search-box {
  position: relative;
  flex: 0 0 320px;
  max-width: 100%;
}

.blog-search-input {
  width: 100%;
  height: 44px;
  padding: 10px 42px 10px 16px;
  font-size: 0.94rem;
  font-family: inherit;
  color: #0f172a;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.blog-search-input::placeholder {
  color: #9ca3af;
}

.blog-search-input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.14);
}

.blog-search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Desktop Filter Buttons (Matching Reference Image) */
.blog-filters-desktop {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.blog-filter-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #334155;
  padding: 9px 18px;
  font-size: 0.9rem;
  font-weight: 550;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.blog-filter-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0b2545;
}

/* Active State: Solid Deep Navy */
.blog-filter-btn.active {
  background: #0b2545;
  border-color: #0b2545;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(11, 37, 69, 0.16);
}

/* Mobile Filter Dropdown (Hidden on desktop, shown on mobile <=768px) */
.blog-filters-mobile {
  display: none;
  width: 100%;
}

.mobile-filter-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 6px;
}

.mobile-filter-select-wrap {
  position: relative;
  width: 100%;
}

.mobile-filter-select {
  width: 100%;
  height: 46px;
  padding: 0 42px 0 16px;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 550;
  color: #0b2545;
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.mobile-filter-select:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.mobile-select-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #0b2545;
}

/* Results Count */
.blog-results-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0284c7;
  margin-top: 14px;
  margin-bottom: 4px;
}

/* ==========================================================================
   Blog Cards Grid (Exact Reference Image Card Anatomy)
   ========================================================================== */
.blog-grid-section {
  padding: 24px 0 60px;
  background: #ffffff;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

/* Single Card */
.blog-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

/* Media / Thumbnail */
.blog-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f1f5f9;
  cursor: pointer;
}

.blog-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.blog-card:hover .blog-card-img {
  transform: scale(1.04);
}

/* Card Body */
.blog-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Category Badge (Light blue soft pill) */
.blog-card-badge-wrap {
  margin-bottom: 10px;
}

.blog-badge {
  display: inline-block;
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.74rem;
  font-weight: 650;
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0.01em;
}

/* Title */
.blog-card-title {
  font-size: 1.04rem;
  font-weight: 700;
  color: #0b2545;
  line-height: 1.34;
  margin-bottom: 8px;
  cursor: pointer;
  transition: color 0.18s ease;
}

.blog-card-title:hover {
  color: #0284c7;
}

/* Description & Read More (Clamped to 2 lines ~18 words) */
.blog-card-desc-wrap {
  margin-bottom: 16px;
}

.blog-card-desc {
  font-size: 0.86rem;
  color: #475569;
  line-height: 1.48;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-read-more {
  background: none;
  border: none;
  padding: 0;
  margin: 0 0 0 4px;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  color: #1d4ed8;
  cursor: pointer;
  display: inline;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.btn-read-more:hover {
  color: #0284c7;
}

/* Card Meta Footer (Calendar Date + Read Time) */
.blog-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #64748b;
}

.blog-card-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calendar-icon {
  color: #64748b;
  flex-shrink: 0;
}

.blog-card-readtime {
  font-weight: 500;
  color: #64748b;
}

/* ==========================================================================
   View All Articles Button (Matching Reference Image)
   ========================================================================== */
.blog-view-all-wrap {
  margin-top: 48px;
  text-align: center;
}

.btn-view-all-articles {
  display: inline-block;
  padding: 11px 32px;
  background: #ffffff;
  color: #0b2545;
  border: 1.5px solid #0b2545;
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.22s ease;
  user-select: none;
}

.btn-view-all-articles:hover {
  background: #0b2545;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(11, 37, 69, 0.18);
  transform: translateY(-1px);
}

/* ==========================================================================
   Empty State
   ========================================================================== */
.blog-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 20px;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  margin: 12px 0;
}

.empty-icon {
  margin-bottom: 12px;
}

.empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0b2545;
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 0.92rem;
  color: #64748b;
  max-width: 420px;
  margin: 0 auto 16px;
}

.btn-reset-filters {
  background: #0284c7;
  color: #ffffff;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease;
}

.btn-reset-filters:hover {
  background: #0369a1;
}

/* ==========================================================================
   Centered Modal Dialog ("Make the card big in center and show whole description")
   ========================================================================== */
.article-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 37, 69, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.article-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

body.modal-open {
  overflow: hidden;
}

.article-modal-content {
  position: relative;
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(11, 37, 69, 0.35);
  overflow-y: auto;
  transform: scale(0.94);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-modal.is-open .article-modal-content {
  transform: scale(1);
}

.modal-card-inner {
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(4px);
}

.modal-close-btn:hover {
  background: rgba(15, 23, 42, 0.92);
  transform: rotate(90deg);
}

.modal-hero-img-wrap {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  background: #0b2545;
}

.modal-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-badge-overlay {
  position: absolute;
  bottom: 16px;
  left: 24px;
}

.badge-modal {
  background: #0284c7;
  color: #ffffff;
  font-size: 0.82rem;
  padding: 4px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-body-container {
  padding: 24px 28px 32px;
}

.modal-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.modal-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.modal-meta-divider {
  color: #cbd5e1;
}

.modal-meta-author {
  color: #0b2545;
  font-weight: 500;
}

.modal-article-title {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 800;
  color: #0b2545;
  line-height: 1.25;
  margin-bottom: 20px;
}

.modal-article-fulltext {
  font-size: 0.96rem;
  color: #334155;
  line-height: 1.68;
}

.modal-article-fulltext p {
  margin-bottom: 14px;
}

.article-subheading {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0b2545;
  margin: 22px 0 10px;
}

.article-bullet-list {
  padding-left: 20px;
  margin-bottom: 16px;
}

.article-bullet-list li {
  margin-bottom: 6px;
  color: #334155;
}

.article-quote {
  margin: 20px 0;
  padding: 16px 20px;
  background: #f0f9ff;
  border-left: 4px solid #0284c7;
  border-radius: 0 8px 8px 0;
  color: #0369a1;
  font-style: italic;
}

.article-quote p {
  margin: 0;
}

.modal-footer-cta {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.modal-doctor-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-doctor-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #0284c7;
}

.modal-doctor-info .doctor-name {
  font-size: 0.96rem;
  font-weight: 700;
  color: #0b2545;
}

.modal-doctor-info .doctor-role {
  font-size: 0.8rem;
  color: #64748b;
}

.modal-cta-btn {
  padding: 10px 22px;
  font-size: 0.9rem;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1200px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 991px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .blog-controls-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .blog-search-box {
    flex: 1 1 100%;
    width: 100%;
  }

  .blog-filters-desktop {
    justify-content: flex-start;
  }
}

/* Mobile Screen <= 768px */
@media (max-width: 768px) {
  .blog-hero-section {
    padding: 48px 0 38px;
  }

  .blog-hero-bg-overlay {
    width: 100%;
    opacity: 0.08;
  }

  .blog-controls-section {
    padding: 24px 0 12px;
  }

  /* Hide Desktop Buttons */
  .blog-filters-desktop {
    display: none;
  }

  /* Show Mobile Dropdown */
  .blog-filters-mobile {
    display: block;
    margin-top: 12px;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .blog-card-media {
    aspect-ratio: 16 / 9;
  }

  .modal-hero-img-wrap {
    height: 200px;
  }

  .modal-body-container {
    padding: 18px 18px 24px;
  }

  .modal-footer-cta {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .modal-doctor-card {
    justify-content: center;
  }

  .modal-cta-btn {
    width: 100%;
  }
}
