/* Blogs Page Styles */
:root {
    --dark-green: #144434;
    --light-green: #91ef18;
    --lime-green: #eaff1d;
}

@font-face {
    font-family: "Allenoire";
    src: url(../assets/fonts/allenoire-allenoire-regular-400.woff2);
}

@font-face {
    font-family: "DM Sans";
    src: url(../assets/fonts/DMSans-VariableFont_opsz-wght.woff2);
}

@font-face {
    font-family: "Alexandria";
    src: url(../assets/fonts/Alexandria-VariableFont_wght.woff2);
}
@font-face {
    font-family: "Tajawal";
    src: url(../assets/fonts/Tajawal-Regular.woff2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: "DM Sans", sans-serif;
}

body.rtl p,
body.rtl h2,
body.rtl h3,
body.rtl span,
body.rtl a,
body.rtl button {
    font-family: "Tajawal", sans-serif !important;
}
body.rtl h1 {
    font-family: "Alexandria", sans-serif !important;
    line-height: 1.5;

}


#main {
    width: 100%;
    min-height: 100vh;
}

/* ===== BLOGS HERO SECTION ===== */

#blogs-hero {
    height: 60vh;
    background-image: url(../assets/images/hero/brandGuideline.webp);
    background-attachment: fixed;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Ensure no transforms interfere with fixed background */
    transform: none !important;
    will-change: auto;
    isolation: isolate;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

#blogs-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 68, 52, 0.85);
    z-index: 1;
}

#blogs-hero #content {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-top:auto;
    color: white;
    max-width: 800px;
    padding: 0 2rem 1rem 2rem;
}

#blogs-hero #content h1 {
    font-family: "Allenoire", sans-serif;
    font-size: 3.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}


/* ===== BLOGS SECTION ===== */

#blogs-section {
    padding: 8rem 6rem;
    /* background-color: #fafafa; */
    /* min-height: 90vh; */
}

.blogs-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

.blogs-top {
    text-align: center;
    margin-bottom: 6rem;
}

.blogs-left {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.blogs-left #dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--light-green);
    position: relative;
}

.blogs-left #dot::before {
    content: "";
    position: absolute;
    top: -6px;
    left: -6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--light-green);
    opacity: 0.3;
    animation: dotRipple 2s ease-in-out infinite;
}

@keyframes dotRipple {
    0% {
        transform: scale(0.8);
        opacity: 0.7;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.blogs-left h2 {
    font-size: 1rem;
    font-weight: 400;
    color: var(--dark-green);
}

.blogs-top h1 {
    font-family: "Allenoire", sans-serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--dark-green);
    /* margin-bottom: 1.5rem; */
    letter-spacing: 0.02rem;
}

.blogs-top p {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== NO BLOGS FALLBACK ===== */

.no-blogs-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 4rem 2rem;
}

.fallback-content {
    text-align: center;
    max-width: 600px;
    opacity: 0;
    transform: translateY(30px);
    animation: fallbackFadeIn 1s ease 0.3s forwards;
}

@keyframes fallbackFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fallback-logo {
    margin-bottom: 2.5rem;
    display: inline-block;
}

.fallback-logo svg {
    color: var(--light-green);
    opacity: 0.9;
    animation: logoFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 16px rgba(145, 239, 24, 0.2));
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.fallback-text h2 {
    font-family: "Allenoire", sans-serif;
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--dark-green);
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

.fallback-text p {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.7;
    margin-bottom: 3rem;
}

.fallback-action {
    display: flex;
    justify-content: center;
}

.fallback-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--dark-green);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.fallback-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.fallback-btn:hover::before {
    left: 100%;
}

.fallback-btn:hover {
    background: var(--light-green);
    color: var(--dark-green);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(145, 239, 24, 0.3);
}

.fallback-btn svg {
    transition: transform 0.3s ease;
}

.fallback-btn:hover svg {
    transform: translateX(4px);
}

/* ===== CAROUSEL STYLES ===== */

.blogs-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
}

.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
    gap: 2rem;
    will-change: transform;
}

/* ===== BLOG CARD STYLES ===== */

.blog-card {
    flex: 0 0 calc(33.333% - 1.33rem);
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(20, 68, 52, 0.08);
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    min-width: 0; /* Prevent flex item from shrinking beyond content */
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 64px rgba(20, 68, 52, 0.15);
}

.blog-image {
    position: relative;
    height: 240px;
    overflow: hidden;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease !important;
}

.blog-card:hover .blog-image img {
    transform: scale(1.05);
}

.blog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 100%);
    transition: opacity 0.3s ease;
}

.blog-card:hover .blog-overlay {
    opacity: 0.8;
}

.category-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--light-green);
    color: var(--dark-green);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
}

.blog-content {
    padding: 2rem;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #888;
}

.read-time {
    background: #f0f0f0;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.blog-date {
    font-weight: 500;
}

