/* ==========================================================================
   GROUPZON - Responsive Stylesheet  |  css/responsive.css
   Breakpoints: 1280px, 1200px, 1024px, 768px, 600px, 480px
   Mobile-first adjustments applied at each breakpoint.
   ========================================================================== */

/* ==========================================================================
   1280px — Constrained desktops
   ========================================================================== */
@media (max-width: 1280px) {
}

/* ==========================================================================
   1200px — Laptops
   ========================================================================== */
@media (max-width: 1200px) {
  .hero-inner { gap: clamp(2rem, 4vw, 3rem); }
}

/* ==========================================================================
   1024px — Tablets landscape / small laptops — collapse navbar
   ========================================================================== */
@media (max-width: 1024px) {
  /* Navbar: hide desktop links, show CTA and toggle with 44px touch target */
  .nav-menu { display: none; }
  .nav-cta { 
    display: inline-flex;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }
  .nav-cta svg {
    display: none;
  }
  .nav-toggle {
    display: flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    cursor: pointer;
  }

  /* Hero: stack to one column */
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-content { order: 2; }
  .hero-visual { order: 1; max-width: 600px; margin-inline: auto; min-height: 280px; }
  .hero-desc { max-width: 100%; margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-eyebrow { margin-inline: auto; }
  .hero::before { opacity: 0.5; }

  /* Inner-page heroes use their own grid; keep the visual below the copy. */
  .page-hero-grid { grid-template-columns: 1fr; }
  .page-hero-grid > * { min-width: 0; }
  .page-hero-content { max-width: 680px; }
  .page-hero-visual { max-width: min(100%, 520px); margin-inline: auto; }

  /* About intro: stack */
  .about-intro { grid-template-columns: 1fr; }
  .about-visual { max-width: 500px; margin-inline: auto; }

  /* Contact layout: stack cleanly */
  .contact-layout-grid { grid-template-columns: 1fr; gap: var(--space-6); }

  /* Feature blocks: stack */
  .feature-block { grid-template-columns: 1fr; }
  .feature-block--reverse { direction: ltr; }

  /* About page grids: stack on smaller screens */
  .why-deep-grid { grid-template-columns: 1fr; }

  /* Video story: clean stacked storytelling layout without empty gaps */
  .video-story-inner { grid-template-columns: 1fr; min-height: unset; gap: 1.25rem; }
  .video-story-sticky { position: static; height: auto; padding: 0; }
  .story-video-display { max-height: 300px; }
  .video-story-panels { padding: 0; }
  .video-story-panel { opacity: 1; transform: none; min-height: auto; }

  /* Solutions page: seamless auto-fit grid and balanced block padding */
  .industry-overview-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.85rem; }
  .solution-industry-block { grid-template-columns: 1fr; gap: var(--space-6); padding-block: clamp(2.5rem, 5vw, 3.5rem); }
  .solution-industry-block--reverse .industry-info,
  .solution-industry-block--reverse .industry-visual-card { order: initial; }
}

/* ==========================================================================
   768px — Tablets portrait
   ========================================================================== */
@media (max-width: 768px) {
  /* Container padding */
  :root { --container-px: clamp(1rem, 4vw, 1.5rem); }

  /* Mobile Animation Tuning: reduced distance (12px), vertical only to prevent overflow */
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-down {
    transform: translateY(12px) !important;
    transition-duration: 0.45s;
  }
  .reveal.is-revealed,
  .reveal-left.is-revealed,
  .reveal-right.is-revealed,
  .reveal-scale.is-revealed,
  .reveal-down.is-revealed {
    transform: translate(0, 0) scale(1) !important;
  }

  /* Gentle mobile floating: 3–4px maximum movement */
  @keyframes floatSlowMobile {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
  }
  @keyframes floatMediumMobile {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
  }
  @keyframes floatFastMobile {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-2px); }
  }

  .float-slow { animation: floatSlowMobile 5s ease-in-out infinite !important; }
  .float-medium { animation: floatMediumMobile 4.2s ease-in-out infinite !important; }
  .float-fast { animation: floatFastMobile 3.2s ease-in-out infinite !important; }
  .float-delayed { animation: floatSlowMobile 5.5s ease-in-out infinite !important; }

  /* Jump to Top Button on Mobile: 48x48px with safe-area support */
  .back-to-top {
    width: 48px;
    height: 48px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    right: 16px;
  }
  .back-to-top .arrow-up-icon {
    width: 18px;
    height: 18px;
  }

  /* Branded Loader size on Mobile: 52x52px */
  .loader-brand-symbol {
    width: 52px;
    height: 52px;
  }

  /* Hero visuals: ensure proper bounding and no horizontal overflow */
  .hero-visual,
  .page-hero-visual {
    max-width: 100%;
    overflow: hidden;
  }

  /* Map canvas responsiveness */
  .map-canvas-wrap {
    min-height: 300px;
  }
  .real-google-map {
    min-height: 300px;
  }

  /* Services grid: 2 cols then 1 */
  .services-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

  /* Solutions grid: 1 col */
  .solutions-grid { grid-template-columns: 1fr; max-width: 480px; margin-inline: auto; }

  /* Why grid: 2 cols */
  .why-grid { grid-template-columns: 1fr 1fr; }

  /* Trust grid: 2 cols */
  .trust-grid { grid-template-columns: 1fr 1fr; }

  /* About principles: 2 cols */
  .about-principles { grid-template-columns: 1fr 1fr; }

  /* Form row: stack */
  .form-row { grid-template-columns: 1fr; }

  /* Footer: 2 col then simplify */
  .footer-main { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: var(--space-3); }

  /* Hero badge: hide on small tablets */
  .hero-badge { display: none; }

  /* CTA banner */
  .cta-banner-actions { flex-direction: column; align-items: center; }

  /* Dropdown: wide dropdown adjust */
  .dropdown--wide { min-width: 340px; }

  /* -----------------------------------------------------------------------
     MOBILE STORYTELLING SECTION — Stacked Sticky Layout
     ----------------------------------------------------------------------- */

  /* Mobile: hide the stepper and telemetry to save vertical space */
  .story-stepper-sticky-bar { display: none; }
  .story-telemetry-cockpit { display: none; }

  /* Mobile: compact section padding */
  .video-story { padding: 1.75rem 0 2rem; }

  /* Mobile: tight header */
  .story-header { margin-bottom: 1.5rem; }
  .story-main-title { font-size: clamp(1.5rem, 5vw, 1.85rem); }
  .story-main-desc { font-size: 0.875rem; }

  /* Mobile video display */
  .story-video-display {
    max-height: 240px !important;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    overflow: hidden;
    width: 100%;
    box-shadow: 0 4px 12px rgba(15, 42, 94, 0.15);
  }

  /* Mobile: Make the video sticky at the top so it stays in view while scrolling the panels! */
  .video-story-sticky {
    position: sticky !important;
    top: calc(var(--navbar-height, 64px) + 0.5rem) !important;
    display: block;
    z-index: 50;
    margin-bottom: 2rem;
  }

  /* Mobile panels: stack them naturally with spacing so scroll-spy still works */
  .video-story-panels {
    padding: 0;
    gap: 1.5rem;
  }

  .video-story-panel {
    display: flex !important;
    flex-direction: column;
    opacity: 1 !important;
    transform: none !important;
    min-height: auto;
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--clr-border);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 42, 94, 0.05);
    transition: all 0.3s ease;
  }

  .video-story-panel.is-active {
    border: 1.5px solid #22c55e;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    box-shadow: 0 6px 20px -4px rgba(34, 197, 94, 0.15);
    transform: scale(1.02) !important;
  }

  /* Panel feature tags on mobile */
  .panel-feature-tags { gap: 0.5rem; margin-top: 1rem; }
  .panel-feature-tags li { font-size: 12px; }
}

