/**
 * Layout shift reduction (CLS): reserved space, flex safety, media shells.
 * Loaded after theme + lead-cta.
 */

html {
    scroll-padding-top: 76px;
}

/* Sticky header: predictable bar + logo slot */
.header .nav-content {
    min-height: 70px;
    align-items: center;
}

/* Desktop: main nav grows; menu items centered in that region; language stays right */
.header .nav-content #desktop-nav {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.header .logo a {
    display: flex;
    align-items: center;
    line-height: 0;
}

.header .logo img {
    width: auto;
    height: 50px;
    max-width: min(240px, 55vw);
    object-fit: contain;
}

/* Menu icons: stable tap targets (hamburger only on small screens — see media query) */
.close-menu {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle {
    min-width: 44px;
    min-height: 44px;
}

@media (max-width: 768px) {
    .header .nav-content #desktop-nav {
        display: none !important;
    }

    .menu-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
}

.mobile-nav-links ul {
    overflow-y: scroll;
}

.menu-toggle i,
.close-menu i {
    display: inline-block;
    min-width: 1.15em;
    text-align: center;
}

/* Flex children: avoid width overflow jumps */
.detail-layout .gallery-column,
.detail-layout .specs-column {
    min-width: 0;
}

/* Gallery case study: fixed media stage so image/video swap does not resize column */
figure.main-suit-image.mwc-gallery-main-wrap {
    margin: 0 0 20px;
    overflow: hidden;
}

.mwc-gallery-stage {
    width: 100%;
    min-height: 260px;
    height: clamp(260px, 52vw, 550px);
    max-height: 550px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
}

.mwc-gallery-stage #main-suit-image,
.mwc-gallery-stage #main-suit-video {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 550px;
    margin: 0 auto;
    object-fit: contain;
}

.mwc-gallery-stage #main-suit-image {
    width: auto;
}

/* Thumbnail strip: reserve row height */
.image-thumbnails {
    min-height: 84px;
    align-items: center;
}

/* Price estimator: bottom padding before JS measures fixed bar (removes large CLS) */
body.mwc-page-price-estimator {
    padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 600px) {
    body.mwc-page-price-estimator {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }
}

/* CTA rows: reduce wrap jump */
.mwc-cta-row {
    min-height: 48px;
    align-items: center;
}

.mwc-hero-cta-row {
    min-height: 48px;
    align-items: center;
}

/* Map placeholder on home: already has height in theme; enforce min for late Leaflet init */
#map.map-placeholder {
    min-height: 380px;
}

/* Hero copy block: less jump when headings/webfonts settle */
@media (max-width: 768px) {
    .hero .hero-text {
        min-height: 12.5rem;
    }
}

.article-featured-image img {
    vertical-align: middle;
    background-color: var(--color-card-bg);
}

/* Reduce font metric swap jitter (webfonts still swap, but synthesis off) */
html {
    font-synthesis: none;
}

/* Language switcher (locale) */
.mwc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mwc-lang-switcher {
    display: flex;
    align-items: center;
}

.mwc-lang-select {
    background: var(--color-card-bg);
    color: var(--color-text);
    border: 1px solid var(--color-secondary);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.88rem;
    cursor: pointer;
    min-width: 8rem;
    max-width: min(17rem, 42vw);
}

.nav-content .nav-lang {
    margin-left: auto;
    margin-right: 0;
    padding-left: 12px;
    flex-shrink: 0;
}

.mwc-lang-switcher-mobile {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--color-light-bg);
    justify-content: center;
}

@media (max-width: 768px) {
    .nav-content .nav-lang {
        display: none;
    }
}

/* Card images: stable box while decoding (keeps theme heights from style.min.css) */
.portfolio-showcase .suit-card img,
.suit-grid .suit-card img {
    width: 100%;
    object-fit: cover;
    background-color: var(--color-card-bg);
}

.blog-archive-grid .blog-card .blog-thumbnail,
.blog-section .blog-card .blog-thumbnail {
    object-fit: cover;
    background-color: var(--color-card-bg);
}

/* Process page: keep step images responsive */
.step-title img {
    max-width: 100%;
    height: auto;
}
@media (max-width: 600px) { 
    .suit-card {
        margin-left: auto;
        margin-right: auto;
    }
}