/* ==========================================================================
   EDEN JOB PORTAL — Responsive refinements
   Mobile-first: base rules target phones first, min-width queries scale up.
   The desktop layout (>=992px) is preserved exactly.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Global overflow guard
   overflow-x: clip removes horizontal scrolling without creating a new
   scroll container (so position: sticky keeps working).
   -------------------------------------------------------------------------- */

html,
body {
  overflow-x: clip;
}

/* Keep grid / flex children from blowing out the viewport with long content */
.grid-2 > *,
.grid-3 > *,
.grid-4 > *,
.jobs-section-grid > *,
.jobs-list > *,
.category-grid > *,
.why-grid > *,
.mission-values > *,
.resume-cta-steps > * {
  min-width: 0;
}

input,
select,
textarea {
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   Shared responsive utilities
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .hide-sm { display: none !important; }
}

@media (max-width: 479px) {
  .hide-xs { display: none !important; }
}

/* --------------------------------------------------------------------------
   Touch targets (mobile + tablet)
   -------------------------------------------------------------------------- */

@media (max-width: 991px) {
  .btn,
  .btn-sm,
  .btn-lg { min-height: 48px; }
  .btn-lg { min-height: 54px; }

  .filters-toggle { min-height: 48px; }

  /* Prevent iOS zoom-on-focus by keeping controls >=16px */
  .sort-select select { font-size: var(--text-base); }

  .apply-sticky { position: static; }
}

@media (max-width: 479px) {
  .btn,
  .btn-sm { min-height: 52px; }
}

/* --------------------------------------------------------------------------
   Header — compact, sticky logo row (top bar scrolls away on mobile)
   -------------------------------------------------------------------------- */

@media (max-width: 991px) {
  .site-header { position: static; }

  .header-inner {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    min-height: 60px;
    background: #fff;
  }
  .site-header.scrolled .header-inner { box-shadow: 0 2px 10px rgba(34, 34, 34, 0.08); }

  .site-logo img { height: 38px; }

  .header-actions { gap: var(--space-2); }
  .header-actions .btn {
    width: 46px;
    height: 46px;
    padding: 0;
  }
  .header-actions .btn svg { width: 20px; height: 20px; }

  .mobile-menu-toggle { width: 46px; height: 46px; }

  .top-bar-inner { min-height: 34px; }
}

@media (max-width: 479px) {
  .top-bar-inner { gap: var(--space-2); }
  .top-bar-social { gap: var(--space-3); }
}

/* --------------------------------------------------------------------------
   Mobile menu
   -------------------------------------------------------------------------- */

.mobile-menu-link {
  padding-top: 0.95rem;
  padding-bottom: 0.95rem;
  font-size: var(--text-lg);
  border-bottom-color: var(--gray-200);
}

.mobile-menu-head .site-logo img { height: 34px; }
.mobile-menu-cta { margin-top: var(--space-8); }
.mobile-menu-cta .btn { min-height: 52px; }

