/* ============================================
   Responsive Styles - Mobile-First
   Breakpoints: 576px, 768px, 1024px, 1440px
   ============================================ */

/* ============================================
   Small devices (landscape phones, 576px and up)
   ============================================ */

@media (min-width: 576px) {
  /* Hero Section */
  .hero-logo-image {
    max-width: 280px; /* Reduced 20% from 350px */
  }

  .hero-title-main {
    font-size: var(--fs-h1);
  }

  .hero-cta {
    flex-direction: row;
    justify-content: center;
  }

  /* Team Grid */
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Research Grid */
  .research-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Social Links */
  .social-list {
    flex-direction: row;
    justify-content: center;
  }
}

/* ============================================
   Medium devices (tablets, 768px and up)
   ============================================ */

@media (min-width: 768px) {
  /* Typography scaling */
  .hero-title-main {
    font-size: var(--fs-h1);
  }

  .hero-description {
    font-size: var(--fs-subtitle);
  }

  .hero-logo-image {
    max-width: 320px; /* Reduced 20% from 400px */
  }

  /* About Section */
  .about-intro {
    font-size: var(--fs-body);
  }

  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2xl);
  }

  .team-member-image {
    height: 350px;
  }

  /* Research Grid */
  .research-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2xl);
  }

  /* Contact Section */
  .contact-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .contact-item {
    padding: var(--space-xl);
  }

  .social-list {
    flex-direction: row;
    justify-content: center;
    gap: var(--space-lg);
  }

  .social-link {
    flex-direction: column;
    padding: var(--space-lg);
    min-width: 120px;
  }
}

/* ============================================
   Large devices (desktops, 1024px and up)
   ============================================ */

@media (min-width: 1024px) {
  /* Hero Section */
  .hero-section {
    padding: var(--space-4xl) var(--space-xl);
  }

  .hero-logo-image {
    max-width: 400px; /* Reduced 20% from 500px */
  }

  .hero-title-main {
    font-size: var(--fs-h1);
  }

  .hero-description {
    font-size: var(--fs-subtitle);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Team Grid - 4 columns */
  .team-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl);
  }

  .team-member-image {
    height: 280px;
  }

  /* Research Grid - 2 columns maintained for better card size */
  .research-grid {
    gap: var(--space-3xl);
  }

  .research-card {
    padding: var(--space-2xl);
  }

  .research-card-header {
    min-height: 100px;
  }

  /* Contact Section */
  .contact-content {
    max-width: 900px;
  }

  .contact-info {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
  }

  .contact-item {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .contact-item:hover {
    transform: translateY(-8px);
  }
}

/* ============================================
   Extra large devices (large desktops, 1440px and up)
   ============================================ */

@media (min-width: 1440px) {
  /* Hero Section */
  .hero-logo-image {
    max-width: 480px; /* Reduced 20% from 600px */
  }

  .hero-title-main {
    font-size: var(--fs-h1);
  }

  /* Larger section padding */
  section {
    padding: calc(var(--space-4xl) * 1.5) 0;
  }

  /* Research Grid - Can accommodate 4 columns on very large screens */
  .research-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4xl);
  }

  /* Larger cards on XL screens */
  .research-card {
    padding: var(--space-3xl);
  }

  .team-member-image {
    height: 320px;
  }
}

/* ============================================
   Mobile UX Improvements (P4.1)
   ============================================ */

@media (max-width: 767px) {
  /* Larger touch targets for mobile CTAs */
  .btn-primary,
  .btn-secondary {
    padding: 1rem 2rem !important;
    font-size: 1rem !important;
    min-height: 48px;
  }

  /* Stack hero CTA buttons full width on mobile */
  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta .btn {
    width: 100%;
    text-align: center;
  }

  /* Improve mobile readability */
  .hero-description {
    font-size: 1rem;
    line-height: 1.7;
  }

  /* Mobile nav CTA hidden (space constrained) */
  .nav-cta-wrapper {
    display: none;
  }

  /* Mobile methodology stack */
  .methodology-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  /* Mobile segmentation stack */
  .segmentation-grid {
    grid-template-columns: 1fr;
  }

  /* Timeline better mobile spacing */
  .timeline {
    padding-left: var(--space-xl);
  }

  .timeline-year {
    width: 60px;
    height: 60px;
    left: -60px;
    font-size: 0.7rem;
  }

  /* Improve scroll snapping for mobile */
  .micro-cta-content {
    flex-direction: column;
    gap: var(--space-md);
  }

  /* Better mobile card padding */
  .segment-card,
  .methodology-step,
  .testimonial-card {
    padding: var(--space-lg);
  }
}

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

@media print {
  /* Hide non-essential elements */
  .nav-toggle,
  .scroll-indicator,
  .social-links,
  .hero-cta {
    display: none !important;
  }

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

  /* Remove shadows and transitions */
  * {
    box-shadow: none !important;
    transition: none !important;
    animation: none !important;
  }

  /* Page breaks */
  section {
    page-break-inside: avoid;
  }

  .team-member,
  .research-card {
    page-break-inside: avoid;
  }

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

/* ============================================
   High contrast mode support
   ============================================ */

@media (prefers-contrast: high) {
  .btn {
    border-width: 3px;
  }

  .nav-link::after {
    height: 3px;
  }

  .team-member,
  .research-card {
    border: 2px solid var(--color-gray-dark);
  }
}

/* ============================================
   Dark mode support (optional for future)
   ============================================ */

@media (prefers-color-scheme: dark) {
  :root {
    --color-background: var(--color-black);
    --color-text: var(--color-white);
    --color-gray-light: #2A2A2A;
    --color-gray-dark: #E0E0E0;
  }

  body {
    background-color: var(--color-background);
    color: var(--color-text);
  }

  .header {
    background-color: #1A1A1A;
    border-bottom: 1px solid #333;
  }

  .nav-menu {
    background-color: #1A1A1A;
  }

  .team-member,
  .research-card,
  .contact-item {
    background-color: #2A2A2A;
  }
}
