:root {
    --bhc2-primary: #1e4f91;
    --bhc2-accent: #d97706;
    --bhc2-surface: #ffffff;
    --bhc2-page: #f4f6f9;
    --bhc2-text: #233047;
    --bhc2-border: rgba(25, 44, 75, .13);
    --bhc2-shadow: 0 18px 42px rgba(20, 36, 62, .10);
}

/* Native BlogHash Dark Mode: adapt child-created light surfaces to the parent dark palette. */
html[data-darkmode="dark"] {
    --bhc2-surface: #202020;
    --bhc2-page: #302d55;
    --bhc2-text: #ffffff;
    --bhc2-border: rgba(255, 255, 255, .14);
    --bhc2-shadow: 0 18px 42px rgba(0, 0, 0, .40);
}

html[data-darkmode="dark"] body { color: var(--bhc2-text); }
html[data-darkmode="dark"] .bhc2-preloader { background: var(--bhc2-surface); }

/* Page Layout: applies one width to BlogHash's existing site containers. */
.bhc2-layout-narrow #main .bloghash-container { max-width: 980px; }
.bhc2-layout-standard #main .bloghash-container { max-width: 1200px; }
.bhc2-layout-wide #main .bloghash-container { max-width: 1440px; }

/* Content Frame: decorates BlogHash's existing content container without changing #main geometry. */
.bhc2-frame-enabled { background: var(--bhc2-page); }
.bhc2-frame-enabled #main > .bloghash-container {
    box-sizing: border-box;
    max-width: var(--bhc2-frame-width, 1200px);
    margin: 32px auto;
    border: 1px solid var(--bhc2-border);
    border-radius: 12px;
    background: var(--bhc2-surface);
    box-shadow: var(--bhc2-shadow);
}
.bhc2-frame-enabled.bhc2-layout-narrow #main { --bhc2-frame-width: 980px; }
.bhc2-frame-enabled.bhc2-layout-standard #main { --bhc2-frame-width: 1200px; }
.bhc2-frame-enabled.bhc2-layout-wide #main { --bhc2-frame-width: 1440px; }

/* Content Frame compatibility: keep the frame visible while allowing its My Account login wrapper to use the available page width. */
@media (min-width: 769px) {
    body.bhc2-frame-enabled.woocommerce-account.bloghash-no-sidebar:not(.logged-in) #main {
        width: 100%;
    }
}

/* BlogHash native Custom Header: preserve full image dimensions without crop or overlap. */
.wp-custom-header,
.wp-custom-header a,
.wp-custom-header img { display: block; width: 100%; }
.wp-custom-header { margin: 0; overflow: visible; background: var(--bhc2-page); }
.wp-custom-header img { height: auto; max-height: none; object-fit: contain; }

.bhc2-header-notice { padding: 10px 0; border-bottom: 1px solid var(--bhc2-border); background: var(--bhc2-page); color: var(--bhc2-text); }
.bhc2-notice-widget, .bhc2-notice-widget p { margin: 0; }

/* BlogHash-inspired, parent-compatible header and blog accents. */
#bloghash-header { border-bottom-color: var(--bhc2-border); }
#bloghash-header .bloghash-primary-nav > li > a:hover,
#bloghash-header .bloghash-primary-nav > li.current-menu-item > a,
#bloghash-header .bloghash-primary-nav > li.current-menu-ancestor > a { color: var(--bhc2-primary); }

.bhc2-cart-highlight #bloghash-header .bloghash-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    border: 1px solid var(--bhc2-border);
    border-radius: 999px;
    background: var(--bhc2-page);
    color: var(--bhc2-primary);
    transition: transform .2s ease, background-color .2s ease, color .2s ease;
}
.bhc2-cart-highlight #bloghash-header .bloghash-cart:hover,
.bhc2-cart-highlight #bloghash-header .bloghash-cart:focus { transform: translateY(-1px); background: var(--bhc2-primary); color: #fff; }
#bloghash-header .bloghash-cart-count { background: var(--bhc2-accent); color: #fff; }

