/* ============================================
   BLOG HOME MOBILE RESPONSIVE STYLES
   ============================================ */

/* Blog Header Mobile Optimization */
@media (max-width: 768px) {
  .blog-header {
    padding: 40px 0 30px;
    min-height: auto;
  }

  .blog-header-bg {
    opacity: 0.85;
  }

  .blog-header-orb {
    filter: blur(50px);
  }

  .blog-header-orb-1 {
    width: 250px;
    height: 250px;
    top: -50px;
    right: -50px;
  }

  .blog-header-orb-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: -50px;
  }

  .blog-breadcrumbs {
    font-size: 12px;
    margin-bottom: 16px;
  }

  .blog-breadcrumbs i {
    font-size: 10px;
  }

  .blog-header-title {
    font-size: 28px !important;
    line-height: 1.3;
    margin-bottom: 12px;
  }

  .blog-header-subtitle {
    font-size: 14px;
    line-height: 1.6;
    padding: 0 8px;
  }

  /* Blog Stats - Mobile Grid */
  .blog-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 20px;
  }

  .blog-stat-item {
    flex-direction: column;
    gap: 6px;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 14px;
    border: 1px solid rgba(13, 42, 87, 0.1);
  }

  .blog-stat-item i {
    font-size: 18px;
    color: var(--brand-accent);
  }

  .blog-stat-item span {
    font-size: 12px;
    font-weight: 700;
    text-align: center;
  }
}

/* Featured Post Mobile Optimization */
@media (max-width: 768px) {
  .blog-featured-card {
    margin-bottom: 30px;
    border-radius: 20px;
    overflow: hidden;
  }

  .blog-featured-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .blog-featured-image {
    border-radius: 0;
    height: 220px;
    overflow: hidden;
  }

  .blog-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .blog-featured-badge {
    top: 12px;
    right: 12px;
    font-size: 11px;
    padding: 6px 12px;
  }

  .blog-featured-content {
    padding: 20px 16px;
  }

  .blog-card-categories {
    margin-bottom: 12px;
  }

  .blog-category-badge {
    font-size: 11px;
    padding: 5px 10px;
  }

  .blog-featured-title {
    font-size: 20px !important;
    line-height: 1.4;
    margin-bottom: 12px;
  }

  .blog-featured-title a {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .blog-card-meta {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
  }

  .meta-item {
    font-size: 12px;
  }

  .meta-item i {
    font-size: 11px;
  }

  .blog-featured-excerpt {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 18px;
  }

  .blog-featured-footer {
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
  }

  .blog-card-author-box {
    width: 100%;
  }

  .blog-card-author-box img {
    width: 36px;
    height: 36px;
  }

  .author-name {
    font-size: 13px;
  }

  .author-role {
    font-size: 11px;
  }

  .blog-featured-footer .btn {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 14px;
  }
}

/* Blog Separator Mobile */
@media (max-width: 768px) {
  .blog-separator {
    margin: 30px 0;
    padding: 0 20px;
  }

  .separator-line {
    height: 1px;
  }

  .separator-text i {
    font-size: 14px;
  }
}

/* Blog Grid Mobile Optimization */
@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0;
  }

  .blog-card {
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(13, 42, 87, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .blog-card:active {
    transform: scale(0.98);
  }

  .blog-card-image {
    height: 200px;
    border-radius: 0;
    overflow: hidden;
    position: relative;
  }

  .blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .blog-reading-time {
    bottom: 10px;
    right: 10px;
    font-size: 11px;
    padding: 6px 10px;
    backdrop-filter: blur(10px);
  }

  .blog-card-content {
    padding: 16px;
  }

  .blog-card-title {
    font-size: 17px !important;
    line-height: 1.4;
    margin-bottom: 10px;
    font-weight: 800;
  }

  .blog-card-title a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .blog-card-excerpt {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 14px;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .blog-card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(13, 42, 87, 0.08);
  }

  .blog-card-author {
    gap: 8px;
  }

  .blog-card-author img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
  }

  .blog-card-author span {
    font-size: 12px;
    font-weight: 700;
  }

  .blog-card-readmore {
    font-size: 13px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(13, 42, 87, 0.05);
    transition: all 0.2s ease;
  }

  .blog-card-readmore:hover {
    background: rgba(13, 42, 87, 0.1);
  }
}

