/**
 * BuddyPress Member Blog - Shortcodes Styles
 *
 * Styles for all shortcodes:
 * - [bp-member-blog-list]
 * - [bp-member-blog-recent]
 * - [bp-member-blog-popular]
 * - [bp-member-blog-categories]
 * - [bp-member-blog-authors]
 *
 * @package Buddypress_Member_Blog
 * @since 3.0.0
 */

/*--------------------------------------------------------------
# CSS Variables (Design System)
--------------------------------------------------------------*/
:root {
    /* Primary Colors */
    --bpmb-primary: #2468c6;
    --bpmb-primary-hover: #1b4f9e;
    --bpmb-primary-light: #e8f0fb;

    /* Secondary Colors */
    --bpmb-secondary: #6c757d;
    --bpmb-secondary-hover: #545b62;
    --bpmb-secondary-light: #f8f9fa;

    /* State Colors */
    --bpmb-success: #28a745;
    --bpmb-success-light: #ebf9eb;
    --bpmb-danger: #dc3545;
    --bpmb-danger-light: #fce8ea;
    --bpmb-warning: #ffc107;
    --bpmb-warning-light: #fff8e1;
    --bpmb-info: #17a2b8;
    --bpmb-info-light: #e7f6f8;

    /* Text Colors */
    --bpmb-text-primary: #303030;
    --bpmb-text-secondary: #6c757d;
    --bpmb-text-muted: #999;
    --bpmb-text-light: #fff;

    /* Background Colors */
    --bpmb-bg-primary: #fff;
    --bpmb-bg-secondary: #f8f9fa;
    --bpmb-bg-tertiary: #f2f2f2;
    --bpmb-bg-hover: rgba(0, 0, 0, 0.05);

    /* Border Colors */
    --bpmb-border-color: #eee;
    --bpmb-border-color-dark: #ccc;
    --bpmb-border-color-light: rgba(0, 0, 0, 0.1);

    /* Spacing */
    --bpmb-space-xs: 4px;
    --bpmb-space-sm: 8px;
    --bpmb-space-md: 16px;
    --bpmb-space-lg: 24px;
    --bpmb-space-xl: 32px;
    --bpmb-space-2xl: 48px;

    /* Border Radius */
    --bpmb-radius-sm: 4px;
    --bpmb-radius-md: 6px;
    --bpmb-radius-lg: 10px;
    --bpmb-radius-xl: 16px;
    --bpmb-radius-full: 100px;

    /* Typography */
    --bpmb-font-size-xs: 12px;
    --bpmb-font-size-sm: 13px;
    --bpmb-font-size-md: 14px;
    --bpmb-font-size-base: 15px;
    --bpmb-font-size-lg: 16px;
    --bpmb-font-size-xl: 18px;
    --bpmb-font-size-2xl: 20px;
    --bpmb-font-size-3xl: 22px;

    /* Font Weights */
    --bpmb-font-weight-normal: 400;
    --bpmb-font-weight-medium: 500;
    --bpmb-font-weight-semibold: 600;
    --bpmb-font-weight-bold: 700;

    /* Line Heights */
    --bpmb-line-height-tight: 1.2;
    --bpmb-line-height-base: 1.5;
    --bpmb-line-height-relaxed: 1.7;

    /* Shadows */
    --bpmb-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --bpmb-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --bpmb-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --bpmb-shadow-focus: 0 0 0 3px rgba(36, 104, 198, 0.25);

    /* Transitions */
    --bpmb-transition-fast: 150ms ease;
    --bpmb-transition-base: 200ms ease;
    --bpmb-transition-slow: 300ms ease;

    /* Z-index Layers */
    --bpmb-z-dropdown: 100;
    --bpmb-z-modal: 1000;
    --bpmb-z-tooltip: 1100;
}

/*
 * Dark mode support - Only applied when theme adds .dark-mode or .dark-scheme class
 * This ensures the plugin remains theme-neutral and doesn't interfere with theme colors
 */
