/* ==========================================================================
   KINANA ICT — responsive.css
   Breakpoints: 1024 (tablet-land), 900 (mobile nav), 768 (tablet), 560 (phone)
   Mobile navigation is intentionally designed as a full-screen drawer.
   ========================================================================== */

/* ---- Large desktop down to laptop -------------------------------------- */
@media (max-width: 1120px) {
  .footer-top { grid-template-columns: 1.4fr 1fr 1fr; row-gap: 40px; }
}

/* ---- Tablet landscape --------------------------------------------------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .hero .ai-orb { max-width: 480px; margin-inline: auto; }
  .split { grid-template-columns: 1fr; }
  .split--reverse .split__media { order: 0; }
  .mega__grid { grid-template-columns: 1fr; }
}

/* ---- Switch to mobile navigation --------------------------------------- */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }

  /* No black band on mobile — the drawer owns the screen instead */
  .nav-strip { height: auto; padding-left: 0; margin-left: 0; justify-content: flex-end; }
  .nav-strip::before, .nav-strip::after { display: none; }

  /* The desktop menu rail unwinds into a plain full-screen drawer */
  .nav {
    position: fixed;
    inset: var(--k-header-h) 0 0 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border: none;
    border-radius: 0;
    padding: 20px var(--k-gutter) 40px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.35s var(--k-ease);
    box-shadow: none;
  }
  body.nav-open .nav { transform: translateX(0); }
  body.nav-open { overflow: hidden; }

  .nav__item { border-bottom: 1px solid var(--k-line); }
  .nav__link { color: var(--k-slate-800) !important; background: none !important; box-shadow: none !important; padding: 18px 4px; font-size: 1.08rem; justify-content: space-between; width: 100%; border-radius: 0; }
  .nav__link::after { display: none; }
  /* Bigger, fully opaque caret — at drawer scale the 13px desktop one reads
     as a smudge at the far right edge */
  .nav__link svg.caret { width: 20px; height: 20px; opacity: 1; color: var(--k-blue-600); }
  .mega::after { display: none; }
  .mega { background: none; }
  .site-header.is-scrolled { height: var(--k-header-h); }

  /* Mega menu becomes an inline expandable panel */
  .mega {
    position: static;
    transform: none;
    width: 100%;
    box-shadow: none;
    border: none;
    border-radius: 0;
    /* no padding while collapsed: with border-box, padding survives
       max-height:0 and leaves a phantom gap under every dropdown item */
    padding: 0;
    opacity: 1;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s var(--k-ease), visibility 0.35s;
  }
  .nav__item.is-open .mega { visibility: visible; max-height: 1400px; padding-bottom: 16px; transform: none; }
  .mega__grid { gap: 8px; }
  .mega__cols { grid-template-columns: 1fr; }
  .mega__feature { display: none; }

  .header-actions .btn { display: none; }
  .nav .btn.header-cta-mobile { display: inline-flex; justify-content: center; margin-top: 26px; }

  /* Header always solid once mobile (readability of hamburger) */
  .site-header--transparent.is-scrolled .brand__name { color: var(--k-ink); }
}

/* ---- Tablet portrait ---------------------------------------------------- */
@media (max-width: 768px) {
  body { font-size: 16px; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  /* Flow rows stack on narrow screens. Two things have to change with the
     direction, and missing them is what pushed a card off the side of the
     screen on a phone:

     1. flex-wrap must become nowrap. In a COLUMN container, "wrap" does not
        wrap text onto new lines - it spills items into a SECOND COLUMN,
        sideways. That is how "Measurable Business Outcomes" ended up beyond
        the right edge, 158px past its row.
     2. flex-basis has to be neutralised. In a column, basis is the HEIGHT,
        not the width, so `flex: 1 1 160px` from components.css made every
        card exactly 160px tall with dead space under the text, and the
        inline `flex-basis:48%` on the home hero became a height too.
        `flex: 0 0 auto` lets each card size to its own content.

     The !important is needed only because those basis values are inline
     attributes on the home hero, written for the desktop row layout. */
  .flow__row { flex-direction: column; flex-wrap: nowrap; }
  .flow__row > * { flex: 0 0 auto !important; }
  .logo-row { gap: 22px 32px; }
  .cta-band .cta-inner { padding: 36px 24px; }
}

/* ---- Phone -------------------------------------------------------------- */
@media (max-width: 560px) {
  :root { --k-header-h: 66px; }
  .grid-4 { grid-template-columns: 1fr; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { width: 100%; }
  .brand__tag { display: none; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  h1 { font-size: clamp(2rem, 8vw, 2.6rem); }
  .stat { text-align: center; }
  .stat__num { display: inline-block; }
}

/* ---- Very small --------------------------------------------------------- */
@media (max-width: 375px) {
  :root { --k-gutter: 18px; }
}