/* Blog Pagination Mobile */
@media (max-width: 768px) {
  .blog-pagination {
    margin-top: 30px;
    padding: 20px 0;
  }

  .blog-pagination ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  .blog-pagination li {
    list-style: none;
  }

  .blog-pagination a,
  .blog-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-primary);
    background: #fff;
    border: 1px solid rgba(13, 42, 87, 0.15);
    transition: all 0.2s ease;
  }

  .blog-pagination a:hover,
  .blog-pagination .current {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 42, 87, 0.2);
  }

  .blog-pagination .prev,
  .blog-pagination .next {
    padding: 8px 14px;
  }

  .blog-pagination i {
    font-size: 12px;
  }
}

/* No Posts Mobile */
@media (max-width: 768px) {
  .no-posts {
    padding: 40px 20px;
    text-align: center;
  }

  .no-posts-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(230, 179, 90, 0.15), rgba(45, 123, 207, 0.15));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .no-posts-icon i {
    font-size: 32px;
    color: var(--brand-accent);
  }

  .no-posts h3 {
    font-size: 20px;
    margin-bottom: 10px;
  }

  .no-posts p {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 20px;
  }

  .no-posts .btn {
    width: auto;
    padding: 12px 24px;
  }
}

/* Touch-Friendly Improvements */
@media (max-width: 768px) {
  /* Increase tap target sizes */
  .blog-card-categories a,
  .blog-card-readmore,
  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  /* Better spacing for thumbs */
  .blog-archive-section {
    padding: 30px 0 50px;
  }

  .section {
    padding: 50px 0;
  }

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

  /* Remove hover effects on touch devices */
  .blog-card:hover .glare {
    opacity: 0;
  }

  /* Optimize images for mobile */
  img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Small Mobile (320px - 480px) */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .blog-header {
    padding: 30px 0 24px;
  }

  .blog-header-title {
    font-size: 24px !important;
  }

  .blog-header-subtitle {
    font-size: 13px;
  }

  .blog-stats {
    gap: 6px;
  }

  .blog-stat-item {
    padding: 10px 6px;
  }

  .blog-stat-item span {
    font-size: 11px;
  }

  .blog-featured-title {
    font-size: 18px !important;
  }

  .blog-card-title {
    font-size: 16px !important;
  }

  .blog-grid {
    gap: 16px;
  }

  .blog-card-content {
    padding: 14px;
  }

  .blog-featured-content {
    padding: 16px 14px;
  }
}

/* Landscape Mobile Optimization */
@media (max-width: 768px) and (orientation: landscape) {
  .blog-header {
    padding: 30px 0 20px;
  }

  .blog-featured-image {
    height: 180px;
  }

  .blog-card-image {
    height: 160px;
  }
}

/* Dark Mode Support (if theme supports it) */
@media (prefers-color-scheme: dark) {
  .blog-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .blog-stat-item {
    background: rgba(255, 255, 255, 0.08);
  }
}

/* Performance Optimizations for Mobile */
@media (max-width: 768px) {
  /* Reduce motion for better performance */
  @media (prefers-reduced-motion: reduce) {
    .blog-card,
    .btn,
    .blog-pagination a {
      transition: none;
    }
  }

  /* GPU acceleration for smooth animations */
  .blog-card,
  .blog-featured-card,
  .btn {
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }

  /* Optimize font rendering */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
}

/* Loading States (Optional Enhancement) */
@media (max-width: 768px) {
  .blog-card.loading {
    opacity: 0.6;
    pointer-events: none;
  }

  .blog-card.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent
    );
    animation: shimmer 1.5s infinite;
  }

  @keyframes shimmer {
    0% {
      transform: translateX(-100%);
    }
    100% {
      transform: translateX(100%);
    }
  }
}

/* Accessibility Improvements */
@media (max-width: 768px) {
  /* Focus states for keyboard navigation */
  .blog-card:focus-within,
  .btn:focus,
  .blog-pagination a:focus {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
  }

  /* Better contrast for readability */
  .blog-card-excerpt,
  .blog-header-subtitle {
    color: #475569;
  }

  /* Larger line height for better readability */
  .blog-card-excerpt,
  .blog-featured-excerpt {
    line-height: 1.8;
  }
}

/* ============================================
   SERVICES SECTION MOBILE RESPONSIVE STYLES
   ============================================ */

