/*
Theme Name: CompareDividends
Theme URI: https://comparedividends.com
Author: CompareDividends
Author URI: https://comparedividends.com
Description: A fully standalone, modern SaaS theme for CompareDividends. Merges BlogHash engine + Blogdash layout + custom premium design system. No parent theme required.
Version: 1.0.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: comparedividends
Tags: blog, news, custom-background, custom-menu, custom-logo, custom-colors, featured-images, full-width-template, theme-options, flexible-header, wide-blocks
*/

/* ==========================================================================
   I. BLOGDASH BASE CSS – ported from blogdash/style.css
   ========================================================================== */

.blogdash {
    --bloghash-radius: 6px;
    background-color: #fcfcfc;
}

.blogdash .bloghash-article.post.sticky {
    outline: none;
}

.blogdash.bloghash-blog-horizontal .col-xs-12:not(:last-child) .bloghash-article {
    padding-bottom: 2.4rem;
    border-bottom: 1px solid rgba(229, 231, 235, .8);
}

.blogdash.bloghash-blog-horizontal .bloghash-article.has-post-thumbnail:not(.format-quote) .entry-media .entry-image-link,
.blogdash.bloghash-blog-horizontal .bloghash-article.has-post-thumbnail:not(.format-quote) .entry-media img {
    height: 100%;
    object-fit: cover;
}

.blogdash.single-post .bloghash-article .entry-media img,
body.blogdash:not(.single-post) .bloghash-article .entry-media {
    border-radius: 0;
    box-shadow: none;
}

.blogdash #featured_links .widget-title,
.blogdash #popular_post .widget-title,
.blogdash #editors_choice .widget-title,
.blogdash #pyml .widget-title {
    font-size: 2.6rem;
}

.blogdash #pyml .bloghash-flex-row {
    --bloghash-gutter-x: 1px;
}

.blogdash #pyml .bloghash-post-item.style-1 {
    min-height: 40rem;
}

[data-darkmode=dark] .bloghash-breadcrumbs,
[data-darkmode=dark] .blogdash.bloghash-header-layout-3 .bloghash-nav-container {
    background: rgb(40, 51, 83);
}

.blogdash.bloghash-header-layout-3 .bloghash-nav-container {
    box-shadow: none;
}

.blogdash.bloghash-header-layout-3 .bloghash-nav-container>.bloghash-container .bloghash-nav {
    min-height: 7.2rem;
}

.blogdash.bloghash-header-layout-3 #bloghash-header-inner .bloghash-nav>ul>li {
    margin-left: 3rem;
}

.blogdash .bloghash-post-item .bloghash-post-content .post-category {
    line-height: 1.2;
    margin-bottom: 0.6rem;
}

.blogdash .post-category .cat-links a {
    --bloghash-radius: 0;
    padding-bottom: 6px;
}

.blogdash .post-category .cat-links a:focus,
.blogdash.using-keyboard .post-category .cat-links a:hover {
    transform: translateY(-2px);
}

.blogdash #hero .swiper-button-prev,
.blogdash #hero .swiper-button-next {
    width: 5rem;
    height: 5rem;
}

.blogdash #hero .swiper-button-prev,
.blogdash #hero .swiper-rtl .swiper-button-next {
    left: 22px;
    right: auto;
}

.blogdash #hero .swiper-button-next,
.blogdash #hero .swiper-rtl .swiper-button-prev {
    right: 22px;
    left: auto;
}

@media screen and (min-width: 869px) {
    .blogdash #hero .bloghash-post-item .bloghash-post-content .bloghash-btn {
        max-height: 0;
        min-height: 0;
        height: 0;
        transform: translateY(500%);
        opacity: 0;
        padding: 0rem 2rem;
        margin-top: 0;
        transition: all 0.55s ease;
        display: flow-root;
        max-width: max-content;
        margin-left: auto;
        margin-right: auto;
    }

    .blogdash #hero .bloghash-post-item:hover .bloghash-post-content .bloghash-btn {
        max-height: 3em;
        height: 3em;
        transform: none;
        opacity: 1;
        padding: 0.8rem 2rem;
        margin-top: 2rem;
    }
}