.blog-content h3 {
    /* font-family: "Allenoire", sans-serif; */
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--dark-green);
    letter-spacing:0rem;
    /* line-height: 1.4; */
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}


.blog-content p {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.blog-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-more {
    font-weight: 600;
    color: var(--dark-green);
    transition: color 0.3s ease;
}

.blog-card:hover .read-more {
    color: var(--light-green);
}

.blog-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--dark-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.blog-card:hover .blog-arrow {
    background: var(--light-green);
    color: var(--dark-green);
    transform: translateX(4px);
}


/* ===== CAROUSEL NAVIGATION ===== */

.carousel-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 -3rem;
    pointer-events: none;
    z-index: 10;
}

.nav-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--dark-green);
    pointer-events: all;
    position: relative;
    z-index: 20;
}

.prev-btn {
    transform: translateX(-3rem);
}

.next-btn {
    transform: translateX(3rem);
}

.nav-btn:hover {
    background: var(--light-green);
    color: var(--dark-green);
    transform: translateX(-3rem) scale(1.1);
}

.next-btn:hover {
    transform: translateX(3rem) scale(1.1);
}

/* ===== CAROUSEL INDICATORS ===== */

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: var(--light-green);
    transform: scale(1.2);
}

.indicator:hover {
    background: var(--dark-green);
}

/* ===== FADE IN ANIMATION ===== */

.section-fade-in {
    opacity: 0;
    transform: translateY(50px);
}

.section-fade-in.animate {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ===== RESPONSIVE STYLES ===== */

/* Tablet Styles */
@media (max-width: 1024px) {
    #blogs-section {
        padding: 6rem 4rem;
    }
    
    .blogs-top h1 {
        font-size: 2.5rem;
    }
    
    #blogs-hero #content h1 {
        font-size: 3rem;
    }
    
    .blog-card {
        flex: 0 0 calc(50% - 1rem);
    }
    
    .prev-btn {
        transform: translateX(-2rem);
    }
    
    .next-btn {
        transform: translateX(2rem);
    }
    
    .nav-btn:hover {
        transform: translateX(-2rem) scale(1.1);
    }
    
    .next-btn:hover {
        transform: translateX(2rem) scale(1.1);
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    #blogs-hero {
        height: 50vh;
        background-attachment: fixed; /* Mobile fallback */
    }
    
    #blogs-hero #content h1 {
        font-size: 2.5rem;
    }
    
    #blogs-hero #content p {
        font-size: 1rem;
    }
    
    #blogs-section {
        padding: 4rem 2rem;
    }
    
    /* Fallback Mobile Styles */
    .no-blogs-fallback {
        min-height: 50vh;
        padding: 3rem 1rem;
    }
    
    .fallback-logo svg {
        width: 80px;
        height: 80px;
    }
    
    .fallback-text h2 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .fallback-text p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .fallback-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .blogs-top {
        margin-bottom: 4rem;
    }
    
    .blogs-top h1 {
        font-size: 2rem;
    }
    
    .blogs-top p {
        font-size: 1rem;
    }
    
    .blog-card {
        flex: 0 0 100%;
    }
    
    .carousel-track {
        gap: 1rem;
    }
    
    .blog-content {
        padding: 1.5rem;
    }
    
    .blog-content h3 {
        font-size: 1.2rem;
    }
    
    .blog-content p {
        font-size: 0.9rem;
    }
    
    .carousel-nav {
        display: none; /* Hide navigation buttons on mobile */
    }
    
    .carousel-indicators {
        margin-top: 2rem;
    }
}

/* Very Small Mobile */
@media (max-width: 480px) {
    #blogs-hero #content h1 {
        font-size: 2rem;
    }
    
    #blogs-section {
        padding: 3rem 1rem;
    }
    
    .blogs-top h1 {
        font-size: 1.8rem;
    }
    
    .blog-image {
        height: 200px;
    }
    
    .blog-content {
        padding: 1.25rem;
    }
}


/* RTL adjustments for navigation buttons */
[dir="rtl"] .prev-btn {
    transform: translateX(3rem);
}

[dir="rtl"] .next-btn {
    transform: translateX(-3rem);
}


/* RTL hover states */
[dir="rtl"] .prev-btn:hover {
    transform: translateX(3rem) scale(1.1);
}

[dir="rtl"] .next-btn:hover {
    transform: translateX(-3rem) scale(1.1);
}

/* RTL carousel track - maintain proper flex direction */
[dir="rtl"] .carousel-track {
    direction: rtl; /* Set direction to RTL for proper carousel flow */
}

[dir="rtl"] .blog-card {
    direction: rtl; /* Keep card content RTL */
}

[dir="rtl"] .fallback-btn svg {
    transform: rotate(180deg);
}



[dir="rtl"] .blog-arrow {
    transform: rotate(180deg);
}

[dir="rtl"] .blog-card:hover .blog-arrow {
    transform: translateX(-4px) rotate(180deg);

}


[dir="rtl"] .category-tag {
 font-family: 'Tajawal', sans-serif;
}