/* WCPT Events Plugin v2 — Self-contained styles */

:root {
    --wcpt-primary: #4c4c7f;
    --wcpt-primary-hover: #3b3b66;
    --wcpt-primary-light: #6b6baf;
    --wcpt-text: #111827;
    --wcpt-text-muted: #6b7280;
    --wcpt-card-bg: #fff;
    --wcpt-card-border: #e5e7eb;
    --wcpt-card-radius: 1rem;
    --wcpt-cta-radius: 0.5rem;
    --wcpt-cta-text: #fff;
}

.wcpt-events-wrap {
    min-height: 80vh;
}
.wcpt-events-grid {
    display: grid;
    gap: 1.5rem;
    padding: 1rem 0;
}
.wcpt-events-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}
.wcpt-events-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 1024px) {
    .wcpt-events-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .wcpt-events-cols-3,
    .wcpt-events-cols-2 {
        grid-template-columns: 1fr;
    }
}

/* Card */
.wcpt-event-card {
    border: 1px solid var(--wcpt-card-border);
    border-radius: var(--wcpt-card-radius);
    background: var(--wcpt-card-bg);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.wcpt-event-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}
.wcpt-event-card:focus {
    outline: 2px solid var(--wcpt-primary);
    outline-offset: 2px;
}

/* Image */
.wcpt-event-image {
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
}
.wcpt-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wcpt-event-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--wcpt-primary) 0%, var(--wcpt-primary-light) 100%);
}

/* CPD badge */
.wcpt-cpd-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--wcpt-primary);
    line-height: 1.4;
}

/* Body */
.wcpt-event-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.wcpt-event-date {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--wcpt-primary);
}
.wcpt-event-time {
    font-size: 0.8rem;
    color: var(--wcpt-text-muted);
}
.wcpt-event-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--wcpt-text);
    line-height: 1.35;
    margin: 0.25rem 0;
}
.wcpt-event-venue {
    font-size: 0.85rem;
    color: var(--wcpt-text-muted);
}

/* Footer */
.wcpt-event-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
    margin-top: auto;
}
.wcpt-event-price {
    font-weight: 600;
    font-size: 1rem;
    color: var(--wcpt-text);
}

/* Status badges */
.wcpt-status-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    white-space: nowrap;
}
.wcpt-status-open {
    color: #15803d;
    background: #f0fdf4;
}
.wcpt-status-sold-out {
    color: #b91c1c;
    background: #fef2f2;
}
.wcpt-status-soon {
    color: #a16207;
    background: #fefce8;
}
.wcpt-status-closed {
    color: #6b7280;
    background: #f3f4f6;
}
.wcpt-status-progress {
    color: #1d4ed8;
    background: #eff6ff;
}

/* CTA */
.wcpt-event-cta {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.75rem 1rem;
    background: var(--wcpt-primary);
    color: var(--wcpt-cta-text);
    border-radius: var(--wcpt-cta-radius);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s ease;
    margin-top: 0.75rem;
    box-sizing: border-box;
}
.wcpt-event-card:hover .wcpt-event-cta {
    background: var(--wcpt-primary-hover);
}

/* Empty / error states */
.wcpt-events-error,
.wcpt-events-empty {
    text-align: center;
    padding: 2rem;
    color: var(--wcpt-text-muted);
    font-size: 1rem;
}