#popular_post,
#editors_choice {
    margin-top: 5rem;
    position: relative;
}

#popular_post .post-category .cat-links a {
    padding: 0;
    color: inherit;
    background: transparent;
    margin-bottom: 0.3rem;
    vertical-align: middle;
}

#popular_post .post-category .cat-links a:hover,
.using-keyboard #popular_post .post-category .cat-links a:focus {
    color: var(--bloghash-primary);
    background: transparent;
}

.blogdash .bloghash-post-item.rounded {
    border-radius: 0;
}

.blogdash .style-1.bloghash-post-item {
    height: 100%;
}

.blogdash .bloghash-post-item .bloghash-post-content .entry-title {
    font-size: 2rem;
    line-height: 1.22;
}

.blogdash .bloghash-post-item .bloghash-post-thumb .inner img {
    transition: all 0.5s ease-in-out;
}

.blogdash.using-keyboard .bloghash-post-item:focus-within .bloghash-post-thumb .inner img,
.blogdash .bloghash-post-item:hover .bloghash-post-thumb .inner img {
    transform: scale(1.1);
}

.bloghash-post-item .bloghash-post-thumb {
    overflow: hidden;
}

.style-3.bloghash-post-item {
    padding-bottom: 1.6rem;
    border-bottom: 1px solid rgba(229, 231, 235, .8);
}

.style-3.bloghash-post-item .bloghash-post-thumb {
    margin-bottom: 1.6rem;
}

.style-3.bloghash-post-item .bloghash-post-thumb img,
.style-3.bloghash-post-item .bloghash-post-thumb {
    min-height: 21rem;
}

.style-3.bloghash-post-item .bloghash-post-content {
    padding: 0;
}

.style-3.bloghash-post-item .bloghash-post-content .post-category {
    margin-bottom: 0.4rem;
}

.style-3.bloghash-post-item .entry-meta a:not(:hover, :focus),
.style-3.bloghash-post-item .entry-meta {
    color: #999a9f;
}

.style-3.bloghash-post-item .post-category .cat-links a {
    font-size: 1.3rem;
    color: #707376;
    background: transparent;
    padding: 0;
}

.using-keyboard .style-3.bloghash-post-item .post-category .cat-links a:focus,
.style-3.bloghash-post-item .post-category .cat-links a:hover {
    color: var(--bloghash-primary);
    background: transparent;
}

.bloghash-post-item.style-4 {
    display: flex;
    align-items: center;
}

.bloghash-post-item.style-4 .bloghash-post-thumb {
    margin-right: 2rem;
    width: 10.2rem;
    height: 10.2rem;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background-color: #d1d1d1;
}

.bloghash-post-item.style-4 .bloghash-post-thumb .inner img {
    transform: scale(1.2) rotate(-10deg);
    transition: all 0.5s ease-in-out;
}

.using-keyboard .bloghash-post-item.style-4:focus-within .bloghash-post-thumb .inner img,
.bloghash-post-item.style-4:hover .bloghash-post-thumb .inner img {
    transform: scale(1) rotate(0deg);
}

.bloghash-post-item.style-4 .bloghash-post-content {
    padding: 0;
}

.bloghash-post-item.style-4 .bloghash-post-content .entry-title {
    font-size: 1.8rem;
}


/* ==========================================================================
   II. COMPAREDIVIDENDS Modern SaaS Design System
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    --cd-primary: #6366f1;
    --cd-gradient: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    --cd-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #db2777 100%);
    --cd-bg: #f8fafc;
    --cd-surface: #ffffff;
    --cd-border: rgba(226, 232, 240, 0.7);
    --cd-text: #1e293b;
    --cd-muted: #64748b;
    --cd-light: #f1f5f9;
    --cd-radius: 10px;
    --cd-radius-lg: 20px;
    --cd-shadow: 0 4px 6px -1px rgba(0, 0, 0, .05), 0 2px 4px -1px rgba(0, 0, 0, .03);
    --cd-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, .06), 0 4px 6px -2px rgba(0, 0, 0, .03);
    --cd-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, .08), 0 10px 10px -5px rgba(0, 0, 0, .04);
    --cd-ease: cubic-bezier(0.4, 0, 0.2, 1);
    /* Override bloghash accent */
    --bloghash-primary: #6366f1;
}

