/**
 * Tavasanbar Blog Widget - Styles
 *
 * @package Tavasanbar_Blog_Widget
 * @since 1.0.0
 */

/* Main Section */
.rl-blog {
    --c: #00d3f3;
    --cl: #5ce1f5;
    --cd: #00a8c4;
    --bg: #020617;
    --card: rgba(15, 23, 42, .6);
    --border: rgba(255, 255, 255, .06);
    --txt: .5;
    --r: 1.25rem;
    padding: 5rem 1.5rem 4rem;
    background: linear-gradient(180deg, var(--bg), #0a1128, var(--bg));
    color: #fff;
    direction: rtl;
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.rl-blog::before,
.rl-blog::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.rl-blog::before {
    inset: 0;
    background-image: linear-gradient(rgba(0, 211, 243, .03) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 211, 243, .03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle, #000 30%, transparent 90%);
    -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 90%);
}

.rl-blog::after {
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 211, 243, .06), transparent 70%);
}

/* Wrapper */
.rl-blog .wrap {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Header */
.rl-blog .hdr {
    text-align: center;
    margin-bottom: 3.5rem;
}

.rl-blog .dia {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    max-width: 20rem;
}

.rl-blog .dia::before,
.rl-blog .dia::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 211, 243, .5), transparent);
}

.rl-blog .dia i {
    width: 10px;
    height: 10px;
    background: var(--c);
    transform: rotate(45deg);
    margin: 0 1rem;
    box-shadow: 0 0 15px rgba(0, 211, 243, .8);
    flex-shrink: 0;
    display: block;
}

.rl-blog h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 900;
    margin: 0 0 .8rem;
}

.rl-blog h2 span {
    background: linear-gradient(135deg, var(--cl), var(--c), var(--cd));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.rl-blog .sub {
    color: rgba(255, 255, 255, .6);
    font-size: 1.05rem;
    max-width: 550px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Grid */
.bl-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
    list-style: none;
    padding: 0;
}

@media (min-width: 640px) {
    .bl-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.75rem;
    }
}

@media (min-width: 1024px) {
    .bl-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* Card */
.bl-c {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    transition: .4s cubic-bezier(.25, .46, .45, .94);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(40px);
}

.bl-c.show {
    opacity: 1;
    transform: translateY(0);
}

.bl-c:hover {
    border-color: rgba(0, 211, 243, .3);
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .5), 0 0 30px rgba(0, 211, 243, .08);
}

.bl-c:focus-within {
    outline: 2px solid var(--c);
    outline-offset: 2px;
}

.bl-c a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    outline: none;
}

/* Figure */
.bl-c figure {
    position: relative;
    width: 100%;
    padding-top: 58%;
    overflow: hidden;
    background: #0f172a;
    margin: 0;
}

.bl-c figure img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s;
}

.bl-c:hover figure img {
    transform: scale(1.08);
}

.bl-c figure::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(15, 23, 42, .9), transparent);
    z-index: 1;
    pointer-events: none;
}

/* Placeholder */
.bl-c .ph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

.bl-c .ph svg {
    width: 48px;
    height: 48px;
    color: rgba(0, 211, 243, .3);
}

/* Category Badge */
.bl-c .cat {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
    background: rgba(0, 211, 243, .15);
    border: 1px solid rgba(0, 211, 243, .3);
    color: var(--c);
    padding: .3rem .85rem;
    border-radius: 2rem;
    font-size: .75rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

/* Body */
.bl-c .body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Meta */
.bl-c .meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: .9rem;
    flex-wrap: wrap;
}

.bl-c .meta span {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    color: rgba(255, 255, 255, .45);
    font-weight: 500;
}

.bl-c .meta svg {
    width: 14px;
    height: 14px;
    opacity: .6;
    flex-shrink: 0;
}

/* Title */
.bl-c h3 {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.7;
    margin: 0 0 .75rem;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .3s;
}

.bl-c:hover h3 {
    color: var(--cl);
}

/* Excerpt */
.bl-c .exc {
    font-size: .88rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, .5);
    margin: 0 0 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Read More */
.bl-c .more {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--c);
    font-size: .85rem;
    font-weight: 700;
    align-self: flex-start;
    padding: .5rem 0;
    border-bottom: 1px solid transparent;
    transition: .3s;
}

