/* Responsive Design CSS */
/* AI Community Hub - Mobile-First Responsive Styles */

/* Mobile First Approach - Base styles are for mobile */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
  .gh-hero-title {
    font-size: 2.25rem;
  }

  .gh-newsletter-form-fields {
    flex-direction: row;
    max-width: 500px;
  }
}

@media (max-width: 991px) {
  .gh-hero-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 32px;
  }

  .gh-hero-brand {
    align-items: center;
    width: 100%;
    max-width: 192px;
  }

  .gh-hero-brand-text {
    align-items: center;
  }

  .gh-hero-brand-name,
  .gh-hero-brand-tagline {
    text-align: center;
  }
}

@media (max-width: 767px) {
  .gh-hero-brand {
    max-width: 100%;
    width: 100%;
    align-items: center !important;
  }

  .gh-hero-brand-logo {
    width: 144px;
    margin: 0 auto;
  }

  .gh-hero-brand-text {
    gap: 12px;
    align-items: center !important;
    width: 100%;
  }

  .gh-hero-brand-name {
    font-size: 1.5rem;
    text-align: center !important;
    width: 100%;
  }

  .gh-hero-brand-tagline {
    font-size: 0.95rem;
    text-align: center !important;
    width: 100%;
    white-space: nowrap;
  }

  /* Override absolute positioning for mobile */
  .gh-hero-title,
  .gh-hero-subtitle {
    position: static;
    left: 0;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.3rem;
    white-space: normal;
  }

  .gh-hero-signal,
  .gh-hero-ai {
    font-size: 1rem;
    position: static;
    transform: none;
  }

  .gh-hero-colon {
    font-size: 1rem;
    position: static;
    transform: none;
    width: auto;
    margin: 0 0.2rem;
  }

  .gh-hero-noise,
  .gh-hero-hype {
    font-size: 0.5rem;
    position: static;
    transform: none;
  }

  .gh-hero-description {
    white-space: normal;
    line-height: 1.5;
    position: static;
    left: 0;
  }

  .gh-hero-cta {
    left: 0;
  }
}

@media (max-width: 480px) {
  .gh-hero-brand {
    max-width: 100%;
    width: 100%;
    align-items: center !important;
  }

  .gh-hero-brand-logo {
    width: 120px;
    margin: 0 auto;
  }

  .gh-hero-brand-text {
    align-items: center !important;
    width: 100%;
  }

  .gh-hero-brand-name {
    font-size: 1.3rem;
    text-align: center !important;
    width: 100%;
  }

  .gh-hero-brand-tagline {
    font-size: 0.9rem;
    text-align: center !important;
    width: 100%;
    white-space: nowrap;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  .gh-hero {
    padding: 33px 0;
  }

  .gh-hero-signal,
  .gh-hero-ai {
    font-size: 1.8rem;
  }

  .gh-hero-colon {
    font-size: 1.8rem;
    margin: 0 0.25rem;
  }

  .gh-hero-noise,
  .gh-hero-hype {
    font-size: 0.7rem;
    margin-left: 0.25rem;
  }

  .gh-hero-title,
  .gh-hero-subtitle {
    gap: 1rem;
  }

  .gh-hero-description {
    font-size: 1.125rem;
  }

  .gh-section-title {
    font-size: 2.5rem;
  }

  .gh-three-pillars {
    padding: 100px 0;
  }

  .gh-columns-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--column-gap);
  }

  .gh-column:nth-child(3) {
    grid-column: 1 / -1;
  }

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

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  .gh-hero-signal,
  .gh-hero-ai {
    font-size: 2rem;
  }

  .gh-hero-colon {
    font-size: 2rem;
    margin: 0 0.3rem;
  }

  .gh-hero-noise,
  .gh-hero-hype {
    font-size: 0.8rem;
    margin-left: 0.3rem;
  }

  .gh-hero-title,
  .gh-hero-subtitle {
    gap: 1rem;
  }

  .gh-columns-container {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .gh-column:nth-child(3) {
    grid-column: auto;
  }

  .gh-resize-handle {
    display: block;
  }

  .gh-head-menu {
    display: flex;
  }

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

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .gh-three-pillars-inner {
    max-width: 1400px;
  }

  .gh-columns-container {
    gap: 32px;
  }

  .gh-column-content {
    max-height: 600px;
  }
}

/* Ultra-wide screens (1400px and up) */
@media (min-width: 1400px) {
  .gh-columns-container {
    gap: 40px;
  }

  .gh-column-content {
    max-height: 700px;
  }
}