/* ---------- Base ---------- */
html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--cd-bg) !important;
    background-image:
        linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, transparent 60%),
        linear-gradient(225deg, rgba(236, 72, 153, 0.05) 0%, transparent 60%) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    color: var(--cd-text) !important;
    -webkit-font-smoothing: antialiased;
}

body.custom-background {
    background-color: var(--cd-bg) !important;
    background-image:
        linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, transparent 60%),
        linear-gradient(225deg, rgba(236, 72, 153, 0.05) 0%, transparent 60%) !important;
}

/* ---------- Sticky Glass Header ---------- */
#masthead,
.site-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid var(--cd-border) !important;
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06) !important;
}

#bloghash-header-inner {
    background: transparent !important;
    box-shadow: none !important;
}

/* ---------- Site Title: icon LEFT, text RIGHT via PHP filter ---------- */
/* The PHP filter in functions.php wraps text in .cd-title-text so we can
   apply gradient only to that span, keeping the img visible */
.bloghash-logo .site-title a {
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
    transition: opacity 0.25s ease !important;
    /* No background-clip on the <a> itself – that would clip the icon image */
    background: none !important;
    -webkit-text-fill-color: inherit !important;
    color: var(--cd-text) !important;
    font-weight: 800 !important;
    font-size: 2.4rem !important;
    letter-spacing: -0.035em !important;
}

.bloghash-logo .site-title a:hover {
    opacity: 0.8 !important;
}

/* Gradient only on the text span (added by PHP filter) */
.bloghash-logo .site-title a .cd-title-text {
    background: var(--cd-gradient) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Icon: explicit sizing and stacking reset */
.bloghash-logo .site-title a img,
.bloghash-logo .site-title a .site-title-icon {
    width: 32px !important;
    height: 32px !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
    object-fit: contain !important;
    vertical-align: middle !important;
    background: none !important;
    background-clip: border-box !important;
    -webkit-background-clip: border-box !important;
    -webkit-text-fill-color: unset !important;
    color: unset !important;
    order: -1 !important;
    /* ensure icon comes first */
}

/* Fallback: if no .cd-title-text span, apply gradient to the whole a
   but only via color (no background-clip) to avoid hiding the icon */
.bloghash-logo .site-title a:not(:has(.cd-title-text)) {
    color: var(--cd-primary) !important;
    -webkit-text-fill-color: var(--cd-primary) !important;
}

/* ---------- Navigation ---------- */

/* Base link styling – simple, explicit, no background-clip on <a> */
#bloghash-header-inner .bloghash-nav>ul>li>a {
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    font-size: 1.15rem !important;
    color: var(--cd-text) !important;
    -webkit-text-fill-color: var(--cd-text) !important;
    background: none !important;
    background-clip: border-box !important;
    -webkit-background-clip: border-box !important;
    position: relative !important;
    padding: 0.85rem 0.65rem !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
}

/* The <span> wrapping link text: make it truly inline, no pseudo-bar artefacts */
#bloghash-header-inner .bloghash-nav>ul>li>a>span {
    display: inline !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    background: none !important;
    background-clip: border-box !important;
    -webkit-background-clip: border-box !important;
    transform: none !important;
    transform-style: flat !important;
    opacity: 1 !important;
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}

/* Kill any pseudo-element underline bars on the nav spans
   (bloghash adds ::before bars when .bloghash-menu-animation-underline is on body) */
#bloghash-header-inner .bloghash-nav>ul>li>a>span::before,
#bloghash-header-inner .bloghash-nav>ul>li>a>span::after {
    display: none !important;
    content: none !important;
}