/* Services Section Mobile Optimization */
@media (max-width: 768px) {
  #services {
    padding: 50px 0;
  }

  #services .head {
    margin-bottom: 30px;
    padding: 0 8px;
  }

  #services .kicker {
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  #services h2 {
    font-size: 26px;
    line-height: 1.3;
    margin-bottom: 12px;
  }

  #services .subtitle {
    font-size: 14px;
    line-height: 1.7;
    padding: 0 4px;
  }

  /* Force single column grid on mobile */
  #services .grid-4-1,
  #services .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  /* Service Cards Mobile Styling */
  .service {
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(13, 42, 87, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .service:active {
    transform: scale(0.98);
  }

  .service .icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    font-size: 24px;
    margin-bottom: 14px;
  }

  .service h3 {
    font-size: 17px;
    line-height: 1.4;
    margin-top: 12px;
    margin-bottom: 10px;
  }

  .service p {
    font-size: 14px;
    line-height: 1.7;
    margin-top: 8px;
    margin-bottom: 12px;
  }

  .service ul {
    margin: 12px 20px 0 0;
    padding: 0;
  }

  .service ul li {
    font-size: 13px;
    line-height: 1.8;
    margin: 6px 0;
    position: relative;
    padding-right: 18px;
  }

  .service ul li::before {
    content: "✓";
    position: absolute;
    right: 0;
    color: var(--brand-accent);
    font-weight: 900;
    font-size: 11px;
  }

  /* Disable tilt effect on mobile */
  .service.tilt {
    transform: none !important;
  }

  .service.tilt .glare {
    display: none !important;
  }

  /* Better touch feedback */
  .service:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(13, 42, 87, 0.12);
  }
}

/* Small Mobile (320px - 480px) - Services */
@media (max-width: 480px) {
  #services {
    padding: 40px 0;
  }

  #services h2 {
    font-size: 24px;
  }

  #services .subtitle {
    font-size: 13px;
  }

  .service {
    padding: 18px;
  }

  .service .icon {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }

  .service h3 {
    font-size: 16px;
  }

  .service p {
    font-size: 13px;
  }

  .service ul li {
    font-size: 12px;
  }
}

/* Landscape Mobile Optimization - Services */
@media (max-width: 768px) and (orientation: landscape) {
  #services {
    padding: 40px 0;
  }

  #services .grid-4-1,
  #services .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px;
  }

  .service {
    padding: 16px;
  }

  .service h3 {
    font-size: 16px;
  }

  .service p {
    font-size: 13px;
  }
}

/* Tablet Portrait (481px - 768px) - Services */
@media (min-width: 481px) and (max-width: 768px) {
  #services .grid-4-1,
  #services .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 18px;
  }

  .service {
    padding: 22px;
  }

  .service .icon {
    width: 54px;
    height: 54px;
    font-size: 26px;
  }

  .service h3 {
    font-size: 18px;
  }

  .service p {
    font-size: 14px;
  }
}

/* Performance Optimizations for Services */
@media (max-width: 768px) {
  /* Reduce motion for better performance */
  @media (prefers-reduced-motion: reduce) {
    .service {
      transition: none;
    }
  }

  /* GPU acceleration */
  .service {
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }
}

/* Touch-Friendly Improvements for Services */
@media (max-width: 768px) {
  /* Ensure proper tap target sizes */
  .service {
    min-height: 220px;
  }

  /* Better spacing between cards for easier tapping */
  #services .grid-4-1,
  #services .grid-4 {
    gap: 18px;
  }

  /* Visual feedback for touch */
  .service:active {
    opacity: 0.9;
    box-shadow: 0 2px 8px rgba(13, 42, 87, 0.1);
  }
}

/* Dark Mode Support for Services */
@media (prefers-color-scheme: dark) {
  .service {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .service h3 {
    color: #fff;
  }

  .service p,
  .service ul li {
    color: rgba(255, 255, 255, 0.8);
  }
}

/* Accessibility for Services */
@media (max-width: 768px) {
  /* Focus states */
  .service:focus,
  .service:focus-within {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
  }

  /* High contrast text */
  .service p {
    color: #334155;
  }

  .service ul li {
    color: #475569;
  }
}

/* Loading States for Services (Optional) */
@media (max-width: 768px) {
  .service.loading {
    opacity: 0.6;
    pointer-events: none;
  }

  .service.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent
    );
    animation: shimmer 1.5s infinite;
  }
}

