/* Katha Fuentes — shared responsive and touch experience
   Loaded after each page's local styles so it can safely normalize every page. */

:root {
  --kh-mobile-nav-height: 72px;
  --kh-mobile-gutter: 20px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a, button, input, select, textarea {
  -webkit-tap-highlight-color: transparent;
}

button, a {
  touch-action: manipulation;
}

/* Mobile navigation is added to the home and Real Estate pages and already
   exists on the remaining pages. It stays hidden until the mobile breakpoint. */
.mob-bottom-nav {
  display: none;
}

@media (max-width: 900px) {
  body {
    padding-bottom: calc(var(--kh-mobile-nav-height) + env(safe-area-inset-bottom));
  }

  /* Compact top bar; navigation moves to the bottom app-style tab bar. */
  .nav {
    height: 58px !important;
    padding: 0 var(--kh-mobile-gutter) !important;
    gap: 12px;
  }

  .nav-logo {
    font-size: 22px !important;
    min-width: 0;
    white-space: nowrap;
  }

  .nav-logo svg {
    width: 40px !important;
    height: 22px !important;
    margin-right: 6px !important;
  }

  .nav-links,
  .nav-cta,
  .nav-r .nav-cta {
    display: none !important;
  }

  .nav-r {
    margin-left: auto;
    flex: 0 0 auto;
  }

  .lang-sw button {
    min-height: 34px;
    min-width: 42px;
    padding: 7px 10px !important;
    cursor: pointer !important;
  }

  .mob-bottom-nav {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    position: fixed;
    z-index: 2000;
    inset: auto 0 0;
    min-height: var(--kh-mobile-nav-height);
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid rgba(26, 43, 74, 0.10);
    box-shadow: 0 -10px 28px rgba(26, 43, 74, 0.10);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .mob-bottom-nav .mbn-tab {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    min-width: 0;
    padding: 5px 2px;
    border-radius: 12px;
    color: var(--MID, #6b7a9a);
    text-decoration: none;
    font-family: var(--FB, Arial, sans-serif);
    cursor: pointer !important;
  }

  .mob-bottom-nav .mbn-ic {
    display: block;
    font-size: 17px;
    line-height: 1;
    transition: transform .2s ease;
  }

  .mob-bottom-nav .mbn-lbl {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 8px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .035em;
    text-align: center;
    white-space: nowrap;
  }

  .mob-bottom-nav .mbn-tab.active {
    color: var(--P, #7b8fd4);
    background: var(--PBG, #f0f3fd);
  }

  .mob-bottom-nav .mbn-tab.active .mbn-ic {
    transform: translateY(-1px);
  }

  /* Base grid and spacing normalization. */
  .hero,
  .who,
  .pillars-grid,
  .re-grid,
  .re-actions,
  .coaching-body,
  .homeschool,
  .proof,
  .contact,
  .ft-grid,
  .hero-bottom-row,
  .hero-stats,
  .stats-band,
  .mkt-grid,
  .process-grid,
  .lead-grid,
  .coach-hero-inner,
  .programs-grid,
  .guides-grid,
  .hs-hero,
  .hs-pillars,
  .hs-life-grid,
  .contact-main,
  .topic-grid,
  .ff-row,
  .pw-grid,
  .faq-inner,
  .approach-steps,
  .curr-grid,
  .balance,
  .curriculum,
  .for-moms,
  .fm-cards,
  .connect,
  .guide-grid,
  .properties-grid {
    grid-template-columns: 1fr !important;
  }

  .hero {
    min-height: auto !important;
    margin-top: 58px !important;
  }

  .hero-l,
  .hero-content,
  .hero-text,
  .main-left,
  .contact-l,
  .contact-r,
  .who-side,
  .who-main,
  .who-qpanel,
  .cl,
  .cr,
  .hs-l,
  .hs-r,
  .re-mkt,
  .re-act,
  .coaching-top,
  .approach,
  .guides,
  .curriculum,
  .for-moms,
  .balance-left,
  .balance-right,
  .connect,
  .faq-left,
  .faq-list,
  .main-right {
    padding-left: var(--kh-mobile-gutter) !important;
    padding-right: var(--kh-mobile-gutter) !important;
  }

  .hero-l,
  .hero-content,
  .hero-text,
  .main-left,
  .contact-l,
  .contact-r {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
    border-left: 0 !important;
    border-right: 0 !important;
  }

  /* The contact page uses a dedicated two-column hero, so make it explicitly block-level on phones. */
  body .hero-text,
  body .hero-contacts {
    width: 100% !important;
    max-width: none !important;
  }

  body .hero:has(.hero-contacts) {
    display: block !important;
  }

  body .hero:has(.hero-contacts) .hero-text,
  body .hero:has(.hero-contacts) .hero-contacts {
    padding-left: var(--kh-mobile-gutter) !important;
    padding-right: var(--kh-mobile-gutter) !important;
    padding-bottom: 30px !important;
  }

  body .hero:has(.hero-contacts) .hero-strip {
    display: flex !important;
    grid-column: auto !important;
    width: auto !important;
    margin: 0 !important;
    padding: 14px var(--kh-mobile-gutter) !important;
    flex-wrap: wrap;
    gap: 8px;
  }

  .hero-r {
    min-height: 320px !important;
  }

  .hero-photo {
    min-height: 320px;
    object-fit: cover;
    object-position: center top;
  }

  .hero-cards {
    top: 16px !important;
    left: 12px !important;
  }

  .hcard {
    padding: 8px 11px !important;
  }

  .hcard-n {
    font-size: 20px !important;
  }

  .hero-tf-strip,
  .hero-strip,
  .hero-cta-bar {
    padding: 14px var(--kh-mobile-gutter) !important;
  }

  .htfs-mkts,
  .hero-pills .h-pill:nth-child(n+3) {
    display: none;
  }

  .hero-foot,
  .hero-btns,
  .who-btns,
  .hero-ctas,
  .hcb-r {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px !important;
  }

  .hero-foot {
    align-items: stretch !important;
  }

  .hero-btns > *,
  .who-btns > *,
  .hero-ctas > * {
    flex: 1 1 190px;
    min-height: 46px;
  }

  /* Homepage and page hero actions need a dependable vertical, thumb-friendly layout. */
  .hero-btns {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100%;
  }

  .hero-btns > * {
    width: 100% !important;
    min-height: 48px !important;
    height: auto !important;
    padding: 13px 20px !important;
    border-radius: 999px !important;
    flex: none !important;
  }

  .h1-primary,
  .hero-h1,
  .hero-h {
    font-size: clamp(32px, 10vw, 50px) !important;
    line-height: 1.02 !important;
  }

  .h1-secondary,
  .hero-sub,
  .hero-manifesto,
  .hero-desc,
  .hero-desc-block {
    font-size: 15px !important;
    line-height: 1.6 !important;
  }

  .h1-tagline {
    font-size: clamp(45px, 14vw, 68px) !important;
    line-height: .96 !important;
  }

  .pillars-head,
  .app-header,
  .curr-header,
  .fm-header,
  .ph-header,
  .gs-header {
    padding: 30px var(--kh-mobile-gutter) 24px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
  }

  .ph-h,
  .pillars-head h2 {
    text-align: left !important;
  }

  .pc,
  .app-step,
  .curr-card,
  .fm-card,
  .guide-card,
  .pw-card,
  .faq-item {
    padding: 24px 20px !important;
    border-right: 0 !important;
  }

  .who-side,
  .who-main,
  .who-qpanel,
  .re-mkt,
  .re-act,
  .coaching-top,
  .cl,
  .cr,
  .hs-l,
  .hs-r,
  .contact-l,
  .contact-r,
  .main-left,
  .main-right,
  .faq-left,
  .faq-list,
  .balance-left,
  .balance-right {
    border-left: 0 !important;
    border-right: 0 !important;
  }

  .wqp-photo {
    aspect-ratio: 16 / 9 !important;
  }

  .re-top {
    padding: 14px var(--kh-mobile-gutter) !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .re-mkt,
  .re-act {
    padding-top: 30px !important;
    padding-bottom: 28px !important;
  }

  .re-city {
    font-size: clamp(48px, 16vw, 66px) !important;
  }

  .re-act {
    min-height: 96px;
  }

  .wl-form,
  .newsletter-form,
  .ml-signup-section form {
    flex-direction: column !important;
    border-radius: 10px !important;
    overflow: visible !important;
  }

  .wl-in,
  .wl-sub,
  .newsletter-form input,
  .newsletter-form button,
  .ml-signup-section input,
  .ml-signup-section button {
    width: 100% !important;
    border-radius: 8px !important;
    min-height: 46px;
  }

  .guide-row {
    grid-template-columns: 1fr auto !important;
    gap: 8px !important;
  }

  .guide-row .g-price {
    grid-column: 2;
    grid-row: 1;
  }

  .guide-row .g-get {
    grid-column: 1 / -1;
    grid-row: 2;
    opacity: 1 !important;
    justify-self: start;
  }

  .stats-band,
  .proof,
  .curr-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .pb-item,
  .stats-band > *,
  .curr-grid > * {
    padding: 22px 16px !important;
    border-right: 1px solid rgba(255,255,255,.08) !important;
  }

  .testi,
  .testimonial,
  .final-cta,
  .cta-final {
    padding: 56px var(--kh-mobile-gutter) !important;
  }

  footer {
    padding: 42px var(--kh-mobile-gutter) calc(28px + env(safe-area-inset-bottom)) !important;
  }

  .ft-grid {
    gap: 26px !important;
  }

  .ft-col {
    min-width: 0;
  }

  .ft-bot {
    flex-direction: column;
    gap: 8px;
    line-height: 1.55;
  }

  input,
  select,
  textarea,
  .ff input,
  .ff select,
  .ff textarea {
    min-height: 46px;
    font-size: 16px !important; /* prevents iOS focus zoom */
  }

  textarea,
  .ff textarea {
    min-height: 110px;
  }

  .frm-2,
  .lf-2 {
    grid-template-columns: 1fr !important;
  }

  .form-sub,
  .frm-sub,
  .ff-sub,
  .fc-form-sub {
    min-height: 48px;
    cursor: pointer !important;
  }
}

@media (max-width: 480px) {
  :root {
    --kh-mobile-gutter: 16px;
  }

  .mob-bottom-nav {
    min-height: 68px;
    padding-left: 3px;
    padding-right: 3px;
  }

  .mob-bottom-nav .mbn-lbl {
    font-size: 7px;
    letter-spacing: 0;
  }

  .mob-bottom-nav .mbn-ic {
    font-size: 16px;
  }

  .nav-logo {
    font-size: 19px !important;
  }

  .nav-logo svg {
    width: 34px !important;
  }

  .hero-r,
  .hero-photo {
    min-height: 270px !important;
  }

  .hero-cards {
    transform: scale(.92);
    transform-origin: top left;
  }

  .hero-tf-strip {
    gap: 8px;
  }

  .htfs-name {
    font-size: 10px !important;
  }

  .htfs-sub {
    display: none;
  }

  .stats-band,
  .proof {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (hover: hover) {
  a:hover, button:hover {
    cursor: pointer;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