/* Clean ::after underline from our own style */
#bloghash-header-inner .bloghash-nav>ul>li>a::before,
#bloghash-header-inner .bloghash-nav>ul>li>a::after {
    display: none !important;
    content: none !important;
}

/* Active / hover: gradient only on the text span */
#bloghash-header-inner .bloghash-nav>ul>li>a:hover>span,
#bloghash-header-inner .bloghash-nav>ul>li.current-menu-item>a>span,
#bloghash-header-inner .bloghash-nav>ul>li.current-menu-ancestor>a>span,
#bloghash-header-inner .bloghash-nav>ul>li.current_page_item>a>span {
    background: var(--cd-gradient) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Dropdown sub-menu */
#bloghash-header-inner .bloghash-nav .sub-menu {
    background: var(--cd-surface) !important;
    border: 1px solid var(--cd-border) !important;
    border-radius: var(--cd-radius) !important;
    box-shadow: var(--cd-shadow-md) !important;
    overflow: hidden;
}

#bloghash-header-inner .bloghash-nav .sub-menu a {
    font-size: 1.05rem !important;
    font-weight: 500 !important;
    color: var(--cd-text) !important;
    -webkit-text-fill-color: var(--cd-text) !important;
    background: transparent !important;
    padding: 0.8rem 1.25rem !important;
}

#bloghash-header-inner .bloghash-nav .sub-menu a:hover {
    background: var(--cd-light) !important;
    color: var(--cd-primary) !important;
    -webkit-text-fill-color: var(--cd-primary) !important;
}

/* Dropdown caret icon */
#bloghash-header-inner .bloghash-nav .menu-item-has-children>a>.bloghash-icon {
    display: inline-flex !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    position: static !important;
    background: none !important;
    transform: none !important;
    opacity: 1 !important;
    -webkit-text-fill-color: var(--cd-text) !important;
}

/* ---------- Buttons ---------- */
.bloghash-btn,
.bloghash-btn.btn-1,
input[type="submit"],
button[type="submit"] {
    background: var(--cd-gradient) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--cd-radius) !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3) !important;
}

.bloghash-btn:hover,
.bloghash-btn.btn-1:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
    background: var(--cd-gradient-hover) !important;
    color: #fff !important;
    transform: translateY(-2px) !important;
}

/* ---------- Post Cards ---------- */
.blogdash .bloghash-article,
.blogdash .bloghash-post-item {
    background: var(--cd-surface) !important;
    border-radius: var(--cd-radius-lg) !important;
    border: 1px solid var(--cd-border) !important;
    box-shadow: var(--cd-shadow) !important;
    overflow: hidden;
    transition: transform 0.3s var(--cd-ease), box-shadow 0.3s var(--cd-ease) !important;
}

.blogdash .bloghash-article:hover,
.blogdash .bloghash-post-item:hover {
    box-shadow: var(--cd-shadow-lg) !important;
    transform: translateY(-5px) !important;
}

.entry-title {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.entry-title a {
    color: var(--cd-text);
}

.entry-title a:hover {
    color: var(--cd-primary);
}

/* ---------- Widgets ---------- */
.blogdash .widget {
    background: var(--cd-surface) !important;
    border-radius: var(--cd-radius-lg) !important;
    border: 1px solid var(--cd-border) !important;
    padding: 1.5rem !important;
    box-shadow: var(--cd-shadow) !important;
}

.blogdash .widget-title {
    font-weight: 700 !important;
    font-size: 0.9375rem !important;
    color: var(--cd-text) !important;
    border-bottom: 2px solid var(--cd-light) !important;
    padding-bottom: 0.75rem !important;
    margin-bottom: 1rem !important;
}

/* ---------- Page Header ---------- */
.page-header {
    background: linear-gradient(135deg, #eef2ff 0%, #fce7f3 100%) !important;
    border-bottom: 1px solid rgba(99, 102, 241, 0.12) !important;
}

.page-header .page-title {
    background: var(--cd-gradient) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    font-weight: 800 !important;
}

/* ==========================================================================
   III. FOOTER
   ========================================================================== */

#colophon,
.site-footer {
    background: #0f172a !important;
    color: #94a3b8 !important;
    border-top: none !important;
    margin-top: 4rem !important;
    padding: 0 !important;
    /* Need position relative so our pseudo-element works correctly
       (bloghash sets #colophon:after to position:absolute filling parent) */
    position: relative !important;
    overflow: hidden !important;
}

/* Gradient top accent line – MUST override bloghash's #colophon:after
   which is: position:absolute; top:0; left:0; width:100%; height:100%
   We use ::before instead which bloghash does not touch */
#colophon::before {
    content: '' !important;
    display: block !important;
    height: 4px !important;
    width: 100% !important;
    background: var(--cd-gradient) !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
}

/* Fix bloghash's #colophon:after absolute overlay that hides content */
#colophon::after {
    display: none !important;
}

