/* =====================================================================
   Ohangwena EOI Investment Portal
   css/responsive.css — breakpoint overrides. Load LAST.

   Breakpoints: 1280 / 1024 / 900 / 768 / 640 / 480
   Mobile-first is applied to the forms and the submission journey; the
   editorial pages degrade gracefully from the desktop layout.
   ===================================================================== */

/* ------------------------------------------------------------------ */
/* <= 1280px — hero column balance                                     */
/* ------------------------------------------------------------------ */

@media (max-width: 1280px) {
  .grid--split { gap: var(--s6); }
}

/* ------------------------------------------------------------------ */
/* <= 1024px — primary nav collapses to the panel                      */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }

  .quickbar ul { grid-template-columns: repeat(3, 1fr); }
  .quickbar a { border-bottom: 1px solid rgb(255 255 255 / 0.15); }
}

/* ------------------------------------------------------------------ */
/* <= 900px — hero and split layouts go single column                  */
/* ------------------------------------------------------------------ */

@media (max-width: 900px) {
  .grid--split { grid-template-columns: 1fr; gap: var(--s7); }

  .hero { padding-block: var(--s8) var(--s7); }
  .hero h1 { max-width: 100%; }
  .hero__grid { grid-template-columns: 1fr; gap: var(--s7); }
  /* Text first: the circle is supporting imagery, not the message. */
  .hero__figure { order: 2; max-width: 420px; }

  .submit-split { grid-template-columns: 1fr; gap: var(--s7); }
  .submit-split__figure { order: 2; padding: var(--s5); }

  .notice-panel { max-width: 32rem; }
}

/* ------------------------------------------------------------------ */
/* <= 768px — section rhythm tightens                                  */
/* ------------------------------------------------------------------ */

@media (max-width: 768px) {
  :root { --header-h: 64px; }

  .section { padding-block: var(--s7); }
  .section--tight { padding-block: var(--s6); }
  .page-head { padding-block: var(--s7); }

  .wrap { padding-inline: var(--s4); }

  .quickbar ul { grid-template-columns: repeat(2, 1fr); }

  .brand__crest { width: 181px; height: 80px; }
  .brand__logo { height: 80px; }
  .brand__text strong { font-size: 0.86rem; }
  .brand__text span { font-size: 0.64rem; }

  .stats { gap: var(--s6); }

  .packgroup { margin-bottom: var(--s7); }
}

/* ------------------------------------------------------------------ */
/* <= 700px — the envelope bar stacks                                  */
/* Proportional widths stop being readable below this; the bar becomes  */
/* a legible list and every range stays visible.                       */
/* ------------------------------------------------------------------ */

@media (max-width: 700px) {
  .envelope__bar { height: auto; flex-direction: column; }
  .envelope__seg {
    flex-direction: row; align-items: baseline; justify-content: space-between;
    border-right: none; border-bottom: 1px solid rgb(255 255 255 / 0.35);
    min-height: 52px; width: 100%;
  }
  .envelope__seg:last-child { border-bottom: none; }
  /* Growth animation is meaningless once stacked */
  .envelope.is-visible .envelope__seg { animation: none; }

  .envelope__scale { flex-direction: column; gap: var(--s1); }
}

/* ------------------------------------------------------------------ */
/* <= 640px — stages, documents and forms restack                      */
/* ------------------------------------------------------------------ */

@media (max-width: 640px) {
  .stage { grid-template-columns: 1fr; gap: var(--s3); }
  .stage__n { font-size: var(--step-1); }
  .stage__meta { gap: var(--s1) var(--s4); }

  .doc { grid-template-columns: 40px 1fr; gap: var(--s3); }
  .doc > .btn { grid-column: 2; justify-self: start; margin-top: var(--s3); }

  .packgroup__head { gap: var(--s3); }

  .site-footer__base { flex-direction: column; gap: var(--s2); }

  .filelist li { grid-template-columns: 1fr auto; }
  .filelist__size { grid-column: 2; }

  .btn-row { flex-direction: column; align-items: stretch; }
  .btn-row .btn { width: 100%; }

  .form, .pathway .btn { max-width: 100%; }
  .pathway .btn { align-self: stretch; }

  .reference { font-size: var(--step-2); width: 100%; text-align: center; }
}

/* ------------------------------------------------------------------ */
/* <= 480px — smallest supported width                                 */
/* Verified at 320px with no horizontal scroll.                        */
/* ------------------------------------------------------------------ */

