/* =============================================================================
   BuddyPress Active Groups Widget — v3.0
   ============================================================================= */

.bp-active-groups-widget {
    --bp-accent:  #6366f1;
    --bp-text:    #0f172a;
    --bp-muted:   #64748b;
    --bp-meta:    #94a3b8;
    --bp-card-bg: #ffffff;
    width: 100%;
    font-family: inherit;
}

.bp-widget-title {
    margin: 0 0 1.25em;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--bp-text);
    letter-spacing: -0.02em;
}

/* Grid */
.bp-groups-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
}

/* Tarjeta base */
.bp-group-card {
    background: var(--bp-card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.07);
    transition: transform .22s ease, box-shadow .22s ease;
    display: flex;
    flex-direction: column;
}

.bp-group-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(0,0,0,.13);
}

/* -----------------------------------------------------------------------
   MODERN — imagen a ancho completo arriba
   ----------------------------------------------------------------------- */
.bp-card--modern .bp-card-image-wrap {
    display: block;
    position: relative;
    height: 160px;
    overflow: hidden;
    background: linear-gradient(135deg, #e0e7ff 0%, #f0fdf4 100%);
    text-decoration: none;
    flex-shrink: 0;
}

.bp-card--modern .bp-card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.bp-card--modern:hover .bp-card-image-wrap img {
    transform: scale(1.05);
}

.bp-card-no-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0e7ff 0%, #f0fdf4 100%);
}

.bp-card-cat-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--bp-accent);
}

/* -----------------------------------------------------------------------
   HORIZONTAL — miniatura 100×100, radio 6px, arriba-izquierda
   ----------------------------------------------------------------------- */
.bp-card--horizontal {
    padding: 14px;
}

.bp-card--horizontal .bp-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.bp-card-thumb {
    width: 100px;
    min-width: 100px;
    height: 100px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    align-self: flex-start;
    background: linear-gradient(135deg, #e0e7ff, #f0fdf4);
}

.bp-card-thumb a {
    display: block;
    width: 100%;
    height: 100%;
}

.bp-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}

.bp-card-thumb--empty {
    background: linear-gradient(135deg, #e0e7ff, #f0fdf4);
}

/* -----------------------------------------------------------------------
   MINIMAL — borde izquierdo de acento
   ----------------------------------------------------------------------- */
.bp-card--minimal {
    padding: 18px 20px;
    border-left: 3px solid var(--bp-accent);
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.bp-card--minimal .bp-card-body {
    padding: 0;
}

/* -----------------------------------------------------------------------
   Cuerpo de tarjeta (compartido)
   ----------------------------------------------------------------------- */
.bp-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.bp-card--horizontal .bp-card-body,
.bp-card--minimal .bp-card-body {
    padding: 0;
}

/* Badge nombre del grupo */
.bp-group-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 99px;
    background-color: color-mix(in srgb, var(--bp-accent) 12%, transparent);
    color: var(--bp-accent);
    text-decoration: none;
    transition: background .18s, color .18s;
    width: fit-content;
}

.bp-group-badge:hover {
    background-color: var(--bp-accent);
    color: #fff;
}

/* Contenido de la actividad */
.bp-activity-content {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #374151;
}

.bp-activity-content a {
    color: inherit;
    text-decoration: none;
    transition: color .15s;
}

.bp-activity-content a:hover {
    color: var(--bp-accent);
    text-decoration: underline;
}

/* Fecha */
.bp-post-date {
    font-size: 0.7rem;
    color: var(--bp-meta);
    margin-top: auto;
    padding-top: 4px;
}

/* Más info */
.bp-mas-info {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--bp-accent);
    text-decoration: none;
    transition: color .15s, text-decoration .15s;
    margin-top: 2px;
}

.bp-mas-info:hover {
    color: var(--bp-accent);
    text-decoration: underline;
}

/* Sin actividad */
.bp-groups-empty {
    text-align: center;
    color: var(--bp-meta);
    padding: 2.5rem;
    font-style: italic;
}

/* Debug */
.bp-debug {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 11px;
    line-height: 1.7;
    overflow-x: auto;
}

/* Responsive */
@media (max-width: 1024px) {
    .bp-groups-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 640px) {
    .bp-groups-grid { grid-template-columns: 1fr !important; }
    .bp-card-thumb  { width: 80px; min-width: 80px; height: 80px; }
}
