/* ==========================================================
   Blogs Manager – front-end styles
   Colors / sizes come from CSS variables set in Settings.
   ========================================================== */

.bm-scope,
.bm-scope *,
.bm-scope *::before,
.bm-scope *::after { box-sizing: border-box; }

.bm-scope {
	font-family: var(--bm-font, inherit);
	font-size: var(--bm-base-font-size, 16px);
	color: var(--bm-text-color, #1e293b);
	line-height: 1.65;
	-webkit-text-size-adjust: 100%;
}
.bm-scope a { text-decoration: none; }
.bm-scope h1, .bm-scope h2, .bm-scope h3 { font-family: inherit; }

.bm-page { background: var(--bm-page-bg); padding-bottom: 70px; width: 100%; }
.bm-container { width: 100%; max-width: var(--bm-container-width, 1200px); margin: 0 auto; padding: 0 20px; }
.bm-container--narrow { max-width: var(--bm-content-width, 820px); }
.bm-embed { width: 100%; }

/* ---------- Hero ---------- */
.bm-hero {
	background: linear-gradient(135deg, var(--bm-primary-dark), var(--bm-primary));
	color: var(--bm-hero-text);
	padding: clamp(38px, 7vw, 78px) 0 clamp(54px, 8vw, 96px);
	text-align: center;
}
.bm-hero h1 {
	color: inherit; margin: 0 0 12px;
	font-size: var(--bm-hero-title-size);
	font-weight: var(--bm-title-weight);
	line-height: 1.2; overflow-wrap: anywhere;
}
.bm-hero p { margin: 0 auto; max-width: 660px; opacity: .92; font-size: 1.08em; }

.bm-hero--single { text-align: left; padding-bottom: clamp(70px, 9vw, 110px); }
.bm-hero--single h1 { font-size: var(--bm-single-title-size); margin: 14px 0 16px; }
.bm-back {
	display: inline-flex; align-items: center; gap: 6px;
	color: var(--bm-hero-text) !important; opacity: .9; font-size: .9em; margin-bottom: 16px;
}
.bm-back:hover { opacity: 1; text-decoration: underline; }
.bm-badges { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Filters ---------- */
.bm-archive-body { padding-top: 34px; }
.bm-archive-body.has-hero { padding-top: 0; }

.bm-filters {
	display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
	background: var(--bm-card-bg); border: 1px solid var(--bm-border-color);
	border-radius: var(--bm-card-radius); padding: 14px; margin-bottom: 30px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
	position: relative; z-index: 2;
}
.bm-archive-body.has-hero .bm-filters { margin-top: -34px; }
.bm-filters input[type="search"],
.bm-filters select {
	flex: 1 1 200px; min-width: 0; height: 46px; padding: 0 14px;
	border: 1px solid var(--bm-border-color); border-radius: 10px;
	background: #fff; color: var(--bm-text-color); font: inherit; font-size: .95em;
}
.bm-filters input:focus, .bm-filters select:focus { outline: 2px solid var(--bm-primary); border-color: var(--bm-primary); }

.bm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	height: 46px; padding: 0 22px; border-radius: 10px; border: 0; cursor: pointer;
	background: var(--bm-primary); color: #fff; font: inherit; font-size: .95em; font-weight: 600;
	transition: background .18s ease;
}
.bm-btn:hover { background: var(--bm-primary-dark); }

/* ---------- Grid / list ---------- */
.bm-list { display: grid; gap: 26px; grid-template-columns: repeat(var(--bm-grid-columns, 3), minmax(0, 1fr)); }

.bm-card {
	display: flex; flex-direction: column;
	background: var(--bm-card-bg); border: 1px solid var(--bm-border-color);
	border-radius: var(--bm-card-radius); overflow: hidden;
	transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
}
.bm-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(36, 67, 147, .15); border-color: var(--bm-primary); }

