/* ================================================================
SINGLE BLOG POST PAGE - Figma Spec Implementation
Uses existing CSS variables from variables.css & custom.css
================================================================ */

/* ========== BASE CONTAINER ========== */
.blog-single-page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: var(--c-bg-dark);
    overflow: hidden;
    padding-bottom: 20px;
}

.blog-single-bg {
    position: absolute;
    inset: 0;
    background: var(--c-bg-dark);
    z-index: 0;
}

.blog-single-main-wrapper {
    position: relative;
    width: 100%;
    /* max-width: 1280px; */
    margin: 0 auto;
    padding: 0 clamp(16px, 2.4vw, 30px);
    z-index: 1;
}

/* ========== PAGE TITLE ========== */
.blog-single-page-title {
    text-align: center;
    margin: 0 auto 40px;
    position: relative;
    padding-top: 20px;
}

.blog-single-page-title-text {
    font-family: var(--font-latin);
    font-weight: 400;
    font-size: 60px;
    line-height: 100%;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 1);
    margin: 0;
    text-align: center;
}

.blog-single-title-line {
    display: block;
    width: 186px;
    height: 12px;
    background: rgba(212, 175, 55, 1);
    margin: 20px auto 0;
    border-radius: 2px;
}

/* ========== BLOG POST CARD (Desktop: 1250×1493) ========== */
.blog-single-card {
    position: relative;
    /* width: 1250px; */
    min-height: 1493px;
    max-height: 2377px;
    margin: 40px auto 0;
    border-radius: 0 600px 0 600px;
    border-top: 1px solid var(--c-white);
    border-bottom: 1px solid var(--c-white);
    border-left: 1px solid var(--c-black);
    border-right: 1px solid var(--c-black);
    background: var(--c-bg-gradient);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 120px 40px 220px;
    box-sizing: border-box;
}

