/**
 * Hubliq — last-mile mobile / touch polish (loads after inline head styles in base.html).
 * Safe areas, 44px tap targets, iOS 16px form text (prevents focus zoom), reduced motion.
 */

/* Faster taps; avoid double-tap zoom delay on controls (does not block pinch-zoom) */
a[href],
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
label[for],
select,
summary {
    touch-action: manipulation;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }
}

/* Notched devices: bottom nav sits in home indicator; horizontal insets on landscape */
@media (max-width: 1441px) {
    .mobile-bottom-nav {
        padding-left: max(0px, env(safe-area-inset-left, 0px)) !important;
        padding-right: max(0px, env(safe-area-inset-right, 0px)) !important;
        padding-bottom: max(6px, env(safe-area-inset-bottom, 0px)) !important;
    }

    .mobile-bottom-nav .mobile-nav-item {
        min-height: 44px !important;
        box-sizing: border-box !important;
        justify-content: center !important;
    }
}

/*
 * iOS Safari zooms focused fields when computed font-size < 16px.
 * Inline base styles clamp body/input below 16px on narrow viewports — override for real controls.
 */
@media (max-width: 1200px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="file"]),
    .form-control,
    .form-select,
    [contenteditable="true"],
    select,
    textarea {
        font-size: max(16px, 1rem) !important;
        line-height: 1.35 !important;
    }
}

@supports (height: 100dvh) {
    @media (max-width: 768px) {
        .modal-dialog {
            max-height: calc(100dvh - 96px) !important;
        }
    }
}

/* Phone landscape: short viewport — extra clearance above bottom nav; nav spans full width without 100vw gap */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 1439px) {
    .mobile-bottom-nav,
    .mobile-bottom-nav[style] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        left: 0 !important;
        right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #paneDiscover {
        padding-bottom: calc(var(--mobile-bottom-nav-panel, 72px) + env(safe-area-inset-bottom, 0px) + 40px) !important;
    }

    .hubliq-detail-doc-layout {
        padding-bottom: calc(var(--mobile-bottom-nav-panel, 72px) + env(safe-area-inset-bottom, 0px) + 28px) !important;
    }

    .hubliq-detail-doc-layout .hubliq-detail-scroll-body {
        padding-bottom: calc(var(--mobile-bottom-nav-panel, 88px) + env(safe-area-inset-bottom, 0px) + 72px) !important;
    }

    .mobile-home-page-2026 .pane:not(#paneBookings),
    .discovery-page .mobile-home-page-2026 main {
        scroll-padding-bottom: calc(var(--mobile-bottom-nav-panel, 72px) + 24px) !important;
    }
}
