/*
 * Block-only styles for bffs/suggestions.
 * Scoped to .bffs-suggestions-container so they never affect widgets,
 * shortcodes, or theme selectors. Loaded only when the block is
 * present (via block.json "style" declaration) and in the block editor canvas.
 * Do NOT import or duplicate from the main public stylesheet.
 */

/* Grid layout — 3 columns by default, responsive at smaller breakpoints.
   Scoped to .bffs-suggestions-container so shortcode renders inside
   .widget-area are unaffected by this rule.
   Uses !important to override the inline .widget-area single-column rule
   when the block is placed inside a Gutenberg widget area. */
.bffs-suggestions-container .bffs-suggestions-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .bffs-suggestions-container .bffs-suggestions-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .bffs-suggestions-container .bffs-suggestions-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Design tokens — declared on the block root so the block works
   standalone without a widget wrapper setting these values. */
.bffs-suggestions-container {
    --bffs-card-radius: 12px;
    --bffs-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.05);
    --bffs-card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.10);
    --bffs-card-border: rgba(0, 0, 0, 0.06);
    --bffs-card-bg: #fff;
    --bffs-text-primary: #111827;
    --bffs-text-secondary: #6b7280;
    --bffs-accent: #2563eb;
    --bffs-accent-hover: #1d4ed8;
    --bffs-accent-soft: #eff6ff;
    --bffs-muted-bg: #f3f4f6;
    --bffs-muted-bg-hover: #e5e7eb;
    --bffs-muted-text: #374151;
    --bffs-transition: 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card surface */
.bffs-suggestions-container .bffs-suggestion-card {
    background: var(--bffs-card-bg, #fff) !important;
    border: 1px solid var(--bffs-card-border, rgba(0, 0, 0, 0.06)) !important;
    border-radius: var(--bffs-card-radius, 12px) !important;
    box-shadow: var(--bffs-card-shadow, 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.05)) !important;
    padding: 18px 16px !important;
    transition: box-shadow var(--bffs-transition, 240ms cubic-bezier(0.4, 0, 0.2, 1)),
                transform var(--bffs-transition, 240ms cubic-bezier(0.4, 0, 0.2, 1)) !important;
}

.bffs-suggestions-container .bffs-suggestion-card:hover {
    box-shadow: var(--bffs-card-shadow-hover, 0 8px 24px rgba(0, 0, 0, 0.10)) !important;
    transform: translateY(-2px);
}

/* Avatar — 96×96 round, ring + shadow, scale on card hover */
.bffs-suggestions-container .bffs-suggestion-avatar {
    width: 96px !important;
    height: 96px !important;
    margin: 0 auto 12px !important;
    border-radius: 50% !important;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
    transition: transform var(--bffs-transition, 240ms cubic-bezier(0.4, 0, 0.2, 1));
}

.bffs-suggestions-container .bffs-suggestion-card:hover .bffs-suggestion-avatar {
    transform: scale(1.04);
}

.bffs-suggestions-container .bffs-suggestion-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    border: 0 !important;
}

/* Display name */
.bffs-suggestions-container .bffs-suggestion-info {
    text-align: center;
}

.bffs-suggestions-container .bffs-suggestion-name {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--bffs-text-primary, #111827) !important;
    margin-bottom: 6px !important;
}

.bffs-suggestions-container .bffs-suggestion-name a {
    color: inherit;
    text-decoration: none;
    transition: color var(--bffs-transition, 240ms cubic-bezier(0.4, 0, 0.2, 1));
}

.bffs-suggestions-container .bffs-suggestion-name a:hover {
    color: var(--bffs-accent, #2563eb);
}

/* Match score pill */
.bffs-suggestions-container .bffs-match-score {
    display: inline-block;
    padding: 3px 10px;
    margin: 0 0 10px;
    background: var(--bffs-accent-soft, #eff6ff);
    color: var(--bffs-accent, #2563eb);
    border-radius: 999px;
    font-size: 12px !important;
    font-weight: 600 !important;
}

/* Action stack */
.bffs-suggestions-container .bffs-suggestion-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

/* Primary action — Connect / Add Friend / Follow */
.bffs-suggestions-container .bffs-suggestion-actions .friendship-button a,
.bffs-suggestions-container .bffs-suggestion-actions .friendship-button button,
.bffs-suggestions-container .bffs-suggestion-actions .follow-button a,
.bffs-suggestions-container .bffs-suggestion-actions .follow-button button {
    background: var(--bffs-accent, #2563eb) !important;
    border: 1px solid var(--bffs-accent, #2563eb) !important;
    color: #fff !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    padding: 8px 14px !important;
    width: 100%;
    text-align: center;
    transition: background var(--bffs-transition, 240ms cubic-bezier(0.4, 0, 0.2, 1)),
                transform var(--bffs-transition, 240ms cubic-bezier(0.4, 0, 0.2, 1)),
                box-shadow var(--bffs-transition, 240ms cubic-bezier(0.4, 0, 0.2, 1));
}

.bffs-suggestions-container .bffs-suggestion-actions .friendship-button a:hover,
.bffs-suggestions-container .bffs-suggestion-actions .friendship-button button:hover,
.bffs-suggestions-container .bffs-suggestion-actions .follow-button a:hover,
.bffs-suggestions-container .bffs-suggestion-actions .follow-button button:hover {
    background: var(--bffs-accent-hover, #1d4ed8) !important;
    border-color: var(--bffs-accent-hover, #1d4ed8) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

/* Secondary action — Not Interested / dismiss */
.bffs-suggestions-container .bffs-suggestion-actions button.bffs-dismiss-suggestion {
    background: var(--bffs-muted-bg, #f3f4f6) !important;
    border: 1px solid var(--bffs-muted-bg, #f3f4f6) !important;
    color: var(--bffs-muted-text, #374151) !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    padding: 8px 14px !important;
    width: 100%;
    transition: background var(--bffs-transition, 240ms cubic-bezier(0.4, 0, 0.2, 1));
}

.bffs-suggestions-container .bffs-suggestion-actions button.bffs-dismiss-suggestion:hover {
    background: var(--bffs-muted-bg-hover, #e5e7eb) !important;
}

/* List layout variant */
.bffs-suggestions-container.bffs-layout-list .bffs-suggestion-card {
    text-align: left;
}

.bffs-suggestions-container.bffs-layout-list .bffs-suggestion-avatar {
    width: 60px !important;
    height: 60px !important;
    margin: 0 15px 0 0 !important;
}

/* Focus-visible accessibility */
.bffs-suggestions-container .bffs-suggestion-actions button:focus-visible,
.bffs-suggestions-container .bffs-suggestion-actions a:focus-visible {
    outline: 2px solid var(--bffs-accent, #2563eb);
    outline-offset: 2px;
}
