/**
 * Portfolio Link Widget – base styles
 *
 * These are the layout / animation styles that do not depend on any
 * Elementor control value and therefore belong in a static stylesheet
 * rather than in dynamically generated inline CSS.
 */

/* Wrapper + link */
.random-portfolio-thumbnail-wrapper,
.random-portfolio-thumbnail-link {
    margin-top: 0.5em;
    display: inline-block;
}

.random-portfolio-thumbnail-link,
.random-portfolio-thumbnail-link:hover {
    transition: transform 0.3s;
}

.random-portfolio-thumbnail-link:hover,
.random-portfolio-thumbnail-link:hover .random-portfolio-title {
    transform: translateY(-0.5em);
}

.random-portfolio-thumbnail-link:hover .random-portfolio-title {
    opacity: 1 !important;
}

.random-portfolio-thumbnail-link:hover .random-portfolio-title-wrapper::before {
    opacity: 1 !important;
}

/* Thumbnail container */
.random-portfolio-thumbnail {
    position: relative;
    overflow: hidden;
    -webkit-mask-image: -webkit-radial-gradient(white, black); /* Safari: force clipping of positioned children with border-radius */
}

/* Image */
.random-portfolio-thumbnail img {
    display: block;
    width: auto;
    height: auto;
}

/* Title wrapper (positioned over image) */
.random-portfolio-title-wrapper {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    pointer-events: none;
}

/* Gradient overlay (::before on title wrapper, always behind title text) */
.random-portfolio-title-wrapper::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 200%;
    background: linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.66) 15%,
        rgba(255, 255, 255, 0) 60%
    );
    pointer-events: none;
    transition: opacity 0.5s;
    opacity: 0;
    z-index: 0;
}

/* Title text */
.random-portfolio-title {
    position: relative;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s, transform 0.5s;
    width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow: hidden;
    transform: translateY(0);
}
