/* Fallback for AOS failure */
[data-aos] {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
}
/* Override AOS styles when initialized */
[data-aos].aos-animate {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}


/* Modern Article Section */
.modern-artikel {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    align-items: center;
    margin-bottom:20px;
}


/* Article Section */
.artikel-section {
    padding: 40px;
    background: #f8f9fa; /* Light background for contrast */
    margin-bottom:20px;
    align-items: center;
}

/* Ensure the row behaves as a flex container */
.artikel-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* Consistent spacing between cards */
}



/* Article Card Styling */
.artikel-card-modern {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure cards stretch to equal height */
}

.artikel-card-modern:hover {
    transform: translateY(-5px);
}

/* Image Wrapper */
.artikel-img-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9; /* Consistent image aspect ratio */
}

.artikel-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure images fill the space without distortion */
}

/* Overlay for Category Badge */
.artikel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: flex-end;
    padding: 10px;
}

.category-badge {
    background: #007bff;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Card Body */
.artikel-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.artikel-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: #333;
}

.artikel-meta {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
}

.artikel-text {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 15px;
    flex-grow: 1;
}

.btn-read-more {
    align-self: flex-start;
}

/* Ensure Bootstrap Grid Works */
.row > .col-lg-6 {
    display: flex;
    flex: 0 0 50%;
    max-width: 50%;
}

/* Responsive Adjustments */
@media (max-width: 991px) { /* Below lg breakpoint */
    .artikel-item {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 767px) { /* Below md breakpoint */
    .artikel-item {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .artikel-card-modern {
        margin-bottom: 20px;
    }
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .artikel-card-modern {
        margin-bottom: 20px;
    }
}

.btn-read-more {
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: 25px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-read-more:hover {
    background-color: #0056b3;
    color: #fff;
}

.btn-load-more {
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 25px;
    background: #007bff;
    color: #fff;
    border: none;
    transition: background 0.3s ease;
}

.btn-load-more:hover {
    background: #0056b3;
}

@media (max-width: 768px) {
    .artikel-title {
        font-size: 1.3rem;
    }
    .artikel-text {
        font-size: 0.95rem;
    }
    .artikel-card-modern {
        margin-bottom: 20px;
    }
}


/* CSS Animation for article cards */
.animate-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s ease-out forwards;
    animation-delay: calc(var(--index) * 0.1s);
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure visibility for dynamically loaded cards */
.artikel-grid .animate-card {
    --index: 0;
}


/* Override any conflicting styles */
.artikel-section .row.artikel-grid {
    display: flex !important;
    flex-wrap: wrap !important;
}

.artikel-section .row.artikel-grid .artikel-item {
    flex: 0 0 31% !important;
    max-width: 100% !important;
}

@media (max-width: 767px) {
    .artikel-section .row.artikel-grid .artikel-item {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}


