/* ============================================================
   KYOBE GROUP LTD — Responsive Stylesheet
   ============================================================ */

/* ── Tablet 768–1199px ── */
@media (max-width: 1199px) {
  .divisions-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .stat-block { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.2); padding: 20px; }
  .stat-block:nth-child(odd) { border-right: 1px solid rgba(255,255,255,0.2); }
  .stat-block:nth-child(3), .stat-block:nth-child(4) { border-bottom: none; }
  .about-split { grid-template-columns: 1fr; gap: 40px; }
  .partners-grid { grid-template-columns: repeat(3, 1fr); }
  .about-img-block { max-width: 480px; margin: 0 auto; }
  .hero-stats-inner { flex-wrap: wrap; }
  .hero-stat { min-width: 50%; flex: 0 0 50%; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); }
  .hero-stat:nth-child(odd) { border-right: 1px solid rgba(255,255,255,0.1); }
  .hero-stat:nth-child(3), .hero-stat:nth-child(4) { border-bottom: none; }
}

/* ── Mobile ≤767px ── */
@media (max-width: 767px) {
  section { padding: 56px 0; }

  /* Nav */
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  /* Hero — fit content naturally, don't force full-screen height (was reading as "vague"/oversized) */
  .hero { min-height: 0; }
  .hero-img-cover { object-position: center 32%; }
  .hero-content { padding: 76px 0 130px; }
  .hero-badge { margin-bottom: 16px; }
  .hero-sub { margin-bottom: 22px; }
  .hero-actions { flex-direction: column; gap: 10px; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-stats { padding-bottom: env(safe-area-inset-bottom, 0); }

  /* Page hero / division banner — trim to a compact mobile-fit header */
  .page-hero, .div-banner { min-height: 0; }

  /* Stats row — always horizontal, compact, scrollable */
  .hero-stats-inner {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .hero-stats-inner::-webkit-scrollbar { display: none; }
  .hero-stat {
    flex: 0 0 auto !important;
    min-width: 78px;
    padding: 14px 10px;
    border-right: 1px solid rgba(255,255,255,0.1) !important;
    border-bottom: none !important;
  }
  .hero-stat:last-child { border-right: none !important; }
  .hero-stat-num { font-size: 1.25rem; }
  .hero-stat-label { font-size: 0.6rem; }

  /* Leadership photos are also .upload-slot — keep them perfectly circular (fixes oval bug) */
  .leader-photo.upload-slot { aspect-ratio: 1 / 1 !important; width: 96px !important; height: 96px !important; min-height: 0 !important; }

  /* Divisions, Why-Kyobe reasons, News (homepage only, via data-autoslide) — auto-sliding swipeable carousel */
  [data-autoslide] {
    display: flex !important; flex-wrap: nowrap !important;
    overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    gap: 16px; padding-bottom: 4px; scrollbar-width: none;
  }
  [data-autoslide]::-webkit-scrollbar { display: none; }
  [data-autoslide] > * { flex: 0 0 85%; scroll-snap-align: center; }
  .services-grid { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: 1fr; }
  /* Non-carousel news grid (full listing page) still stacks normally */
  .news-grid:not([data-autoslide]) { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .stat-block { border-right: none !important; border-bottom: 1px solid rgba(255,255,255,0.18) !important; }
  .stat-block:nth-child(odd) { border-right: 1px solid rgba(255,255,255,0.18) !important; }
  .stat-block:nth-child(3), .stat-block:nth-child(4) { border-bottom: none !important; }

  /* About image — full width, fluid height that scales with screen width */
  .about-split { grid-template-columns: 1fr; gap: 24px; }
  .about-img-block { max-width: 100%; width: 100%; }
  .about-img-placeholder {
    height: auto; aspect-ratio: 4 / 3; border-radius: 0;
    margin-left: calc(-5vw); width: calc(100% + 10vw);
  }
  .about-img-badge { position: static; display: inline-flex; align-items: center; gap: 12px; margin: 12px 0 0; }

  /* Businesses big cards — image on top, fluid height */
  .biz-big-card { grid-template-columns: 1fr !important; }
  .biz-big-card-img { min-height: 0 !important; height: auto !important; aspect-ratio: 16 / 10; order: -1 !important; border-radius: 0 !important; }
  .biz-big-card-body { padding: 28px 22px !important; order: 2 !important; }

  /* Division cards, news thumbs, gallery slots — fluid height instead of fixed px */
  .division-card-thumb,
  .news-card-thumb,
  .upload-slot {
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 10;
  }
  .news-featured .upload-slot { aspect-ratio: 16 / 11; }
  .product-card .upload-slot { aspect-ratio: 4 / 3; }

  /* Page hero — compact mobile-fit header */
  .page-hero { padding: 92px 0 40px; }
  .div-banner { padding: 92px 0 44px; }

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

  /* Gallery */
  .gallery-grid { columns: 2; }

  /* Float buttons */
  .float-wa { bottom: 18px; right: 16px; width: 50px; height: 50px; }
  .float-top { bottom: 78px; right: 16px; }

  /* CTA actions */
  .cta-actions { flex-direction: column; align-items: center; }
  .cta-actions .btn { width: 100%; max-width: 320px; justify-content: center; }
}

/* ── Small mobile <480px ── */
@media (max-width: 479px) {
  .gallery-grid { columns: 1; }
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.5rem; }
  .contact-form { padding: 24px 18px; }
  .hero-stat-num { font-size: 1.1rem; }
}

/* ── Hours/Contact two-col → single col on mobile ── */
@media (max-width: 767px) {
  .hours-contact-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  /* Contact page two-col */
  section > .container > div[style*="1fr 1.3fr"] {
    grid-template-columns: 1fr !important;
  }
  /* About mission/vision two-col */
  section > .container > div[style*="1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  /* Trust / Sustainability 3-col */
  section > .container > div[style*="repeat(3,1fr)"] {
    grid-template-columns: 1fr !important;
  }
}

/* Sky strip on mobile */
@media (max-width: 767px) {
  .sky-strip p { font-size: 0.68rem; letter-spacing: 0.02em; }
  .partners-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .pricing-grid[data-autoslide] {
    display: flex !important; flex-wrap: nowrap !important;
    overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    gap: 14px; padding-bottom: 4px; scrollbar-width: none;
  }
  .pricing-grid[data-autoslide]::-webkit-scrollbar { display: none; }
  .pricing-grid[data-autoslide] > * { flex: 0 0 70%; scroll-snap-align: center; }
  .testimonial-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   v2 additions — leadership / news / product catalog responsive
   ============================================================ */
@media (max-width: 1199px) {
  .leadership-grid { grid-template-columns: repeat(2, 1fr); }
  .news-featured { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .leadership-grid { grid-template-columns: 1fr; }
  .news-featured { grid-template-columns: 1fr; }
  .news-featured-body { padding: 26px 22px; }
  .product-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 479px) {
  .product-grid { grid-template-columns: 1fr; }
}
