/**
 * Work Showcase Widget
 * CSS File
 */


/* Widget wrapper */

.cinematic-work-showcase-wrapper {
    position: relative;
    max-width: 80rem;
    margin: 0 auto;
    perspective: 1000px;
    /* Add perspective for 3D animations */
}


/* Grid layout - Two column with offset */

.cinematic-work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 1.5rem;
    min-height: 300px;
    /* Ensure minimum height during animation */
    will-change: opacity;
    /* Optimize for animation */
}


/* Create offset for the odd columns */

.cinematic-work-grid .cinematic-work-item:nth-child(2n+1) {
    margin-top: 50px;
}


/* Item styling */

.cinematic-work-item {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    overflow: hidden;
    background-color: unset;
    box-shadow: none;
    will-change: transform, opacity;
    /* Optimize for animation */
    transform-style: preserve-3d;
    /* Better performance for 3D transforms */
    backface-visibility: hidden;
    /* Prevent flickering on some browsers */
}


/* Remove default transition since GSAP will handle this */

.cinematic-work-item:hover {
    transform: none;
}


/* Image container */

.cinematic-work-image {
    position: relative;
    height: 430px !important;
    overflow: hidden;
    border-radius: 0;
    will-change: transform, opacity;
    /* Optimize for animation */
    transform: translateZ(0);
    /* Force hardware acceleration */
    backface-visibility: hidden;
}

.cinematic-work-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Remove transition since GSAP will handle this */
    transform-origin: center center;
    will-change: transform;
    transform: translateZ(0);
}


/* Top Right Text Styling */

.cinematic-work-top-right-text {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 15px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    pointer-events: none;
    will-change: transform, opacity;
    transform: translateZ(0);
}


/* Layout specific styles */

.cinematic-work-layout-top_right .cinematic-work-item {
    position: relative;
}


/* Right Container Layout */

.cinematic-right-container-section {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 2rem;
}

.cinematic-right-container-wrapper {
    width: 100%;
    max-width: 50%;
}

.cinematic-right-container {
    color: #fff;
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cinematic-right-container-heading {
    font-size: 2rem;
    line-height: 1.2;
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.cinematic-right-container-content {
    font-size: 1rem;
    line-height: 1.5;
}

.cinematic-work-layout-right_container.cinematic-work-grid {
    margin-top: 2rem;
}


/* Ensure content displays correctly in all layouts */

.cinematic-work-layout-right_container .cinematic-work-content {
    padding: 0.75rem 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    color: #fff;
    background-color: unset;
    border-top: none;
}


/* Clear any possible float */

.cinematic-work-layout-right_container:after {
    content: "";
    display: table;
    clear: both;
}


/* Responsive adjustments for right container */

@media (max-width: 1024px) {
    .cinematic-right-container-wrapper {
        max-width: 60%;
    }
    .cinematic-right-container-heading {
        font-size: 1.75rem;
    }
}

@media (max-width: 767px) {
    .cinematic-right-container-section {
        justify-content: center;
    }
    .cinematic-right-container-wrapper {
        max-width: 100%;
    }
    .cinematic-right-container-heading {
        font-size: 1.5rem;
    }
}


/* Content styling */

.cinematic-work-content {
    padding: 0.75rem 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    color: #fff;
    background-color: unset;
    border-top: none;
    will-change: transform, opacity;
    /* Optimize for animation */
    transform: translateZ(0);
}


/* Title styling */

.cinematic-work-title {
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0 0 0.25rem 0;
    line-height: 1.2;
    will-change: opacity, transform;
}

.cinematic-work-title a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.cinematic-work-title a:hover {
    color: rgba(255, 255, 255, 0.8);
}


/* Category styling */

.cinematic-work-category {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    font-weight: 300;
    letter-spacing: 0.01em;
    border-bottom: 1px solid #ffffff1a;
    will-change: opacity, transform;
}


/* Date styling */

.cinematic-work-date {
    margin-top: 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
    border-top: none;
    padding-top: 0;
    border-bottom: 1px solid #ffffff1a;
    will-change: opacity, transform;
}

.cinematic-work-date .date-label {
    display: none;
}

.cinematic-work-date .date-value {
    color: rgba(255, 255, 255, 0.5);
}


/* Hover effects - used in combination with GSAP animations */


/* Zoom effect - base styles only, animation handled by GSAP */

.cinematic-work-hover-zoom .cinematic-work-image img {
    transition: none;
    /* Remove transition since GSAP handles this */
}


/* Grayscale effect */

.cinematic-work-hover-grayscale .cinematic-work-image img {
    filter: grayscale(0);
    transition: filter 0.3s ease;
}

.cinematic-work-hover-grayscale .cinematic-work-image img:hover {
    filter: grayscale(100%);
}


/* Overlay effect */

.cinematic-work-hover-overlay .cinematic-work-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    opacity: 0;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.cinematic-work-hover-overlay .cinematic-work-image:hover::before {
    opacity: 1;
}


/* No items message */

.cinematic-work-no-items {
    text-align: center;
    padding: 40px;
    font-size: 1.1rem;
    color: #fff;
    background-color: #000;
    border-radius: 0;
}


/* Animation states */


/* Initial state for GSAP to animate from (not visible in normal usage) */

.elementor-editor-active .cinematic-work-item,
.elementor-editor-active .cinematic-work-image,
.elementor-editor-active .cinematic-work-content,
.elementor-editor-active .cinematic-work-title,
.elementor-editor-active .cinematic-work-category,
.elementor-editor-active .cinematic-work-date,
.elementor-editor-active .cinematic-work-top-right-text {
    opacity: 1 !important;
    transform: none !important;
}


/* Optimize animations in preview and render */

.elementor-widget-cinematic-work-showcase {
    transform: translateZ(0);
}


/* Responsive styles */

@media (max-width: 1024px) {
    .cinematic-work-grid {
        grid-gap: 1rem;
    }
    .cinematic-work-grid .cinematic-work-item:nth-child(2n+1) {
        margin-top: 30px;
    }
}

@media (max-width: 767px) {
    .cinematic-work-grid {
        grid-template-columns: 1fr;
    }
    .cinematic-work-grid .cinematic-work-item:nth-child(2n+1) {
        margin-top: 0;
    }
    .cinematic-work-image {
        height: 200px !important;
    }
    .cinematic-work-content {
        padding: 0.75rem 1rem;
    }
    .cinematic-work-title {
        font-size: 1.1rem;
    }
}