/* =============================================
   OGPortal Posts Grid – Frontend Styles
   ============================================= */

/* Grid wrapper */
.opg-grid {
    display: grid;
    gap: var(--opg-gap, 20px);
    width: 100%;
    box-sizing: border-box;
}

.opg-cols-1 { grid-template-columns: 1fr; }
.opg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.opg-cols-3 { grid-template-columns: repeat(3, 1fr); }
.opg-cols-4 { grid-template-columns: repeat(4, 1fr); }
.opg-cols-5 { grid-template-columns: repeat(5, 1fr); }
.opg-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* Card */
.opg-card {
    display: flex;
    flex-direction: column;
    background: var(--opg-bg, #fff);
    border-radius: var(--opg-radius, 6px);
    overflow: hidden;
    box-shadow: var(--opg-shadow, 0 2px 8px rgba(0,0,0,0.08));
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.opg-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.16);
}

/* Thumbnail */
.opg-card__img {
    display: block;
    overflow: hidden;
    width: 100%;
    background: #e8e8e8;
    flex-shrink: 0;
}

.opg-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.38s ease;
}

.opg-card:hover .opg-card__img img {
    transform: scale(1.04);
}

.opg-card__img-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 120px;
    background: linear-gradient(135deg, #ddd 25%, #e8e8e8 50%, #ddd 75%);
}

/* Body */
.opg-card__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px 14px;
    flex: 1;
}

/* Category badge */
.opg-card__cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff !important;
    background: var(--opg-cat, #c0392b);
    border-radius: 3px;
    padding: 2px 7px;
    align-self: flex-start;
    text-decoration: none !important;
    line-height: 1.6;
    transition: opacity 0.2s;
}

.opg-card__cat:hover {
    opacity: 0.85;
}

/* Title */
.opg-card__title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: var(--opg-ts, 15px) !important;
    line-height: 1.4 !important;
    font-weight: 700;
}

.opg-card__title a {
    color: var(--opg-title, #1a1a1a) !important;
    text-decoration: none !important;
}

.opg-card__title a:hover {
    color: var(--opg-cat, #c0392b) !important;
}

/* Excerpt */
.opg-card__excerpt {
    margin: 0 !important;
    font-size: 13px;
    line-height: 1.55;
    color: #666;
}

/* Date */
.opg-card__date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #999;
    margin-top: auto;
    padding-top: 6px;
}

.opg-card__date svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* No posts */
.opg-no-posts {
    text-align: center;
    color: #888;
    padding: 2rem;
    font-style: italic;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .opg-cols-5,
    .opg-cols-6 { grid-template-columns: repeat(3, 1fr); }
    .opg-cols-4  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .opg-cols-3,
    .opg-cols-4,
    .opg-cols-5,
    .opg-cols-6 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
    .opg-grid {
        grid-template-columns: 1fr !important;
    }
}