/* Mobile-specific adjustments */
@media (max-width: 767px) {
  .gh-hero {
    padding: 20px 0;
  }

  .gh-hero-signal,
  .gh-hero-ai {
    font-size: 1.2rem;
  }

  .gh-hero-colon {
    font-size: 1.2rem;
    margin: 0 0.2rem;
  }

  .gh-hero-noise,
  .gh-hero-hype {
    font-size: 0.5rem;
    margin-left: 0.2rem;
  }

  .gh-hero-title,
  .gh-hero-subtitle {
    gap: 0.75rem;
  }

  .gh-hero-description {
    font-size: 0.9rem;
  }
  /* Hide desktop-only elements */
  .gh-resize-handle {
    display: none !important;
  }

  /* Stack columns vertically */
  .gh-columns-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .gh-column {
    margin-bottom: 0;
  }

  .gh-column-content {
    max-height: 400px;
  }

  /* Simplify job listings on mobile */
  .gh-job-filters,
  .gh-job-counts,
  .gh-job-count {
    padding: 0 1rem;
  }

  .gh-job-details {
    flex-direction: column;
    gap: 0.5rem;
  }

  .gh-job-footer {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  /* Stack news item elements */
  .gh-news-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .gh-news-footer {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  /* Simplify research paper layout */
  .gh-research-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .gh-research-footer {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .gh-research-metrics {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Modal adjustments */
  .gh-modal-container {
    width: 95%;
    max-height: 90vh;
  }

  .gh-modal-header,
  .gh-modal-body,
  .gh-modal-footer {
    padding: 1rem;
  }

  /* Card grid adjustments */
  .gh-featured-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Touch-friendly adjustments for mobile */
@media (max-width: 767px) and (pointer: coarse) {
  .gh-btn {
    min-height: 44px;
    padding: 0.75rem 1rem;
  }

  .gh-btn-sm {
    min-height: 36px;
    padding: 0.5rem 0.75rem;
  }

  .gh-news-action,
  .gh-research-action,
  .gh-job-action {
    min-height: 44px;
    min-width: 44px;
  }

  .gh-modal-close {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Tablet-specific adjustments */
@media (min-width: 768px) and (max-width: 991px) {
  .gh-columns-container {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .gh-column:nth-child(3) {
    grid-column: 1 / -1;
  }

  .gh-column-content {
    max-height: 500px;
  }

  /* Two-column layout for filters */
  .gh-filter-checkboxes {
    grid-template-columns: 1fr 1fr;
  }
}

/* Landscape phone adjustments */
@media (max-width: 991px) and (orientation: landscape) {
  .gh-hero {
    padding: 20px 0;
  }

  .gh-three-pillars {
    padding: 60px 0;
  }

  .gh-column-content {
    max-height: 300px;
  }
}

/* High DPI / Retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .gh-head-logo img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Hover-capable devices */
@media (hover: hover) {
  .gh-column:hover {
    transform: translateY(-4px);
  }

  .gh-card:hover {
    transform: translateY(-2px);
  }

  .gh-job-item:hover,
  .gh-news-item:hover,
  .gh-research-item:hover {
    background: var(--bg-secondary);
  }
}

/* Non-hover devices (touch screens) */
@media (hover: none) {
  .gh-column,
  .gh-card {
    transform: none !important;
  }

  .gh-job-item:active,
  .gh-news-item:active,
  .gh-research-item:active {
    background: var(--bg-secondary);
  }
}

/* Print styles for mobile */
@media print and (max-width: 767px) {
  .gh-columns-container {
    display: block;
  }

  .gh-column {
    margin-bottom: 2rem;
    page-break-inside: avoid;
  }

  .gh-column-header {
    background: white !important;
    border-bottom: 2px solid black;
  }

  .gh-column-content {
    max-height: none;
    overflow: visible;
  }

  .gh-hero,
  .gh-newsletter,
  .gh-featured {
    display: none;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .gh-column,
  .gh-card {
    transition: none;
  }

  .gh-loading-spinner {
    animation: none;
  }

  .gh-loading-spinner::before {
    content: "Loading...";
    display: block;
    text-align: center;
  }
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
  .gh-column {
    border: 2px solid var(--text-primary);
  }

  .gh-btn-outline {
    border-width: 2px;
  }

  .gh-job-item,
  .gh-news-item,
  .gh-research-item {
    border-bottom-width: 2px;
  }
}

/* Dark mode responsive adjustments */
@media (prefers-color-scheme: dark) {
  @media (max-width: 767px) {
    .gh-modal-container {
      background: var(--bg-card);
      border: 1px solid var(--border-medium);
    }
  }
}

/* Container queries (when supported) */
@supports (container-type: inline-size) {
  .gh-column {
    container-type: inline-size;
  }

  @container (max-width: 300px) {
    .gh-job-details,
    .gh-news-footer,
    .gh-research-footer {
      flex-direction: column;
      gap: 0.5rem;
    }

    .gh-btn-sm {
      font-size: 0.75rem;
      padding: 0.375rem 0.5rem;
    }
  }
}

/* Custom breakpoints for specific components */
@media (max-width: 480px) {
  .gh-hero {
    padding: 18px 0;
  }

  /* Override absolute positioning for small mobile */
  .gh-hero-title,
  .gh-hero-subtitle {
    position: static;
    left: 0;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    white-space: normal;
  }

  .gh-hero-signal,
  .gh-hero-ai {
    font-size: 0.85rem;
    position: static;
    transform: none;
  }

  .gh-hero-colon {
    font-size: 0.85rem;
    position: static;
    transform: none;
    width: auto;
    margin: 0 0.15rem;
  }

  .gh-hero-noise,
  .gh-hero-hype {
    font-size: 0.4rem;
    position: static;
    transform: none;
  }

  .gh-hero-description {
    font-size: 0.85rem;
    white-space: normal;
    line-height: 1.5;
    position: static;
    left: 0;
  }

  .gh-hero-cta {
    flex-direction: column;
    align-items: center;
    left: 0;
  }

  .gh-newsletter-form-fields {
    flex-direction: column;
    width: 100%;
    max-width: none;
  }

  .gh-newsletter-input {
    width: 100%;
  }

  .gh-newsletter-contact {
    font-size: 0.85rem;
    padding: 1rem 0.5rem 0;
    margin-top: 1.5rem;
  }
}

/* Mobile Navigation Fixes */
@media (max-width: 768px) {
  /* Hide Jobs/News/Research text in header on mobile */
  .gh-site-jobs,
  .gh-site-news,
  .gh-site-research {
    display: none;
  }

  /* Stack navigation vertically on mobile */
  .gh-head-inner {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .gh-head-menu {
    order: 3;
    flex-basis: 100%;
    margin-top: 1rem;
  }

  .gh-head-menu .nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .gh-head-menu .nav li {
    margin: 0;
  }

  .gh-head-menu .nav li a {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
  }

  /* Adjust dropdown on mobile */
  .gh-nav-dropdown-content {
    position: static;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 4px;
    margin-top: 0.5rem;
    background-color: var(--bg-card) !important; /* Use theme background color */
    border: 1px solid var(--border-light);
    width: 100%;
    min-width: auto;
  }

  .gh-nav-dropdown:hover .gh-nav-dropdown-content,
  .gh-nav-dropdown:active .gh-nav-dropdown-content,
  .gh-nav-dropdown:focus-within .gh-nav-dropdown-content {
    display: flex;
    flex-direction: column;
  }

  /* Fix dropdown link colors for mobile */
  .gh-nav-dropdown-content a {
    padding: 0.75rem 1rem !important;
    font-size: 0.875rem !important;
  }

  /* Hero title responsive fixes */
  .gh-hero-inner {
    padding: 0 1rem;
    max-width: 100%;
    overflow-x: hidden;
  }

  .gh-hero-content {
    max-width: 100%;
    overflow-x: hidden;
  }

  .gh-hero-title-container {
    max-width: 100%;
    overflow-wrap: break-word;
  }

  .gh-hero-title {
    font-size: 1.5rem;
    line-height: 1.3;
    word-wrap: break-word;
  }

  .gh-hero-subtitle {
    font-size: 1rem;
    line-height: 1.4;
    word-wrap: break-word;
  }

  .gh-hero-signal,
  .gh-hero-ai {
    font-size: 1.5rem;
  }

  .gh-hero-noise,
  .gh-hero-hype {
    font-size: 0.6rem;
    vertical-align: middle;
  }

  .gh-hero-colon {
    font-size: 1.5rem;
    margin: 0 0.15rem;
  }

  .gh-hero-description {
    font-size: 0.95rem;
    max-width: 100%;
    overflow-wrap: break-word;
  }

  /* Ensure hero elements fit within viewport */
  .gh-hero {
    overflow-x: hidden;
    max-width: 100vw;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .gh-three-pillars-inner,
  .gh-hero-inner {
    padding: 0 12px;
  }

  .gh-hero {
    padding: 15px 0;
  }

  .gh-column-header,
  .gh-column-footer {
    padding: 0.75rem;
  }

  .gh-job-item,
  .gh-news-item,
  .gh-research-item {
    padding: 1rem;
  }

  .gh-hero-signal {
    font-size: 1.2rem;
  }

  .gh-hero-noise {
    font-size: 0.45rem;
  }

  .gh-hero-description {
    font-size: 0.8rem;
  }

  .gh-section-title {
    font-size: 1.75rem;
  }

  /* Even smaller hero text for very small screens */
  .gh-hero-title {
    font-size: 1.2rem;
  }

  .gh-hero-subtitle {
    font-size: 0.85rem;
  }

  .gh-hero-signal,
  .gh-hero-ai {
    font-size: 1.2rem;
  }

  .gh-hero-colon {
    font-size: 1.2rem;
  }
}

/* Wide mobile screens (large phones) */
@media (min-width: 414px) and (max-width: 767px) {
  .gh-columns-container {
    gap: 2rem;
  }

  .gh-column-content {
    max-height: 450px;
  }
}

/* Foldable device support */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .gh-columns-container {
    grid-template-columns: 1fr 1fr;
  }

  .gh-column:nth-child(3) {
    grid-column: 1 / -1;
  }
}

/* Performance optimizations for lower-end devices */
@media (max-width: 767px) {
  .gh-column {
    will-change: auto;
  }

  .gh-loading-spinner {
    will-change: transform;
  }
}
