
/* Fix navbar visibility issues */
#navbar .nav-link {
  visibility: visible !important;
}

#navbar .nav-item {
  visibility: visible !important;
}

#navbar .navbar-nav {
  visibility: visible !important;
}

#navbar .navbar-collapse {
  visibility: visible !important;
}

/* Modern Hero Section */
.hero-section-new {
  position: relative;
  min-height: 600px;
  background: white;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 80px 40px;
}

/* Animated gradient background */
.hero-bg-gradient {
  position: absolute;
  top: 0;
  right: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(135deg, #4169e1 0%, #6e8efb 50%, #a7c5ff 100%);
  clip-path: polygon(30% 0%, 100% 0%, 100% 100%, 0% 100%);
  z-index: 1;
}

/* Floating shapes animation */
.floating-shape {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float-shapes 20s infinite ease-in-out;
}

.shape-1 {
  width: 300px;
  height: 300px;
  top: -100px;
  right: 10%;
  animation-delay: 0s;
}

.shape-2 {
  width: 200px;
  height: 200px;
  top: 40%;
  right: 5%;
  animation-delay: 3s;
}

.shape-3 {
  width: 150px;
  height: 150px;
  bottom: 10%;
  right: 25%;
  animation-delay: 6s;
}

@keyframes float-shapes {
  0%, 100% {
      transform: translateY(0) rotate(0deg);
  }
  33% {
      transform: translateY(-30px) rotate(120deg);
  }
  66% {
      transform: translateY(30px) rotate(240deg);
  }
}

/* Dotted pattern overlay */
.hero-pattern {
  position: absolute;
  top: 0;
  right: 0;
  width: 60%;
  height: 100%;
  z-index: 2;
  opacity: 0.1;
  background-image: radial-gradient(circle, white 1px, transparent 1px);
  background-size: 30px 30px;
}

/* Content container */
.hero-content-wrapper {
  position: relative;
  z-index: 10;
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

/* Left content */
.hero-left {
  padding-right: 40px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(65, 105, 225, 0.1);
  color: #4169e1;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
  border: 1px solid rgba(65, 105, 225, 0.2);
  animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
  0%, 100% {
      box-shadow: 0 0 0 0 rgba(65, 105, 225, 0.4);
  }
  50% {
      box-shadow: 0 0 0 8px rgba(65, 105, 225, 0);
  }
}

.hero-title {
  font-size: 56px;
  font-weight: 900;
  line-height: 1.1;
  color: #111827;
  margin-bottom: 24px;
  letter-spacing: -2px;
}

.hero-title .highlight {
  color: #4169e1;
  position: relative;
  display: inline-block;
}

.hero-title .highlight::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 0;
  width: 100%;
  height: 12px;
  background: rgba(65, 105, 225, 0.2);
  z-index: -1;
  transform: skewX(-12deg);
}

.hero-subtitle {
  font-size: 18px;
  line-height: 1.7;
  color: #6b7280;
  margin-bottom: 32px;
  max-width: 500px;
}

/* Stats row */
.hero-stats {
  display: flex;
  gap: 40px;
  margin-bottom: 40px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 36px;
  font-weight: 800;
  color: #4169e1;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: #9ca3af;
  font-weight: 500;
}

/* CTA buttons */
.hero-cta {
  display: flex;
  gap: 16px;
  align-items: center;
}

.btn-primary {
  padding: 16px 32px;
  background: #4169e1;
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(65, 105, 225, 0.3);
}

.btn-primary:hover {
  background: #3258cf;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(65, 105, 225, 0.4);
}

.btn-secondary {
  padding: 16px 32px;
  background: white;
  color: #4169e1;
  border: 2px solid #4169e1;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: #4169e1;
  color: white;
  transform: translateY(-2px);
}

/* Right side - Decorative illustration */
.hero-right {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-illustration {
  width: 100%;
  max-width: 500px;
  position: relative;
}

/* Floating card animation */
.floating-card {
  background: white;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  position: relative;
  animation: float-card 6s infinite ease-in-out;
}

@keyframes float-card {
  0%, 100% {
      transform: translateY(0);
  }
  50% {
      transform: translateY(-20px);
  }
}

.card-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #4169e1, #6e8efb);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(65, 105, 225, 0.3);
}

.card-icon i {
  font-size: 28px;
  color: white;
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}

.card-text {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
}

/* Small floating elements */
.mini-card {
  position: absolute;
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  animation: float-mini 4s infinite ease-in-out;
}

.mini-card-1 {
  top: 10%;
  right: -10%;
  animation-delay: 1s;
}

.mini-card-2 {
  bottom: 10%;
  left: -10%;
  animation-delay: 2s;
}

@keyframes float-mini {
  0%, 100% {
      transform: translateY(0) rotate(0deg);
  }
  50% {
      transform: translateY(-15px) rotate(5deg);
  }
}

.mini-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4169e1, #6e8efb);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-icon i {
  font-size: 20px;
  color: white;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
  cursor: pointer;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% {
      transform: translateX(-50%) translateY(0);
  }
  50% {
      transform: translateX(-50%) translateY(-10px);
  }
}

