/* Hover Card Widget Styles (Original) */
.hover-card-widget {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-card-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, transparent 40%, rgba(1, 60, 50, 0.6) 70%, rgba(1, 60, 50, 0.9) 100%);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.hover-card-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* Position Variations */
.position-top-left .hover-card-content {
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
}

.position-top-center .hover-card-content {
    justify-content: flex-start;
    align-items: center;
    text-align: center;
}

.position-top-right .hover-card-content {
    justify-content: flex-start;
    align-items: flex-end;
    text-align: right;
}

.position-center-left .hover-card-content {
    justify-content: center;
    align-items: flex-start;
    text-align: left;
}

.position-center-center .hover-card-content {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.position-center-right .hover-card-content {
    justify-content: center;
    align-items: flex-end;
    text-align: right;
}

.position-bottom-left .hover-card-content {
    justify-content: flex-end;
    align-items: flex-start;
    text-align: left;
}

.position-bottom-center .hover-card-content {
    justify-content: flex-end;
    align-items: center;
    text-align: center;
}

.position-bottom-right .hover-card-content {
    justify-content: flex-end;
    align-items: flex-end;
    text-align: right;
}

.hover-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.hover-card-icon i,
.hover-card-icon svg {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-card-title {
    margin: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.hover-card-description {
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(-10px);
    will-change: opacity, transform, max-height;
}

.hover-card-description p {
    margin: 0;
}

.hover-card-line {
    opacity: 0;
    visibility: hidden;
    background-color: #333333;
    height: 2px;
    width: 50px;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
        visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
        width 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
    will-change: opacity, width;
}

.hover-card-widget:hover .hover-card-description {
    opacity: 1;
    visibility: visible;
    max-height: 500px;
    transform: translateY(0);
}

.hover-card-widget:hover .hover-card-line {
    opacity: 1;
    visibility: visible;
}

.hover-card-widget:hover .hover-card-icon {
    transform: scale(1.08);
}

.hover-card-widget:hover .hover-card-title {
    transform: translateY(-3px);
}

.hover-card-widget:hover {
    transform: translateY(-2px);
}

/* Custom Post Cards Widget Styles */
.post-cards-container {
    width: 100%;
    margin-bottom: 20px;
}

/* Grid Layout */
.post-cards-container.grid-layout {
    display: grid;
    /* Default fallback, overridden by Elementor Value */
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

/* Remove !important overrides to allow Elementor responsive controls to work */
@media (max-width: 992px) {
    .post-cards-container.grid-layout {
        /* Default fallback only */
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .post-cards-container.grid-layout {
        /* Default fallback only */
        grid-template-columns: 1fr;
    }
}

/* Slider Layout */
.post-cards-container.slider-layout {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 20px;
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.post-cards-container.slider-layout::-webkit-scrollbar {
    height: 6px;
}

.post-cards-container.slider-layout::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.post-cards-container.slider-layout::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.post-cards-container.slider-layout .post-card-item {
    flex: 0 0 auto;
    width: 300px;
    scroll-snap-align: start;
}

.post-cards-container.grid-layout .post-card-item {
    width: auto;
    min-width: 0;
    /* Prevents grid blowout */
}

/* Post Card Base */
.post-card {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    height: 400px;
    /* Fallback */
    width: 100%;
    background-color: #f0f0f0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    /* Smooth transition for the card container itself */
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.post-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    /* Slower, smoother zoom */
    z-index: 1;
}

.post-card:hover .post-card-bg {
    transform: scale(1.1);
}

.post-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 2;
    transition: opacity 0.4s ease;
}

.post-card-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    z-index: 3;
    box-sizing: border-box;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.post-card:hover .post-card-content {
    /* Slightly lift content on hover */
    transform: translateY(-5px);
}

/* Top Section */
.post-card-top {
    display: flex;
    justify-content: flex-start;
    /* Arrow is left aligned now */
    align-items: flex-start;
    width: 100%;
}

/* Arrow Icon Box */
/* Arrow Icon Box */
/* Arrow Icon Box */
.post-card-icon-box {
    width: 40px;
    height: 40px;

    /* Stronger Glass Effect */
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);

    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: white;

    /* Positioning - Default LTR (English) -> Top Right */
    position: absolute;
    top: 20px;
    right: 20px;
    left: auto;
    z-index: 10;

    /* Animation Initial State */
    opacity: 0;
    transform: translate(-10px, 10px);
    /* LTR: Move Inwards (Left-Down) */
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* RTL (Arabic) Override -> Top Left */
body.rtl .post-card-icon-box {
    left: 20px;
    right: auto;
    transform: translate(10px, 10px);
    /* RTL: Move Inwards (Right-Down) */
}

/* Hover States */
.post-card:hover .post-card-icon-box {
    opacity: 1;
    transform: translate(0, 0);
    /* Move to corner */
    background-color: rgba(255, 255, 255, 0.25);
}

body.rtl .post-card:hover .post-card-icon-box {
    transform: translate(0, 0);
    /* RTL Hover relative to its start transform */
}

/* Icon Rotation */
.post-card-icon-box i {
    transform: rotate(-45deg);
    /* LTR: Up-Right */
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* RTL Icon Rotation: Point Top-Left */
body.rtl .post-card-icon-box i {
    transform: rotate(-135deg);
    /* RTL: Up-Left */
}

/* Hover Icon Animations */
.post-card:hover .post-card-icon-box i {
    transform: rotate(-45deg) scale(1.1);
}

body.rtl .post-card:hover .post-card-icon-box i {
    transform: rotate(-135deg) scale(1.1);
}


/* Bottom Section */
.post-card-bottom {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
}

/* Badges */
.post-card-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
}

/* Shared Badge Styles */
.post-card-category,
.post-card-live-badge {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    color: white;
    margin-bottom: 0 !important;
}

.post-card-category {
    background-color: #f39c12;
    backdrop-filter: blur(5px);
}

.post-card-live-badge {
    background-color: #e74c3c;
    gap: 6px;
}

.live-dot {
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
    display: inline-block;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.post-card-title {
    margin: 0 0 8px 0;
    padding: 0;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 700;
}

.post-card-title a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-title a:hover {
    color: #e0e0e0;
}

.post-card-date {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.post-card-date i {
    font-size: 11px;
}

/* Mobile specific fix for height */
@media (max-width: 576px) {
    .post-card {
        height: 300px;
    }
}

/* --- Logo Loop Widget Styles --- */
.logo-loop-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.logo-loop-track {
    display: flex;
    flex-direction: row;
    width: max-content;
    animation: logoLoop 20s linear infinite;
}

.logo-loop-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    /* margin-right is set inline via controls */
}

.logo-loop-item img {
    max-width: none;
    /* Prevent responsive max-width */
    height: 50px;
    /* Default fallback */
    width: auto;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* Grayscale */
.logo-loop-container.is-grayscale .logo-loop-item img {
    filter: grayscale(100%);
    opacity: 0.7;
}

.logo-loop-container.is-grayscale .logo-loop-item:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* Fade Edges Using Mask */
.logo-loop-container.has-fade {
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

@keyframes logoLoop {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
        /* Moves half the duplicated content */
    }
}

/* Pause on hover (handled by inline style but good to have class) */
.logo-loop-container:hover .logo-loop-track.paused {
    animation-play-state: paused;
}

/* Ensure logo loop animation logic handles duplication correctly */
@keyframes logoLoop {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* 
   Since we duplicate the logos once (creating 2 identical sets), 
   moving by -50% shifts the entire first set out of view, 
   seamlessly replaced by the second set. 
*/

/* Adjust for Right-to-Left (Reverse) Direction */
.logo-loop-track[style*="animation-direction: reverse"] {
    animation-name: logoLoopReverse;
}

@keyframes logoLoopReverse {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}

/* Make sure container doesn't overflow */
.logo-loop-container {
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}


/* --- Fix: Force Row Layout for Logo Loop --- */
.logo-loop-track {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: max-content !important;
    box-sizing: border-box;
}

.logo-loop-item {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
}

/* Ensure images don't force breaks */
.logo-loop-item img {
    display: block;
    border: none;
    box-shadow: none;
}

/* --- Fix: Make Post Card Clickable --- */
a.post-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Ensure title looks right without the inner anchor tag */
.post-card-title {
    color: white;
    cursor: pointer;
}

/* Previous rule was .post-card-title a:hover */
.post-card:hover .post-card-title {
    color: #e0e0e0;
}