/* ============================================================
   CheckMate — Plugin Grid Shortcode [checkmate_plugin_grid]
   Dark design to match the [checkmate_index] page aesthetic.
   ============================================================ */

/* ── Page header (title / subline / description) ─────────── */

.cm-grid-header {
    margin-bottom: 40px;
}

.cm-grid-header--has-logo {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
}

.cm-grid-header__text {
    flex: 1;
    min-width: 0;
}

.cm-grid-header__logo {
    flex-shrink: 0;
    padding-top: 6px;
}

.cm-grid-header__logo img {
    display: block;
    max-width: 120px;
    max-height: 80px;
    object-fit: contain;
}

.cm-grid-header__title {
    margin: 0 0 10px;
    font-size: 50px;
    font-weight: 700 !important;
    line-height: 65px;
    color: #ffffff !important;
}

.cm-grid-header__subline {
    margin: 0 0 14px;
    font-size: 20px !important;
    line-height: 35px !important;
    font-weight: 400 !important;
    color: #ffffff !important;
}

.cm-grid-header__desc {
    margin: 48px 0;
    font-size: 18px;
    color: #ffffff;
    line-height: 1.65;
    max-width: 68ch;
}

/* ── Grid layout ──────────────────────────────────────────── */

.cm-plugin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 0;
}

/* ── Card ─────────────────────────────────────────────────── */

.cm-plugin-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.15s ease;
}

.cm-plugin-card:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

/* ── Logo ─────────────────────────────────────────────────── */

.cm-plugin-card__logo {
    display: flex;
    align-items: center;
}

.cm-plugin-card__logo img {
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
    border-radius: 0;
}

.cm-plugin-card__logo-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.03em;
    user-select: none;
}

/* ── Category icon badge (vendor archive pages) ───────────── */

.cm-plugin-card__category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.cm-plugin-card__category-icon svg {
    width: 40px;
    height: 40px;
    display: block;
}

/* ── Category label (vendor archive pages, next to icon) ───── */

.cm-plugin-card__category-label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Body ─────────────────────────────────────────────────── */

.cm-plugin-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cm-plugin-card__name {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #ffffff !important;
}

.cm-plugin-card__desc {
    margin: 0;
    font-size: 18px;
    color: #ffffff;
    line-height: 1.55;
}

/* ── Author pill ──────────────────────────────────────────── */

.cm-plugin-card__author {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Verified badge (before author name) ──────────────────── */

.cm-plugin-card__verified {
    display: inline-flex;
    align-items: center;
    color: #1d9bf0;
    flex-shrink: 0;
}

.cm-plugin-card__verified svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* ── Actions footer (Get Plugin + Details) ───────────────── */

.cm-plugin-card__actions {
    display: flex;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cm-plugin-card__link {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: color 0.15s ease;
}

.cm-plugin-card__link:hover {
    color: #ffffff;
    text-decoration: none;
}

/* ── Empty state ──────────────────────────────────────────── */

.cm-grid-empty {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* ── Details trigger (secondary action, right-aligned) ─────── */

.cm-plugin-card__more {
    margin-left: auto;
    padding: 0;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.01em;
    text-transform: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: color 0.15s ease;
}

.cm-plugin-card__more:hover {
    color: rgba(255, 255, 255, 0.85);
}

/* ── Modal overlay ─────────────────────────────────────────── */

.cm-plugin-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cm-plugin-modal[hidden] {
    display: none;
}

.cm-plugin-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ── Modal box ─────────────────────────────────────────────── */

.cm-plugin-modal__box {
    position: relative;
    z-index: 1;
    background: rgba(13, 27, 46, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: 2px solid #1d9bf0;
    border-radius: 0;
    max-width: 620px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Close button ──────────────────────────────────────────── */

.cm-plugin-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    font-family: inherit;
    transition: color 0.15s ease;
}

.cm-plugin-modal__close:hover {
    color: #ffffff;
}

/* ── Title ─────────────────────────────────────────────────── */

.cm-plugin-modal__title {
    margin: 0 40px 0 0 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    color: #ffffff !important;
}

/* ── Description ───────────────────────────────────────────── */

.cm-plugin-modal__desc {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Footer ────────────────────────────────────────────────── */

.cm-plugin-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.cm-plugin-modal__author {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.02em;
    line-height: 1;
}

.cm-plugin-modal__verified {
    display: inline-flex;
    align-items: center;
    color: #1d9bf0;
    flex-shrink: 0;
}

.cm-plugin-modal__verified svg {
    width: 14px;
    height: 14px;
    display: block;
}

/* ── Get Plugin CTA ──────────────────────────────────────────── */

.cm-plugin-modal__cta {
    display: inline-block;
    padding: 8px 18px;
    background: #1d9bf0;
    color: #ffffff !important;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none !important;
    border-radius: 0;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.cm-plugin-modal__cta:hover {
    background: #1a8fd1;
    color: #ffffff !important;
}

/* ── Modal meta (vendor logo + category icons) ──────────────── */

.cm-plugin-modal__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cm-plugin-modal__meta[hidden] {
    display: none;
}

.cm-plugin-modal__vendor-logo img {
    display: block;
    height: 32px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.cm-plugin-modal__category-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cm-plugin-modal__category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: rgba(255, 255, 255, 0.7);
}

.cm-plugin-modal__category-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

