/* Legacy iPad / Safari compatibility layer. Activated only by legacy-ipad.js. */
html.legacy-ipad{-webkit-text-size-adjust:100%;text-size-adjust:100%;}
html.legacy-ipad,html.legacy-ipad body{overflow-x:hidden;}
html.legacy-ipad body{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;}

/* Avoid effects that are costly or unsupported on iOS 12 Safari. */
html.legacy-ipad body>nav.fixed,
html.legacy-ipad .site-shell-nav,
html.legacy-ipad main [class*="rounded-xl"],
html.legacy-ipad main [class*="rounded-2xl"],
html.legacy-ipad .ask-context-card,
html.legacy-ipad .live-secondary-btn{-webkit-backdrop-filter:none!important;backdrop-filter:none!important;}
html.legacy-ipad .v2-reveal,
html.legacy-ipad .fade-in{opacity:1!important;transform:none!important;transition:none!important;}
html.legacy-ipad *{scroll-behavior:auto!important;}

/* Universal header: keep it compact on the 768x1024 / 1024x768 Mini 2 viewport. */
html.legacy-ipad .universal-site-header .shell-inner,
html.legacy-ipad .site-shell-nav .shell-inner{width:calc(100% - 28px)!important;min-height:72px!important;display:flex!important;align-items:center!important;}
html.legacy-ipad .universal-site-header .shell-links,
html.legacy-ipad .site-shell-nav .shell-links{display:none!important;}
html.legacy-ipad .universal-site-header .shell-toggle,
html.legacy-ipad .site-shell-nav .shell-toggle{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:44px!important;height:44px!important;flex:0 0 44px!important;}
html.legacy-ipad .universal-site-header .global-lang-toggle,
html.legacy-ipad .site-shell-nav .global-lang-toggle{min-width:68px!important;min-height:44px!important;}
html.legacy-ipad .universal-site-header .shell-brand,
html.legacy-ipad .site-shell-nav .shell-brand{min-width:0!important;max-width:calc(100% - 132px)!important;}
html.legacy-ipad .universal-site-header .shell-brand strong,
html.legacy-ipad .site-shell-nav .shell-brand strong{font-size:16px!important;line-height:1.08!important;white-space:normal!important;}
html.legacy-ipad .universal-site-header .shell-brand span,
html.legacy-ipad .site-shell-nav .shell-brand span{font-size:11px!important;}
html.legacy-ipad .site-shell-nav .shell-mobile{padding:0 14px 14px!important;}
html.legacy-ipad .site-shell-nav.is-open .shell-mobile{display:block!important;}
html.legacy-ipad .site-shell-nav .shell-mobile a{display:block!important;margin-top:5px!important;min-height:44px!important;line-height:24px!important;}

/* Home hero: explicit sizes instead of clamp(), and a JPEG fallback for pre-WebP Safari. */
html.legacy-ipad #home.church-home-hero{min-height:0!important;padding-top:0!important;}
html.legacy-ipad .church-home-hero-inner{display:flex!important;flex-wrap:wrap!important;width:calc(100% - 32px)!important;max-width:1120px!important;margin:0 auto!important;padding:52px 0 58px!important;}
html.legacy-ipad .church-home-copy{width:52%!important;padding-right:24px!important;box-sizing:border-box!important;}
html.legacy-ipad .church-home-visual{width:48%!important;box-sizing:border-box!important;}
html.legacy-ipad .church-home-copy h2{font-size:64px!important;line-height:.86!important;}
html.legacy-ipad .church-home-copy p{font-size:17px!important;line-height:1.6!important;}
html.legacy-ipad .church-home-actions{display:block!important;margin-top:24px!important;}
html.legacy-ipad .church-home-actions .church-btn{display:inline-flex!important;margin:0 8px 10px 0!important;min-height:46px!important;}
html.legacy-ipad .church-home-stats{display:flex!important;flex-wrap:wrap!important;margin-top:22px!important;}
html.legacy-ipad .church-home-stats>div{margin:0 20px 10px 0!important;}
html.legacy-ipad .church-home-frame{min-height:420px!important;background-image:url('/images/church-hero.jpg')!important;background-position:58% center!important;background-size:cover!important;transform:none!important;}
html.legacy-ipad .church-home-frame img{display:none!important;}
html.legacy-ipad .church-home-note{left:12px!important;right:12px!important;bottom:14px!important;width:auto!important;}

/* Common tablet layout fallbacks when flex gap/grid gap support is incomplete. */
html.legacy-ipad .site-shell-footer .shell-footer-grid{display:flex!important;flex-wrap:wrap!important;margin:0 -12px!important;}
html.legacy-ipad .site-shell-footer .shell-footer-grid>div{width:33.333%!important;padding:0 12px!important;box-sizing:border-box!important;}
html.legacy-ipad main img{max-width:100%;height:auto;}
html.legacy-ipad iframe,html.legacy-ipad video{max-width:100%!important;}
html.legacy-ipad audio{max-width:100%!important;width:100%!important;}
html.legacy-ipad input,html.legacy-ipad select,html.legacy-ipad textarea{font-size:16px!important;}
html.legacy-ipad a,html.legacy-ipad button{touch-action:manipulation;}
html.legacy-ipad .sermon-audio{height:44px!important;}

/* Portrait Mini 2: stack the hero and key footer columns cleanly. */
@media(max-width:850px){
  html.legacy-ipad .church-home-copy,html.legacy-ipad .church-home-visual{width:100%!important;padding-right:0!important;}
  html.legacy-ipad .church-home-copy{margin-bottom:30px!important;}
  html.legacy-ipad .church-home-copy h2{font-size:58px!important;}
  html.legacy-ipad .church-home-frame{min-height:360px!important;}
  html.legacy-ipad .site-shell-footer .shell-footer-grid>div{width:100%!important;margin-bottom:24px!important;}
}

/* Very narrow old iPads / zoomed views. */
@media(max-width:700px){
  html.legacy-ipad .universal-site-header .shell-brand strong,html.legacy-ipad .site-shell-nav .shell-brand strong{font-size:14px!important;}
  html.legacy-ipad .church-home-hero-inner{padding-top:38px!important;}
  html.legacy-ipad .church-home-copy h2{font-size:48px!important;}
  html.legacy-ipad .church-home-copy p{font-size:16px!important;}
}