.bhc2-archive-accent .bloghash-entry { border-color: var(--bhc2-border); transition: transform .2s ease, box-shadow .2s ease; }
.bhc2-archive-accent .bloghash-entry:hover { transform: translateY(-3px); box-shadow: var(--bhc2-shadow); }
.bhc2-archive-accent .bloghash-entry .entry-title a:hover,
.bhc2-archive-accent .bloghash-entry-category a,
.bhc2-archive-accent .bloghash-entry-meta a:hover { color: var(--bhc2-primary); }
.bhc2-archive-accent .bloghash-read-more,
.bhc2-archive-accent .bloghash-button,
.bhc2-archive-accent .bloghash-btn { border-color: var(--bhc2-primary); background: var(--bhc2-primary); color: #fff; }
.bhc2-archive-accent .bloghash-read-more:hover,
.bhc2-archive-accent .bloghash-button:hover,
.bhc2-archive-accent .bloghash-btn:hover { border-color: var(--bhc2-accent); background: var(--bhc2-accent); color: #fff; }
.bhc2-archive-accent .bloghash-ticker-label { background: var(--bhc2-primary); color: #fff; }

/* Button Shape: Blogsy-aligned values for standard BlogHash, WooCommerce, and block buttons. */
body.bhc2-button-shape-circle { --bhc2-button-radius: 50px; }
body.bhc2-button-shape-round { --bhc2-button-radius: 10px; }
body.bhc2-button-shape-smooth { --bhc2-button-radius: 8px; }
body.bhc2-button-shape-sharp { --bhc2-button-radius: 0; }
body[class*="bhc2-button-shape-"] .bloghash-btn:not(.btn-text-1),
body[class*="bhc2-button-shape-"] .bloghash-read-more,
body[class*="bhc2-button-shape-"] .bloghash-button,
body[class*="bhc2-button-shape-"] #infinite-handle span,
body[class*="bhc2-button-shape-"] #main .wp-block-button__link,
body[class*="bhc2-button-shape-"] #main .wp-element-button,
body[class*="bhc2-button-shape-"] #main .button,
body[class*="bhc2-button-shape-"] #main button[type="submit"],
body[class*="bhc2-button-shape-"] #main input[type="submit"],
body[class*="bhc2-button-shape-"] #main input[type="reset"] { border-radius: var(--bhc2-button-radius); }

/* Parent-compatible footer accent. */
.site-footer { border-top-color: var(--bhc2-border); }
.site-footer a:hover, .site-footer a:focus { color: var(--bhc2-accent); }

/* Child utility controls. */
.bhc2-preloader { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; gap: 8px; background: #fff; transition: opacity .25s ease, visibility .25s ease; }
.bhc2-preloader span { width: 10px; height: 10px; border-radius: 50%; background: var(--bhc2-primary); animation: bhc2-bounce .7s infinite alternate; }
.bhc2-preloader span:nth-child(2) { animation-delay: .15s; }
.bhc2-preloader span:nth-child(3) { animation-delay: .3s; }
.bhc2-preloader.is-hidden { opacity: 0; visibility: hidden; }
@keyframes bhc2-bounce { to { transform: translateY(-8px); background: var(--bhc2-accent); } }

/* Background Animation: Blogmate-inspired floating decorative shapes. */
.bhc2-background-animation { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bhc2-background-animation .bhc2-animation-shape { position: absolute; bottom: -110px; display: block; width: 40px; height: 40px; background: var(--bhc2-primary); border-radius: 5px; opacity: .1; animation: bhc2-background-rise 10s infinite ease-in; }
.bhc2-background-animation .bhc2-animation-triangle .bhc2-animation-shape { background: var(--bhc2-accent); clip-path: polygon(50% 0, 0 100%, 100% 100%); }
.bhc2-background-animation .bhc2-animation-circle .bhc2-animation-shape { background: var(--bhc2-accent); border-radius: 50%; }
.bhc2-animation-squares .bhc2-animation-shape:nth-child(1) { left: 10%; width: 40px; height: 40px; animation-duration: 8s; }
.bhc2-animation-squares .bhc2-animation-shape:nth-child(2) { left: 28%; width: 20px; height: 20px; animation-duration: 6s; animation-delay: 1s; }
.bhc2-animation-squares .bhc2-animation-shape:nth-child(3) { left: 48%; width: 58px; height: 58px; animation-duration: 11s; animation-delay: 2s; }
.bhc2-animation-squares .bhc2-animation-shape:nth-child(4) { left: 68%; width: 30px; height: 30px; animation-duration: 7s; animation-delay: 3s; }
.bhc2-animation-squares .bhc2-animation-shape:nth-child(5) { left: 86%; width: 74px; height: 74px; animation-duration: 12s; animation-delay: 1s; }
.bhc2-animation-triangles .bhc2-animation-shape:nth-child(1) { left: 18%; width: 26px; height: 24px; animation-duration: 9s; animation-delay: 2s; }
.bhc2-animation-triangles .bhc2-animation-shape:nth-child(2) { left: 56%; width: 48px; height: 42px; animation-duration: 13s; animation-delay: 4s; }
.bhc2-animation-triangles .bhc2-animation-shape:nth-child(3) { left: 78%; width: 34px; height: 30px; animation-duration: 8s; animation-delay: 5s; }
.bhc2-animation-circles .bhc2-animation-shape:nth-child(1) { left: 7%; width: 22px; height: 22px; animation-duration: 7s; animation-delay: 1s; }
.bhc2-animation-circles .bhc2-animation-shape:nth-child(2) { left: 38%; width: 64px; height: 64px; animation-duration: 12s; animation-delay: 3s; }
.bhc2-animation-circles .bhc2-animation-shape:nth-child(3) { left: 72%; width: 44px; height: 44px; animation-duration: 9s; animation-delay: 6s; }
.bhc2-animation-circles .bhc2-animation-shape:nth-child(4) { left: 92%; width: 30px; height: 30px; animation-duration: 8s; animation-delay: 2s; }
@keyframes bhc2-background-rise { 0% { bottom: -110px; transform: translateX(0) rotate(0deg); } 50% { transform: translateX(100px) rotate(180deg); } 100% { bottom: 110vh; transform: translateX(-200px) rotate(360deg); } }

@media (max-width: 1500px) { .bhc2-layout-wide #main .bloghash-container { max-width: 1280px; } }
@media (max-width: 768px) {
    .bhc2-layout-narrow #main .bloghash-container,
    .bhc2-layout-standard #main .bloghash-container,
    .bhc2-layout-wide #main .bloghash-container { max-width: 100%; }
    .bhc2-frame-enabled #main > .bloghash-container { margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
    .bhc2-cart-highlight #bloghash-header .bloghash-cart { min-width: 38px; min-height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
    .bhc2-background-animation { display: none; }
}


/* Header layout 1: keep branding and navigation beside one another in WordPress LTR locales. */
@media only screen and (min-width: 869px) {
    body.bloghash-header-layout-1:not(.bloghash-is-rtl):not(.rtl):not(.bloghash-is-mobile) #bloghash-header-inner .bloghash-header-container {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: flex-start !important;
    }

    body.bloghash-header-layout-1:not(.bloghash-is-rtl):not(.rtl):not(.bloghash-is-mobile) #bloghash-header-inner .bloghash-header-container .bloghash-logo {
        flex: 0 0 auto !important;
        margin-right: 2.4rem !important;
        margin-left: 0 !important;
        text-align: left !important;
    }

    body.bloghash-header-layout-1:not(.bloghash-is-rtl):not(.rtl):not(.bloghash-is-mobile) #bloghash-header-inner .bloghash-header-container .bloghash-nav {
        flex: 1 1 auto !important;
        min-width: 0;
        align-self: center;
        text-align: left !important;
    }

    body.bloghash-header-layout-1:not(.bloghash-is-rtl):not(.rtl):not(.bloghash-is-mobile) #bloghash-header-inner .bloghash-header-container .bloghash-nav > ul {
        justify-content: flex-start !important;
    }
}

/* Horizontal post card: mirror the approved RTL presentation in WordPress LTR locales. */
@media only screen and (min-width: 869px) {
    body:not(.bloghash-is-rtl):not(.rtl).bloghash-layout__boxed-separated.bloghash-blog-image-wrap .bloghash-blog-horizontal .bloghash-article:not(.format-quote) .bloghash-blog-entry-wrapper.bloghash-thumb-left .entry-media,
    body:not(.bloghash-is-rtl):not(.rtl).bloghash-layout__boxed-separated.bloghash-blog-image-wrap.bloghash-blog-horizontal .bloghash-article:not(.format-quote) .bloghash-blog-entry-wrapper.bloghash-thumb-left .entry-media {
        order: 2;
        margin-right: 0;
        margin-left: 3rem;
    }
}

/* Fonts Plugin compatibility: allow the selected button/input font to inherit through BlogHash controls. */
#main button,
#main input,
#main select,
#main textarea,
#main .button,
#secondary button,
#secondary input,
#secondary select,
#secondary textarea,
#secondary .button {
    font-family: inherit !important;
}

/* Native BlogHash Scroll Top Button: child-controlled physical page edge. */
body.bhc2-scroll-top-right #bloghash-scroll-top {
    right: 24px;
    left: auto;
}

body.bhc2-scroll-top-left #bloghash-scroll-top {
    right: auto;
    left: 24px;
}

@media (max-width: 768px) {
    body.bhc2-scroll-top-right #bloghash-scroll-top {
        right: 16px;
        left: auto;
    }

    body.bhc2-scroll-top-left #bloghash-scroll-top {
        right: auto;
        left: 16px;
    }
}
