/* Automatically apply theme fonts to standard blog posts */
.single-post p, 
.type-post p {
    font-family: 'Rubik', sans-serif !important;
    font-size: 18px !important;
    line-height: 1.6 !important;
}

.single-post h1, .single-post h2, .single-post h3, .single-post h4,
.type-post h1, .type-post h2, .type-post h3, .type-post h4 {
    font-family: 'Playfair Display', Georgia, serif !important;
}

/* --- CRITICAL DESKTOP CLS ANCHOR --- */
@media (min-width: 1101px) {
    /* Freeze the master header container box so it can never expand or collapse dynamically */
    header#header {
        height: 90px !important; 
        min-height: 70px !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure the inner content stays perfectly aligned inside our fixed bounding box */
    header#header .wrapper {
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important; /* Blocks layout items from wrapping or falling down */
    }

    header#header .navTabs {
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
    }
}

/* --- FIX MAIN-THREAD LAYOUT THRASHING --- */
.productsGallery img, 
.mediablogImg img, 
.moreOptionBox img {
    transition: opacity 0.2s ease-in-out !important;
    will-change: opacity !important;
}

/* Prevent testimonial headshots and utility icons from warping */
img[src*="headshot"],
img[src*="thumb"],
.articleImg img,
.logoMenuHolder img,
.wheretobuyContent img {
    object-fit: cover !important;
    aspect-ratio: 1 / 1 !important;
}

/* Ensure the horizontal buy/retailer icons preserve their shapes */
img[src*="icon1"], img[src*="icon2"], img[src*="icon3"] {
    object-fit: contain !important;
    aspect-ratio: auto !important;
}

/* --- FLUID DESKTOP LINK COMPRESSION: PREVENTS SCREEN CUTOFF --- */
@media (min-width: 1101px) {
    /* Remove rigid width calculations from the menu list wrapper */
    header#header .wrapper .navTabs ul.menuHolder {
        display: inline-flex !important;
        align-items: center !important;
        min-width: auto !important; 
        width: auto !important;
        visibility: visible !important;
        gap: 14px !important; /* Clean horizontal spacing between text elements */
    }

    header#header .navTabs ul.menuHolder > li {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Dynamically optimize font sizing and padding for laptop views */
    header#header .navTabs ul.menuHolder > li > a {
        font-size: 15px !important; /* Slightly optimized text print layer footprint */
        padding-left: 2px !important;
        padding-right: 2px !important;
        letter-spacing: 0.5px !important;
    }
}

/* --- DESKTOP SEARCH WINDOW STYLING METRICS --- */
.navSearchDiv {
    z-index: 10000 !important; 
    flex-shrink: 0 !important; /* Absolute rule: blocks container from being squished or clipped */
    display: inline-flex !important;
    align-items: center !important;
}

#searchDropdownProducts.dropdown {
    background: #0b051a !important; /* Solid background matching brand theme */
    z-index: 10001 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

input#searchProducts.dropdownSearch {
    background: transparent !important;
    z-index: 10002 !important;
}

.navSearchDiv .closeDropdown {
    z-index: 10050 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* --- PREMIUM DESKTOP INLINE FLAGS VIEW --- */
@media (min-width: 1101px) {
    .header-weglot-wrapper {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-right: 18px !important; /* Spacing gap before the search icon container */
        height: auto !important;
        width: auto !important;
        overflow: visible !important;
        position: relative !important;
        z-index: 90 !important; /* Automatically slides beneath the search bar layer when clicked */
        flex-shrink: 0 !important; 
    }
    
    .header-weglot-wrapper aside,
    .header-weglot-wrapper aside.weglot-dropdown {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
    }
    
    .header-weglot-wrapper aside ul {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .header-weglot-wrapper .wgflag,
    .header-weglot-wrapper img.wgflag {
        display: block !important;
        width: 24px !important;
        height: 16px !important;
        object-fit: cover !important;
        border-radius: 2px !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4) !important;
        opacity: 0.65;
        transition: all 0.2s ease-in-out !important;
    }
    
    .header-weglot-wrapper ul li a:hover .wgflag,
    .header-weglot-wrapper ul li.wg-li-current .wgflag {
        opacity: 1 !important;
        transform: scale(1.08) !important;
    }
}

/* --- MOBILE & TABLET VIEW: RESILIENT FLOATING SIDEBAR CAPSULE --- */
@media (max-width: 1100px) {
    header#header .wrapper {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    
    .navSearchDiv {
        margin-right: 15px !important;
    }

    /* Fixed bottom corner capsule position rule for mobile devices */
    .header-weglot-wrapper {
        position: fixed !important;
        bottom: 30px !important;
        left: 20px !important;
        right: auto !important;
        top: auto !important;
        z-index: 999999 !important; 
        display: inline-flex !important;
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
    }

    .header-weglot-wrapper aside,
    .header-weglot-wrapper aside.weglot-dropdown {
        background: rgba(255, 255, 255, 0.08) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        border-radius: 30px !important; 
        padding: 6px 10px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        height: auto !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35) !important;
    }

    .header-weglot-wrapper aside ul {
        display: flex !important;
        flex-direction: row !important; 
        align-items: center !important;
        gap: 8px !important; 
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .header-weglot-wrapper aside ul li {
        display: inline-flex !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .header-weglot-wrapper .wgflag,
    .header-weglot-wrapper img.wgflag {
        display: block !important;
        visibility: visible !important;
        width: 21px !important;
        height: 14px !important;
        object-fit: cover !important;
        border-radius: 1px !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
        opacity: 0.6;
    }

    .header-weglot-wrapper ul li.wg-li-current .wgflag,
    .header-weglot-wrapper ul li a:active .wgflag {
        opacity: 1 !important;
    }
}

/* --- CLEANUP: HIDE FRAGMENTED TEXT STRINGS GLOBALLY --- */
.header-weglot-wrapper aside label,
.header-weglot-wrapper aside .wglangname,
.header-weglot-wrapper aside span:not(.wgflag),
.header-weglot-wrapper aside ul li a span:not(.wgflag) {
    display: none !important;
}
.header-weglot-wrapper aside ul li a {
    font-size: 0 !important;
    color: transparent !important;
    text-decoration: none !important;
}