.scroll-indicator span {
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.scroll-indicator i {
  font-size: 24px;
  color: #4169e1;
}

/* Responsive */
@media (max-width: 968px) {
  .hero-content-wrapper {
      grid-template-columns: 1fr;
      gap: 40px;
      text-align: center;
  }

  .hero-left {
      padding-right: 0;
  }

  .hero-title {
      font-size: 42px;
  }

  .hero-stats {
      justify-content: center;
  }

  .hero-cta {
      justify-content: center;
      flex-wrap: wrap;
  }

  .hero-bg-gradient {
      width: 100%;
      clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
      opacity: 0.1;
  }

  .hero-right {
      order: -1;
  }

  .mini-card {
      display: none;
  }
}

@media (max-width: 640px) {
  .hero-section-new {
      padding: 60px 20px;
  }

  .hero-title {
      font-size: 32px;
  }

  .hero-stats {
      flex-direction: column;
      gap: 20px;
      align-items: center;
  }

  .btn-primary, .btn-secondary {
      width: 100%;
      justify-content: center;
  }
}

/* Overlay Card Styles */
.overlay-card {
position: relative;
height: 280px;
border-radius: 12px;
overflow: hidden;
cursor: pointer;
transition: transform 0.3s ease, box-shadow 0.3s ease;
background-color: #f3f4f6;
}

.overlay-card:hover {
transform: translateY(-8px);
box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.overlay-card-image {
position: absolute;
inset: 0;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
transition: transform 0.3s ease;
}

.overlay-card:hover .overlay-card-image {
transform: scale(1.05);
}

.overlay-card-gradient {
position: absolute;
inset: 0;
background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.7) 100%);
}

.overlay-card-content {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 20px;
color: white;
z-index: 10;
}

.overlay-badge {
display: inline-block;
background: #4169e1;
padding: 4px 12px;
border-radius: 20px;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
}

.overlay-date {
display: inline-block;
background: rgba(255, 255, 255, 0.25);
padding: 4px 12px;
border-radius: 20px;
font-size: 11px;
font-weight: 600;
}

.overlay-title {
font-size: 18px;
font-weight: 800;
line-height: 1.3;
margin-top: 10px;
}

/* Pink Separator */
.pink-separator {
height: 3px;
background: #4169e1;
border-radius: 999px;
margin: 32px 0;
}

/* Section Title */
.section-title {
font-size: 28px;
font-weight: 800;
position: relative;
padding-bottom: 12px;
display: inline-block;
}

.section-title::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 60px;
height: 3px;
background: linear-gradient(90deg, #4169e1, #6e8efb);
border-radius: 999px;
}

/* Blog Card Styles */
.blog-card {
background: white;
border-radius: 12px;
overflow: hidden;
transition: transform 0.3s ease, box-shadow 0.3s ease;
cursor: pointer;
box-shadow: 0 4px 12px rgba(65, 105, 225, 0.2);
display: flex;
flex-direction: column;
position: relative;
}

.blog-card:hover {
transform: translateY(-8px);
box-shadow: 0 20px 40px rgba(65, 105, 225, 0.3);
}

.blog-card > div:first-child {
width: 100%;
height: 200px;
overflow: hidden;
flex-shrink: 0;
background-color: #f3f4f6;
}

.blog-card-image {
width: 100%;
height: 100%;
object-fit: contain;
object-position: center;
transition: transform 0.3s ease;
display: block;
}

