/* Modern Apple-inspired custom styles */

/* Force white background with high specificity */
html, body {
  background-color: #FFFFFF !important;
}

.container, .container-fluid, .main-content, #main, main {
  background-color: #FFFFFF !important;
}

/* Remove any orange/beige backgrounds */
*[style*="background-color: #fbe9d0"],
*[style*="background-color: #fceedd"],
.nav-card[style*="background"],
.post-card[style*="background"] {
  background-color: #FFFFFF !important;
}

/* Typography improvements */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.003em;
  background-color: #FFFFFF !important;
}

/* Headers with better spacing */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1 {
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 1.2;
}

/* Enhanced navbar with higher specificity */
.navbar.navbar-custom,
.navbar-custom {
  backdrop-filter: saturate(180%) blur(20px) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
  background-color: rgba(251, 251, 253, 0.85) !important;
  border-bottom: 1px solid rgba(229, 229, 231, 0.8) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.navbar-custom .navbar-brand {
  font-weight: 600 !important;
  color: #1D1D1F !important;
  transition: color 0.2s ease !important;
}

.navbar-custom .navbar-nav .nav-link {
  font-weight: 600 !important;
  color: #1D1D1F !important;
  transition: color 0.2s ease !important;
}

.navbar-custom .navbar-nav .nav-link:hover,
.navbar-custom .navbar-nav .nav-link:focus {
  color: #007AFF !important;
}

.navbar-custom .navbar-nav .nav-link.active {
  color: #007AFF !important;
  font-weight: 700 !important;
}

.navbar-custom .navbar-brand:hover,
.navbar-custom .navbar-brand:focus {
  color: #007AFF !important;
}

.navbar-custom .navbar-brand.active {
  color: #007AFF !important;
  font-weight: 700 !important;
}

/* Button improvements with higher specificity */
.btn,
.btn-primary {
  border-radius: 8px !important;
  font-weight: 500 !important;
  padding: 0.75rem 1.5rem !important;
  transition: all 0.2s ease !important;
  border: none !important;
}

.btn-primary {
  background-color: #007AFF !important;
  border-color: #007AFF !important;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: #0051D5 !important;
  border-color: #0051D5 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.35) !important;
}

/* Card and content improvements */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

/* ==========================================
   HOMEPAGE NAVIGATION CARDS - Enhanced Apple Style
   ========================================== */

.quick-nav-container {
  margin: 3rem 0;
}

.quick-nav-card {
  display: block;
  text-decoration: none;
  background: linear-gradient(135deg, #FFFFFF 0%, #FAFBFC 100%);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 24px;
  padding: 3rem 2rem;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.quick-nav-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.2) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.quick-nav-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: all 0.6s ease;
  pointer-events: none;
}

.quick-nav-card:hover::before {
  opacity: 1;
}

.quick-nav-card:hover::after {
  opacity: 1;
  transform: rotate(45deg);
}

.quick-nav-card:hover {
  text-decoration: none;
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.08);
}

.card-icon {
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

.card-icon i {
  font-size: 3rem;
  color: #007AFF;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 4px 8px rgba(0, 122, 255, 0.2));
}

.card-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: #1D1D1F;
  margin: 0;
  transition: all 0.4s ease;
  position: relative;
  z-index: 2;
  letter-spacing: -0.01em;
}

/* Individual card hover colors */
.quick-nav-card:nth-child(1):hover {
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  border-color: #2196F3;
}

.quick-nav-card:nth-child(1):hover .card-icon i {
  color: #1976D2;
  transform: scale(1.1);
}

.quick-nav-card:nth-child(1):hover .card-title {
  color: #1565C0;
}

.quick-nav-card:nth-child(2):hover {
  background: linear-gradient(135deg, #E8F5E8 0%, #C8E6C9 100%);
  border-color: #4CAF50;
}

.quick-nav-card:nth-child(2):hover .card-icon i {
  color: #2E7D32;
  transform: scale(1.1);
}

.quick-nav-card:nth-child(2):hover .card-title {
  color: #1B5E20;
}

.quick-nav-card:nth-child(3):hover {
  background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
  border-color: #FF9800;
}

.quick-nav-card:nth-child(3):hover .card-icon i {
  color: #F57C00;
  transform: scale(1.1);
}

.quick-nav-card:nth-child(3):hover .card-title {
  color: #E65100;
}

.quick-nav-card:nth-child(4):hover {
  background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD9 100%);
  border-color: #E91E63;
}

