/* Touch-First Navigation Enhancements */
@media (max-width: 768px) {
  /* Thumb-zone aware navigation */
  .mobile-nav {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: rgba(0,0,0,0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    z-index: 1000;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
  }

  .mobile-nav:active {
    transform: scale(0.95);
    background: rgba(0,0,0,0.9);
  }

  /* Expandable menu */
  .mobile-nav.expanded {
    width: auto;
    height: auto;
    border-radius: 30px;
    padding: 15px;
    flex-direction: column;
    gap: 10px;
  }

  .mobile-nav-items {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
  }

  .mobile-nav.expanded .mobile-nav-items {
    display: flex;
  }

  .mobile-nav-item {
    background: rgba(255,255,255,0.2);
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 14px;
    text-decoration: none;
    color: white;
    transition: background 0.2s ease;
    min-width: 80px;
    text-align: center;
  }

  .mobile-nav-item:active {
    background: rgba(255,255,255,0.4);
  }

  /* Larger tap targets everywhere */
  a, button, input, select, textarea {
    min-height: 44px;
    padding: 12px 16px;
  }

  /* Thumb-friendly link spacing */
  p a {
    padding: 8px 4px;
    margin: 0 2px;
    border-radius: 4px;
    transition: background 0.2s ease;
  }

  p a:active {
    background: rgba(0,100,200,0.1);
  }

  /* Enhanced typography for mobile reading */
  body {
    font-size: 18px;
    line-height: 1.6;
  }

  h1 { font-size: 2em; margin-bottom: 0.5em; }
  h2 { font-size: 1.5em; margin-bottom: 0.4em; }
  h3 { font-size: 1.3em; margin-bottom: 0.3em; }

  p {
    margin-bottom: 1.2em;
    max-width: none; /* Remove desktop line length limits */
  }

  /* Swipe gesture hint */
  .swipe-hint {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    opacity: 0.8;
    z-index: 999;
    animation: swipeHint 3s ease-in-out infinite;
  }

  @keyframes swipeHint {
    0%, 100% { opacity: 0.8; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.3; transform: translateX(-50%) translateY(-5px); }
  }

  /* Touch feedback for interactive elements */
  .interactive:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }

  /* Improved focus states for touch */
  *:focus {
    outline: 3px solid #007AFF;
    outline-offset: 2px;
    border-radius: 4px;
  }

  /* Reading progress indicator for long articles */
  .reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #007AFF, #5AC8FA);
    z-index: 1001;
    transition: width 0.1s ease;
  }

  /* Horizontal scroll hints for wide content */
  .horizontal-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .horizontal-scroll::-webkit-scrollbar {
    display: none;
  }

  /* Scroll snap for better control */
  .scroll-snap {
    scroll-snap-type: x mandatory;
  }

  .scroll-snap > * {
    scroll-snap-align: start;
  }
}

/* Touch interaction states for all screen sizes */
@media (pointer: coarse) {
  /* Hover effects become touch effects */
  .hover-effect:hover,
  .hover-effect:active {
    /* Replace hover with active state */
  }

  /* Remove hover-dependent interactions */
  .hover-only {
    display: none;
  }

  /* Show touch alternatives */
  .touch-alternative {
    display: block;
  }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
  .mobile-nav {
    bottom: 10px;
    right: 10px;
    width: 50px;
    height: 50px;
  }

  body {
    font-size: 16px;
  }

  .swipe-hint {
    bottom: 70px;
  }
}

/* Dark mode considerations for mobile */
@media (prefers-color-scheme: dark) {
  .mobile-nav {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
  }

  .mobile-nav-item {
    background: rgba(255,255,255,0.1);
  }

  .swipe-hint {
    background: rgba(255,255,255,0.2);
    color: white;
  }
}