.blog-card:hover .blog-card-image {
transform: scale(1.05);
}

.blog-card-content {
padding: 20px;
}

.category-badge {
background: #4169e1;
color: white;
padding: 4px 12px;
border-radius: 20px;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
position: relative;
overflow: hidden;
}

.category-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.blog-card:hover .category-badge::before {
    left: 100%;
}

.date-badge {
color: #6b7280;
font-size: 13px;
font-weight: 600;
}

.blog-card-title {
font-size: 18px;
font-weight: 800;
line-height: 1.3;
margin: 12px 0;
color: #111827;
}

.blog-card-excerpt {
font-size: 14px;
color: #6b7280;
line-height: 1.6;
display: -webkit-box;
-webkit-line-clamp: 3;
line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}

/* Sidebar Styles */
.sidebar-widget {
background: white;
border-radius: 16px;
padding: 24px;
margin-bottom: 24px;
box-shadow: 0 4px 12px rgba(65, 105, 225, 0.2);
transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sidebar-widget:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(65, 105, 225, 0.25);
}

.widget-title {
font-size: 18px;
font-weight: 800;
margin-bottom: 16px;
color: #111827;
}

.latest-item {
display: flex;
gap: 12px;
padding-bottom: 16px;
margin-bottom: 16px;
border-bottom: 1px solid #e5e7eb;
}

.latest-item:last-child {
border-bottom: none;
padding-bottom: 0;
margin-bottom: 0;
}

.latest-thumb {
width: 80px;
height: 80px;
border-radius: 8px;
object-fit: contain;
flex-shrink: 0;
background-color: #f3f4f6;
}

.latest-content {
flex: 1;
}

.latest-title {
font-size: 14px;
font-weight: 700;
color: #111827;
line-height: 1.4;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
margin-bottom: 6px;
}

.latest-title:hover {
color: #4169e1;
}

.latest-date {
font-size: 12px;
color: #9ca3af;
}

.category-list-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 0;
font-size: 14px;
color: #4b5563;
}

.category-count {
background: #eef2ff;
color: #4169e1;
padding: 2px 10px;
border-radius: 12px;
font-size: 12px;
font-weight: 700;
}

.subscribe-input {
width: 100%;
padding: 12px 16px;
border: 1px solid #e5e7eb;
border-radius: 25px;
font-size: 14px;
margin-bottom: 12px;
}

.subscribe-input:focus {
outline: none;
border-color: #4169e1;
box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.15);
}

.subscribe-btn {
width: 100%;
padding: 12px 24px;
background: #4169e1;
color: white;
border: none;
border-radius: 25px;
font-weight: 700;
font-size: 13px;
text-transform: uppercase;
letter-spacing: 0.5px;
cursor: pointer;
transition: background 0.3s ease;
position: relative;
overflow: hidden;
}

.subscribe-btn:hover {
background: #3258cf;
}

.subscribe-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.subscribe-btn:active::after {
    width: 300px;
    height: 300px;
}

/* Modal Styles */
#blog-modal {
display: none !important;
visibility: hidden;
opacity: 0;
transition: opacity 0.4s ease-out;
backdrop-filter: blur(8px);
}

#blog-modal.open {
display: flex !important;
visibility: visible;
opacity: 1;
}

#modal-container {
transform: translateY(100%);
transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.4, 1.1);
}

#blog-modal.open #modal-container {
transform: translateY(0);
}

#modal-content-scroll {
overflow-y: auto;
height: 100%;
scrollbar-width: thin;
scrollbar-color: #4169e1 #e5e7eb;
}

#modal-content-scroll::-webkit-scrollbar {
width: 8px;
}

#modal-content-scroll::-webkit-scrollbar-track {
background: #e5e7eb;
}

#modal-content-scroll::-webkit-scrollbar-thumb {
background-color: #4169e1;
border-radius: 20px;
border: 2px solid #e5e7eb;
}

#reading-progress {
position: absolute;
top: 0;
left: 0;
height: 4px;
width: 0;
background-color: #4169e1;
transition: width 0.1s linear;
}


/* Pulse Animation for Hero Icon */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(65, 105, 225, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 32px rgba(65, 105, 225, 0.4);
    }
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Enhanced Card Hover Effects */
.blog-card::before,
.overlay-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #4169e1, #6e8efb);
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.blog-card:hover::before {
    opacity: 0.2;
}