.bl-c .more svg {
    width: 16px;
    height: 16px;
    transition: transform .3s;
}

.bl-c:hover .more {
    color: var(--cl);
    border-bottom-color: rgba(0, 211, 243, .3);
}

.bl-c:hover .more svg {
    transform: translateX(-4px);
}

/* Footer */
.rl-blog .foot {
    text-align: center;
}

.rl-blog .foot a {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    background: linear-gradient(135deg, rgba(0, 211, 243, .12), rgba(0, 211, 243, .06));
    border: 1px solid rgba(0, 211, 243, .25);
    color: var(--c);
    padding: .9rem 2.2rem;
    border-radius: .85rem;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    font-family: inherit;
    transition: .4s;
}

.rl-blog .foot a svg {
    width: 18px;
    height: 18px;
    transition: transform .3s;
}

.rl-blog .foot a:hover {
    background: linear-gradient(135deg, var(--c), var(--cd));
    color: var(--bg);
    border-color: var(--c);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 211, 243, .25);
}

.rl-blog .foot a:hover svg {
    transform: translateX(-4px);
}

/* Empty State */
.bl-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(15, 23, 42, .4);
    border: 1px dashed rgba(0, 211, 243, .2);
    border-radius: var(--r);
}

.bl-empty svg {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    display: block;
    color: rgba(0, 211, 243, .3);
}

.bl-empty h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: rgba(255, 255, 255, .7);
    margin: 0 0 .5rem;
}

.bl-empty p {
    color: rgba(255, 255, 255, .4);
    font-size: .95rem;
    margin: 0;
    line-height: 1.7;
}

/* Skeleton Loader */
.bl-sk {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: var(--r);
    overflow: hidden;
}

.bl-sk .si {
    width: 100%;
    padding-top: 58%;
    background: linear-gradient(110deg, #0f172a 30%, #1a2744 50%, #0f172a 70%);
    background-size: 300% 100%;
    animation: shm 1.8s ease-in-out infinite;
}

.bl-sk .sb {
    padding: 1.5rem;
}

.bl-sk .sl {
    border-radius: 6px;
    background: linear-gradient(110deg, #1e293b 30%, #2a3a52 50%, #1e293b 70%);
    background-size: 300% 100%;
    animation: shm 1.8s ease-in-out infinite;
    margin-bottom: .75rem;
}

@keyframes shm {
    0% {
        background-position: 200% 0;
    }
    to {
        background-position: -200% 0;
    }
}

/* Error State */
.bl-err {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(239, 68, 68, .05);
    border: 1px solid rgba(239, 68, 68, .15);
    border-radius: var(--r);
}

.bl-err p {
    color: rgba(255, 255, 255, .6);
    margin: 0 0 1rem;
    font-size: .95rem;
}

.bl-err button {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(0, 211, 243, .1);
    border: 1px solid rgba(0, 211, 243, .3);
    color: var(--c);
    padding: .6rem 1.5rem;
    border-radius: .75rem;
    font-size: .9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: .3s;
}

.bl-err button:hover {
    background: rgba(0, 211, 243, .2);
}

/* Mobile Slider */
@media (max-width: 639px) {
    .bl-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 1rem;
        gap: 1rem;
    }
    
    .bl-grid::-webkit-scrollbar {
        display: none;
    }
    
    .bl-grid > li {
        min-width: 85%;
        max-width: 85%;
        scroll-snap-align: center;
        flex-shrink: 0;
    }
    
    .bl-c {
        min-width: 100%;
        max-width: 100%;
    }
    
    .bl-dots {
        display: flex;
        justify-content: center;
        gap: .5rem;
        margin-bottom: 2rem;
    }
    
    .bl-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(255, 255, 255, .15);
        border: none;
        padding: 0;
        cursor: pointer;
        transition: .3s;
    }
    
    .bl-dot.on {
        background: var(--c);
        box-shadow: 0 0 10px rgba(0, 211, 243, .5);
        width: 24px;
        border-radius: 4px;
    }
}

@media (min-width: 640px) {
    .bl-dots {
        display: none !important;
    }
}

/* Fade Animation */
.fade {
    opacity: 0;
    transform: translateY(30px);
    transition: .7s ease;
}

.fade.show {
    opacity: 1;
    transform: translateY(0);
}

/* Lazy Load Image */
.tsb-lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tsb-lazy.loaded {
    opacity: 1;
}