.quick-nav-card:nth-child(4):hover .card-icon i {
  color: #C2185B;
  transform: scale(1.1);
}

.quick-nav-card:nth-child(4):hover .card-title {
  color: #AD1457;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .quick-nav-card {
    padding: 2rem 1.25rem;
    margin-bottom: 1rem;
  }
  
  .card-icon i {
    font-size: 2.25rem;
  }
  
  .card-title {
    font-size: 1.125rem;
  }
}

/* Footer improvements with higher specificity */
footer,
footer.footer {
  background-color: #F5F5F7 !important;
  border-top: 1px solid #E5E5E7 !important;
  padding: 2rem 0 !important;
}

footer p.text-muted {
  color: #6E6E73 !important;
}

footer a {
  color: #007AFF !important;
}

footer a:hover,
footer a:focus {
  color: #0051D5 !important;
}


/* Link improvements */
a {
  color: #007AFF;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #0051D5;
  text-decoration: none;
}

/* Profile image improvements */
.avatar-img {
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.avatar-img:hover {
  transform: scale(1.05);
}

/* Publication cards */
.publication-card {
  border-radius: 12px;
  border: 1px solid #E5E5E7;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: #FFFFFF;
  transition: all 0.3s ease;
}

.publication-card:hover {
  border-color: #007AFF;
  box-shadow: 0 8px 32px rgba(0, 122, 255, 0.1);
  transform: translateY(-2px);
}

/* Override publication styles from main theme - Compact version for homepage */
.publications-list .publication-preview {
  background: #FFFFFF !important;
  border: 1px solid #E5E5E7 !important;
  border-radius: 12px !important;
  padding: 1.5rem !important; /* Reduced from 2rem */
  margin-bottom: 1.5rem !important; /* Reduced from 2rem */
  transition: all 0.3s ease !important;
  display: flex !important;
  gap: 1.25rem !important; /* Reduced from 1.5rem */
  align-items: flex-start !important;
}

.publications-list .publication-preview:hover {
  border-color: #007AFF !important;
  box-shadow: 0 8px 32px rgba(0, 122, 255, 0.1) !important;
  transform: translateY(-2px) !important;
}

/* Publication image styling with high specificity - Compact version */
.publications-list .publication-preview .publication-image,
.publication-preview .publication-image {
  flex-shrink: 0 !important;
  width: 120px !important; /* Reduced from 150px */
  height: auto !important;
  margin-right: 1.25rem !important; /* Reduced from 1.5rem */
}

.publications-list .publication-preview .publication-image img,
.publication-preview .publication-image img {
  width: 100% !important;
  height: 168px !important; /* Reduced from 210px (120px * 1.4) */
  border-radius: 8px !important;
  object-fit: cover !important;
  object-position: center !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
  border: 1px solid #E5E5E7 !important;
  padding: 0 !important;
  max-height: none !important;
  max-width: none !important;
}

.publications-list .publication-preview .publication-image img:hover,
.publication-preview .publication-image img:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
}

.publication-content {
  flex: 1;
}

.publication-title {
  font-size: 1.125rem !important; /* Reduced from 1.25rem */
  font-weight: 600;
  color: #1D1D1F;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.publication-title:hover {
  color: #007AFF;
}

.publication-authors {
  color: #6E6E73;
  font-size: 0.9rem !important; /* Reduced from 0.95rem */
  margin-bottom: 0.75rem;
}

.publication-meta {
  color: #8E8E93;
  font-size: 0.85rem !important; /* Reduced from 0.9rem */
  margin-bottom: 1rem;
}

.publication-journal {
  font-style: italic;
  margin-right: 1rem;
}

.publication-year {
  font-weight: 500;
  margin-right: 1rem;
}

.publication-abstract {
  margin: 0.75rem 0 !important; /* Reduced from 1rem 0 */
}

.publication-abstract details summary {
  cursor: pointer;
  color: #007AFF;
  font-weight: 500;
  padding: 0.375rem 0 !important; /* Reduced from 0.5rem 0 */
  outline: none;
  transition: color 0.2s ease;
  font-size: 0.9rem !important; /* Added smaller font size */
}

