/* ============================================================
   Category Card Grid — grid.css
   ============================================================ */

/* Grid wrapper */
.ccg-grid {
    display: grid;
    gap: 16px;
    margin: 24px 0;
}

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

/* ---- Card ---- */
.ccg-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px 20px 20px;
    min-height: 160px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    overflow: visible;
}

.ccg-card:not(.ccg-card--locked):hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.ccg-card--locked {
    background: #fafafa;
}

/* ---- Members Only badge (top-right pill) ---- */
.ccg-badge {
    position: absolute;
    top: -12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #1f2937;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 4px 10px 4px 8px;
    border-radius: 20px;
    white-space: nowrap;
    line-height: 1;
}

.ccg-badge__icon {
    display: block;
    flex-shrink: 0;
}

/* ---- Card body ---- */
.ccg-card__body {
    flex: 1;
}

.ccg-card__title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 4px;
    color: #111827;
    text-align: center;
}

.ccg-card--locked .ccg-card__title {
    color: #374151;
}

.ccg-card__title a {
    color: inherit;
    text-decoration: none;
}

.ccg-card__title a:hover {
    text-decoration: underline;
    color: #2563eb;
}

/* ---- Card footer (button row) ---- */
.ccg-card__footer {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

/* ---- Buttons ---- */
.ccg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 8px;
    padding: 10px 36px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    transition: background 0.15s ease, opacity 0.15s ease;
    white-space: nowrap;
}

/* Start — blue */
.ccg-btn--start {
    background: #2fa8e0;
    color: #ffffff;
}

.ccg-btn--start:hover {
    background: #1a8fc7;
    color: #ffffff;
    text-decoration: none;
}

/* Locked — grey, disabled */
.ccg-btn--locked {
    background: #e5e7eb;
    color: #6b7280;
    cursor: not-allowed;
    opacity: 1;
}

.ccg-btn__icon {
    display: block;
    flex-shrink: 0;
}

/* ---- Error / empty state ---- */
.ccg-error,
.ccg-no-posts {
    color: #6b7280;
    font-style: italic;
    padding: 16px 0;
}

/* ---- Responsive ---- */
@media ( max-width: 1024px ) {
    .ccg-grid--cols-4 { grid-template-columns: repeat(3, 1fr); }
}

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

@media ( max-width: 480px ) {
    .ccg-grid--cols-4,
    .ccg-grid--cols-3,
    .ccg-grid--cols-2 { grid-template-columns: 1fr; }
}
