/* ===========================
   BLOG LISTING PAGE - MODERN ANIMATIONS
   Inspired by Career Page Design
   =========================== */

/* ===========================
   ANIMATION KEYFRAMES
   =========================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeBlurIn {
    from {
        opacity: 0;
        filter: blur(10px);
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes imageReveal {
    from {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
    }
    to {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* ===========================
   PAGE TITLE ANIMATIONS
   =========================== */

.page-title {
    animation: fadeBlurIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.page-title .title {
    animation: fadeBlurIn 1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

.breadkcum {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s backwards;
}

/* ===========================
   BLOG GRID CONTAINER
   =========================== */

.tf-grid-1 {
    position: relative;
}

/* ===========================
   BLOG CARD BASE STYLES & ANIMATIONS
   =========================== */

.fl-item2 {
    opacity: 0;
    animation: fadeInScale 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    will-change: transform, opacity;
}

/* Staggered Animation Delays */
.fl-item2:nth-child(1) {
    animation-delay: 0.1s;
}

.fl-item2:nth-child(2) {
    animation-delay: 0.2s;
}

.fl-item2:nth-child(3) {
    animation-delay: 0.3s;
}

.fl-item2:nth-child(4) {
    animation-delay: 0.4s;
}

.fl-item2:nth-child(5) {
    animation-delay: 0.5s;
}

.fl-item2:nth-child(6) {
    animation-delay: 0.6s;
}

/* Additional items continue the pattern */
.fl-item2:nth-child(n+7) {
    animation-delay: 0.7s;
}

/* ===========================
   BLOG CARD HOVER EFFECTS
   =========================== */

.tf-post-grid {
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tf-post-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(161, 194, 189, 0.1), rgba(112, 137, 147, 0.05));
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
    pointer-events: none;
}

.tf-post-grid:hover::before {
    opacity: 1;
}

.tf-post-grid:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 60px rgba(25, 24, 59, 0.3),
                0 10px 30px rgba(161, 194, 189, 0.2);
    border-color: rgba(161, 194, 189, 0.3);
}

/* ===========================
   IMAGE ZOOM & REVEAL EFFECTS
   =========================== */

.tf-post-grid .top {
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.tf-post-grid .top .image {
    display: block;
    overflow: hidden;
    position: relative;
}

.tf-post-grid .top .image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(161, 194, 189, 0.2), rgba(112, 137, 147, 0.1));
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.tf-post-grid:hover .top .image::before {
    opacity: 1;
}

.tf-post-grid .top img {
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.5s ease;
    will-change: transform;
    animation: imageReveal 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.tf-post-grid:hover .top img {
    transform: scale(1.1) rotate(1deg);
    filter: brightness(1.1);
}

/* ===========================
   DATE BADGE ANIMATION
   =========================== */

.date-2 {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInScale 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.3s backwards;
}

.tf-post-grid:hover .date-2 {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(161, 194, 189, 0.3);
}

/* ===========================
   CATEGORY TAGS ANIMATION
   =========================== */

.category-post {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.4s backwards;
}

.category-post .item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.category-post .item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #A1C2BD, #708993);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tf-post-grid:hover .category-post .item {
    transform: translateY(-3px);
}

.tf-post-grid:hover .category-post .item::before {
    opacity: 1;
}

.category-post .item span {
    position: relative;
    z-index: 1;
}

/* ===========================
   POST CONTENT ANIMATIONS
   =========================== */

.post-content {
    position: relative;
    z-index: 1;
    padding: 30px;
    background: rgba(0, 0, 0, 0.02);
    transition: background 0.5s ease;
}

.tf-post-grid:hover .post-content {
    background: rgba(161, 194, 189, 0.05);
}

.post-content .title {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: inline-block;
}