.mobile-menu-social {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.mobile-menu-social a {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--green-500);
  color: #fff;
  box-shadow: var(--shadow-green);
  transition: all 0.3s ease;
}
.mobile-menu-social a:hover { background: var(--green-600); transform: scale(1.08); color: #fff; }
.mobile-menu-social svg { width: 22px; height: 22px; }

/* --------------------------------------------------------------------------
   Section rhythm — tighten whitespace on small screens
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .section {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
  }
  .section-head { margin-bottom: var(--space-8); }

  .top-bar-social a { width: 44px; height: 44px; justify-content: center; }
  .top-bar-social svg { width: 18px; height: 18px; }
  .footer-social a { width: 44px; height: 44px; }
  .footer-social svg { width: 20px; height: 20px; }
}

/* --------------------------------------------------------------------------
   Home hero
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .hero-inner {
    gap: var(--space-6);
    padding-top: var(--space-10);
    padding-bottom: var(--space-12);
  }
  .hero-eyebrow { margin-bottom: var(--space-4); }
  .hero h1 { font-size: var(--text-3xl); }
  .hero-sub { margin-bottom: var(--space-6); }
  .hero-actions { margin-bottom: var(--space-6); }
}

@media (max-width: 479px) {
  .hero h1 { font-size: clamp(1.875rem, 8vw, 2.25rem); }
  .hero-sub { font-size: var(--text-base); }
}

/* Hero stats — stack into compact rows below 640px */
@media (max-width: 639px) {
  .hero-stats {
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: var(--space-3);
  }
  .hero-stats .stat-block {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    padding-left: var(--space-3);
  }
  .hero-stats .stat-value { font-size: var(--text-xl); }
  .hero-stats .stat-label { margin-top: 0; }
}

/* --------------------------------------------------------------------------
   Search bar — full-width stacked fields + button
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .search-field { min-height: 52px; }
  .search-bar .btn { width: 100%; min-height: 52px; }
}

.search-field input,
.search-field select { min-width: 0; }

/* --------------------------------------------------------------------------
   Homepage blocks
   -------------------------------------------------------------------------- */

@media (max-width: 479px) {
  .trust-strip-inner {
    gap: var(--space-4);
    padding-top: var(--space-6);
    padding-bottom: var(--space-6);
  }
  .trust-item { gap: var(--space-3); }
  .trust-item-icon { width: 40px; height: 40px; }

  .info-card,
  .testimonial-card,
  .category-card { padding: var(--space-5); }

  .cta-banner,
  .resume-cta { padding: var(--space-8) var(--space-5); }
}

/* --------------------------------------------------------------------------
   Job cards
   -------------------------------------------------------------------------- */

@media (max-width: 991px) {
  .job-card-foot { flex-wrap: wrap; }
  .job-card-actions { flex: 1; justify-content: flex-end; }
  .job-card-actions .btn { flex: 1 1 0; }
}

@media (max-width: 479px) {
  .job-card-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .job-card-actions { width: 100%; }
  .job-card-date { width: 100%; }
}

/* --------------------------------------------------------------------------
   Job detail + apply pages
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .detail-card,
  .apply-form-card,
  .contact-form-card { padding: var(--space-5); }
  .detail-head h1 { font-size: var(--text-xl); }
}

/* Detail facts: 2-up on small screens, 1-up on tiny screens (readability) */
.detail-facts { grid-template-columns: 1fr 1fr; }
@media (max-width: 359px) {
  .detail-facts { grid-template-columns: 1fr; }
}

/* Apply / modal actions stack on small screens */
@media (max-width: 479px) {
  .modal-actions { flex-direction: column; }
  .modal-actions .btn { width: 100%; }
}

/* --------------------------------------------------------------------------
   Results toolbar / pagination
   -------------------------------------------------------------------------- */

@media (max-width: 479px) {
  .results-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .sort-select { width: 100%; }
  .sort-select select { width: 100%; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .footer-main { gap: var(--space-8); }
  .footer-bottom { text-align: center; }
  .footer-bottom-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-4);
  }
}

/* --------------------------------------------------------------------------
   Floating buttons — safe spacing from screen edges
   -------------------------------------------------------------------------- */

@media (max-width: 479px) {
  .whatsapp-float {
    right: var(--space-4);
    bottom: var(--space-4);
  }
  .whatsapp-float-btn { width: 50px; height: 50px; }
  .back-to-top {
    right: var(--space-4);
    bottom: 182px;
  }
}

/* --------------------------------------------------------------------------
   Legacy max-width helpers (kept for smaller adjustments)
   -------------------------------------------------------------------------- */

@media (max-width: 991px) {
  .jobs-sidebar { position: static; }
  .desktop-filter-panel { display: none; }
}

@media (max-width: 640px) {
  .hero-actions .btn { width: 100%; }
  .cta-banner-actions .btn { width: 100%; }
}

/* Print */
@media print {
  .site-header,
  .site-footer,
  .whatsapp-float,
  .back-to-top,
  .apply-sticky,
  .no-print { display: none !important; }
  body { background: #fff; }
}
