@media (min-width: 1023.99px) {
    body {
        --keydesign-h1-font-size: 57px;
        --keydesign-h2-font-size: 47px;
        --keydesign-h3-font-size: 32px;
        --keydesign-h4-font-size: 24px;
        --keydesign-h5-font-size: 21px;
    }

    .keydesign-widget .widget-title:not(:empty) {
        font-size: var(--keydesign-h5-font-size);
        font-weight: var(--keydesign-h5-font-weight);
    }

    .blog-layout-grid .keydesign-card .post-title {
        line-height: var(--keydesign-h4-line-height);
        font-size: var(--keydesign-h4-font-size);
        font-weight: var(--e-global-typography-primary-font-weight)
    }

    .entry-meta,
    .category-meta {
        font-family: var(--e-global-typography-secondary-font-family);
        font-weight: var(--e-global-typography-secondary-font-weight);
        font-size: 13px;
    }

    .blog-layout-horizontal .keydesign-card .entry-wrapper .post-title {
        font-size: var(--keydesign-h4-font-size);
        line-height: var(--keydesign-h4-line-height);
    }
}

@media (max-width: 1024px) {

    .breadcrumbs ul,
    .page-header .entry-title+p,
    .ekit-wid-con .ekit-breadcrumb {
        --font-size-paragraphs: var(--keydesign-h5-font-size);
    }

    .woocommerce #content .product_list_widget li a,
    .widget_recent_entries .recent-posts-thumb a .recent-post-title {
        font-size: var(--keydesign-h5-font-size);
    }

    .ekit-wid-con .ekit-post-list-wrapper .ekit_post_list_content_wraper .elementor-icon-list-text,
    .blog-layout-grid .keydesign-card .post-title {
        font-size: var(--keydesign-h4-font-size);
    }
}


.woocommerce .wc-style-detailed ul.products li.product:hover .woo-entry-image {
    background: var(--e-global-color-light);
}

.site-content .keydesign-portfolio-item-design-1 .keydesign-portfolio-grid-item__wrapper {
    background-color: transparent;
}

.related-posts .keydesign-card.type-keydesign-portfolio .medium-size-thumb {
    aspect-ratio: 1.06;
}

.elementor-widget-elementskit-heading .ekit-wid-con .elementskit-section-title>span {
    transition: none !important;
}

/* Fix Layout via Parent Wrapper (site-content) for sidebar alignment */
body.single-post .site-content,
body.blog .site-content,
body.archive .site-content,
body.search .site-content {
    max-width: var(--container-max-width, 1240px);
    margin: 60px auto;
    padding-left: 20px;
    padding-right: 20px;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

/* Reset specific #primary constraint, let flex handle it */
body.single-post #primary,
body.blog #primary,
body.archive #primary,
body.search #primary {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Sidebar sizing and placement */
body.blog #secondary,
body.archive #secondary,
body.search #secondary,
body.single-post #secondary {
    width: 300px;
    flex-shrink: 0;
}

/* Center images on Single Post only */
body.single-post .entry-image,
body.single-post .wp-block-image,
body.single-post .entry-content img {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

/* Mobile responsive */
@media (max-width: 1024px) {

    body.single-post .site-content,
    body.blog .site-content,
    body.archive .site-content,
    body.search .site-content {
        flex-direction: column;
    }

    body.blog #secondary,
    body.archive #secondary,
    body.search #secondary {
        width: 100%;
    }
}

/* Blog List Visual Refinements */
.blog .post-title,
.archive .post-title,
.search .post-title {
    font-size: 22px !important;
    margin-bottom: 20px !important;
    /* Spacing title/text */
}

/* Limit excerpt length */
.blog .entry-content p,
.archive .entry-content p,
.search .entry-content p,
.blog .entry-content-card p,
.archive .entry-content-card p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0;
}

/* Vertical Spacing Between Posts */
.blog .keydesign-card,
.archive .keydesign-card,
.search .keydesign-card {
    margin-bottom: 60px !important;
    /* Visual separation */
}

/* Improve Text Readability */
.blog .entry-content p,
.archive .entry-content p {
    line-height: 1.8 !important;
    /* Less cramped text */
}

/* Main Blog Spacing - Force Image Margin (Desktop) */
@media (min-width: 767px) {
    .blog-layout-horizontal .keydesign-card .entry-image {
        margin-right: 50px !important;
        /* Force gap here */
        max-width: 40%;
    }

    .blog-layout-horizontal .keydesign-card .entry-wrapper {
        padding-left: 0 !important;
    }
}

/* Sidebar Widget Spacing */
.widget_recent_entries .recent-posts-thumb a {
    gap: 20px !important;
    align-items: flex-start;
}

.widget_recent_entries .recent-posts-thumb a img {
    margin-right: 20px !important;
}

/* Mobile Layout Fix - Stack Cards */
/* Mobile/Tablet Layout Fix - Stack Cards (< 991px) */
@media (max-width: 991px) {
    body .blog-layout-horizontal .keydesign-card {
        flex-direction: column !important;
        display: flex !important;
        align-items: flex-start !important;
        height: auto !important;
    }

    body .blog-layout-horizontal .keydesign-card .entry-image,
    body .blog-layout-horizontal .keydesign-card .entry-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 auto !important;
    }

    body .blog-layout-horizontal .keydesign-card .entry-image {
        margin-right: 0 !important;
        margin-bottom: 20px !important;
        height: auto !important;
    }

    body .blog-layout-horizontal .keydesign-card .entry-wrapper {
        padding-left: 0 !important;
    }

    body .blog-layout-horizontal .keydesign-card .entry-image img {
        width: 100% !important;
        height: auto !important;
        object-fit: cover;
    }
}