.publication-abstract details summary:hover {
  color: #0051D5;
}

.publication-abstract details[open] summary {
  margin-bottom: 0.5rem !important; /* Reduced from 0.75rem */
}

.publication-abstract details p {
  font-size: 0.85rem !important; /* Smaller abstract text */
  line-height: 1.4 !important;
  color: #6E6E73 !important;
}

.publication-links {
  margin: 0.75rem 0 !important; /* Reduced from 1rem 0 */
}

.publication-links .btn {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.375rem 0.75rem !important; /* Smaller buttons */
  font-size: 0.8rem !important;
}

.publication-tags {
  margin-top: 0.75rem !important; /* Reduced from 1rem */
}

.publication-tags .tag {
  background-color: #F5F5F7;
  color: #6E6E73;
  padding: 0.2rem 0.6rem !important; /* Reduced padding */
  border-radius: 12px !important; /* Reduced from 16px */
  font-size: 0.75rem !important; /* Reduced from 0.8rem */
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  margin: 0.2rem 0.2rem 0.2rem 0 !important; /* Reduced margins */
  transition: all 0.2s ease;
  cursor: default;
}

/* Keep old link styles for backward compatibility but lower priority */
.publication-tags a {
  background-color: #F5F5F7;
  color: #6E6E73;
  padding: 0.25rem 0.75rem;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  margin: 0.25rem 0.25rem 0.25rem 0;
  transition: all 0.2s ease;
}

.publication-tags a:hover {
  background-color: #007AFF;
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* Section dividers */
.section-divider {
  text-align: center;
  margin: 3rem 0 2rem 0;
}

.section-heading {
  font-weight: 600;
  color: #1D1D1F;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #007AFF 0%, #5AC8FA 100%);
  border: none;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .publication-preview {
    flex-direction: column;
    padding: 1.5rem;
  }
  
  .publication-image {
    width: 100%;
    max-width: 180px; /* Slightly narrower for mobile */
    margin: 0 auto;
  }
  
  .publication-image img {
    height: 460px; /* Much taller mobile format: 180px * 2.5 ≈ 460px */
  }
}

/* Tag improvements - Non-clickable tags for publications */
.tag {
  background-color: #F5F5F7;
  color: #6E6E73;
  padding: 0.25rem 0.75rem;
  border-radius: 16px;
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0.25rem;
  display: inline-block;
  cursor: default;
}

/* Responsive spacing */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  
  .navbar {
    padding: 0.5rem 1rem;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Loading animation for better UX */
.fade-in {
  animation: fadeIn 0.6s ease-in-out;
}

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

/* ==========================================
   HOMEPAGE HERO ABOUT SECTION
   ========================================== */

.hero-about-section {
  margin: 3rem 0 4rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #FBFBFD 0%, #FFFFFF 100%);
  border-radius: 20px;
  border: 1px solid #F2F2F7;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.profile-image-container {
  position: relative;
  display: inline-block;
}

.profile-image {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #FFFFFF;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-image:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.about-content {
  padding-left: 2rem;
}

.about-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1D1D1F;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.about-description {
  font-size: 1.125rem;
  color: #6E6E73;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.about-links {
  margin-top: 2rem;
}

.about-links .btn {
  padding: 0.875rem 2rem;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.about-links .btn-primary {
  background: linear-gradient(135deg, #007AFF 0%, #5AC8FA 100%);
  border: none;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.about-links .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.4);
}

.about-links .btn-outline-primary {
  color: #007AFF;
  border-color: #007AFF;
  background: rgba(0, 122, 255, 0.05);
}

.about-links .btn-outline-primary:hover {
  background: #007AFF;
  border-color: #007AFF;
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.about-links .btn-outline-primary:hover i {
  color: #FFFFFF;
}

/* ==========================================
   QUICK NAVIGATION CARDS (Updated to match original nav-cards)
   ========================================== */

.quick-nav-container {
  margin: 3rem 0;
}

.quick-nav-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #FBFBFD 100%);
  border: 1px solid #E5E5E7;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  height: 280px; /* Fixed height for all cards */
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.quick-nav-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #007AFF 0%, #5AC8FA 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.quick-nav-card:hover::before {
  transform: scaleX(1);
}

.quick-nav-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 122, 255, 0.1);
  border-color: #007AFF;
}

.quick-nav-card .card-icon {
  color: #007AFF;
  font-size: 3rem;
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.quick-nav-card:hover .card-icon {
  transform: scale(1.1);
}

.quick-nav-card .card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 1rem;
}

.quick-nav-card .card-description {
  color: #6E6E73;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.quick-nav-card .card-link {
  display: inline-block;
  background-color: #007AFF;
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
}

.quick-nav-card .card-link:hover {
  background-color: #0051D5;
  color: #FFFFFF;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.35);
}

.quick-nav-card .card-link i {
  margin-left: 0.5rem;
  font-size: 0.8rem;
}

/* ==========================================
   LATEST BLOG POSTS SECTION (Fixed Heights)
   ========================================== */

.latest-posts-container {
  margin: 3rem 0;
}

.latest-post-card {
  background: #FFFFFF;
  border: 1px solid #E5E5E7;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 420px; /* Fixed height for all blog cards */
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.latest-post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 122, 255, 0.1);
  border-color: #007AFF;
}

