/* ============================================================
   responsive.css — Global mobile polish pass (Milestone 7)
   Breakpoints: 1024px, 768px, 480px
   ============================================================ */

/* ══ Section headings — tighter on small screens ══════════ */
@media (max-width: 768px) {
  .section { padding: var(--space-section-mobile) 0; }

  .section-heading { font-size: 28px; }

  /* Hero shrinks gracefully */
  .hero { min-height: 70vh; padding: 110px 20px 70px; }
  .hero__title { font-size: clamp(32px, 8vw, 56px); }
  .hero__subtitle { font-size: 16px; }

  /* Hero CTA buttons stack on very narrow screens */
  .hero .flex-cta { flex-direction: column; align-items: center; }
}

/* ══ Marquee — reduce font size on mobile ═════════════════ */
@media (max-width: 640px) {
  .marquee-item { font-size: 18px; padding: 0 28px; }
  .logo-box { height: 80px; } /* M-6: was 131px — too tall on mobile */
}

/* ══ Services grid — single column on mobile ══════════════ */
@media (max-width: 640px) {
  .services-grid { grid-template-columns: 1fr; }
  .service-card__img { height: 200px; }
  .service-card__body { padding: 24px; }
  .service-card__title { font-size: 20px; }
  /* C-3: Services card min-height + stagger offset */
  .rt-card-wrapper { min-height: 220px !important; padding: 24px 20px !important; }
  .rt-cards-right-wrapper { margin-top: 0 !important; }
}

/* ══ Work page — section heading + grid ═══════════════════ */
@media (max-width: 768px) {
  .work-hero { padding: 100px 0 48px; }
  .work-hero h1 { font-size: clamp(30px, 8vw, 48px); }
  .filter-bar { gap: 8px; }
  .filter-btn { font-size: 12px; padding: 6px 14px; }
  .work-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 480px) {
  .work-grid { grid-template-columns: 1fr; }
  /* C-2: brand dropdown too cramped beside filter pills at 375px */
  .brand-filter-container { display: none; }
}

/* ══ Popup — full screen on very small screens ════════════ */
@media (max-width: 480px) {
  .popup-overlay { padding: 0; align-items: flex-end; }
  .popup {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 96dvh;
  }
}

/* ══ Home Page layout adjustments ═══════════════════════════ */
@media (max-width: 768px) {
  /* About Us layout */
  #about .container > div {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
}

@media (max-width: 480px) {
  .blog-hero { padding: 100px 0 48px; }
  .blog-hero h1 { font-size: clamp(28px, 8vw, 48px); }
  #blog-grid { grid-template-columns: 1fr; gap: 20px; padding: 40px 0; }
  .blog-detail-hero__title { font-size: clamp(26px, 6vw, 44px); }
  .blog-detail-body { font-size: 16px; padding: 40px 20px; }
}

/* ══ Blog page ════════════════════════════════════════════ */
@media (max-width: 768px) {
  .blog-hero { padding: 100px 0 48px; }
  .blog-hero h1 { font-size: clamp(28px, 8vw, 48px); }
  #blog-grid { grid-template-columns: 1fr; gap: 20px; padding: 40px 0; }
  .blog-detail-hero__title { font-size: clamp(26px, 6vw, 44px); }
  .blog-detail-body { font-size: 16px; padding: 40px 20px; }
  .blog-detail-hero { padding: 100px 0 40px; }
}

/* ══ Career page ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .career-hero { padding: 100px 0 48px; }
  .career-hero h1 { font-size: clamp(28px, 8vw, 48px); }
  .values-strip { grid-template-columns: repeat(2, 1fr); }
  .role-card { padding: 20px; }
  .apply-modal { padding: 24px 16px; }
}
@media (max-width: 480px) {
  .values-strip { grid-template-columns: repeat(2, 1fr); }
  .role-card { flex-direction: column; gap: 16px; }
  .role-card__action { width: 100%; }
  .role-card__action .btn { width: 100%; justify-content: center; }
  .form-submit-row { flex-direction: column; }
  .form-submit-row .btn { width: 100%; justify-content: center; }
}

/* ══ Team section ═════════════════════════════════════════ */
@media (max-width: 480px) {
  .team-grid { grid-template-columns: 1fr; gap: 40px; }
  .team-card__img-wrapper { width: 160px; height: 160px; }
  .team-card__name { font-size: 20px; }
}

/* ══ Testimonials & FAQ ════════════════════════════════════ */
@media (max-width: 768px) {
  .faq-question { font-size: 16px; }
  .teaser-banner { padding: 48px 20px; }
  .teaser-banner h3 { font-size: 22px; }
}

/* ══ Footer ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
}
@media (max-width: 480px) {
  .footer { padding-block: var(--space-7) var(--space-5); }
  .footer__grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer__tagline { max-width: none; }
}

/* ══ Admin panel — table overflow on mobile ═══════════════ */
@media (max-width: 768px) {
  .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-table { min-width: 600px; }
  .admin-sidebar { width: 100%; position: static; height: auto; }
  .admin-layout {
    flex-direction: column;
  }
}

/* ══ Global touch-friendly tap targets ════════════════ */
@media (max-width: 768px) {
  .btn { min-height: 44px; }          /* WCAG 2.5.5 minimum */
  .nav__link { min-height: 44px; display: flex; align-items: center; }
  .nav__inner { padding-inline: 16px; } /* C-5: prevent logo/hamburger squeeze at 375px */
  .filter-btn { min-height: 44px; }   /* raised from 40px */
  .tag-btn { min-height: 44px; }      /* raised from 40px */
  .carousel-btn { width: 44px; height: 44px; }
  .footer__social-link { width: 44px; height: 44px; } /* H-2: was 38px */
  .page-btn { min-height: 44px; min-width: 44px; }    /* H-4: blog pagination */
  /* H-8: footer grid — 2 columns with tighter gap on tablet */
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-5); }
}

/* ══ Smooth scroll — respect user preference ══════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .marquee-container { animation: none !important; }
}

/* ══ High contrast mode support ═══════════════════════════ */
@media (forced-colors: active) {
  .btn--primary { background: ButtonText; color: ButtonFace; }
  .nav__link.active::after { background: ButtonText; }
}

/* ══ Print styles ═════════════════════════════════════════ */
@media print {
  .nav, .footer, .carousel-nav, .popup-overlay, .tag-filter-wrapper { display: none; }
  body { background: white; color: black; font-size: 12pt; }
  .hero { min-height: unset; padding: 24pt 0; background: white; color: black; }
  a { color: black; }
}

/* ══ Hero stats strip — 2×2 grid on very small screens ═══ */
@media (max-width: 480px) {
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
    width: 100%;
    justify-items: center;
    text-align: center;
  }
  .hero-stat__divider { display: none; } /* hide vertical dividers on 2×2 grid */
}

/* ══ Portfolio popup close button — safe zone on mobile ═══ */
@media (max-width: 480px) {
  .portfolio-popup__close {
    top: 10px !important;
    right: 10px !important;
    width: 44px !important;  /* L-3: was 36px — below 44px tap target minimum */
    height: 44px !important;
    background: rgba(0,0,0,0.7) !important;
    z-index: 20 !important;
  }
}

/* ══ Cookie consent — wider on very small screens ════════ */
@media (max-width: 360px) {
  .cookie-consent {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 12px;
  }
}
