/* ==========================================================================
   Custom Post Display - Frontend Styles
   ========================================================================== */

/* Container */
.plb-container {
    width: 100%;
    margin: 2rem 0;
}

/* ==========================================================================
   Grid Layout
   ========================================================================== */

.plb-layout-grid .plb-posts-wrapper {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.plb-layout-grid.plb-posts-wrapper[data-columns="1"] {
    grid-template-columns: 1fr;
}

.plb-layout-grid .plb-posts-wrapper.plb-columns-2 {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.plb-layout-grid .plb-posts-wrapper.plb-columns-3 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.plb-layout-grid .plb-posts-wrapper.plb-columns-4 {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.plb-layout-grid .plb-posts-wrapper.plb-columns-5 {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.plb-layout-grid .plb-posts-wrapper.plb-columns-6 {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.plb-layout-grid .plb-post-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.plb-layout-grid .plb-post-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   List Layout
   ========================================================================== */

.plb-layout-list .plb-posts-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.plb-layout-list .plb-post-item {
    display: flex;
    gap: 1.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.3s ease;
}

.plb-layout-list .plb-post-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.plb-layout-list .plb-post-thumbnail {
    flex-shrink: 0;
    width: 200px;
    height: 150px;
}

.plb-layout-list .plb-post-content {
    flex: 1;
}

/* ==========================================================================
   Table Layout
   ========================================================================== */

.plb-layout-table .plb-table-wrapper {
    overflow-x: auto;
}

.plb-layout-table .plb-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.plb-layout-table .plb-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.plb-layout-table .plb-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.plb-layout-table .plb-table td {
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    vertical-align: middle;
}

.plb-layout-table .plb-table tbody tr {
    transition: background-color 0.2s ease;
}

.plb-layout-table .plb-table tbody tr:hover {
    background-color: #f9fafb;
}

.plb-layout-table .plb-table-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.plb-layout-table .plb-table-title a {
    font-weight: 600;
    color: #111827;
    text-decoration: none;
}

.plb-layout-table .plb-table-title a:hover {
    color: #2563eb;
}

/* ==========================================================================
   Common Elements
   ========================================================================== */

/* Thumbnail */
.plb-post-thumbnail {
    position: relative;
    overflow: hidden;
}

.plb-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.plb-post-thumbnail:hover img {
    transform: scale(1.05);
}

.plb-layout-grid .plb-post-thumbnail {
    height: 200px;
}

.plb-post-thumbnail a {
    display: block;
    height: 100%;
}

/* Content */
.plb-post-content {
    padding: 1.5rem;
}

.plb-layout-list .plb-post-content {
    padding: 0;
}

/* Title */
.plb-post-title {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    line-height: 1.4;
}

.plb-post-title a {
    color: #111827;
    text-decoration: none;
    transition: color 0.2s ease;
}

.plb-post-title a:hover {
    color: #2563eb;
}

/* Meta */
.plb-post-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.plb-post-date,
.plb-post-author {
    display: flex;
    align-items: center;
}

.plb-post-date::before {
    content: "📅";
    margin-right: 0.25rem;
}

.plb-post-author::before {
    content: "✍️";
    margin-right: 0.25rem;
}

/* Excerpt */
.plb-post-excerpt {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

/* Read More */
.plb-read-more {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.plb-read-more:hover {
    background: #1d4ed8;
    color: #fff;
}

/* No Posts */
.plb-no-posts {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
    font-size: 1.125rem;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .plb-layout-grid .plb-posts-wrapper {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .plb-layout-list .plb-post-item {
        flex-direction: column;
    }
    
    .plb-layout-list .plb-post-thumbnail {
        width: 100%;
        height: 200px;
    }
    
    .plb-layout-table .plb-table {
        font-size: 0.875rem;
    }
    
    .plb-layout-table .plb-table th,
    .plb-layout-table .plb-table td {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .plb-layout-grid .plb-posts-wrapper {
        grid-template-columns: 1fr;
    }
    
    .plb-post-content {
        padding: 1rem;
    }
    
    .plb-post-title {
        font-size: 1.125rem;
    }
}