.dark-mode .bpmb-post-item,
.dark-scheme .bpmb-post-item {
    --bpmb-bg-primary: #1e1e1e;
    --bpmb-border-color: #333;
}

.dark-mode .bpmb-post-title a,
.dark-scheme .bpmb-post-title a {
    --bpmb-text-primary: #e0e0e0;
}

.dark-mode .bpmb-post-excerpt,
.dark-scheme .bpmb-post-excerpt {
    --bpmb-text-primary: #a0a0a0;
}

.dark-mode .bpmb-category-tag,
.dark-scheme .bpmb-category-tag {
    --bpmb-bg-secondary: #333;
    --bpmb-text-primary: #e0e0e0;
}

.dark-mode .bpmb-categories-list,
.dark-scheme .bpmb-categories-list {
    --bpmb-bg-primary: #1e1e1e;
    --bpmb-border-color: #333;
}

.dark-mode .bpmb-category-item,
.dark-scheme .bpmb-category-item {
    --bpmb-border-color: #333;
}

.dark-mode .bpmb-category-item a,
.dark-scheme .bpmb-category-item a {
    --bpmb-text-primary: #e0e0e0;
}

.dark-mode .bpmb-category-card,
.dark-scheme .bpmb-category-card {
    --bpmb-bg-primary: #1e1e1e;
    --bpmb-border-color: #333;
}

.dark-mode .bpmb-category-card .bpmb-category-name,
.dark-scheme .bpmb-category-card .bpmb-category-name {
    --bpmb-text-primary: #e0e0e0;
}

.dark-mode .bpmb-shortcode-empty,
.dark-scheme .bpmb-shortcode-empty {
    --bpmb-bg-secondary: #2d2d2d;
    --bpmb-text-secondary: #a0a0a0;
}

/* Authors dark mode */
.dark-mode .bpmb-author-card,
.dark-scheme .bpmb-author-card {
    --bpmb-bg-primary: #1e1e1e;
    --bpmb-border-color: #333;
}

.dark-mode .bpmb-author-name a,
.dark-scheme .bpmb-author-name a {
    --bpmb-text-primary: #e0e0e0;
}

.dark-mode .bpmb-author-post-count,
.dark-scheme .bpmb-author-post-count {
    --bpmb-text-secondary: #a0a0a0;
}

.dark-mode .bpmb-author-bio,
.dark-scheme .bpmb-author-bio {
    --bpmb-text-secondary: #a0a0a0;
}

.dark-mode .bpmb-authors .bpmb-author-avatar img,
.dark-scheme .bpmb-authors .bpmb-author-avatar img {
    --bpmb-border-color: #444;
}

.dark-mode .bpmb-view-posts,
.dark-scheme .bpmb-view-posts {
    --bpmb-bg-secondary: #2d3748;
    --bpmb-text-primary: #60a5fa;
}

.dark-mode .bpmb-view-posts:hover,
.dark-scheme .bpmb-view-posts:hover {
    --bpmb-bg-primary: #3b82f6;
    --bpmb-text-light: #fff;
}

/*--------------------------------------------------------------
# Base Shortcode Styles
--------------------------------------------------------------*/
.bpmb-shortcode {
	margin: 0 0 2em;
}

