/**
 * WordPress Compatibility Fixes
 * Fixes conflicts between WordPress default styles and Ulina theme.
 *
 * @package Ulina_Theme
 */

/* =============================================
   1. WordPress Admin Bar Fix
   ============================================= */

/* When admin bar is visible, offset the sticky header */
body.admin-bar .header01 {
    top: 32px;
}

body.admin-bar .header01.fixedHeader {
    top: 32px;
}

/* Search popup position fix with admin bar */
body.admin-bar .popup_search_sec {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .header01,
    body.admin-bar .header01.fixedHeader {
        top: 46px;
    }
    body.admin-bar .popup_search_sec {
        top: 46px;
    }
}

@media screen and (max-width: 600px) {
    body.admin-bar .header01.fixedHeader {
        top: 0;
    }
}

/* =============================================
   2. WordPress Default Style Resets
   ============================================= */

/* Remove WordPress default margins on images */
.entry-content img,
.wp-block-image img {
    max-width: 100%;
    height: auto;
}

/* WordPress gallery compatibility */
.gallery {
    margin: 0 -10px;
}

.gallery-item {
    padding: 0 10px;
    margin-bottom: 20px;
}

/* WordPress captions */
.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 14px;
    color: #7f8495;
    padding: 8px 0;
}

/* =============================================
   3. WordPress Block Editor Compatibility
   ============================================= */

/* Align wide and full support */
.alignwide {
    margin-left: -50px;
    margin-right: -50px;
    max-width: calc(100% + 100px);
}

.alignfull {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
}

/* =============================================
   4. WordPress Navigation / Menu Fixes
   ============================================= */

/* Fix WordPress menu list styles */
.mainMenu ul,
.mainMenu ul ul,
.mainMenu ul ul ul {
    list-style: none;
    padding: 0;
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footerNav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* WordPress menu item classes compatibility */
.mainMenu ul li.current-menu-item > a,
.mainMenu ul li.current-menu-ancestor > a,
.mainMenu ul li.current_page_item > a {
    color: #7b9496;
}

/* =============================================
   5. WooCommerce Style Fixes
   ============================================= */

/* Override WooCommerce default button styles */
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
    font-family: 'Jost', sans-serif;
    border-radius: 48px;
    background: #9ebbbd;
    color: #fff;
    border: none;
    padding: 10px 25px;
    font-weight: 500;
    text-transform: uppercase;
}

.woocommerce #respond input#submit:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
    background: #52586d;
    color: #fff;
}

/* WooCommerce messages/notices */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    border-top-color: #9ebbbd;
}

.woocommerce-message::before {
    color: #9ebbbd;
}

/* Star ratings WooCommerce override */
.woocommerce .star-rating {
    color: #ffc107;
}

/* WooCommerce product price override */
.woocommerce div.product p.price,
.woocommerce div.product span.price {
    color: #52586d;
}

/* =============================================
   6. Misc Fixes
   ============================================= */

/* Fix for WordPress adding unwanted body margins */
body {
    margin: 0 !important;
    padding: 0;
}

/* Ensure no horizontal overflow */
html {
    overflow-x: hidden;
}

/* Fix WordPress image alignment */
.alignleft {
    float: left;
    margin: 0 20px 20px 0;
}

.alignright {
    float: right;
    margin: 0 0 20px 20px;
}

.aligncenter {
    display: block;
    margin: 0 auto 20px;
}

/* WordPress pagination compatibility with Ulina styles */
.navigation.pagination .nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.navigation.pagination .page-numbers {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border: 1px solid #e1e1e1;
    border-radius: 50%;
    font-family: 'Jost', sans-serif;
    font-size: 16px;
    color: #52586d;
    transition: all ease 350ms;
}

.navigation.pagination .page-numbers:hover,
.navigation.pagination .page-numbers.current {
    background: #9ebbbd;
    border-color: #9ebbbd;
    color: #fff;
}

/* Screen reader text (WordPress accessibility) */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

/* =============================================
   7. Custom Logo WordPress Compatibility
   ============================================= */

.custom-logo-link {
    display: inline-block;
}

.custom-logo-link img {
    max-height: 50px;
    width: auto;
}
