/* ==== FILTER BUTTONS ==== */

.bnb-pub-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.bnb-pub-filter .filter-btn {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.bnb-pub-filter .filter-btn:hover {
    background: #e0e0e0;
}

.bnb-pub-filter .filter-btn.active {
    background: #000;
    color: #fff;
    border-color: #000;
    font-weight: 600;
}


/* ===== GRID LAYOUT ==== */

.bnb-publications-grid {
    display: grid;
    gap: 30px;
    justify-content: center;
    grid-template-columns: repeat(3, minmax(350px, 1fr)); 
    max-width: 1200px;
    margin: 0 auto;
}

/* ==== BREAKPOINTS ==== */

@media (max-width: 599px) {
    .bnb-publications-grid {
        grid-template-columns: repeat(1, minmax(280px, 1fr));
        max-width: 500px;
    }
}

@media (min-width: 600px) and (max-width: 1199px) {
    .bnb-publications-grid {
        grid-template-columns: repeat(2, minmax(320px, 1fr));
        max-width: 900px;
    }
}

/* ==== CARD STYLES ==== */
.bnb-publication-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bnb-publication-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.bnb-publication-image-wrap {
    background-color: #f9f9f9; 
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bnb-publication-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bnb-publication-content {
    padding: 16px 18px 20px;
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
}

.bnb-publication-title {
    font-style: italic;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.3;
    font-family: Helvetica, sans-serif;
    font-size: x-large;
}

.bnb-publication-excerpt {
    color: #555;
    font-size: 16px;
    margin-bottom: 12px;
    flex-grow: 1; 
}

.bnb-publication-date {
    font-size: 15px;
    margin-bottom: 15px;
}

.bnb-publication-read-more {
    background: #000;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
    font-size: 14px;
    align-self: flex-start; 
}

.bnb-publication-read-more:hover {
    background: #333;
}

.bnb-btn-loading {
    background: #444 !important;
    cursor: not-allowed !important;
    opacity: 0.8;
}


/* ==== MODAL STYLES ====== */

/* Modal Container */
#bnb-publication-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden; 
    transition: opacity .25s ease, visibility .25s;
}

#bnb-publication-modal.bnb-modal-visible {
    opacity: 1;
    visibility: visible;
}

/* Modal Overlay */
.bnb-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

/* Modal Inner Box  */
#bnb-publication-modal-inner {
    background: #fff;
    border-radius: 8px;
    max-width: 900px;
    width: 90%; 
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px 40px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000000;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

#bnb-publication-modal.bnb-modal-visible #bnb-publication-modal-inner {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    #bnb-publication-modal-inner {
        padding: 20px 25px;
        width: 95%;
    }
}

/* Close button */
#bnb-publication-close {
    position: absolute;
    color: #fff;
    right: 15px;
    top: 15px;
    width: 32px;
    height: 32px;
    background: #000;
    border: none;
    border-radius: 50%; 
    display: flex;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: 0.2s;
    z-index: 10;
}

#bnb-publication-close:hover {
    background: #888;
}

/* Modal Content Header */
.bnb-pub-modal-header h2 {
    margin-top: 0;
    font-size: 28px;
    font-weight: 700;
}

.bnb-pub-modal-header p {
    font-size: 14px;
    color: #555;
    margin: 5px 0;
}

.bnb-pub-modal-header hr {
    margin: 15px 0;
    border-color: #eee;
    margin-top: 1em !important;
    margin-bottom: 1em !important;
}

.bnb-pub-date-in-modal {
    color:#777;
    font-size:13px;
}

/* ==== LOADER BOX ==== */

#bnb-loader-box {
    position: absolute;
    z-index: 9999999;
    background: #fff;
    padding: 18px 24px;
    border-radius: 8px;
    display: none;
    align-items: center;
    gap: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.bnb-loading-text {
    font-weight: bold;
    font-size: 18px;
    margin: 0;
    color: black;
}

/* Spinner animation */
.bnb-spinner {
    width: 17px;
    height: 17px;
    border: 5px solid #ccc;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#bnb-publication-modal.bnb-modal-loading .bnb-modal-overlay {
    pointer-events: none;
    cursor: wait;
}

.bnb-publication-card {
  cursor: pointer;
}

.bnb-no-publications-wrap {
  grid-column: 1 / -1; 
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.bnb-no-publications-text {
  font-size: 18px !important;
  color: #555;
  text-align: center;
}



/* ===== PUBLICATIONS CAROUSEL ===== */

.bnb-publications-carousel {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    position: relative;

}

.bnb-publications-carousel::-webkit-scrollbar {
    display: none;
}

.bnb-carousel-slide {
    flex: 0 0 33.333%; 
    display: flex;
    box-sizing: border-box;
    padding: 0 10px; 
}

.bnb-carousel-slide .bnb-publication-card {
    width: 100%;
    margin: 0 auto;
}

.bnb-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    cursor: pointer;
    z-index: 999; 
    background: rgba(255,255,255,0.8);
    border-radius: 50%; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.bnb-carousel-arrow svg {
    width: 80%;
    height: 80%;
    fill: #000;
}

.bnb-carousel-arrow.elementor-swiper-button-prev {
    left: 0; 
}

.bnb-carousel-arrow.elementor-swiper-button-next {
    right: 0; 
}

.bnb-carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border-radius: 50%;
}

.bnb-publications-carousel-inner {
    overflow: hidden; 
    position: relative;
    width: 100%;
}

.bnb-publications-carousel-inner::-webkit-scrollbar {
    display: none;
}

.bnb-publications-carousel-track {
    display: flex;
    flex-wrap: nowrap !important;
    gap: 20px; 
    transition: transform 0.5s ease;
    scroll-snap-type: x mandatory;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .bnb-carousel-slide { flex: 0 0 33.333%; } 
}
@media (max-width: 1100px) and (min-width: 601px) {
    .bnb-carousel-slide { flex: 0 0 50%; } 
}
@media (max-width: 600px) {
    .bnb-carousel-slide { flex: 0 0 100%; } 
}

.bnb-publications-carousel.bnb-carousel-disabled .bnb-publications-carousel-track {
    justify-content: center;
    width: 100%;
}

/* Ensure arrows are visible on mobile when carousel is active */
@media (max-width: 768px) {
    .bnb-carousel-active .bnb-carousel-arrow {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .bnb-carousel-active .bnb-carousel-slide {
        flex: 0 0 85% !important; 
    }
    
    .bnb-carousel-active .bnb-publications-carousel-track {
        display: flex !important;
        flex-wrap: nowrap !important;
    }
}

#bnb-publication-modal.bnb-modal-loading #bnb-loader-box {
  display: flex;
}

#bnb-publication-modal.bnb-modal-loading #bnb-publication-modal-inner {
  display: none;
}