/**
 * Safari / WebKit fixes (iOS & desktop): viewport height, notches, overflow quirks.
 * Load after site-typography.css and type-exclude.css.
 */

/* Prevent iOS from inflating small text on orientation change */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* iOS: match document height to the visible viewport (pairs with viewport-fit=cover) */
@supports (-webkit-touch-callout: none) {
    html {
        height: -webkit-fill-available;
    }
    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
}

/* Full-viewport hero: iOS 100vh can exceed visible area — prefer svh when supported */
.hero-slider {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    height: 100vh;
}

@supports (height: 100svh) {
    .hero-slider {
        min-height: 100svh;
        height: 100svh;
    }
}

/* Keep short-landscape / small-height hero behavior (keyboard, iPhone landscape) */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-slider {
        min-height: 500px;
        height: auto;
    }
}

/* Inner slides rely on parent height; keep stacking context stable during fades */
.hero-slider .slide {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Media never overflows flex/grid ancestors (common Safari horizontal scroll cause) */
img,
video {
    max-width: 100%;
    height: auto;
}

/* Fixed header: respect safe area on notched iPhones (requires viewport-fit=cover) */
.header {
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

/* Main content clears fixed header + status bar / notch */
.page-content {
    padding-top: calc(180px + env(safe-area-inset-top, 0px));
}

@media (max-width: 768px) {
    .page-content {
        padding-top: calc(100px + env(safe-area-inset-top, 0px));
    }
}

/* Mobile nav drawer: full visible height on iOS */
@media (max-width: 768px) {
    .nav-links {
        min-height: 100vh;
        min-height: 100svh;
        min-height: -webkit-fill-available;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-sizing: border-box;
    }
}

/* Flex/grid children can shrink instead of forcing overflow (Safari + long words) */
.split-wrap,
.nav-links,
.leadership-grid,
.csr-grid,
.projects-grid,
.biz-main-block,
.fleet-grid,
.capabilities-grid,
.biz-two-col,
.biz-collage-wrap,
.biz-col-left,
.contact-map,
.collage-photo {
    min-width: 0;
}
