/* ============================================
   OOND Dev Consultant - Responsive Styles
   ============================================ */

/* ============================================
   Breakpoint System
   - Desktop First Approach
   - Tablet: 1024px and below
   - Mobile: 768px and below
   - Small Mobile: 480px and below
   ============================================ */

/* ============================================
   Tablet Styles (1024px and below)
   ============================================ */

@media screen and (max-width: 1024px) {

  /* Typography Adjustments */
  :root {
    --font-size-5xl: 2.5rem;     /* 40px - down from 48px */
    --font-size-4xl: 2rem;       /* 32px - down from 36px */
    --font-size-3xl: 1.75rem;    /* 28px - down from 30px */
  }

  /* Container Adjustments */
  .container {
    max-width: 960px;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  /* Grid Adjustments */
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Testimonials Grid - Tablet: 2 columns */
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }

  /* Section Spacing */
  section {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
  }

  .section-lg {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }

  /* Card Adjustments */
  .card {
    padding: var(--space-xl);
  }

  /* Footer Grid */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   Mobile Styles (768px and below)
   ============================================ */

@media screen and (max-width: 768px) {

  /* Typography Scale Down */
  :root {
    --font-size-5xl: 2rem;       /* 32px */
    --font-size-4xl: 1.75rem;    /* 28px */
    --font-size-3xl: 1.5rem;     /* 24px */
    --font-size-2xl: 1.25rem;    /* 20px */
    --header-height: 70px;
  }

  h1 {
    line-height: 1.3;
  }

  /* Container */
  .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  /* ============================================
     Header & Navigation - Mobile
     ============================================ */

  .header-content {
    padding: var(--space-sm) 0;
  }

  .logo {
    font-size: var(--font-size-xl);
  }

  /* Show Mobile Toggle */
  .mobile-menu-toggle {
    display: flex;
    z-index: 1001;
  }

  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  /* Hide main navigation on mobile */
  .main-nav {
    display: none;
  }

  /* Mobile Navigation */
  .nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: var(--color-white);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }

  .nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-menu {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .nav-link {
    width: 100%;
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-size-lg);
  }

  .nav-link::after {
    display: none;
  }

  .nav-link:hover {
    background-color: var(--color-bg-light);
  }

  /* Mobile CTA Button in Nav */
  .nav .btn {
    width: 100%;
    margin-top: var(--space-md);
    justify-content: center;
  }

  /* ============================================
     Grid Systems - Mobile
     ============================================ */

  .grid-cols-4,
  .grid-cols-3,
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }

  /* Testimonials Grid - Mobile: 1 column */
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .testimonial-card {
    padding: var(--space-lg);
  }

  /* Stack Flex Layouts */
  .flex-wrap {
    flex-direction: column;
  }

  /* ============================================
     Buttons - Mobile
     ============================================ */

  .btn {
    width: 100%;
    justify-content: center;
  }

  .btn-large {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-base);
  }

  /* Inline buttons in cards remain auto-width */
  .card .btn {
    width: auto;
  }

  /* ============================================
     Cards - Mobile
     ============================================ */

  .card {
    padding: var(--space-lg);
  }

  .card-icon {
    width: 50px;
    height: 50px;
    font-size: var(--font-size-2xl);
  }

  .card-title {
    font-size: var(--font-size-lg);
  }

  /* ============================================
     Section Spacing - Mobile
     ============================================ */

  section {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-2xl);
  }

  .section-lg {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
  }

  .section-sm {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
  }

  /* ============================================
     Footer - Mobile
     ============================================ */

  .footer {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-lg);
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-section {
    text-align: center;
  }

  .footer-links {
    align-items: center;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-bottom {
    margin-top: var(--space-xl);
    padding-top: var(--space-md);
  }

  /* ============================================
     Utility Adjustments - Mobile
     ============================================ */

  /* Reduce spacing on mobile */
  .gap-2xl {
    gap: var(--space-xl);
  }

  .gap-xl {
    gap: var(--space-lg);
  }

  .gap-lg {
    gap: var(--space-md);
  }

  /* Mobile-specific utilities */
  .mobile-center {
    text-align: center;
  }

  .mobile-full-width {
    width: 100%;
  }

  .mobile-stack {
    flex-direction: column;
  }
}

/* ============================================
   Small Mobile Styles (480px and below)
   ============================================ */

@media screen and (max-width: 480px) {

  /* Further Typography Reduction */
  :root {
    --font-size-5xl: 1.75rem;    /* 28px */
    --font-size-4xl: 1.5rem;     /* 24px */
    --font-size-3xl: 1.375rem;   /* 22px */
  }

  /* Tighter Container */
  .container {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }

  /* Reduce Card Padding */
  .card {
    padding: var(--space-md);
  }

  /* Smaller Buttons */
  .btn {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-size-sm);
  }

  .btn-large {
    padding: var(--space-md) var(--space-lg);
  }

  /* Compact Card Icons */
  .card-icon {
    width: 45px;
    height: 45px;
    font-size: var(--font-size-xl);
  }

  /* Tighter Section Spacing */
  section {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
  }

  .section-lg {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-2xl);
  }

  /* Footer Adjustments */
  .footer {
    padding-top: var(--space-xl);
  }

  .footer-section h3 {
    font-size: var(--font-size-base);
  }

  .social-link {
    width: 36px;
    height: 36px;
  }
}

/* ============================================
   Landscape Mobile Optimization
   ============================================ */

@media screen and (max-width: 768px) and (orientation: landscape) {

  /* Reduce vertical spacing in landscape */
  section {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
  }

  .header {
    height: 60px;
  }

  :root {
    --header-height: 60px;
  }

  .logo {
    font-size: var(--font-size-lg);
  }

  /* Compact navigation for landscape */
  .nav {
    padding: var(--space-md);
  }

  .nav-link {
    padding: var(--space-sm) var(--space-md);
  }
}

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

@media print {

  /* Hide navigation and non-essential elements */
  .header,
  .nav,
  .nav-toggle,
  .footer-social,
  .btn {
    display: none;
  }

  /* Optimize for print */
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  section {
    page-break-inside: avoid;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  /* Show links */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* ============================================
   Responsive Utilities
   ============================================ */

/* Hide/Show by Breakpoint */
@media screen and (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }

  .show-mobile {
    display: block !important;
  }
}

@media screen and (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }

  .show-desktop {
    display: block !important;
  }
}

/* Tablet-specific visibility */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .hide-tablet {
    display: none !important;
  }

  .show-tablet {
    display: block !important;
  }
}

/* ============================================
   Touch Device Optimizations
   ============================================ */

@media (hover: none) and (pointer: coarse) {

  /* Larger touch targets for mobile devices */
  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .nav-link {
    min-height: 44px;
  }

  .social-link {
    min-width: 44px;
    min-height: 44px;
  }

  /* Remove hover effects on touch devices */
  .card:hover {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }

  /* But keep active states for touch feedback */
  .btn:active {
    transform: scale(0.98);
  }

  .card:active {
    transform: scale(0.99);
  }
}

/* ============================================
   High Contrast Mode Support
   ============================================ */

@media (prefers-contrast: high) {

  :root {
    --color-text-light: var(--color-text-dark);
  }

  .btn-outline {
    border-width: 3px;
  }

  .card {
    border: 2px solid var(--color-border);
  }
}

/* ============================================
   Reduced Motion Support
   ============================================ */

@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;
  }

  .card:hover,
  .btn:hover,
  .nav-link:hover {
    transform: none;
  }
}

/* Dark mode responsive handled in style.css via [data-theme="dark"] */
