/* NewsPlayGrid Frontend Styles - Pinterest Masonry Grid */

.newsplaygrid-container {
    width: 100%;
    max-width: 1600px;
    margin: 20px auto;
    padding: 0 15px;
}

.newsplaygrid-grid {
    margin: 0 auto;
}

/* When Masonry.js is enabled */
.newsplaygrid-grid.masonry-enabled {
    /* Masonry will handle the layout */
}

.newsplaygrid-grid.masonry-enabled .newsplaygrid-item {
    width: calc(20% - 20px); /* 5 columns */
    float: left;
    margin-bottom: 25px;
}

/* Fallback: CSS columns when Masonry.js is not available */
.newsplaygrid-grid:not(.masonry-enabled) {
    column-count: 1;
    column-gap: 20px;
}

.newsplaygrid-item {
    width: 100%;
    margin-bottom: 20px;
    break-inside: avoid;
    page-break-inside: avoid;
}

/* Responsive - Masonry enabled */
@media (min-width: 576px) {
    .newsplaygrid-grid:not(.masonry-enabled) {
        column-count: 2;
        column-gap: 20px;
    }
    .newsplaygrid-grid.masonry-enabled .newsplaygrid-item {
        width: calc(50% - 15px);
    }
}

@media (min-width: 768px) {
    .newsplaygrid-grid:not(.masonry-enabled) {
        column-count: 3;
        column-gap: 20px;
    }
    .newsplaygrid-grid.masonry-enabled .newsplaygrid-item {
        width: calc(33.333% - 17px);
    }
}

@media (min-width: 992px) {
    .newsplaygrid-grid:not(.masonry-enabled) {
        column-count: 4;
        column-gap: 25px;
    }
    .newsplaygrid-grid.masonry-enabled .newsplaygrid-item {
        width: calc(25% - 19px);
    }
}

@media (min-width: 1200px) {
    .newsplaygrid-grid:not(.masonry-enabled) {
        column-count: 5;
        column-gap: 25px;
    }
    .newsplaygrid-grid.masonry-enabled .newsplaygrid-item {
        width: calc(20% - 20px); /* 5 columns */
    }
}

.newsplaygrid-item-inner {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
    margin-bottom: 15px;
    overflow: hidden;
}

.newsplaygrid-item-inner:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.newsplaygrid-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
    padding: 0 20px;
}

.newsplaygrid-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.newsplaygrid-title a:hover {
    color: #0073aa;
}

.newsplaygrid-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #666;
}

.newsplaygrid-source {
    font-weight: 600;
    color: #0073aa;
}

.newsplaygrid-date {
    color: #999;
}

.newsplaygrid-description {
    margin-bottom: 15px;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

.newsplaygrid-readmore {
    display: inline-block;
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.newsplaygrid-readmore:hover {
    color: #005177;
    text-decoration: underline;
}

.newsplaygrid-empty {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666;
}

.newsplaygrid-empty p {
    margin: 0;
    font-size: 16px;
}

/* Image styles */
.newsplaygrid-image {
    width: 100%;
    margin-bottom: 15px;
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
}

.newsplaygrid-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

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

.newsplaygrid-item-inner > *:not(.newsplaygrid-image) {
    padding-left: 20px;
    padding-right: 20px;
}

.newsplaygrid-item-inner > .newsplaygrid-title {
    margin-top: 15px;
}

.newsplaygrid-item-inner > .newsplaygrid-readmore {
    margin-bottom: 20px;
    display: inline-block;
}