.latest-post-card .post-image {
  width: 100%;
  height: 160px; /* Fixed image height */
  overflow: hidden;
  border-bottom: 1px solid #F2F2F7;
  flex-shrink: 0;
}

.latest-post-card .post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.latest-post-card:hover .post-image img {
  transform: scale(1.05);
}

.latest-post-card .post-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.latest-post-card .post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: #8E8E93;
  font-weight: 500;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #F2F2F7;
  flex-shrink: 0;
}

.latest-post-card .post-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6rem;
}

.latest-post-card .post-title a {
  color: #1D1D1F;
  text-decoration: none;
  transition: color 0.2s ease;
}

.latest-post-card .post-title a:hover {
  color: #007AFF;
}

.latest-post-card .post-subtitle {
  font-size: 0.95rem;
  color: #6E6E73;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  font-weight: 500;
  flex-shrink: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.latest-post-card .post-excerpt {
  color: #6E6E73;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.latest-post-card .read-more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #007AFF;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  margin-top: auto;
  flex-shrink: 0;
}

.latest-post-card .read-more-link:hover {
  color: #0051D5;
  transform: translateX(2px);
}

.latest-post-card .read-more-link i {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.latest-post-card:hover .read-more-link i {
  transform: translateX(3px);
}

/* ==========================================
   RESPONSIVE DESIGN FOR HOMEPAGE
   ========================================== */

@media (max-width: 768px) {
  .hero-about-section {
    margin: 2rem 0 3rem 0;
    padding: 1.5rem;
  }

  .about-content {
    padding-left: 0;
    margin-top: 2rem;
    text-align: center;
  }

  .about-title {
    font-size: 2rem;
  }

  .about-description {
    font-size: 1rem;
  }

  .profile-image {
    width: 150px;
    height: 150px;
  }

  .quick-nav-card {
    padding: 1.5rem;
    margin-bottom: 1rem;
    height: 240px; /* Reduced height for mobile */
  }

  .quick-nav-card .card-icon {
    font-size: 2.5rem; /* Slightly smaller for mobile */
  }

  .quick-nav-card .card-title {
    font-size: 1.125rem;
  }

  .quick-nav-card .card-description {
    font-size: 0.9rem;
  }

  .latest-post-card {
    height: 380px; /* Reduced height for mobile */
    margin-bottom: 1.5rem;
  }

  .latest-post-card .post-image {
    height: 140px;
  }

  .latest-post-card .post-content {
    padding: 1rem;
  }

  .latest-post-card .post-title {
    font-size: 1rem;
  }

  .latest-post-card .post-subtitle {
    font-size: 0.85rem;
  }

  .latest-post-card .post-excerpt {
    font-size: 0.8rem;
  }

  .latest-post-card .post-meta {
    font-size: 0.75rem;
  }

  /* Compact publications for mobile */
  .publications-list .publication-preview {
    flex-direction: column !important;
    padding: 1.25rem !important;
    text-align: center !important;
  }
  
  .publications-list .publication-preview .publication-image {
    width: 100% !important;
    max-width: 140px !important;
    margin: 0 auto 1rem auto !important;
  }
  
  .publications-list .publication-preview .publication-image img {
    height: 196px !important; /* 140px * 1.4 */
  }
}

/* ==========================================
   BLOG STYLES - Medium-like Design
   ========================================== */

/* Blog Header */
.blog-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.blog-main-title {
  font-size: 3rem;
  font-weight: 700;
  color: #1D1D1F;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.blog-subtitle {
  font-size: 1.25rem;
  color: #6E6E73;
  font-weight: 400;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Blog Cards Container - Wider margins */
.blog-posts-container {
  margin-top: 2rem;
  padding: 0 2rem;
}

/* Blog Cards Layout - Improved spacing */
.blog-posts-container .row {
  margin-left: -1rem;
  margin-right: -1rem;
}

.blog-posts-container .row > [class*="col-"] {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Blog Card Styling - Square design with minimal border */
.blog-card {
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid #E5E5E7;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  max-height: 420px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  border-color: #C7C7CC;
}

.blog-card-image {
  width: 100%;
  height: 160px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  border-bottom: 1px solid #F2F2F7;
}

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

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

.blog-card-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  margin-bottom: 0.875rem;
  font-size: 0.8rem;
  color: #8E8E93;
  font-weight: 500;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #F2F2F7;
}

.blog-date {
  color: #8E8E93;
}

.blog-readtime {
  color: #8E8E93;
}

.blog-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  color: #1D1D1F;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6rem;
}

.blog-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-card-title a:hover {
  color: #007AFF;
}

.blog-card-subtitle {
  font-size: 0.9rem;
  font-weight: 400;
  color: #6E6E73;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-excerpt {
  color: #6E6E73;
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
  font-size: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #F2F2F7;
}

.blog-card-footer {
  margin-top: auto;
}

.read-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #007AFF;
  font-weight: 500;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.read-more-btn:hover {
  color: #0051D5;
  text-decoration: none;
  transform: translateX(2px);
}

.read-more-btn i {
  font-size: 0.875rem;
  transition: transform 0.2s ease;
}

.read-more-btn:hover i {
  transform: translateX(3px);
}

/* No Posts Message */
.no-posts-message {
  text-align: center;
  padding: 4rem 2rem;
}

.no-posts-message i {
  color: #C7C7CC;
}

/* ==========================================
   BLOG POST ARTICLE STYLES
   ========================================== */

.blog-post-article {
  max-width: 100%;
  margin: 0 auto;
}

.blog-post-header {
  text-align: center;
  margin-bottom: 3rem;
  border-bottom: 1px solid #E5E5E7;
  padding-bottom: 2rem;
}

.blog-post-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: #8E8E93;
  font-weight: 500;
}

.blog-post-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: #1D1D1F;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.blog-post-subtitle {
  font-size: 1.5rem;
  font-weight: 400;
  color: #6E6E73;
  line-height: 1.4;
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.blog-post-image {
  margin: 2rem 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.blog-post-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Article Content Typography - Wider margins */
.blog-post-content {
  font-size: 1.125rem;
  line-height: 1.7;
  color: #1D1D1F;
  max-width: 800px;
  margin: 0 auto 3rem auto;
  padding: 0 2rem;
}

.blog-post-content h1,
.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4,
.blog-post-content h5,
.blog-post-content h6 {
  font-weight: 600;
  color: #1D1D1F;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.blog-post-content h1 { font-size: 2rem; }
.blog-post-content h2 { font-size: 1.75rem; }
.blog-post-content h3 { font-size: 1.5rem; }
.blog-post-content h4 { font-size: 1.25rem; }

.blog-post-content p {
  margin-bottom: 1.5rem;
  color: #1D1D1F;
}

.blog-post-content a {
  color: #007AFF;
  text-decoration: underline;
  text-decoration-color: rgba(0, 122, 255, 0.3);
  text-underline-offset: 3px;
  transition: all 0.2s ease;
}

.blog-post-content a:hover {
  color: #0051D5;
  text-decoration-color: #0051D5;
}

/* Code Blocks */
.blog-post-content pre {
  background: #F5F5F7;
  border: 1px solid #E5E5E7;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
}

.blog-post-content code {
  background: #F5F5F7;
  color: #1D1D1F;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

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

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

.blog-post-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* Blockquotes */
.blog-post-content blockquote {
  border-left: 4px solid #007AFF;
  background: #F5F5F7;
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #6E6E73;
}

/* Images in content */
.blog-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 2rem 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Article Footer - Wider margins */
.blog-post-footer {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 2rem 0 2rem;
  border-top: 1px solid #E5E5E7;
}

.blog-post-tags {
  margin-bottom: 2rem;
}

.tags-label {
  font-weight: 600;
  color: #1D1D1F;
  margin-right: 0.75rem;
}

/* Social Share - Apple-like design */
.blog-post-share {
  margin-bottom: 2rem;
  text-align: center;
}

.blog-post-share h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 1.5rem;
  text-align: center;
}

.share-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #1D1D1F;
  min-width: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.share-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 0, 0, 0.1);
}

.share-btn.twitter {
  color: #1D1D1F;
}

.share-btn.twitter:hover {
  background: #1DA1F2;
  color: #FFFFFF;
  border-color: #1DA1F2;
  box-shadow: 0 4px 16px rgba(29, 161, 242, 0.3);
}

.share-btn.linkedin {
  color: #1D1D1F;
}

.share-btn.linkedin:hover {
  background: #0077B5;
  color: #FFFFFF;
  border-color: #0077B5;
  box-shadow: 0 4px 16px rgba(0, 119, 181, 0.3);
}

.share-btn.email {
  color: #1D1D1F;
}

.share-btn.email:hover {
  background: #34C759;
  color: #FFFFFF;
  border-color: #34C759;
  box-shadow: 0 4px 16px rgba(52, 199, 89, 0.3);
}

/* Post Navigation - Improved alignment */
.blog-post-navigation {
  margin: 3rem 0 2rem 0;
  padding: 2rem 0;
  border-top: 1px solid #E5E5E7;
}

.nav-post {
  padding: 1.5rem;
  border: 1px solid #E5E5E7;
  border-radius: 12px;
  transition: all 0.3s ease;
  height: 100%;
}

.nav-post:hover {
  border-color: #007AFF;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.1);
}

.nav-label {
  display: block;
  font-size: 0.875rem;
  color: #8E8E93;
  font-weight: 500;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-link {
  color: #1D1D1F;
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: #007AFF;
  text-decoration: none;
}

/* Previous post - left aligned */
.prev-post {
  text-align: left;
}

.prev-post .nav-link {
  justify-content: flex-start;
}

/* Next post - right aligned */
.next-post {
  text-align: right;
}

.next-post .nav-link {
  justify-content: flex-end;
  text-align: right;
}

.next-post .nav-label {
  text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
  .blog-main-title {
    font-size: 2.25rem;
  }
  
  .blog-subtitle {
    font-size: 1.125rem;
  }
  
  .blog-posts-container {
    padding: 0 1rem;
  }
  
  .blog-card {
    max-height: 380px;
    margin-bottom: 1.5rem;
  }
  
  .blog-card-content {
    padding: 1rem;
  }
  
  .blog-card-image {
    height: 140px;
  }
  
  .blog-card-title {
    font-size: 1rem;
    line-height: 1.3;
  }
  
  .blog-card-subtitle {
    font-size: 0.85rem;
  }
  
  .blog-card-excerpt {
    font-size: 0.8rem;
  }
  
  .blog-card-meta {
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
  }
  
  .blog-post-title {
    font-size: 2rem;
  }
  
  .blog-post-subtitle {
    font-size: 1.25rem;
  }
  
  .blog-post-content {
    font-size: 1rem;
    padding: 0 1.5rem;
    max-width: 100%;
  }
  
  .blog-post-footer {
    padding: 2rem 1.5rem 0 1.5rem;
    max-width: 100%;
  }
  
  .share-buttons {
    gap: 0.75rem;
    flex-wrap: wrap;
  }
  
  .share-btn {
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
  }
  
  .blog-post-share h4 {
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
  }

  .blog-post-navigation .col-md-6:first-child {
    margin-bottom: 1rem;
  }
}

/* Enhanced post title readability on cover images */
.intro-header.big-img .post-heading h1 {
  /* Stronger text shadow for better readability */
  text-shadow: 
    2px 2px 6px rgba(0, 0, 0, 0.8),
    1px 1px 3px rgba(0, 0, 0, 0.9),
    0 0 10px rgba(0, 0, 0, 0.6) !important;
  
  /* Optional: add a subtle background for extra readability */
  background: rgba(0, 0, 0, 0.3) !important;
  padding: 0.5rem 1rem !important;
  border-radius: 8px !important;
  display: inline-block !important;
  backdrop-filter: blur(2px) !important;
}

.intro-header.big-img .post-heading .post-subheading {
  /* Enhanced subtitle readability */
  text-shadow: 
    2px 2px 4px rgba(0, 0, 0, 0.8),
    1px 1px 2px rgba(0, 0, 0, 0.9) !important;
  
  /* Subtle background for subtitle too */
  background: rgba(0, 0, 0, 0.2) !important;
  padding: 0.3rem 0.8rem !important;
  border-radius: 6px !important;
  display: inline-block !important;
  margin-top: 1rem !important;
  backdrop-filter: blur(1px) !important;
}

/* Ensure the background doesn't interfere on smaller screens */
@media (max-width: 768px) {
  .intro-header.big-img .post-heading h1,
  .intro-header.big-img .post-heading .post-subheading {
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(3px) !important;
  }
}

/* Enhanced post meta elements (author, date, readtime) readability on cover images */
.intro-header.big-img .post-heading .post-meta {
  /* Enhanced text shadow for better readability */
  text-shadow: 
    2px 2px 4px rgba(0, 0, 0, 0.8),
    1px 1px 2px rgba(0, 0, 0, 0.9) !important;
  
  /* Subtle background for meta information */
  background: rgba(0, 0, 0, 0.25) !important;
  padding: 0.4rem 0.8rem !important;
  border-radius: 6px !important;
  display: inline-block !important;
  margin-top: 0.8rem !important;
  backdrop-filter: blur(1px) !important;
  color: #FFF !important;
}

/* Style the author line specifically */
.intro-header.big-img .post-heading .post-author-line {
  /* Style the entire "By Author Name" line */
  text-shadow: 
    2px 2px 4px rgba(0, 0, 0, 0.8),
    1px 1px 2px rgba(0, 0, 0, 0.9) !important;
  background: rgba(0, 0, 0, 0.25) !important;
  padding: 0.3rem 0.7rem !important;
  border-radius: 5px !important;
  display: inline-block !important;
  margin: 0.5rem 0 !important;
  backdrop-filter: blur(1px) !important;
  color: #FFF !important;
}

.intro-header.big-img .post-heading .post-author-line strong {
  /* Make author name stand out more within the styled line */
  text-shadow: inherit !important;
  color: inherit !important;
}

/* Enhanced readtime display */
.intro-header.big-img .post-heading .readtime {
  text-shadow: 
    2px 2px 4px rgba(0, 0, 0, 0.8),
    1px 1px 2px rgba(0, 0, 0, 0.9) !important;
  background: rgba(0, 0, 0, 0.2) !important;
  padding: 0.2rem 0.6rem !important;
  border-radius: 4px !important;
  display: inline-block !important;
  margin-left: 0.5rem !important;
  backdrop-filter: blur(1px) !important;
}

/* Mobile adjustments for post meta */
@media (max-width: 768px) {
  .intro-header.big-img .post-heading .post-meta {
    background: rgba(0, 0, 0, 0.35) !important;
    backdrop-filter: blur(2px) !important;
    padding: 0.5rem 1rem !important;
  }
}

/* Enhanced mobile responsiveness for quick navigation cards */
@media (max-width: 767px) {
  .quick-nav-container .row {
    margin: 0 -0.5rem;
  }
  
  .quick-nav-container .row > * {
    padding: 0 0.5rem;
    margin-bottom: 1rem;
  }
  
  .quick-nav-card {
    padding: 1.5rem 1rem !important;
    min-height: 100px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  .card-icon i {
    font-size: 1.75rem !important;
    margin-bottom: 0.5rem !important;
  }
  
  .card-title {
    font-size: 0.9rem !important;
    line-height: 1.2 !important;
    margin: 0 !important;
  }
}

/* Tablet view adjustments */
@media (min-width: 768px) and (max-width: 991px) {
  .quick-nav-card {
    padding: 2rem 1.5rem !important;
    min-height: 120px !important;
  }
  
  .card-icon i {
    font-size: 2rem !important;
  }
  
  .card-title {
    font-size: 1rem !important;
  }
}