/* Stagger Animation for Services Cards */
@media (max-width: 768px) {
  .service.reveal {
    animation-delay: calc(var(--i, 0) * 0.1s);
  }

  .service:nth-child(1) { --i: 1; }
  .service:nth-child(2) { --i: 2; }
  .service:nth-child(3) { --i: 3; }
  .service:nth-child(4) { --i: 4; }
  .service:nth-child(5) { --i: 5; }
  .service:nth-child(6) { --i: 6; }
}

/* Empty State for Services */
@media (max-width: 768px) {
  .no-services {
    padding: 40px 20px;
    text-align: center;
  }

  .no-services h3 {
    font-size: 20px;
    margin-bottom: 10px;
  }

  .no-services p {
    font-size: 14px;
  }
}

/* ============================================
   MOBILE MENU ENHANCEMENT STYLES
   ============================================ */

/* Mobile Menu Overlay */
@media (max-width: 768px) {
  /* Mobile menu backdrop */
  [role="dialog"][aria-modal="true"] {
    animation: fadeInBackdrop 0.3s ease;
  }

  @keyframes fadeInBackdrop {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  /* Mobile menu panel - enhanced styles */
  [role="dialog"] > div {
    animation: slideInDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(13, 42, 87, 0.25) !important;
  }

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

  /* Mobile menu links styling */
  [role="dialog"] a {
    padding: 14px 16px !important;
    border-radius: 12px !important;
    transition: all 0.2s ease !important;
    color: var(--brand-primary) !important;
    display: block !important;
    text-decoration: none !important;
    border: 1px solid transparent !important;
  }

  [role="dialog"] a:hover,
  [role="dialog"] a:focus {
    background: linear-gradient(135deg, rgba(230, 179, 90, 0.08), rgba(45, 123, 207, 0.08)) !important;
    border-color: rgba(230, 179, 90, 0.3) !important;
    transform: translateX(-3px) !important;
  }

  [role="dialog"] a:active {
    transform: scale(0.98) !important;
    background: linear-gradient(135deg, rgba(230, 179, 90, 0.15), rgba(45, 123, 207, 0.15)) !important;
  }

  /* Submenu items styling */
  [role="dialog"] a[style*="padding-right:20px"] {
    font-size: 13px !important;
    padding-right: 24px !important;
    opacity: 0.9 !important;
    position: relative;
  }

  [role="dialog"] a[style*="padding-right:20px"]::before {
    content: "→";
    position: absolute;
    right: 8px;
    opacity: 0.5;
    font-size: 11px;
  }

  /* Hamburger button styling */
  .hamb {
    cursor: pointer;
    background: rgba(13, 42, 87, 0.05);
    transition: all 0.3s ease;
  }

  .hamb:hover {
    background: rgba(13, 42, 87, 0.1);
    transform: scale(1.05);
  }

  .hamb:active {
    transform: scale(0.95);
  }

  /* When menu is open */
  .hamb[aria-expanded="true"] {
    background: var(--brand-primary);
    color: #fff;
  }
}

/* Small Mobile Menu Adjustments */
@media (max-width: 480px) {
  [role="dialog"] > div {
    min-width: 260px !important;
    max-width: 95% !important;
    padding: 16px !important;
  }

  [role="dialog"] a {
    padding: 12px 14px !important;
    font-size: 14px !important;
  }

  [role="dialog"] a[style*="padding-right:20px"] {
    font-size: 12px !important;
    padding-right: 20px !important;
  }
}

/* Landscape Mobile Menu */
@media (max-width: 768px) and (orientation: landscape) {
  [role="dialog"] {
    padding-top: 60px !important;
  }

  [role="dialog"] > div {
    max-height: 70vh !important;
  }
}

/* Menu Accessibility Enhancements */
@media (max-width: 768px) {
  /* Focus indicator for menu items */
  [role="dialog"] a:focus {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
  }

  /* Touch target size compliance */
  [role="dialog"] a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Menu Loading State */
@media (max-width: 768px) {
  .menu-loading {
    opacity: 0.6;
    pointer-events: none;
  }

  .menu-loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent
    );
    animation: shimmer 1.5s infinite;
  }
}

/* Dark Mode Support for Menu */
@media (prefers-color-scheme: dark) {
  [role="dialog"] > div {
    background: #1a1a1a !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
  }

  [role="dialog"] a {
    color: #fff !important;
  }

  [role="dialog"] a:hover,
  [role="dialog"] a:focus {
    background: rgba(255, 255, 255, 0.1) !important;
  }
}