.overlay-card:hover::before {
    opacity: 0.3;
}

/* Loading Animation for Images */
.blog-card-image, .overlay-card-image, .latest-thumb {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #4169e1, #6e8efb);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Tooltip for Category Count */
.category-count {
    position: relative;
    cursor: help;
}

.category-count:hover::after {
    content: 'Number of posts';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #111827;
    color: white;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    margin-bottom: 4px;
}

/* Category Filter Navbar */
.category-filter-btn {
    padding: 10px 20px;
    background: #f3f4f6;
    border: 2px solid transparent;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.category-filter-btn:hover {
    background: #e5e7eb;
    color: #111827;
    transform: translateY(-2px);
}

.category-filter-btn.active {
    background: linear-gradient(135deg, #4169e1 0%, #6e8efb 100%);
    color: white;
    border-color: #4169e1;
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.3);
}

.category-filter-btn i {
    font-size: 16px;
}

/* Hide blog cards by default when filtering */
.blog-card.hidden {
    display: none !important;
}

.overlay-card.hidden {
    display: none !important;
}

/* Stagger Animation for Blog Cards */
.blog-card {
    animation: slideUp 0.5s ease-out backwards;
}

.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.2s; }
.blog-card:nth-child(3) { animation-delay: 0.3s; }
.blog-card:nth-child(4) { animation-delay: 0.4s; }
.blog-card:nth-child(5) { animation-delay: 0.5s; }
.blog-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reading content */
.reading-content p {
    margin-bottom: 1.5em;
    line-height: 1.8;
}

.reading-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2em 0;
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ======================================== */

/* Tablet Landscape and Below (1024px) */
@media (max-width: 1024px) {
    .hero-section-new {
        padding: 60px 30px;
    }
    
    .hero-content-wrapper {
        gap: 40px;
    }
    
    .hero-title {
        font-size: 48px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    /* Main content container */
    div[style*="max-width: 1320px"] {
        padding: 30px 15px !important;
    }
}

/* Tablet Portrait (768px) */
@media (max-width: 768px) {
    /* Hero Section */
    .hero-section-new {
        padding: 50px 20px;
        min-height: auto;
    }
    
    .hero-title {
        font-size: 36px;
        letter-spacing: -1px;
    }
    
    .hero-subtitle {
        font-size: 15px;
        max-width: 100%;
    }
    
    .hero-cta {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
        padding: 14px 28px;
    }
    
    .hero-illustration {
        max-width: 100%;
    }
    
    .floating-card {
        padding: 20px;
    }
    
    .card-title {
        font-size: 18px;
    }
    
    .scroll-indicator {
        bottom: 20px;
    }
    
    /* Category Filter */
    div[style*="Filter by"] {
        padding: 15px !important;
    }
    
    .category-filter-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .category-filter-btn i {
        font-size: 14px;
    }
    
    /* Featured/Overlay Cards */
    .overlay-card {
        height: 240px;
    }
    
    .overlay-title {
        font-size: 16px;
    }
    
    .overlay-card-content {
        padding: 16px;
    }
    
    /* Section Title */
    .section-title {
        font-size: 24px;
    }
    
    .pink-separator {
        margin: 24px 0;
    }
    
    /* Blog Cards Grid - Make 2 columns */
    #cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
    
    .blog-card-title {
        font-size: 16px;
    }
    
    .blog-card-excerpt {
        font-size: 13px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
    
    .blog-card-content {
        padding: 16px;
    }
    
    /* Sidebar */
    .sidebar-widget {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .widget-title {
        font-size: 16px;
    }
    
    .latest-thumb {
        width: 70px;
        height: 70px;
    }
    
    .latest-title {
        font-size: 13px;
    }
    
    /* Modal */
    #modal-container {
        max-width: 100% !important;
        border-radius: 16px 16px 0 0 !important;
    }
}

/* Mobile Landscape (640px) */
@media (max-width: 640px) {
    /* Hero Section */
    .hero-section-new {
        padding: 40px 15px;
    }
    
    .hero-badge {
        font-size: 12px;
        padding: 8px 16px;
    }
    
    .hero-title {
        font-size: 32px;
        margin-bottom: 16px;
    }
    
    .hero-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .btn-primary,
    .btn-secondary {
        font-size: 14px;
        padding: 12px 24px;
    }
    
    .floating-card {
        padding: 16px;
    }
    
    .card-icon {
        width: 50px;
        height: 50px;
    }
    
    .card-icon i {
        font-size: 24px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .card-text {
        font-size: 13px;
    }
    
    /* Category Filter - Stack vertically */
    .category-filter-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    /* Overlay Cards - Full width on mobile */
    .overlay-card {
        height: 200px;
    }
    
    .overlay-title {
        font-size: 14px;
    }
    
    .overlay-badge,
    .overlay-date {
        font-size: 10px;
        padding: 3px 10px;
    }
    
    /* Section Title */
    .section-title {
        font-size: 20px;
    }
    
    .section-title::after {
        width: 40px;
        height: 2px;
    }
    
    /* Blog Cards - Single column on small mobile */
    #cards-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .blog-card > div:first-child {
        height: 180px;
    }
    
    .blog-card-title {
        font-size: 16px;
        margin: 8px 0;
    }
    
    .blog-card-excerpt {
        font-size: 14px;
    }
    
    .category-badge,
    .date-badge {
        font-size: 10px;
        padding: 3px 10px;
    }
    
    /* Sidebar */
    .sidebar-widget {
        padding: 16px;
    }
    
    .widget-title {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .latest-item {
        padding-bottom: 12px;
        margin-bottom: 12px;
    }
    
    .latest-thumb {
        width: 60px;
        height: 60px;
    }
    
    .latest-title {
        font-size: 12px;
    }
    
    .latest-date {
        font-size: 11px;
    }
    
    .category-list-item {
        font-size: 13px;
        padding: 6px 0;
    }
    
    .category-count {
        font-size: 11px;
        padding: 2px 8px;
    }
    
    .subscribe-input {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .subscribe-btn {
        padding: 10px 20px;
        font-size: 12px;
    }
    
    /* Load More Button */
    button[id="load-more"] {
        padding: 10px 24px !important;
        font-size: 14px !important;
    }
    
    /* Modal - Full screen on mobile */
    #modal-container {
        border-radius: 12px 12px 0 0 !important;
    }
    
    #modal-content-scroll {
        padding: 20px 15px !important;
    }
}

/* Extra Small Mobile (480px) */
@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 13px;
    }
    
    .btn-primary,
    .btn-secondary {
        font-size: 13px;
        padding: 11px 20px;
    }
    
    .hero-stats {
        gap: 15px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .category-filter-btn {
        padding: 7px 12px;
        font-size: 11px;
    }
    
    .overlay-card {
        height: 180px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .blog-card > div:first-child {
        height: 160px;
    }
    
    .blog-card-title {
        font-size: 15px;
    }
    
    .blog-card-excerpt {
        font-size: 13px;
    }
}

/* Landscape Mode Fix for Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section-new {
        min-height: auto;
        padding: 30px 20px;
    }
    
    .scroll-indicator {
        display: none;
    }
    
    .hero-stats {
        display: none;
    }
}

/* Grid Layout Responsiveness */
@media (max-width: 1200px) {
    div[style*="display: grid"][style*="grid-template-columns"] {
        grid-template-columns: 1fr 300px !important;
        gap: 30px !important;
    }
}

@media (max-width: 992px) {
    div[style*="display: grid"][style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }
    
    /* Sidebar comes after content on tablet/mobile */
    .sidebar-widget {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .blog-card:hover,
    .overlay-card:hover,
    .sidebar-widget:hover {
        transform: none;
    }
    
    /* Make buttons more touch-friendly */
    .category-filter-btn,
    .btn-primary,
    .btn-secondary,
    .subscribe-btn {
        min-height: 44px; /* iOS minimum touch target */
    }
    
    /* Disable complex animations on mobile */
    .blog-card::before,
    .overlay-card::before {
        display: none;
    }
}

/* Print Styles */
@media print {
    .hero-section-new,
    .category-filter-btn,
    .sidebar-widget,
    .scroll-indicator,
    #blog-modal {
        display: none !important;
    }
    
    .blog-card {
        page-break-inside: avoid;
        box-shadow: none !important;
    }
}
