/* Min Pet Shop: blog styles (blog page, post archives, single post, "Tin liên quan").
 * Markup: Flatsome [blog_posts] (.box-blog-post) with classes mps-blog-cards / mps-blog-mini,
 * templates template-parts/posts/*.php and helpers in inc/blog.php.
 * Reference: min-pet-shop.myharavan.com /blogs/news and /blogs/news/<article>.
 */

/* ---------- Blog wrapper (single + archives) ---------- */
#content.blog-wrapper.page-wrapper { padding-top: 0; padding-bottom: 0; }
#content.blog-wrapper > .section.bread-crumb { margin-bottom: 50px; }

/* ---------- Cards: [blog_posts class="mps-blog-cards"] (reference .item-blog) ---------- */
#content .row.mps-blog-cards { margin: 0 -10px; width: auto; max-width: none; padding: 0; }
#content .row.mps-blog-cards > .col { padding: 0 10px; margin-bottom: 20px; }
.mps-blog-cards .col-inner { height: auto; }
.mps-blog-cards .box-blog-post {
	overflow: hidden;
	background-color: color-mix(in srgb, var(--mainColor) 5%, transparent);
	border-radius: 10px;
	padding: 15px;
	width: 100%;
	color: #000;
}
.mps-blog-cards .box-blog-post .box-image { width: 100% !important; margin: 0 0 10px; border-radius: 10px; overflow: hidden; position: relative; }
.mps-blog-cards .box-blog-post .image-cover { padding-top: 100% !important; overflow: hidden; background: none; }
.mps-blog-cards .box-blog-post .image-cover img {
	position: absolute;
	top: 0; right: 0; bottom: 0; left: 0;
	margin: auto;
	width: auto !important;
	height: auto !important;
	max-width: 100%;
	max-height: 100%;
	object-fit: initial;
	transform: scale(1);
	transition: all .5s ease;
}
.mps-blog-cards .box-blog-post:hover .image-cover img { transform: scale(1.2); }
.mps-blog-cards .box-text { padding: 0 !important; font-size: 14px; text-align: left; }
.mps-blog-cards .box-text-inner { padding: 0; }
.mps-blog-cards .info-post { display: flex !important; gap: 8px; align-items: center; margin: 0 0 10px !important; padding: 0; list-style: none; font-size: 14px; line-height: 1.5; }
.mps-blog-cards .info-post li { display: flex !important; align-items: center; gap: 5px; margin: 0 !important; }
.mps-blog-cards .info-post li::before,
.article-main .info-post li::before {
	content: "";
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	background: var(--hover);
	-webkit-mask: url(../icons/date.svg) center / contain no-repeat;
	mask: url(../icons/date.svg) center / contain no-repeat;
}
.mps-blog-cards .info-post li.comment::before,
.article-main .info-post li.comment::before { -webkit-mask-image: url(../icons/comment.svg); mask-image: url(../icons/comment.svg); }
.mps-blog-cards .post-title { margin: 0 0 .5rem !important; font-size: 16px !important; line-height: 1.2 !important; font-weight: 700; }
.mps-blog-cards .post-title a {
	color: #000;
	font-size: 16px;
	font-weight: 700;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	line-height: 1.4;
	max-height: calc(1em * 1.4 * 2);
	word-break: break-word;
}
.mps-blog-cards .post-title a:hover { color: var(--mainColor); }
.mps-blog-cards .is-divider { display: none; }
.mps-blog-cards .from_the_blog_excerpt {
	margin: 0 0 10px !important;
	font-size: 14px;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	line-height: 1.4;
	max-height: calc(1em * 1.4 * 3);
	word-break: break-word;
}
.mps-blog-cards .box-text .button {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: none !important;
	box-shadow: none;
	color: var(--mainColor);
	font-size: 14px;
	font-weight: 700;
	line-height: 21px;
	letter-spacing: 0;
	text-transform: none;
	transition: all .5s ease;
}
.mps-blog-cards .box-text .button::after {
	content: "";
	width: 18px;
	height: 18px;
	background: currentColor;
	-webkit-mask: url(../icons/arrow.svg) center / 13px no-repeat;
	mask: url(../icons/arrow.svg) center / 13px no-repeat;
}
.mps-blog-cards .box-text .button:hover { color: var(--hover); gap: 5px; }
.mps-blog-cards .box-text .button span { padding: 0; }
@media (max-width: 500px) {
	#content .row.mps-blog-cards { margin: 0 -5px; }
	#content .row.mps-blog-cards > .col { padding: 0 5px; margin-bottom: 10px; }
}

/* Reference grid: 4 per row from 1200 px, 2 per row below (Flatsome switches to 4 at 850). */
@media (min-width: 850px) and (max-width: 1199px) {
	#content .row.mps-blog-cards:not(.slider) > .col { flex-basis: 50%; max-width: 50%; }
}