.bm-card__media {
	display: block; position: relative; height: var(--bm-image-height, 210px);
	background: var(--bm-primary-light); overflow: hidden; flex: 0 0 auto;
}
.bm-card__img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s ease; }
.bm-card:hover .bm-card__img { transform: scale(1.06); }
.bm-card__placeholder {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	color: var(--bm-primary); opacity: .55;
	background: linear-gradient(135deg, var(--bm-primary-light), #fff);
}

.bm-card__body { display: flex; flex-direction: column; align-items: flex-start; padding: 22px; flex: 1 1 auto; min-width: 0; }

.bm-badge {
	display: inline-block; padding: 3px 12px; margin-bottom: 12px; border-radius: 999px;
	background: var(--bm-primary-light); color: var(--bm-primary) !important;
	font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; line-height: 1.6;
}
.bm-badge:hover { background: var(--bm-primary); color: #fff !important; }
.bm-badge--light { background: rgba(255, 255, 255, .18); color: var(--bm-hero-text) !important; margin-bottom: 0; }
.bm-badge--light:hover { background: #fff; color: var(--bm-primary) !important; }

.bm-card__title { margin: 0 0 10px; font-size: var(--bm-card-title-size); font-weight: var(--bm-title-weight); line-height: 1.3; overflow-wrap: anywhere; }
.bm-card__title a { color: var(--bm-text-color); }
.bm-card__title a:hover { color: var(--bm-primary); }

.bm-meta { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.bm-meta li { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--bm-muted-color); font-size: .85em; }
.bm-meta svg { color: var(--bm-primary); flex-shrink: 0; }
.bm-meta--hero { margin: 0; gap: 6px 22px; }
.bm-meta--hero li { color: var(--bm-hero-text); opacity: .95; font-size: .95em; }
.bm-meta--hero svg { color: currentColor; }

.bm-card__excerpt {
	margin: 0 0 16px; color: var(--bm-muted-color);
	font-size: var(--bm-excerpt-size, 15px); line-height: 1.65; overflow-wrap: anywhere;
}
.bm-ellipsis {
	color: var(--bm-primary) !important; font-weight: 800; letter-spacing: .08em;
	padding: 0 2px 0 4px; border-radius: 4px; transition: background .15s ease;
}
.bm-ellipsis:hover { background: var(--bm-primary-light); text-decoration: underline; }

.bm-readmore {
	margin-top: auto; display: inline-flex; align-items: center; gap: 8px;
	color: var(--bm-primary) !important; font-weight: 700; font-size: .95em;
}
.bm-readmore svg { transition: transform .2s ease; }
.bm-readmore:hover svg { transform: translateX(5px); }

/* List layout (image left) */
.bm-layout-list .bm-list { grid-template-columns: 1fr; gap: 20px; }
.bm-layout-list .bm-card { flex-direction: row; }
.bm-layout-list .bm-card__media { flex: 0 0 min(34%, 340px); height: auto; min-height: var(--bm-image-height, 210px); }
.bm-layout-list .bm-card__body { padding: 24px 26px; }

.bm-empty { text-align: center; padding: 56px 20px; color: var(--bm-muted-color); background: var(--bm-card-bg); border: 1px dashed var(--bm-border-color); border-radius: var(--bm-card-radius); }

/* ---------- Pagination ---------- */
.bm-pagination { margin-top: 38px; display: flex; justify-content: center; }
.bm-pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; margin: 0; padding: 0; }
.bm-pagination li { margin: 0; }
.bm-pagination a, .bm-pagination span {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 42px; height: 42px; padding: 0 14px; border-radius: 10px;
	border: 1px solid var(--bm-border-color); background: var(--bm-card-bg);
	color: var(--bm-primary); font-weight: 600; font-size: .95em;
}
.bm-pagination a:hover { background: var(--bm-primary-light); border-color: var(--bm-primary); }
.bm-pagination .current { background: var(--bm-primary); border-color: var(--bm-primary); color: #fff; }
.bm-pagination .dots { border: 0; background: transparent; }

/* ---------- Single post ---------- */
.bm-article-wrap { margin-top: -56px; position: relative; z-index: 2; }

.bm-featured { margin: 0 0 24px; border-radius: var(--bm-card-radius); overflow: hidden; box-shadow: 0 14px 40px rgba(15, 23, 42, .18); background: var(--bm-primary-light); }
.bm-featured__img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: cover; }

.bm-article {
	background: var(--bm-card-bg); border: 1px solid var(--bm-border-color);
	border-radius: var(--bm-card-radius); padding: clamp(22px, 4vw, 44px);
	box-shadow: 0 6px 22px rgba(15, 23, 42, .05);
}
.bm-content { font-size: 1.06em; line-height: 1.85; overflow-wrap: anywhere; }
.bm-content > *:first-child { margin-top: 0; }
.bm-content > *:last-child { margin-bottom: 0; }
.bm-content p { margin: 0 0 1.3em; }
.bm-content h2, .bm-content h3, .bm-content h4 { margin: 1.8em 0 .6em; line-height: 1.3; color: var(--bm-text-color); font-weight: var(--bm-title-weight); }
.bm-content a { color: var(--bm-primary); text-decoration: underline; }
.bm-content ul, .bm-content ol { margin: 0 0 1.3em 1.3em; padding: 0; }
.bm-content li { margin-bottom: .45em; }
.bm-content img, .bm-content video, .bm-content iframe { max-width: 100%; height: auto; border-radius: 10px; }
.bm-content figure { margin: 1.6em 0; }
.bm-content figcaption { font-size: .85em; color: var(--bm-muted-color); text-align: center; margin-top: 8px; }
.bm-content blockquote { margin: 1.6em 0; padding: 14px 22px; border-left: 4px solid var(--bm-primary); background: var(--bm-primary-light); border-radius: 0 10px 10px 0; font-style: italic; }
.bm-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.bm-content th, .bm-content td { border: 1px solid var(--bm-border-color); padding: 8px 12px; }
.bm-content pre { overflow-x: auto; padding: 16px; background: #0f172a; color: #e2e8f0; border-radius: 10px; }

/* Share */
.bm-share { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--bm-border-color); }
.bm-share__label { font-weight: 700; }
.bm-share__buttons { display: flex; gap: 10px; }
.bm-share__btn {
	position: relative; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--bm-primary-light); color: var(--bm-primary) !important; transition: background .18s, color .18s, transform .15s;
}
.bm-share__btn:hover { background: var(--bm-primary); color: #fff !important; transform: translateY(-3px); }
.bm-share__btn.is-copied::after {
	content: "Copied!"; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
	background: #0f172a; color: #fff; font-size: 12px; padding: 3px 9px; border-radius: 6px; white-space: nowrap;
}

/* Prev / next */
.bm-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 26px; }
.bm-prevnext__item {
	display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; min-width: 0;
	background: var(--bm-card-bg); border: 1px solid var(--bm-border-color); border-radius: var(--bm-card-radius);
	transition: border-color .2s, box-shadow .2s;
}
.bm-prevnext__item:hover { border-color: var(--bm-primary); box-shadow: 0 8px 22px rgba(36, 67, 147, .12); }
.bm-prevnext__item--next { text-align: right; grid-column: 2; }
.bm-prevnext__dir { font-size: .8em; text-transform: uppercase; letter-spacing: .06em; color: var(--bm-muted-color); }
.bm-prevnext__title { font-weight: 700; color: var(--bm-primary); overflow-wrap: anywhere; }

/* Related */
.bm-related { margin-top: 56px; }
.bm-related__title { margin: 0 0 24px; font-size: 1.6em; font-weight: var(--bm-title-weight); color: var(--bm-text-color); position: relative; padding-bottom: 12px; }
.bm-related__title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 60px; height: 3px; background: var(--bm-primary); border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
	.bm-card, .bm-card__img, .bm-readmore svg, .bm-share__btn { transition: none !important; }
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1100px) {
	.bm-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
	.bm-container { padding: 0 16px; }
	.bm-list { gap: 18px; }
	.bm-card__body { padding: 18px; }
	.bm-filters { padding: 12px; }
	.bm-filters .bm-btn { flex: 1 1 100%; }
	.bm-article-wrap { margin-top: -44px; }
}

@media (max-width: 640px) {
	.bm-list { grid-template-columns: 1fr; }

	.bm-layout-list .bm-card { flex-direction: column; }
	.bm-layout-list .bm-card__media { flex: 0 0 auto; height: var(--bm-image-height, 210px); min-height: 0; }

	.bm-prevnext { grid-template-columns: 1fr; }
	.bm-prevnext__item--next { grid-column: auto; text-align: left; }
	.bm-share { flex-direction: column; align-items: flex-start; }
}