.bpmb-shortcode-empty,
.bpmb-shortcode-error {
	padding: 1.5em;
	text-align: center;
	color: var(--bpmb-text-secondary, #6c757d);
	background: var(--bpmb-bg-secondary, #f8f9fa);
	border-radius: var(--bpmb-radius-lg, 8px);
}

.bpmb-shortcode-error {
	color: var(--bpmb-danger, #dc3545);
	background: var(--bpmb-danger-light, #fce8ea);
}

/*--------------------------------------------------------------
# Post Grid Layouts
--------------------------------------------------------------*/
.bpmb-member-blog-list,
.bpmb-recent-posts,
.bpmb-popular-posts,
.bpmb-authors {
	display: grid;
	gap: var(--bpmb-space-lg, 24px);
}

.bpmb-columns-1 {
	grid-template-columns: 1fr;
}

.bpmb-columns-2 {
	grid-template-columns: repeat(2, 1fr);
}

.bpmb-columns-3 {
	grid-template-columns: repeat(3, 1fr);
}

.bpmb-columns-4 {
	grid-template-columns: repeat(4, 1fr);
}

/*--------------------------------------------------------------
# Post Item Card
--------------------------------------------------------------*/
.bpmb-post-item {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--bpmb-bg-primary, #fff);
	border: 1px solid var(--bpmb-border-color, #e9ecef);
	border-radius: var(--bpmb-radius-lg, 8px);
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.bpmb-post-item:hover {
	box-shadow: var(--bpmb-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
	transform: translateY(-2px);
}

/* Thumbnail */
.bpmb-post-thumbnail {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
}

.bpmb-post-thumbnail a {
	display: block;
	height: 100%;
}

.bpmb-post-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.bpmb-post-item:hover .bpmb-post-thumbnail img {
	transform: scale(1.05);
}

/* Content */
.bpmb-post-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: var(--bpmb-space-md, 16px);
}

.bpmb-post-title {
	margin: 0 0 var(--bpmb-space-sm, 8px);
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.3;
}

.bpmb-post-title a {
	color: var(--bpmb-text-primary, #212529);
	text-decoration: none;
}

.bpmb-post-title a:hover {
	color: var(--bpmb-primary, #2468c6);
}

/* Meta */
.bpmb-post-meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--bpmb-space-sm, 8px) var(--bpmb-space-md, 16px);
	margin-bottom: 12px;
	font-size: 0.875rem;
	color: var(--bpmb-text-secondary, #6c757d);
}

.bpmb-post-meta span {
	display: inline-flex;
	align-items: center;
	gap: var(--bpmb-space-xs, 4px);
}

.bpmb-post-meta svg {
	opacity: 0.7;
}

.bpmb-author-avatar {
	display: inline-flex;
	align-items: center;
}

.bpmb-author-avatar img {
	border-radius: 50%;
	margin-right: 4px;
}

.bpmb-post-author a {
	color: #495057;
	text-decoration: none;
}

.bpmb-post-author a:hover {
	color: #2468c6;
}

/* Excerpt */
.bpmb-post-excerpt {
	flex: 1;
	margin-bottom: 12px;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--bpmb-text-primary, #495057);
}

.bpmb-post-excerpt p {
	margin: 0;
}

/* Read More */
.bpmb-read-more {
	display: inline-flex;
	align-items: center;
	margin-top: auto;
	padding: var(--bpmb-space-sm, 8px) var(--bpmb-space-md, 16px);
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--bpmb-primary, #2468c6);
	text-decoration: none;
	background: var(--bpmb-primary-light, #e8f0fc);
	border-radius: var(--bpmb-radius-sm, 4px);
	transition: all 0.2s ease;
	align-self: flex-start;
}

.bpmb-read-more:hover {
	background: var(--bpmb-primary, #2468c6);
	color: var(--bpmb-text-light, #fff);
}

/*--------------------------------------------------------------
# Popular Posts - Rank Badge
--------------------------------------------------------------*/
.bpmb-post-rank {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 1;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--bpmb-text-light, #fff);
	background: var(--bpmb-primary, #2468c6);
	border-radius: 50%;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bpmb-post-item:not(:has(.bpmb-post-thumbnail)) .bpmb-post-rank {
	position: relative;
}

.bpmb-rank-1 .bpmb-post-rank {
	background: linear-gradient(135deg, #ffd700, #ffa500);
	color: #212529;
}

.bpmb-rank-2 .bpmb-post-rank {
	background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
}

.bpmb-rank-3 .bpmb-post-rank {
	background: linear-gradient(135deg, #cd7f32, #a0522d);
}

/* Views count styling */
.bpmb-post-views {
	font-weight: 500;
	color: #495057;
}

.bpmb-post-views svg {
	width: 14px;
	height: 14px;
}

/*--------------------------------------------------------------
# Categories - Cloud Style
--------------------------------------------------------------*/
.bpmb-categories-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.bpmb-category-tag {
	display: inline-block;
	padding: 6px 12px;
	color: var(--bpmb-text-primary, #495057);
	text-decoration: none;
	background: var(--bpmb-bg-secondary, #f8f9fa);
	border-radius: 20px;
	transition: all 0.2s ease;
	line-height: 1.4;
}

.bpmb-category-tag:hover {
	background: var(--bpmb-primary, #2468c6);
	color: var(--bpmb-text-light, #fff);
}

.bpmb-category-tag .bpmb-category-count {
	font-size: 0.75em;
	opacity: 0.7;
	margin-left: 2px;
}

/*--------------------------------------------------------------
# Categories - List Style
--------------------------------------------------------------*/
.bpmb-categories-list {
	background: #fff;
	border: 1px solid #e9ecef;
	border-radius: 8px;
	padding: 0;
}

.bpmb-category-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bpmb-category-item {
	border-bottom: 1px solid #e9ecef;
}

.bpmb-category-item:last-child {
	border-bottom: none;
}

.bpmb-category-item a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 16px;
	color: #495057;
	text-decoration: none;
	transition: all 0.2s ease;
}

.bpmb-category-item a:hover {
	background: #f8f9fa;
	color: #2468c6;
}

.bpmb-categories-list .bpmb-category-count {
	font-size: 0.875rem;
	padding: 2px 8px;
	background: #e9ecef;
	border-radius: 12px;
	color: #6c757d;
}

.bpmb-category-item a:hover .bpmb-category-count {
	background: #2468c6;
	color: #fff;
}

/*--------------------------------------------------------------
# Categories - Grid Style
--------------------------------------------------------------*/
.bpmb-categories-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 16px;
}

.bpmb-category-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 20px 16px;
	text-align: center;
	background: #fff;
	border: 1px solid #e9ecef;
	border-radius: 8px;
	text-decoration: none;
	transition: all 0.2s ease;
}

.bpmb-category-card:hover {
	border-color: #2468c6;
	box-shadow: 0 4px 12px rgba(36, 104, 198, 0.15);
	transform: translateY(-2px);
}

.bpmb-category-card .bpmb-category-name {
	display: block;
	font-size: 1rem;
	font-weight: 600;
	color: #212529;
	margin-bottom: 4px;
}

.bpmb-category-card .bpmb-category-count {
	font-size: 0.875rem;
	color: #6c757d;
}

.bpmb-category-card:hover .bpmb-category-name {
	color: #2468c6;
}

/*--------------------------------------------------------------
# Authors Grid
--------------------------------------------------------------*/
.bpmb-author-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 24px 16px;
	text-align: center;
	background: #fff;
	border: 1px solid #e9ecef;
	border-radius: 12px;
	transition: all 0.2s ease;
}

.bpmb-author-card:hover {
	border-color: #2468c6;
	box-shadow: 0 8px 24px rgba(36, 104, 198, 0.12);
	transform: translateY(-4px);
}

.bpmb-authors .bpmb-author-avatar {
	margin-bottom: 16px;
}

.bpmb-authors .bpmb-author-avatar a {
	display: block;
	border-radius: 50%;
	overflow: hidden;
	transition: transform 0.2s ease;
}

.bpmb-authors .bpmb-author-avatar a:hover {
	transform: scale(1.05);
}

.bpmb-authors .bpmb-author-avatar img {
	border-radius: 50%;
	border: 3px solid #e9ecef;
	transition: border-color 0.2s ease;
}

.bpmb-author-card:hover .bpmb-author-avatar img {
	border-color: #2468c6;
}

.bpmb-author-info {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.bpmb-author-name {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.3;
}

.bpmb-author-name a {
	color: #212529;
	text-decoration: none;
	transition: color 0.2s ease;
}

.bpmb-author-name a:hover {
	color: #2468c6;
}

.bpmb-author-post-count {
	font-size: 0.875rem;
	color: #6c757d;
	font-weight: 500;
}

.bpmb-author-bio {
	margin: 8px 0 0;
	font-size: 0.875rem;
	line-height: 1.5;
	color: #495057;
}

.bpmb-view-posts {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 12px;
	padding: 8px 16px;
	font-size: 0.875rem;
	font-weight: 500;
	color: #2468c6;
	text-decoration: none;
	background: #e8f0fc;
	border-radius: 20px;
	transition: all 0.2s ease;
}

.bpmb-view-posts:hover {
	background: #2468c6;
	color: #fff;
}

.bpmb-view-posts svg {
	transition: transform 0.2s ease;
}

.bpmb-view-posts:hover svg {
	transform: translateX(3px);
}

/*--------------------------------------------------------------
# Responsive Styles
--------------------------------------------------------------*/
@media (max-width: 992px) {
	.bpmb-columns-4 {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	.bpmb-columns-3,
	.bpmb-columns-4 {
		grid-template-columns: repeat(2, 1fr);
	}

	.bpmb-post-meta {
		flex-direction: column;
		gap: 4px;
	}

	.bpmb-categories-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.bpmb-columns-2,
	.bpmb-columns-3,
	.bpmb-columns-4 {
		grid-template-columns: 1fr;
	}

	.bpmb-post-content {
		padding: 12px;
	}

	.bpmb-post-title {
		font-size: 1rem;
	}

	.bpmb-categories-grid {
		grid-template-columns: 1fr;
	}

	.bpmb-category-card {
		padding: 16px 12px;
	}
}

/*--------------------------------------------------------------
# Dark Mode Support
--------------------------------------------------------------*/
.dark-mode .bpmb-post-item,
.dark-scheme .bpmb-post-item {
	background: #1e1e1e;
	border-color: #333;
}

.dark-mode .bpmb-post-title a,
.dark-scheme .bpmb-post-title a {
	color: #e0e0e0;
}

.dark-mode .bpmb-post-excerpt,
.dark-scheme .bpmb-post-excerpt {
	color: #a0a0a0;
}

.dark-mode .bpmb-category-tag,
.dark-scheme .bpmb-category-tag {
	background: #333;
	color: #e0e0e0;
}

.dark-mode .bpmb-categories-list,
.dark-scheme .bpmb-categories-list {
	background: #1e1e1e;
	border-color: #333;
}

.dark-mode .bpmb-category-item,
.dark-scheme .bpmb-category-item {
	border-color: #333;
}

.dark-mode .bpmb-category-item a,
.dark-scheme .bpmb-category-item a {
	color: #e0e0e0;
}

.dark-mode .bpmb-category-card,
.dark-scheme .bpmb-category-card {
	background: #1e1e1e;
	border-color: #333;
}

.dark-mode .bpmb-category-card .bpmb-category-name,
.dark-scheme .bpmb-category-card .bpmb-category-name {
	color: #e0e0e0;
}

.dark-mode .bpmb-shortcode-empty,
.dark-scheme .bpmb-shortcode-empty {
	background: #2d2d2d;
	color: #a0a0a0;
}

/* Authors dark mode */
.dark-mode .bpmb-author-card,
.dark-scheme .bpmb-author-card {
	background: #1e1e1e;
	border-color: #333;
}

.dark-mode .bpmb-author-name a,
.dark-scheme .bpmb-author-name a {
	color: #e0e0e0;
}

.dark-mode .bpmb-author-post-count,
.dark-scheme .bpmb-author-post-count {
	color: #a0a0a0;
}

.dark-mode .bpmb-author-bio,
.dark-scheme .bpmb-author-bio {
	color: #a0a0a0;
}

.dark-mode .bpmb-authors .bpmb-author-avatar img,
.dark-scheme .bpmb-authors .bpmb-author-avatar img {
	border-color: #444;
}

.dark-mode .bpmb-view-posts,
.dark-scheme .bpmb-view-posts {
	background: #2d3748;
	color: #60a5fa;
}

.dark-mode .bpmb-view-posts:hover,
.dark-scheme .bpmb-view-posts:hover {
	background: #3b82f6;
	color: #fff;
}