/* Hide the default bloghash widget footer + copyright bar */
#bloghash-footer,
#bloghash-copyright {
    display: none !important;
}

/* Custom footer grid layout */
.cd-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem 0;
}

.cd-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

@media (max-width: 900px) {
    .cd-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .cd-footer-grid {
        grid-template-columns: 1fr;
    }
}

/* Brand */
.cd-footer-brand .site-name {
    display: inline-block;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--cd-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    margin-bottom: 0.85rem;
}

.cd-footer-brand p {
    font-size: 0.875rem;
    line-height: 1.7;
    color: #64748b;
    max-width: 240px;
}

/* Link columns */
.cd-footer-col h4 {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #cbd5e1;
    margin-bottom: 1rem;
    margin-top: 0;
}

.cd-footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.cd-footer-col ul li a {
    font-size: 0.875rem;
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.cd-footer-col ul li a:hover {
    color: #f1f5f9 !important;
    -webkit-text-fill-color: #f1f5f9 !important;
}

/* Bottom bar */
.cd-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    font-size: 0.8125rem;
    color: #475569;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cd-footer-bottom a {
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
    text-decoration: none !important;
}

.cd-footer-bottom a:hover {
    color: #f1f5f9 !important;
    -webkit-text-fill-color: #f1f5f9 !important;
}

/* ==========================================================================
   IV. USER PROVIDED CUSTOM CSS & DROPDOWN / WIDGET TWEAKS
   ========================================================================== */

.bloghash-nav .children,
.bloghash-nav .sub-menu {
    min-width: 25rem;
}

.grecaptcha-badge {
    visibility: hidden;
}

.logo-inner {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    gap: 0.5rem !important;
    /* optional spacing between icon and text */
    overflow: hidden !important;
}

.logo-inner span {
    font-size: 2.4rem !important;
    /* scaled up to match the header size */
    flex-shrink: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.bmc-btn-text {
    color: #ffffff !important;
}

.no-underline-link {
    text-decoration: none !important;
    color: #0077cc !important;
    /* Optional: override link color */
}

.no-underline-link:hover {
    text-decoration: underline !important;
    /* Optional: add underline on hover */
}

.no-underline-link-name {
    text-decoration: none !important;
    color: #002050 !important;
    /* Optional: override link color */
}

.no-underline-link-name:hover {
    text-decoration: underline !important;
    /* Optional: add underline on hover */
}

body .custom-footer-wrapper #colophon.site-footer {
    padding: 0 !important;
    margin: 0 !important;
}

/* Fix microscopic and invisible dropdown items / widget headings */
.bloghash-nav .children li a,
.bloghash-nav .sub-menu li a {
    font-size: 1.05rem !important;
    color: var(--cd-text) !important;
    -webkit-text-fill-color: var(--cd-text) !important;
    background: transparent !important;
}

/* Ensure the widget headings in the old footer (if still visible due to cache) 
   don't inherit the invisible transparent background-clip */
.blogdash #bloghash-footer .widget-title,
.blogdash #bloghash-footer-widgets .widget-title {
    color: var(--cd-text) !important;
    -webkit-text-fill-color: var(--cd-text) !important;
    background: none !important;
    visibility: visible !important;
}