/* ================================================
   Custom Single Post Styles - Simplified Version
   ================================================ */

/* WoodMart Element Title Styling */
h4.wd-el-title {
    font-family: "Biryani", Arial, Helvetica, sans-serif;
    font-weight: 800!important;
    font-size: 26px !important;
}

/* WoodMart Navigation Pagination */
.wd-nav-pagin {
    align-items: baseline;
}

/* CSS Custom Properties for better performance */
@property --link-decoration-color {
    syntax: '<color>';
    inherits: false;
    initial-value: var(--new-green, #0F3F36);
}

@property --link-decoration-thickness {
    syntax: '<length>';
    inherits: false;
    initial-value: 1px;
}

/* Hide page title and breadcrumbs on single posts */
.single-post .wd-page-title,
.single-post .page-title,
.single-post .yoast-breadcrumb,
.single-post .wd-breadcrumbs,
.single-post .woocommerce-breadcrumb,
.single-post .breadcrumb-nav,
.single-post nav[class*="breadcrumb"] {
    display: none !important;
}

.custom-single-post {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Fixed stars container for post images */
.top-stars-container {
    position: relative;
    margin-bottom: -20px;
    z-index: 3;
}

.stars-wrapper {
    position: absolute;
    top: -32px;
    right: -8px;
    display: flex;
    gap: 4px;
}

.stars-wrapper.custom-stars-wrapper {
    top: 8px;
}

.stars-wrapper svg {
    width: 16px;
    height: 16px;
}

.stars-wrapper svg path {
    fill: var(--new-green, #0F3F36);
}

/* Desktop adjustments for post stars */
@media (min-width: 992px) {
    .stars-wrapper svg {
        width: 24px;
        height: 24px;
    }

    .custom-post-thumbnail img {
        height: 600px;
        max-height: 600px;
    }
}

/* Desktop adjustments for post hero area */
.blog-post-single .shop-hero-area {
    border-radius: var(--radius-16);
    background: linear-gradient(to bottom, white -10%, var(--power-lime) 60%, var(--power-lime) 100%);
    position: relative;
    display: flex;
    padding: var(--space-48) var(--radius-32) var(--radius-32);
    flex-direction: column;
    overflow: hidden;
    font-family: var(--font-primary);
    justify-content: start;
    gap: var(--radius-16);
    margin: -40px -30px var(--radius-32);
    --r: 15px;
    --s: 15px;
    --x: 150px;
    --y: 10px;
    --_m: /calc(2*var(--r)) calc(2*var(--r)) radial-gradient(#000 70%,#0000 72%);
    --_g: conic-gradient(at calc(100% - var(--r)) var(--r), rgba(0, 0, 0, 0) 25%, #000 0);
    --_d: (var(--s) + var(--r));
    mask: calc(100% - var(--_d) - var(--x)) 0 var(--_m), 100% calc(var(--_d) + var(--y)) var(--_m), radial-gradient(var(--s) at 100% 0, #0000 99%, #000 calc(100% + 1px)) calc(-1* var(--r) - var(--x)) calc(var(--r) + var(--y)), var(--_g) calc(-1* var(--_d) - var(--x)) 0, var(--_g) 0 calc(var(--_d) + var(--y));
    mask-repeat: no-repeat;
}

.shop-hero-section {
    position: relative;
}

.custom-post-thumbnail {
    position: relative;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    display: block; /* Show regular image on desktop */
}

.custom-post-thumbnail img {
    width: 100%;
    height: 960px; /* Square aspect ratio */
    max-height: 960px;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-16);
}

/* Category badge on single post image - top right of image */
.blog-single-image-category {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 5px 12px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sales-light-red, #FFC3C3);
    color: var(--sales-red, #B1292B);
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-transform: capitalize;
    text-decoration: none;
    border-radius: 100px;
    z-index: 10;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.blog-single-image-category:hover {
    background: var(--sales-red, #B1292B);
    color: var(--sales-light-red, #FFC3C3);
}

/* Mobile adjustments for post stars */
@media (max-width: 991px) {
    .stars-wrapper {
        top: -15px;
        right: 0px;
        gap: 2px;
    }

    .shop-hero-area {
        margin: -20px 0 20px;
        background: var(--new-green);
        --r: 4px;
        --s: 14px;
        --x: 100px;
        --y: 10px;
        position: relative;
    }

    /* Mobile background image styling */
    .shop-hero-area.mobile-bg-image {
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    .shop-hero-area.mobile-bg-image .custom-post-thumbnail {
        display: none; /* Hide the regular image on mobile since we're using background */
    }
}

/* Post Title - Comes AFTER the image */
.custom-post-title-section {
    text-align: center;
    margin: 40px 0 14px 0;
    padding: 0 20px;
}

.custom-post-title {
    font-family: Biryani, sans-serif;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--new-green, #0F3F36);
    margin: 0 0 20px 0;
    text-align: left;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-wrap: pretty;
}

/* Custom Title Tags */
.custom-title-tags {
    margin: 15px 0 20px 0;
    text-align: left;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.custom-title-tags a {
    display: inline-block;
    background-color: var(--new-light-green, #D8FFB4);
    color: var(--new-green, #0F3F36);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    margin: 0 8px 8px 0;
    border-radius: 16px;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.custom-title-tags a:hover {
    color: var(--volt-pink-dark, #FF6B9D);
}

/* Content Layout - Centered with 800px max width */
.custom-post-content {
    max-width: 800px;
    margin: 14px auto 60px auto;
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--new-green, #0F3F36);
    padding: 0 20px;
}

.custom-post-content h2,
.custom-post-content h3 {
    color: var(--new-green, #0F3F36);
    font-family: Biryani, sans-serif;
    font-weight: 800;
    margin: 30px 0 20px 0;
    text-wrap: pretty;
}
.custom-post-content h4 {
    color: var(--new-green, #0F3F36);
    font-family: Biryani, sans-serif;
    font-weight: 700;
    margin: 20px 0 16px 0;
}

.custom-post-content p {
    margin-bottom: 16px;
    color: var(--new-green, #0F3F36);
}

.custom-post-content strong,
.custom-post-content b {
    font-weight: 700;
    color: var(--new-green, #0F3F36);
}

.custom-post-content ul,
.custom-post-content ol {
    color: var(--new-green, #0F3F36);
    margin-bottom: 16px;
}

.custom-post-content li {
    color: var(--new-green, #0F3F36);
    margin-bottom: 8px;
}

.custom-post-content blockquote {
    color: var(--new-green, #0F3F36);
    border-left: 4px solid var(--volt-pink-dark, #FF6B9D);
    padding-left: 20px;
    font-style: italic;
    margin: 30px 0;
}

/* Apply custom link styling only to links within specific elements */
.custom-post-content p a,
.custom-post-content h5 a,
.custom-post-content h6 a,
.custom-post-content ul a,
.custom-post-content ol a,
.custom-post-content li a {
    color: var(--new-green, #0F3F36);
    text-decoration-line: underline;
    text-decoration-thickness: var(--link-decoration-thickness);
    text-decoration-color: var(--link-decoration-color);
    text-underline-offset: 2px;
    transition: --link-decoration-color 0.3s ease-out, --link-decoration-thickness 0.2s ease-out;
    will-change: text-decoration-color, text-decoration-thickness;
    contain: layout style paint;
}

/* Mobile optimization - only apply hover effects on devices that support hover */
@media (hover: hover) and (pointer: fine) {
    .custom-post-content p a:hover,
    .custom-post-content h5 a:hover,
    .custom-post-content h6 a:hover,
    .custom-post-content ul a:hover,
    .custom-post-content ol a:hover,
    .custom-post-content li a:hover {
        --link-decoration-color: var(--volt-pink-dark, #FF6B9D);
        --link-decoration-thickness: 2px;
    }
}

/* Fallback for older browsers that don't support @property */
@supports not (@property --link-decoration-color) {
    .custom-post-content p a,
    .custom-post-content h5 a,
    .custom-post-content h6 a,
    .custom-post-content ul a,
    .custom-post-content ol a,
    .custom-post-content li a {
        text-decoration-thickness: 1px;
        text-decoration-color: var(--new-green, #0F3F36);
    }

    @media (hover: hover) and (pointer: fine) {
        .custom-post-content p a:hover,
        .custom-post-content h5 a:hover,
        .custom-post-content h6 a:hover,
        .custom-post-content ul a:hover,
        .custom-post-content ol a:hover,
        .custom-post-content li a:hover {
            text-decoration-color: var(--volt-pink-dark, #FF6B9D);
            text-decoration-thickness: 2px;
        }
    }
}

.custom-post-content code {
    background-color: rgba(15, 63, 54, 0.1);
    color: var(--new-green, #0F3F36);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.custom-post-content pre {
    background-color: rgba(15, 63, 54, 0.05);
    color: var(--new-green, #0F3F36);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.custom-post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.custom-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    color: var(--new-green, #0F3F36);
}

.custom-post-content th,
.custom-post-content td {
    border: 1px solid rgba(15, 63, 54, 0.2);
    padding: 12px;
    text-align: left;
    color: var(--new-green, #0F3F36);
}

.custom-post-content th {
    background-color: rgba(15, 63, 54, 0.1);
    font-weight: 700;
}

.custom-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0px 0;
}

.wd-wpb.wd-images-gallery {
    margin-bottom: 0px;
}

.wd-wpb {
    margin-bottom: 0px;
}

/* Footer Section */
.custom-post-footer {
    max-width: 800px;
    margin: 60px auto 40px auto;
    border-top: 2px solid #f0f0f0;
    padding: 40px 20px 0 20px;
}

/* Sharing Text */
.sharing-text {
    text-align: center;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 700;
    color: var(--new-green, #0F3F36);
    line-height: 1.3;
    text-transform: none;
    letter-spacing: normal;
}

.custom-tags {
    text-align: center;
    margin-bottom: 30px;
}

.custom-tags a {
    display: inline-block;
    background: #f0f0f0;
    color: var(--new-green, #0F3F36);
    padding: 8px 16px;
    border-radius: 20px;
    margin: 5px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.custom-tags a:hover {
    background: var(--volt-pink-dark, #FF6B9D);
    color: white;
}

/* ================================================
   Responsive Design
   ================================================ */

@media (max-width: 1024px) {
    .custom-post-content {
        margin: 40px auto;
        padding: 0 0px;
    }

    .custom-post-title-section {
        padding: 0 0px;
    }
}

@media (max-width: 768px) {
    .custom-single-post {
        padding: 0 0px;
    }

    .wd-content-layout {
        padding-block: 20px;
    }

    .custom-post-title-section {
        margin: 30px 0 14px 0;
        padding: 0 0px;
    }

    .custom-post-title {
        max-width: 100%;
        padding: 0 0px;
    }

    .custom-title-tags {
        padding: 0 0px;
        margin: 10px 0 15px 0;
    }

    .custom-title-tags a {
        font-size: 12px;
        padding: 3px 8px;
        margin: 0 6px 6px 0;
    }

    .custom-post-thumbnail img {
        height: 400px;
    }
    .blog-single-image-category {
        position: absolute;
        top: 10px;
        right: 10px;
        padding: 2px 8px;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.4;
        border-radius: 20px;

    

    .custom-post-content {
        padding: 0 0px;
        margin: 30px auto;
    }

                .custom-post-footer {
                padding: 30px 0px 0 0px;
                margin: 40px auto 30px auto;
            }

            .sharing-text {
                margin-bottom: 15px;
            }
}

@media (max-width: 480px) {
    .custom-post-thumbnail img {
        height: 300px;
    }

    .custom-post-title-section {
        padding: 0 0px;
    }

    .custom-post-title {
        font-size: 32px;
        padding: 0 0px;
    }

    .custom-title-tags {
        padding: 0 0px;
        margin: 10px 0 15px 0;
    }

    .custom-title-tags a {
        font-size: 10px;
        padding: 2px 8px;
        margin: 0 4px 4px 0;
    }

                .custom-post-content {
                font-size: 1rem;
                padding: 0 0px;
            }

            .sharing-text {
                margin-bottom: 10px;
            }
}