.post-content .title a {
    background: linear-gradient(135deg, #fff, #fff) no-repeat;
    background-size: 0% 2px;
    background-position: left bottom;
    transition: background-size 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.3s ease;
    padding-bottom: 2px;
}

.tf-post-grid:hover .post-content .title a {
    background-size: 100% 2px;
    color: #A1C2BD;
}

.post-content .sub-title {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.85;
}

.tf-post-grid:hover .post-content .sub-title {
    opacity: 1;
    transform: translateX(5px);
}

/* ===========================
   READ MORE BUTTON ANIMATIONS
   =========================== */

.bottom-post {
    margin-top: 25px;
    opacity: 1 !important;
    visibility: visible !important;
}

.bottom-post .tf-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.bottom-post .tf-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #A1C2BD, #708993);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.bottom-post .tf-btn span,
.bottom-post .tf-btn i {
    position: relative;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-post .tf-btn:hover::before {
    opacity: 1;
}

.bottom-post .tf-btn:hover {
    transform: translateX(10px);
    border-color: transparent;
    box-shadow: 0 8px 25px rgba(161, 194, 189, 0.4);
}

.bottom-post .tf-btn:hover span {
    color: #fff;
}

/* Icon slide animation */
.bottom-post .tf-btn i {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-post .tf-btn:hover i {
    transform: translateX(5px);
    color: #fff;
}

/* Shimmer effect on hover */
.bottom-post .tf-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s ease;
}

.bottom-post .tf-btn:hover::after {
    left: 100%;
}

/* ===========================
   SIDEBAR ANIMATIONS
   =========================== */

.tf-sidebar {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s backwards;
}

.sidebar-item {
    opacity: 0;
    animation: fadeInScale 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.sidebar-search {
    animation-delay: 0.6s;
}

.sidebar-categories {
    animation-delay: 0.7s;
}

.sidebar-recent-posts {
    animation-delay: 0.8s;
}

.sidebar-tags {
    animation-delay: 0.9s;
}

.sidebar-banner {
    animation-delay: 1s;
}

/* Sidebar item hover effects */
.sidebar-item .list .item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding-left: 5px;
}

.sidebar-item .list .item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #A1C2BD, #708993);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-item .list .item:hover::before {
    width: 20px;
}

.sidebar-item .list .item:hover {
    padding-left: 25px;
    color: #A1C2BD;
}

/* Recent posts hover */
.tf-post-list {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    padding: 10px;
    margin: -10px;
}

.tf-post-list:hover {
    background: rgba(161, 194, 189, 0.05);
    transform: translateX(5px);
}

.tf-post-list .image img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.tf-post-list:hover .image img {
    transform: scale(1.1);
}

/* Tags animation */
.tabs-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.tabs-item::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tabs-item:hover::before {
    opacity: 1;
}

.tabs-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(161, 194, 189, 0.3);
    color: #fff !important;
}

/* ===========================
   LOAD MORE BUTTON
   =========================== */

.view-more-button2 {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.8s backwards;
}

.btn-loadmore2 {
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-loadmore2::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #A1C2BD, #708993);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.btn-loadmore2:hover::before {
    opacity: 1;
}

.btn-loadmore2:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(161, 194, 189, 0.4);
}

.btn-loadmore2 span,
.btn-loadmore2 i {
    position: relative;
    z-index: 1;
    transition: all 0.4s ease;
}

.btn-loadmore2:hover i {
    transform: translateX(5px);
}

/* ===========================
   SCROLL REVEAL ANIMATIONS
   =========================== */

/* Items that are initially hidden and revealed on scroll */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===========================
   PERFORMANCE OPTIMIZATIONS
   =========================== */

/* Use GPU acceleration for smooth animations */
.tf-post-grid,
.tf-post-grid .top img,
.bottom-post .tf-btn,
.fl-item2 {
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===========================
   RESPONSIVE ADJUSTMENTS
   =========================== */

@media (max-width: 991px) {
    .tf-post-grid:hover {
        transform: translateY(-8px) scale(1.01);
    }
    
    .fl-item2:nth-child(n+4) {
        animation-delay: 0.4s;
    }
}

@media (max-width: 767px) {
    .tf-post-grid:hover {
        transform: translateY(-5px);
    }
    
    .fl-item2 {
        animation-delay: 0.2s !important;
    }
    
    .bottom-post .tf-btn:hover {
        transform: translateX(5px);
    }
}

/* ===========================
   LOADING STATE ANIMATIONS
   =========================== */

.loading-skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ===========================
   FILTER BUTTON MOBILE
   =========================== */

.fillter-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fillter-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(161, 194, 189, 0.3);
}
