/**
 * Cogrounding.com - Additional Responsive Enhancements
 * Extra responsive utilities and fixes
 */

/* ============================================
   Utility Classes
   ============================================ */

/* Hide on mobile */
@media (max-width: 767px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Hide on tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  .hide-tablet {
    display: none !important;
  }
}

/* Hide on desktop */
@media (min-width: 1024px) {
  .hide-desktop {
    display: none !important;
  }
}

/* Show only on mobile */
.show-mobile {
  display: none !important;
}

@media (max-width: 767px) {
  .show-mobile {
    display: block !important;
  }
}

/* ============================================
   Typography Responsive Adjustments
   ============================================ */

@media (max-width: 480px) {
  :root {
    --font-size-h1: 1.75rem;
    --font-size-h2: 1.5rem;
    --font-size-h3: 1.25rem;
    --font-size-body: 1rem;
  }
  
  .hero-title {
    font-size: 1.75rem;
    line-height: 1.2;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
}

/* ============================================
   Mobile Navigation Enhancements
   ============================================ */

@media (max-width: 1024px) {
  .site-header {
    padding: var(--spacing-sm) 0;
  }
  
  .main-nav {
    position: relative;
  }
  
  .nav-menu {
    background-color: var(--color-white);
    border-top: 1px solid var(--color-medium-gray);
  }
  
  .nav-menu li {
    border-bottom: 1px solid var(--color-medium-gray);
  }
  
  .nav-menu li:last-child {
    border-bottom: none;
  }
  
  /* Hamburger animation */
  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
  }
  
  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
  }
}

/* ============================================
   Touch-Friendly Enhancements
   ============================================ */

@media (hover: none) {
  /* Remove hover effects on touch devices */
  .card:hover,
  .btn:hover {
    transform: none;
  }
  
  /* Increase tap target sizes */
  .btn {
    min-height: 48px;
    padding: 1rem 1.75rem;
  }
  
  .nav-menu a {
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  
  /* Make links easier to tap */
  a {
    -webkit-tap-highlight-color: rgba(0, 112, 112, 0.1);
  }
}

/* ============================================
   Small Mobile Optimization (iPhone SE, etc.)
   ============================================ */

@media (max-width: 375px) {
  .container {
    padding: 0 1rem;
  }
  
  .card,
  .service-detail,
  .process-step {
    padding: var(--spacing-md);
  }
  
  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
  }
  
  .modal {
    width: 95%;
    padding: var(--spacing-md);
  }
  
  /* Service modals - stack columns on mobile */
  .service-modal .modal-body > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: var(--spacing-lg) !important;
  }
  
  .service-modal .modal-header > div {
    flex-direction: column;
    align-items: flex-start !important;
    gap: var(--spacing-sm) !important;
  }
}

/* ============================================
   Tablet Landscape Adjustments
   ============================================ */

@media (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
  .hero {
    padding: var(--spacing-2xl) 0;
  }
  
  .section {
    padding: calc(var(--section-spacing) * 0.75) 0;
  }
}

/* ============================================
   Large Desktop Enhancements
   ============================================ */

@media (min-width: 1440px) {
  :root {
    --container-max-width: 1280px;
    --font-size-h1: 4rem;
    --font-size-h2: 3rem;
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  /* Hide navigation and non-essential elements */
  .eyebrow,
  .site-header,
  .site-footer,
  .btn,
  .modal-overlay,
  .cta-section {
    display: none !important;
  }
  
  /* Adjust colors for printing */
  body {
    color: #000;
    background: #fff;
  }
  
  .hero,
  .section {
    padding: 1rem 0;
  }
  
  /* Ensure content fits on page */
  .card-grid {
    display: block;
  }
  
  .card {
    page-break-inside: avoid;
    margin-bottom: 1rem;
  }
  
  /* Show URLs for links */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* ============================================
   Accessibility Enhancements
   ============================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-text: #000000;
    --color-text-light: #333333;
  }
  
  .btn-primary {
    border: 2px solid var(--color-black);
  }
  
  .card {
    border: 1px solid var(--color-text);
  }
}

/* ============================================
   Landscape Mobile Fixes
   ============================================ */

@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    padding: var(--spacing-lg) 0;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .section {
    padding: var(--spacing-xl) 0;
  }
}

/* ============================================
   Founders Section Responsive Styles
   ============================================ */

/* Mobile - stack image and content */
@media (max-width: 768px) {
  .founders-section > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: var(--spacing-lg) !important;
  }
  
  .founders-image {
    order: -1;
  }
  
  .logo-image {
    height: 100px;
  }
}

/* Tablet - adjust layout */
@media (min-width: 769px) and (max-width: 1023px) {
  .founders-section > div[style*="grid-template-columns"] {
    gap: var(--spacing-lg) !important;
  }
}

/* Small mobile - further adjustments */
@media (max-width: 480px) {
  .founders-section {
    gap: var(--spacing-md) !important;
  }
  
  .logo-image {
    height: 90px;
  }
  
  .footer-logo-image {
    height: 30px;
  }
}
