/**
 * News Grid Widget Styles
 */


/* Grid Structure */

.news-grid-wrapper {
    width: 100%;
    max-width: 100%;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
    grid-auto-rows: 1fr;
}


/* Related Posts Mode Styles */

.news-grid-related-mode {
    margin-top: 40px;
}

.news-grid-related-mode .news-grid-related {
    grid-template-columns: 1fr;
    /* Single column for related post */
    max-width: 100%;
}

.news-grid-related-mode::before {
    content: attr(data-related-title, 'Related Post');
    display: block;
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
    color: #0f0f0f;
}


/* Filter Styles */

.news-filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 30px;
}

.news-filter-button {
    background-color: transparent;
    color: #0D0D0D !important;
    border: 1px solid #0D0D0D !important;
    padding: 8px 24px !important;
    border-radius: 30px !important;
    cursor: pointer;
    margin-right: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    -webkit-border-radius: 30px !important;
    -moz-border-radius: 30px !important;
    -ms-border-radius: 30px !important;
    -o-border-radius: 30px !important;
}

.news-filter-button:hover {
    background-color: #0d0d0d !important;
    color: #ffffff !important;
}

.news-filter-button.active {
    background-color: #0d0d0d !important;
    color: #ffffff !important;
}

.news-filter-dropdown {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #ffffff;
    color: #333333;
    cursor: pointer;
    width: 200px;
    max-width: 100%;
}


/* Card Styles */

.news-card {
    background-color: #0f0f0f;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    color: #ffffff;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
    position: relative;
}

.news-card-image {
    height: 280px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.news-card-image:after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    width: 100%;
    height: 30px;
    z-index: 1;
    background-color: #0D0D0D;
    ;
    transform: rotate(3deg);
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}


/* Hover Effects */

.news-card-image.hover-effect-zoom img:hover {
    transform: scale(1.05);
}

.news-card-image.hover-effect-grayscale img {
    filter: grayscale(0);
    transition: filter 0.5s ease;
}

.news-card-image.hover-effect-grayscale img:hover {
    filter: grayscale(70%);
}

.news-card-image.hover-effect-brightness img {
    filter: brightness(1);
    transition: filter 0.5s ease;
}

.news-card-image.hover-effect-brightness img:hover {
    filter: brightness(1.1);
}

.news-card-content {
    padding: 22px 25px 25px;
    background-color: #0f0f0f;
    position: relative;
    z-index: 2;
    border-top: none;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}


/* Tilted divider */

.elementor-widget-news-grid[data-settings*="\"enable_tilted_divider\":\"yes\""] .news-card-content::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 40px;
    background-color: #0f0f0f;
    transform: skewY(-3deg);
    z-index: -1;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
}


/* Hide divider when disabled */

.elementor-widget-news-grid:not([data-settings*="\"enable_tilted_divider\":\"yes\""]) .news-card-content::before {
    display: none;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    font-size: 0.85em;
    color: #cccccc;
}

.news-card-category {
    background-color: #e02b3c;
    color: #ffffff;
    width: 85px;
    height: 85px;
    border-radius: 100%;
    font-size: clamp(0.5em, 1.8vw, 0.85em);
    font-weight: 500;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 5;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    line-height: 1.1;
    word-break: break-word;
    hyphens: auto;
    -webkit-border-radius: 100%;
    -moz-border-radius: 100%;
    -ms-border-radius: 100%;
    -o-border-radius: 100%;
}

.news-card-category:hover::after {
    content: attr(data-category);
    position: absolute;
    top: 120%;
    right: 50%;
    transform: translateX(50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    white-space: nowrap;
    z-index: 10;
}

.news-card-category.algemeen,
.news-card-category.catégorie-algemeen {
    background-color: #e02b3c;
}

.news-card-date {
    font-size: 0.85em;
    opacity: 0.7;
}

.news-card-title {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0;
    color: #ffffff;
    transition: color 0.3s ease;
    line-height: 1.3;
}

.news-card:hover .news-card-title {
    color: #f0f0f0;
}

.news-grid-no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    background-color: #f8f8f8;
    border-radius: 5px;
}

.no-posts-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    background-color: #f8f8f8;
    border-radius: 5px;
}


/* Responsive Styles */

@media (max-width: 1200px) {
    .news-card-category {
        width: 60px;
        height: 60px;
        font-size: clamp(0.45em, 1.6vw, 0.8em);
    }
}

@media (max-width: 767px) {
    .news-filter-container {
        flex-direction: column;
        align-items: center;
    }
    .news-filter-dropdown {
        width: 100%;
        max-width: 300px;
    }
    .news-card-category {
        width: 55px;
        height: 55px;
        font-size: clamp(0.4em, 1.5vw, 0.75em);
    }
}


/* Animation Preparation */

.news-card-animated {
    opacity: 0;
}


/* Elementor Editor Mode */

.elementor-editor-active .news-card-animated,
body.elementor-editor-active .news-card-animated,
.elementor-editor-preview .news-card-animated,
body.elementor-editor-preview .news-card-animated,
.news-grid-wrapper.elementor-editor-mode .news-card-animated,
.elementor-editor-active .news-grid-editor-mode .news-card-animated {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    animation: none !important;
    transition: none !important;
}


/* Fix for initial visibility in editor */

.elementor-editor-active .news-grid-wrapper,
.elementor-editor-preview .news-grid-wrapper,
.news-grid-wrapper.elementor-editor-mode,
.news-grid-wrapper.news-grid-editor-mode {
    min-height: 200px;
}


/* Ensure grid layout still works in editor */

.elementor-editor-active .news-grid,
.elementor-editor-preview .news-grid,
.news-grid-wrapper.elementor-editor-mode .news-grid {
    display: grid !important;
}


/* Correct any GSAP-related issues in editor */

.elementor-editor-active .news-card,
.elementor-editor-preview .news-card,
.news-grid-wrapper.elementor-editor-mode .news-card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}