/**
 * Custom Post Grid Styles
 * Desktop: 2 columns | Tablet: 2 columns | Mobile: 1 column with ads
 */

/* ========================================
   WRAPPER & GRID
======================================== */

.cpg-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cpg-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

/* ========================================
   POST CARD
======================================== */

.cpg-post {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cpg-post:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

/* ========================================
   THUMBNAIL
======================================== */

.cpg-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 60%;
    overflow: hidden;
    background: #f3f4f6;
}

.cpg-thumbnail a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

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

.cpg-post:hover .cpg-thumbnail img {
    transform: scale(1.08);
}

/* ========================================
   CONTENT
======================================== */

.cpg-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Title */
.cpg-title {
    margin: 0 0 12px 0;
    font-size: 20px;
    line-height: 1.4;
    font-weight: 600;
}

.cpg-title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* Meta */
.cpg-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #9ca3af;
}

.cpg-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cpg-meta svg {
    flex-shrink: 0;
    color: #9ca3af;
}

/* Excerpt */
.cpg-excerpt {
    color: #6b7280;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
    flex-grow: 1;
}

/* Read More */
.cpg-readmore {
    display: inline-flex;
    align-items: center;
    color: #2563eb;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
    margin-top: auto;
}

.cpg-readmore:hover {
    color: #1d4ed8;
}

/* ========================================
   AD SLOT (MOBILE ONLY)
======================================== */

.cpg-ad-slot {
    display: none; /* Hidden on desktop and tablet */
    grid-column: 1 / -1;
    padding: 20px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    text-align: center;
    min-height: 100px;
}

/* ========================================
   NO POSTS MESSAGE
======================================== */

.cpg-no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 16px;
}

/* ========================================
   TABLET (768px - 1024px)
   Keep 2 columns
======================================== */

@media screen and (max-width: 1024px) and (min-width: 768px) {
    .cpg-grid {
        gap: 25px;
    }
    
    .cpg-title {
        font-size: 18px;
    }
}

/* ========================================
   MOBILE (< 768px)
   1 column + show ads
======================================== */

@media screen and (max-width: 767px) {
    .cpg-wrapper {
        padding: 15px;
    }
    
    .cpg-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* SHOW ADS ON MOBILE */
    .cpg-ad-slot {
        display: block;
    }
    
    .cpg-content {
        padding: 16px;
    }
    
    .cpg-title {
        font-size: 18px;
    }
    
    .cpg-meta {
        font-size: 12px;
        gap: 12px;
    }
    
    .cpg-meta svg {
        width: 12px;
        height: 12px;
    }
    
    .cpg-excerpt {
        font-size: 14px;
    }
}

/* ========================================
   SMALL MOBILE (< 480px)
======================================== */

@media screen and (max-width: 480px) {
    .cpg-wrapper {
        padding: 10px;
    }
    
    .cpg-grid {
        gap: 16px;
    }
    
    .cpg-content {
        padding: 14px;
    }
    
    .cpg-title {
        font-size: 17px;
    }
}

/* ========================================
   ANIMATIONS
======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cpg-post {
    animation: fadeInUp 0.4s ease-out;
}