/* ========== INNER WRAPPER (1064×1493, with back button positioned inside) ========== */
.blog-single-card-element-wrapper {
    position: relative; /* Critical: makes absolute children position relative to this */
    margin: 50px auto 0;
    padding: 95px;
    max-width: 90%;
    /* max-height: 1493px; */
    /* min-height: 1493px; */
    border-radius: 0 150px 0 150px;
    opacity: 1;
    border-top: 1px solid var(--c-white);
    border-bottom: 1px solid var(--c-white);
    border-left: none ;
    border-right: none ;
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* 
[dir="rtl"] .blog-single-card-element-wrapper {
    border-radius: 150px 0 150px 0;
} */

/* ========== POST IMAGE (660×408) ========== */
.blog-single-image-wrapper {
    position: relative;
    width: 660px;
    height: 408px;
    margin: 0 auto 40px;
    border-radius: 0 80px 0 80px;
    border: 2px solid var(--c-white);
    border-image-slice: 1;
    overflow: hidden;
}
/* 
[dir="rtl"] .blog-single-image-wrapper {
    border-radius: 80px 0 80px 0;
} */

.blog-single-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

/* ========== POST CONTENT ========== */
.blog-single-content {
    width: 100%;
    width: auto;
    margin: 0 auto;
    padding: 200px 0;
}

.blog-single-text {
    font-family: var(--font-arabic);
    font-weight: 400;
    font-size: 35px;
    line-height: 42px;
    letter-spacing: 0;
    text-align: center;
    text-transform: capitalize;
    color: rgba(255, 255, 255, 1);
    margin: 0;
}

/* ========== BACK BUTTON (Bottom LEFT of wrapper: 350×125) ========== */
.blog-single-back-btn {
    position: absolute;
    bottom: 40px;
    left: 40px; /* Changed from right: 40px to left: 40px */
    right: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center; 
    gap: 20px;
    width: 350px;
    height: 125px;
    border-radius: 0 70px  0 70px;
    border-top: 3px solid var(--c-black);
    border-bottom: 3px solid var(--c-black);
    border-left: 3px solid var(--c-white);
    border-right: 3px solid var(--c-white);
    border-image-slice: 1;
    background: var(--c-button-bg);
    color: rgba(255, 255, 255, 1);
    text-decoration: none;
    font-family: 'Tajawal', var(--font-arabic);
    font-weight: 700;
    font-size: 32px;
    line-height: 100%;
    letter-spacing: 0;
    text-align: left;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* [dir="rtl"] .blog-single-back-btn {
    left: auto;
    right: 40px;
    justify-content: flex-end;
    text-align: left;
    flex-direction: row-reverse;
} */

.blog-single-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.blog-single-back-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    transform: rotate(90.97deg);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    rotate: 135deg;
}

.blog-single-back-btn:hover .blog-single-back-icon {
    transform: rotate(90.97deg) scale(1.1);
}

/* ========== REUSABLE FOOTER COMPONENT ========== */
.blog-single-footer {
    position: absolute;
    top: var(--footer-top, 120px);
    right: var(--footer-right, 37px);
    left: auto;
    z-index: 10;
}

/* ========== RESPONSIVE - TABLET (1024px) ========== */
@media (max-width: 1023.98px) {
    .blog-single-card {
        width: min(90vw, 800px);
        min-height: auto;
        border-radius: 0 100px 0 100px;
        padding: 80px 30px 140px;
    }
    
    .blog-single-card-element-wrapper {
        max-width: 100%;
        max-height: none;
        min-height: auto;
        padding: 60px 30px;
        border-radius: 0 100px 0 100px;
    }
    
    /* [dir="rtl"] .blog-single-card-element-wrapper {
        border-radius: 100px 0 100px 0;
    } */
    
    .blog-single-image-wrapper {
        width: 100%;
        max-width: 500px;
        height: 300px;
        border-radius: 0 60px 0 60px;
    }
    
    .blog-single-text {
        font-size: 28px;
        line-height: 36px;
    }
    
    .blog-single-back-btn {
        width: 280px;
        height: 100px;
        font-size: 26px;
        bottom: 30px;
        left: 30px;
    }
    
    /* [dir="rtl"] .blog-single-back-btn {
        left: auto;
        right: 30px;
    } */
    
    .blog-single-back-icon {
        width: 24px;
        height: 24px;
    }
}

/* ========== RESPONSIVE - MOBILE (320px card) ========== */
@media (max-width: 767.98px) {
    .blog-single-page {
        padding-bottom: 0;
        border: none;
        background: var(--c-bg-dark);
    }
    
    .blog-single-main-wrapper {
        padding: 0 10px;
    }
    
    /* Title - Inter 20px */
    .blog-single-page-title {
        margin: 0 auto 20px;
        padding-top: 10px;
    }
    
    .blog-single-page-title-text {
        font-size: 20px;
    }
    
    .blog-single-title-line {
        width: 80px;
        height: 4px;
        margin: 10px auto 0;
    }
    
    /* Mobile Card: 320×400px */
    .blog-single-card {
        width: 320px;
        min-height: 400px;
        margin: 39px auto 0;
        border-radius: 0 100px 0 100px;
        border-top: 1.5px solid var(--c-white);
        border-bottom: 1.5px solid var(--c-white);
        border-left: 1.5px solid var(--c-black);
        border-right: 1.5px solid var(--c-black);
        border-image-slice: 1;
        background: var(--c-bg-gradient);
        padding: 20px 16px 60px;
        align-items: center;
    }
    
    /* Inner Wrapper Mobile */
    .blog-single-card-element-wrapper {
        width: 250px;
        min-height: 265px;
        margin: 17px auto 0;
        border-radius: 0 80px 0 80px;
        border: 1px solid rgba(255, 255, 255, 1);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        padding: 24px 16px 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    /* [dir="rtl"] .blog-single-card-element-wrapper {
        border-radius: 80px 0 80px 0;
    } */
    
    /* Mobile Image: 134×77px */
    .blog-single-image-wrapper {
        width: 134px;
        height: 77px;
        margin: 0 auto 12px;
        border-radius: 0 10px 0 10px;
        border: 2px solid var(--c-white);
        border-image-slice: 1;
    }
    
    .blog-single-content{
        padding: 40px 0 50px;
    }

    /* Mobile Text: Sukar 8px */
    .blog-single-text {
        font-family: var(--font-arabic);
        font-weight: 400;
        font-size: 8px;
        line-height: 15px;
        text-align: center;
        text-transform: capitalize;
        color: rgba(255, 255, 255, 1);
        margin: 0;
    }
    
    .blog-single-back-btn {
    position: absolute;
    bottom: 25px;
    left: 40px; /* Changed from right: 40px to left: 40px */
    right: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center; 
    gap: 12px;
    width: 55px;
    height: 15px;
    border-radius: 0 5px  0 5px;
    border-top: 1.5px solid var(--c-black);
    border-bottom: 1.5px solid var(--c-black);
    border-left: 1.5px solid var(--c-white);
    border-right: 1.5px solid var(--c-white);
    border-image-slice: 1;
    background: var(--c-button-bg);
    color: rgba(255, 255, 255, 1);
    text-decoration: none;
    font-family: 'Tajawal', var(--font-arabic);
    font-weight: 700;
    font-size: 8px;
    line-height: 100%;
    letter-spacing: 0;
    text-align: left;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* [dir="rtl"] .blog-single-back-btn {
    left: auto;
    right: 40px;
    justify-content: flex-end;
    text-align: left;
    flex-direction: row-reverse;
} */

.blog-single-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.blog-single-back-icon {
    width: 10px;
    height: 10px;
    object-fit: contain;
    transform: rotate(90.97deg);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    rotate: 135deg;
}

.blog-single-back-btn:hover .blog-single-back-icon {
    transform: rotate(90.97deg) scale(1.1);
}
    /* Hide desktop footer on mobile */
    .blog-single-footer {
        display: none;
    }
}

/* ========== SMALL MOBILE (320px) ========== */
@media (max-width: 319.98px) {
    .blog-single-card {
        width: calc(100vw - 20px);
        max-width: 320px;
        min-height: 400px;
        padding: 16px 12px 50px;
    }
    
    .blog-single-card-element-wrapper {
        width: calc(100% - 32px);
        max-width: 250px;
        min-height: 265px;
        padding: 20px 12px;
    }
    
    .blog-single-text {
        font-size: 7px;
        line-height: 13px;
    }
    
    .blog-single-back-btn {
        width: 50px;
        height: 14px;
        font-size: 7px;
        bottom: 16px;
        left: 16px;
    }
    
    /* [dir="rtl"] .blog-single-back-btn {
        left: auto;
        right: 16px;
    } */
}