/* MMSN Publications Frontend Grid CSS */

.mmsn-frontend-grid-wrapper {
    width: 100%;
    margin: 20px 0;
    box-sizing: border-box;
}

.mmsn-frontend-grid-wrapper * {
    box-sizing: border-box;
}

.mmsn-frontend-grid-empty {
    padding: 30px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    color: #64748b;
    font-size: 15px;
}

/* Flex Grid Container */
.mmsn-publications-flex-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
}

/* Publication Card (Desktop: 3 items in a row) */
.mmsn-publication-card {
    flex: 0 0 calc(33.333% - 14px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

/* Preview Image Wrapper */
.mmsn-card-preview-wrapper {
    height: 380px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    width: 100%;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

/* Gradient Overlay inside Image */
.mmsn-card-overlay {
    width: 100%;
    padding: 24px 20px 20px 20px;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.6) 60%, rgba(15, 23, 42, 0) 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}



/* Card Title */
.mmsn-card-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 2.8em;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mmsn-publication-card:hover .mmsn-card-title {
    -webkit-line-clamp: 12;
    max-height: 16.8em; /* Reveal up to 12 lines smoothly */
}

/* Card Separator Line */
.mmsn-card-separator {
    height: 1px;
    background: #e2e8f0;
    width: 100%;
}

/* Buttons Bar (Flex row) */
.mmsn-card-buttons-bar {
    display: flex;
    padding: 16px 20px;
    gap: 12px;
    background: #f8fafc;
}

/* Button stylings */
.mmsn-card-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.2s ease;
    line-height: 1.5;
    border: 1px solid transparent;
}

.mmsn-card-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Preview Button - Ghosty style */
.mmsn-card-btn-preview {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155 !important;
}

.mmsn-card-btn-preview:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b !important;
}

/* Download Button - Teal filled */
.mmsn-card-btn-download {
    background: #004E66;
    color: #ffffff !important;
}

.mmsn-card-btn-download:hover {
    background: #00384a;
}

/* Media Queries (Responsive design) */

/* 2 Columns on tablets */
@media (max-width: 991px) {
    .mmsn-publication-card {
        flex: 0 0 calc(50% - 10px);
    }
}

/* 1 Column on mobile */
@media (max-width: 600px) {
    .mmsn-publications-flex-grid {
        gap: 16px;
    }
    .mmsn-publication-card {
        flex: 0 0 100%;
    }
    .mmsn-card-preview-wrapper {
        height: 320px;
    }
}
