/* Rezultati Page Styles */

body.page-template-page-rezultati {
    background: #fff !important;
}

.rezultati-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 30px;
    background: #fff;
}

/* Grid layout - 3 columns */
.rezultati-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px 50px;
    margin-top: 20px;
    align-items: start;
}

/* Individual card - simple layout */
.rezultati-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
    cursor: pointer; /* Only visual change - cursor becomes hand */
}

/* Text paragraph */
.card-text {
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    font-weight: 400 !important;
    line-height: 1.5;
    color: #000;
    margin: 0;
    min-height: 100px;
    max-height: 100px; /* Adjust this value */
    overflow-y: scroll; /* Always scrollable */
    padding-right: 8px;
    scrollbar-width: none; /* Firefox - hide scrollbar */
    -ms-overflow-style: none; /* IE/Edge - hide scrollbar */
    
    /* Initial fade at bottom */
    mask-image: linear-gradient(to bottom, 
        transparent 0%,
        black 15%,
        black 85%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(to bottom, 
        transparent 0%,
        black 15%,
        black 85%,
        transparent 100%
    );
    
    transition: mask-image 0.3s, -webkit-mask-image 0.3s;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.card-text::-webkit-scrollbar {
    display: none;
    width: 0;
}

/* SCROLL POSITION DETECTION */
/* Top fade when NOT at the top */
.card-text:not([data-scroll-top="true"]) {
    mask-image: linear-gradient(to bottom, 
        transparent 0%,
        black 15%,
        black 85%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(to bottom, 
        transparent 0%,
        black 15%,
        black 85%,
        transparent 100%
    );
}

/* Bottom fade when NOT at the bottom */
.card-text:not([data-scroll-bottom="true"]) {
    mask-image: linear-gradient(to bottom, 
        transparent 0%,
        black 15%,
        black 85%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(to bottom, 
        transparent 0%,
        black 15%,
        black 85%,
        transparent 100%
    );
}

/* No bottom fade when scrolled to bottom */
.card-text[data-scroll-bottom="true"] {
    mask-image: linear-gradient(to bottom, 
        transparent 0%,
        black 15%,
        black 100%
    );
    -webkit-mask-image: linear-gradient(to bottom, 
        transparent 0%,
        black 15%,
        black 100%
    );
}

/* No top fade when scrolled to top */
.card-text[data-scroll-top="true"] {
    mask-image: linear-gradient(to bottom, 
        black 0%,
        black 85%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(to bottom, 
        black 0%,
        black 85%,
        transparent 100%
    );
}

/* No fades when in the middle */
.card-text[data-scroll-top="false"][data-scroll-bottom="false"] {
    mask-image: linear-gradient(to bottom, 
        transparent 0%,
        black 15%,
        black 85%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(to bottom, 
        transparent 0%,
        black 15%,
        black 85%,
        transparent 100%
    );
}

/* ALWAYS show fades on hover (if content is scrollable) */
.rezultati-card:hover .card-text:not([data-scroll-top="true"]):not([data-scroll-bottom="true"]) {
    mask-image: linear-gradient(to bottom, 
        transparent 0%,
        black 15%,
        black 85%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(to bottom, 
        transparent 0%,
        black 15%,
        black 85%,
        transparent 100%
    );
}

/* Image - black border, no padding */
.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 3px solid #000;
    padding: 0;
    background: #000; /* Black matches border, hides gaps better */
}

/* Button */
.card-link-btn {
    display: inline-block;
    background: #9fb4f9;
    color: #fff;
    padding: 4px 10px;
    border: 2px solid transparent;
    border-radius: 14px;
    font-family: 'Work Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    align-self: flex-start;
}

.card-link-btn:hover {
    color: #9fb4f9 !important;
    background-color: #fff !important;
    border: 2px solid #9fb4f9 !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Responsive design */
@media (max-width: 1200px) {
    .rezultati-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 50px 40px;
    }
}

@media (max-width: 768px) {
    .rezultati-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .rezultati-container {
        padding: 40px 20px;
    }
    
    .card-image {
        height: 300px;
    }
}