/**
 * WebAlive Plugin Showcase
 *
 * Clean, theme-friendly styles using CSS custom properties for easy overrides.
 * Add to your theme/child-theme:
 *   :root { --wa-showcase-accent: #0073aa; }
 */

/* ── Variables ─────────────────────────────────────────────────────── */

:root {
    --wa-showcase-accent: #2271b1;
    --wa-showcase-accent-hover: #135e96;
    --wa-showcase-bg: #ffffff;
    --wa-showcase-bg-alt: #f6f7f7;
    --wa-showcase-border: #dcdcde;
    --wa-showcase-text: #1d2327;
    --wa-showcase-text-muted: #646970;
    --wa-showcase-radius: 8px;
    --wa-showcase-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --wa-showcase-gap: 24px;
}

/* ── Grid layout ───────────────────────────────────────────────────── */

.wa-showcase-grid {
    display: grid;
    gap: var(--wa-showcase-gap);
    margin: 1.5em 0;
}

.wa-showcase-grid.wa-showcase-layout-container {
    margin: 1.5em auto;
}

.wa-showcase-layout-container {
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.wa-showcase-layout-full {
    max-width: none;
    width: 100%;
}

.wa-showcase-cols-1 { grid-template-columns: 1fr; }
.wa-showcase-cols-2 { grid-template-columns: repeat(2, 1fr); }
.wa-showcase-cols-3 { grid-template-columns: repeat(3, 1fr); }
.wa-showcase-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .wa-showcase-cols-3,
    .wa-showcase-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .wa-showcase-cols-2,
    .wa-showcase-cols-3,
    .wa-showcase-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* ── Card (grid item) ──────────────────────────────────────────────── */

.wa-showcase-card {
    display: flex;
    flex-direction: column;
    background: var(--wa-showcase-bg);
    border: 1px solid var(--wa-showcase-border);
    border-radius: var(--wa-showcase-radius);
    box-shadow: var(--wa-showcase-shadow);
    overflow: hidden;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.wa-showcase-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* ── Card header: icon left, text right, alt background ─────────── */

.wa-showcase-card__header {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 20px;
    background: var(--wa-showcase-bg-alt);
}

.wa-showcase-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 110px;
    height: 110px;
}

a.wa-showcase-card__icon {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.wa-showcase-card__icon img {
    width: 140px;
    height: 140px;
    object-fit: contain;
}

.wa-showcase-card__icon--placeholder {
    width: 140px;
    height: 140px;
    font-size: 22px;
    font-weight: 700;
    color: var(--wa-showcase-accent);
    letter-spacing: 2px;
    background: var(--wa-showcase-bg);
}

.wa-showcase-card__meta {
    flex: 1;
    min-width: 0;
}

.wa-showcase-card__title {
    margin: 0 0 2px;
    font-size: 1.35em;
    line-height: 1.3;
}

.wa-showcase-card__title a {
    color: var(--wa-showcase-text);
    text-decoration: none;
}

.wa-showcase-card__title a:hover {
    color: var(--wa-showcase-accent);
}

.wa-showcase-card__author {
    margin: 0;
    font-size: 0.82em;
    color: var(--wa-showcase-text-muted);
}

/* ── Card body ──────────────────────────────────────────────────── */

.wa-showcase-card__body {
    flex: 1;
    padding: 0 20px 12px;
}

.wa-showcase-card__desc {
    font-size: 0.9em;
    color: var(--wa-showcase-text);
    line-height: 1.5;
    max-height: 4.5em;
    overflow: hidden;
}

.wa-showcase-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: var(--wa-showcase-bg-alt);
    border-top: 1px solid var(--wa-showcase-border);
    font-size: 0.8em;
}

.wa-showcase-card__version {
    color: var(--wa-showcase-text-muted);
    font-weight: 500;
}

/* Future: Buy button */
.wa-showcase-card__buy {
    display: inline-block;
    padding: 4px 14px;
    background: var(--wa-showcase-accent);
    color: #fff !important;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: background 0.15s ease;
}

.wa-showcase-card__buy:hover {
    background: var(--wa-showcase-accent-hover);
}

/* ── Single plugin detail ──────────────────────────────────────────── */

.wa-showcase-single {
    margin: 1.5em 0;
    background: var(--wa-showcase-bg);
    border: 1px solid var(--wa-showcase-border);
    border-radius: var(--wa-showcase-radius);
    box-shadow: var(--wa-showcase-shadow);
    overflow: hidden;
}

.wa-showcase-single.wa-showcase-layout-container {
    margin: 1.5em auto;
}

.wa-showcase-single__banner {
    width: 100%;
    max-height: 250px;
    overflow: hidden;
    background: var(--wa-showcase-bg-alt);
}

.wa-showcase-single__banner img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.wa-showcase-single__header {
    display: flex;
    gap: 20px;
    padding: 24px;
    align-items: flex-start;
}

.wa-showcase-single__icon {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
}

.wa-showcase-single__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wa-showcase-single__meta {
    flex: 1;
}

.wa-showcase-single__title {
    margin: 0 0 4px;
    font-size: 1.5em;
    line-height: 1.2;
}

.wa-showcase-single__title a {
    color: var(--wa-showcase-text);
    text-decoration: none;
}

.wa-showcase-single__title a:hover {
    color: var(--wa-showcase-accent);
}

.wa-showcase-single__author {
    margin: 0 0 12px;
    color: var(--wa-showcase-text-muted);
    font-size: 0.95em;
}

.wa-showcase-single__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.wa-showcase-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.8em;
    font-weight: 500;
    border-radius: 999px;
    background: var(--wa-showcase-bg-alt);
    border: 1px solid var(--wa-showcase-border);
    color: var(--wa-showcase-text-muted);
}

/* Future: Buy button on single */
.wa-showcase-single__buy {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 24px;
    background: var(--wa-showcase-accent);
    color: #fff !important;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.wa-showcase-single__buy:hover {
    background: var(--wa-showcase-accent-hover);
}

.wa-showcase-single__description,
.wa-showcase-single__changelog {
    padding: 0 24px 24px;
}

.wa-showcase-single__description h3,
.wa-showcase-single__changelog summary {
    font-size: 1.1em;
    margin: 0 0 8px;
    color: var(--wa-showcase-text);
}

.wa-showcase-single__changelog summary {
    cursor: pointer;
    user-select: none;
}

.wa-showcase-single__content {
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--wa-showcase-text);
}

.wa-showcase-single__content ul {
    padding-left: 1.5em;
}

.wa-showcase-single__content h4 {
    margin: 1em 0 0.3em;
    font-size: 1em;
}

/* ── Empty state ───────────────────────────────────────────────────── */

.wa-showcase-empty {
    padding: 24px;
    text-align: center;
    color: var(--wa-showcase-text-muted);
    font-style: italic;
}

@media (max-width: 600px) {
    .wa-showcase-single__header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .wa-showcase-single__badges {
        justify-content: center;
    }
}
