/* Tarjetas de categoría del sitio público */
.categorias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.35rem;
    align-items: stretch;
}

.ccard {
    --cc-ink: #1a2332;
    --cc-muted: #5c6675;
    --cc-line: #d7dce6;
    --cc-steel: #3d4a5c;
    --cc-accent: #c62828;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid var(--cc-line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(26, 35, 50, 0.05);
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.ccard::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: #1a2332;
    opacity: 0.85;
}

.ccard:hover {
    transform: translateY(-3px);
    border-color: #c5ccd8;
    box-shadow: 0 12px 28px rgba(26, 35, 50, 0.1);
}

.ccard:hover::after {
    background: var(--cc-accent);
}

.ccard__media {
    position: relative;
    height: 170px;
    background: #eef1f5;
    overflow: hidden;
    border-bottom: 1px solid var(--cc-line);
}

.ccard__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.ccard:hover .ccard__img {
    transform: scale(1.04);
}

.ccard__noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #8b95a5;
    font-size: 1.6rem;
    background: linear-gradient(160deg, #f3f4f6, #e8ebf0);
}

.ccard__badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: calc(100% - 1.5rem);
    padding: 0.28rem 0.62rem;
    border-radius: 999px;
    background: rgba(26, 35, 50, 0.88);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ccard__badge i {
    font-size: 0.68rem;
    opacity: 0.9;
}

.ccard__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 0.55rem;
    padding: 1rem 1.1rem 1.15rem;
}

.ccard__title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.28;
    color: var(--cc-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ccard__desc {
    margin: 0;
    color: var(--cc-muted);
    font-size: 0.84rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ccard__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    margin-top: 0.2rem;
    padding: 0.7rem 0 0;
    border-top: 1px solid var(--cc-line);
}

.ccard__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.28rem;
    min-width: 0;
    padding: 0 0.2rem;
    position: relative;
}

.ccard__stat + .ccard__stat::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.15rem;
    bottom: 0.15rem;
    width: 1px;
    background: #e8ebf0;
}

.ccard__stat i {
    color: var(--cc-steel);
    font-size: 0.9rem;
}

.ccard__stat span {
    color: #667084;
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.25;
}

.ccard__stat strong {
    color: var(--cc-ink);
    font-weight: 800;
}

.ccard__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid var(--cc-line);
    color: var(--cc-accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: gap 0.2s ease, color 0.2s ease;
}

.ccard:hover .ccard__cta {
    color: #9f1d1d;
    gap: 0.55rem;
}

@media (max-width: 600px) {
    .categorias-grid {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .ccard__media {
        height: 140px;
    }

    .ccard__body {
        padding: 0.85rem 0.9rem 1rem;
    }

    .ccard__title {
        font-size: 0.95rem;
    }

    .ccard__stat span {
        font-size: 0.56rem;
    }
}

[data-theme="dark"] .ccard {
    --cc-ink: #f1f5f9;
    --cc-muted: #94a3b8;
    --cc-line: #1e2a3f;
    --cc-steel: #cbd5e1;
    --cc-accent: #ef5350;
    background: #121826;
    border-color: #1e2a3f;
    box-shadow: none;
}

[data-theme="dark"] .ccard__media {
    background: #0f172a;
    border-bottom-color: #1e2a3f;
}

[data-theme="dark"] .ccard__badge {
    background: rgba(15, 23, 42, 0.92);
}

[data-theme="dark"] .ccard__stat + .ccard__stat::before {
    background: #1e2a3f;
}

[data-theme="dark"] .ccard__stat span {
    color: #94a3b8;
}

[data-theme="dark"] .ccard__stat strong {
    color: #f8fafc;
}