/* ---------- Mini list: [blog_posts class="mps-blog-mini"] (reference "Tin tức mới nhất") ---------- */
#content .row.mps-blog-mini { margin: 0; width: 100%; max-width: none; padding: 0; }
#content .row.mps-blog-mini > .col { flex-basis: 100%; max-width: 100%; padding: 0; margin: 0 0 15px; }
#content .row.mps-blog-mini > .col:last-child { margin-bottom: 0; }
.mps-blog-mini .box-blog-post { display: flex; align-items: flex-start; }
.mps-blog-mini .box-blog-post .box-image { flex: 0 0 150px; width: 150px !important; min-width: 150px; margin: 0; border-radius: 5px; overflow: hidden; }
.mps-blog-mini .box-blog-post .image-cover { padding-top: 100% !important; }
.mps-blog-mini .box-text { padding: 0 0 0 10px !important; text-align: left; font-size: 14px; }
.mps-blog-mini .post-title { font-size: 16px !important; font-weight: 700 !important; margin: 0 0 3px !important; line-height: 1.4 !important; }
.mps-blog-mini .post-title a { color: #000; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.mps-blog-mini .post-title a:hover { color: var(--hover); }
.mps-blog-mini .is-divider { display: none; }
.mps-blog-mini .time-post { margin: 0; color: var(--mainColor); font-size: 14px; line-height: 1.5; }

/* ---------- Single post (reference .blogpage / .article-main) ---------- */
#content > .section.blogpage { margin-bottom: 0; padding-bottom: 30px !important; }
.blogpage .mps-article-row { align-items: stretch; }
.blogpage .mps-toc-col > .col-inner { height: 100%; }
.article-main .entry-content { padding: 0; }
.ftoc-head { padding: 10px; border-radius: 10px; margin-bottom: 30px; position: sticky; top: 100px; background: var(--bg); }
.ftoc-head .title-goto-wrapper { display: inline-block; margin: 0 0 15px !important; font-size: 24px; font-weight: 700; line-height: 1.5; color: var(--mainColor); }
#content .ftoc-head .toc-list { list-style: disc; padding: 0 0 0 20px; margin: 0; }
#content .ftoc-head .toc-list .toc-list { list-style: circle; padding-left: 20px; margin: 0; }
#content .ftoc-head .toc-list-item { margin: 0 0 10px !important; font-size: 16px; line-height: 1.5; color: #000; }
#content .ftoc-head .toc-list-item:last-child { margin-bottom: 0 !important; }
#content .ftoc-head .toc-list-item a { color: #000; font-size: 16px; }
#content .ftoc-head .toc-list-item a:hover { color: var(--hover); }

.article-main .article-inner { padding: 0; }
#content .article-main .article-title { font-size: 30px; font-weight: 700; line-height: 1.4; margin: 0 0 10px; text-align: center; color: #000; }
.article-main .info-post { display: flex; gap: 20px; align-items: center; justify-content: center; margin: 0 0 30px; padding: 0; list-style: none; font-size: 14px; line-height: 1.5; }
.article-main .info-post li { display: flex; align-items: center; gap: 5px; margin: 0; }
.article-main .info-post li::before { background: currentColor; }
.article-main .rte { font-size: 16px; line-height: 1.5; color: #000; }
#content .article-main .rte :is(h2, h3, h4) { margin: 0 0 .5rem; line-height: 1.4; color: #000; scroll-margin-top: 120px; }
#content .article-main .rte h2 { font-size: 24px; font-weight: 700; }
#content .article-main .rte h3 { font-size: 22px; font-weight: 500; }
#content .article-main .rte h4 { font-size: 20px; font-weight: 500; }
.article-main .rte p { margin: 0 0 1rem; }
.article-main .rte strong { font-weight: 700; }
.article-main .rte ul, .article-main .rte ol { margin: 0; padding: 0; list-style: none; }
.article-main .rte li { margin: 0; }
.article-main .rte img { max-width: 100%; height: auto; }
#comments:empty { display: none; }

@media (max-width: 991px) {
	#content .article-main .article-title { font-size: 24px; }
}

/* ---------- "Tin liên quan" (reference .blog-lq) ---------- */
#content > .section.blog-lq { margin: 30px 0 50px; }
#content .blogpage .mps-article-row > .col { margin-bottom: 0; }
#content .blog-lq .section-content > .row-fix { padding: 0 21px; }
#content .blog-lq .row-fix > .col { margin-bottom: 0; }
.blog-lq .title-index { margin-bottom: 20px; }
.blog-lq .title-index a { color: var(--mainColor); }
.blog-lq .title-index a:hover { color: var(--hover); }
#content .blog-lq .row.mps-blog-cards.slider { margin: 0 -10px; }
#content .blog-lq .row.mps-blog-cards.slider .flickity-viewport { overflow: hidden; }
#content .blog-lq .row.mps-blog-cards > .col,
#content .blog-lq .row.mps-blog-cards .flickity-slider > .col { padding: 0 10px; margin-bottom: 0; }
.blog-lq .mps-blog-cards .flickity-prev-next-button { display: none; }
@media (max-width: 767px) {
	#content .blog-lq .row.mps-blog-cards.slider { margin: 0 -5px; }
	#content .blog-lq .row.mps-blog-cards .flickity-slider > .col { padding: 0 5px; }
}

/* ---------- Post archives (category, tag, search) ---------- */
#content > .section.mps-blog-archive { margin-bottom: 50px; }
.mps-blog-archive .nav-pagination { margin: 10px 0 0; }