/* ==========================================================================
   600px — Large phones
   ========================================================================== */
@media (max-width: 600px) {
  .industry-overview-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .industry-overview-card { min-height: 0; padding: 0.85rem; }
  .solution-industry-block { padding-block: clamp(2rem, 6vw, 2.75rem); }
  .industry-features-grid { grid-template-columns: 1fr; }
  .industry-visual-card { padding: 1.25rem; }
  .page-hero { padding-bottom: 3.5rem; }
  .page-hero-visual,
  .page-hero-visual .hero-visual { min-height: 260px; max-width: 100%; overflow: clip; }
  .page-hero-title,
  .page-hero-desc { max-width: 100%; overflow-wrap: anywhere; }
  .page-hero-actions { gap: 0.9rem; }
  .ecosystem-network { width: min(100%, 460px); transform: scale(0.78); transform-origin: center; }

  /* Services: 1 col */
  .services-grid { grid-template-columns: 1fr; }

  /* Trust: 1 col */
  .trust-grid { grid-template-columns: 1fr; }

  /* Why: 1 col */
  .why-grid { grid-template-columns: 1fr; }

  /* About principles: 1 col */
  .about-principles { grid-template-columns: 1fr; }
  .simplicity-grid { grid-template-columns: 1fr; }
  .workflow-track { grid-template-columns: 1fr; }



  /* Legal footer */
  .footer-legal { flex-direction: column; gap: var(--space-2); align-items: flex-start; }

  /* Hero */
  .hero-title br { display: none; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; justify-content: center; }

  /* Page header */
  .page-header-title { letter-spacing: -0.02em; }

  /* Video story: smaller video on small phones */
  .story-video-display { max-height: 200px !important; }
  .video-story-panel-title { font-size: 1.05rem; }
}

/* ==========================================================================
   480px — Small phones
   ========================================================================== */
@media (max-width: 480px) {
  :root {
    --navbar-height: 64px;
  }

  /* Navbar brand logo slightly smaller */
  .nav-brand-logo { height: 36px; }

  /* Section headings */
  .section-title { letter-spacing: -0.01em; }

  /* Cards padding */
  .service-card { padding: var(--space-5); }
  .card { padding: var(--space-5); }
  .form-card { padding: var(--space-5); }

  /* Mobile drawer full-width */
  .nav-drawer { width: 100vw; }

  /* Buttons: stack tightly */
  .cta-banner-actions .btn { width: 100%; justify-content: center; }
  .hero-actions .btn { font-size: var(--text-sm); }

  /* Footer brand */
  .footer-brand-logo { height: 38px; }
  .footer-brand-desc { max-width: 100%; }

  /* Dropdown in mobile handled by drawer; hide desktop dropdown entirely on mobile */
  .dropdown { display: none !important; }

  /* Contact page: tight padding on info cards */
  .info-card { padding: var(--space-4); gap: var(--space-3); }
  .map-canvas-wrap { min-height: 260px; }
  .real-google-map { min-height: 260px; }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
  .site-header, .nav-drawer, .nav-backdrop, .scroll-progress,
  .hero-badge, .cta-banner, .video-story, .cookie-banner { display: none !important; }
  body { font-size: 12pt; line-height: 1.5; color: #000; background: #fff; }
  .container { max-width: 100%; padding-inline: 1rem; }
  a { text-decoration: underline; color: inherit; }
  .site-footer { background: transparent; color: #000; border-top: 1px solid #ccc; }
}