@media (max-width: 480px) {
  .quickbar ul { grid-template-columns: 1fr; }
  .quickbar a { padding: var(--s4); flex-direction: row; align-items: baseline; gap: var(--s3); }

  .grid--3, .grid--4 { grid-template-columns: 1fr; }

  .faq summary { padding-right: var(--s6); }
  .faq__a { padding-right: 0; }

  .callout { padding: var(--s4); }
  .card { padding: var(--s4); }
  .pathway { padding: var(--s5); }
  .dropzone { padding: var(--s5) var(--s4); }
}

/* ------------------------------------------------------------------ */
/* Landscape phones — reclaim vertical space                           */
/* ------------------------------------------------------------------ */

@media (max-height: 480px) and (orientation: landscape) {
  .hero { padding-block: var(--s6); }
  .hero__figure { max-width: 300px; }
  .page-head { padding-block: var(--s6); }
  .mobile-nav a { padding: var(--s3) 0; font-size: var(--step-0); }
}

/* ------------------------------------------------------------------ */
/* Safe areas — iOS notch and home indicator                           */
/* ------------------------------------------------------------------ */

@supports (padding: max(0px)) {
  .wrap {
    padding-left: max(var(--s5), env(safe-area-inset-left));
    padding-right: max(var(--s5), env(safe-area-inset-right));
  }
  .mobile-nav { padding-bottom: max(var(--s5), env(safe-area-inset-bottom)); }
}

/* ------------------------------------------------------------------ */
/* Coarse pointers — enlarge targets                                   */
/* ------------------------------------------------------------------ */

@media (pointer: coarse) {
  .nav a, .site-footer a { padding-block: var(--s2); }
  .faq summary { padding-block: var(--s5); }
}

/* ------------------------------------------------------------------ */
/* Wizard — mobile first is the priority here (brief §45)              */
/* ------------------------------------------------------------------ */

@media (max-width: 1099px) {
  .wizard__layout { grid-template-columns: 1fr; gap: var(--s5); }

  /* The full step list is too tall on a phone. Collapse to the bar plus
     a summary line; the nav list itself becomes a horizontal scroller. */
  .wizard__nav { position: static; padding: var(--s4); min-width: 0; max-width: 100%; }
  .wizard__nav ol {
    display: flex; gap: var(--s1); overflow-x: auto;
    -webkit-overflow-scrolling: touch; padding-bottom: var(--s2);
    /* Without an explicit basis the flex row sizes to its content and
       drags the parent wider than the screen. */
    min-width: 0; max-width: 100%; flex-wrap: nowrap;
  }
  .wizard__nav ol li { flex: 0 0 auto; }
  .wizard__nav-item {
    border-left: 0; border-bottom: 2px solid transparent;
    white-space: nowrap; padding: var(--s2);
  }
  .wizard__nav-item[aria-current='step'] {
    border-left: 0; border-bottom-color: var(--ohg-crest);
  }
  .wizard__nav-t { display: none; }
  .wizard__nav-item[aria-current='step'] .wizard__nav-t { display: inline; }
}

@media (max-width: 768px) {
  .wizard { padding-block: var(--s6); }
  .wizard__form { padding: var(--s5); }
}

@media (max-width: 640px) {
  .wizard__actions { flex-direction: column; }
  .wizard__actions .btn { width: 100%; }
  .wizard__actions [data-wizard-save] { margin-left: 0; }

  .repeat__item { padding: var(--s4); padding-top: var(--s7); }
  .repeat__remove { top: var(--s2); right: var(--s2); }

  .review__head { flex-direction: column; align-items: flex-start; gap: var(--s2); }
}

/* ------------------------------------------------------------------ */
/* Header at phone widths                                              */
/*                                                                     */
/* The lockup is 2.70:1, so its width is height x 2.7. At 320px the bar */
/* has 272px of usable space and the Menu button takes 88 of it, which  */
/* leaves about 160px for the logo — roughly 58px tall. These steps     */
/* keep the mark as large as actually fits.                            */
/* ------------------------------------------------------------------ */

@media (max-width: 560px) {
  .brand__crest { width: 181px; height: 80px; }
  .brand__logo { height: 80px; }
}

/* At 320px the bar has 272px of usable space and the Menu button takes
   about 76 of it. Crest 36 + gap 12 + wordmark 112 = 160, which fits with
   room to spare. The wordmark is kept rather than hidden — it is the only
   place the site name appears on screen. */
@media (max-width: 400px) {
  .site-header__bar { gap: var(--s3); }
  .brand { gap: var(--s2); }
  .brand__crest { width: 36px; height: 36px; }
  .brand__logo { height: 54px; }
  .brand__text strong { font-size: 0.78rem; white-space: nowrap; }
  .brand__text span { font-size: 0.58rem; white-space: nowrap; }
  .nav-toggle { padding: var(--s2); }
}
