/* Blog homepage – custom layout (no Publisher listing CSS) */

.am-blog-home {
	background: var(--am-bg, #f6f6f6);
	padding: 18px 0 36px;
}

.am-blog-home__inner {
	max-width: 1300px;
}

/* ── Hero mosaic (2 + 3 grid) ── */
.am-hero-section {
	margin-bottom: 18px;
	background: #fff;
	padding: 6px;
	border: 1px solid var(--am-border, #e2e2e2);
	border-radius: 3px;
}

.am-hero-mosaic {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.am-hero-mosaic__row {
	display: grid;
	gap: 3px;
}

.am-hero-mosaic__row--top {
	grid-template-columns: 1fr 1fr;
}

.am-hero-mosaic__row--bottom {
	grid-template-columns: repeat(3, 1fr);
}

.am-hero-mosaic__item {
	position: relative;
	overflow: hidden;
	background: #111;
}

.am-hero-mosaic__item--lg {
	height: 300px;
}

.am-hero-mosaic__item--sm {
	height: 210px;
}

.am-hero-mosaic__link {
	display: block;
	width: 100%;
	height: 100%;
	position: relative;
}

.am-hero-mosaic__media {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.am-hero-mosaic__media img,
.am-hero-mosaic__media .am-hero-mosaic__placeholder,
.am-hero-mosaic__placeholder {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

.am-hero-mosaic__placeholder {
	background: linear-gradient(135deg, #1a3a34 0%, #0d2520 100%);
}

.am-hero-mosaic__overlay {
	position: absolute;
	inset: auto 0 0 0;
	z-index: 2;
	padding: 14px 16px 16px;
	background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
	color: #fff;
	pointer-events: none;
}

.am-hero-mosaic__overlay h2 {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.45;
	margin: 0;
	color: #fff;
	pointer-events: all;
}

.am-hero-mosaic__item--lg .am-hero-mosaic__overlay h2 {
	font-size: 18px;
}

/* ── Category badges (theme teal – override Bootstrap blue) ── */
.am-blog-home .am-term-badge .term-badge,
.am-blog-home .am-term-badge .term-badge a,
.am-blog-home .term-badges .term-badge,
.am-blog-home .term-badges .term-badge a {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 2px;
	color: #fff !important;
	background: var(--am-teal, #03967c) !important;
	border: none !important;
	text-decoration: none;
	line-height: 1.4;
	white-space: nowrap;
}

/* Hero mosaic: compact category pill (tighter left/right) */
.am-blog-home .am-hero-mosaic__item .am-term-badge {
	width: auto;
	max-width: fit-content;
}

.am-blog-home .am-hero-mosaic__item .am-term-badge .term-badge,
.am-blog-home .am-hero-mosaic__item .am-term-badge .term-badge a {
	display: inline-block;
	width: auto;
	font-size: 9px;
	padding: 2px 4px;
	line-height: 1.2;
	border-radius: 2px;
}

.am-blog-home .am-hero-mosaic__item .am-term-badge.floated {
	top: 8px;
	right: 8px;
}

.am-term-badge.floated {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
}

.am-mix-big__thumb .am-term-badge.floated,
.am-post-thumb .am-term-badge.floated {
	top: 12px;
	right: 12px;
}

/* ── Main layout ── */
.am-home-layout {
	display: grid;
	grid-template-columns: 1fr 320px;
	gap: 16px;
	align-items: start;
}

.am-home-block {
	background: #fff;
	border: 1px solid var(--am-border, #ddd);
	padding: 14px 16px;
	margin-bottom: 14px;
	border-radius: 3px;
}

/* ── برترین مطالب: big right + 4 small left (RTL) ── */
.am-mix-section {
	display: grid;
	grid-template-columns: 1.15fr 1fr;
	gap: 14px;
	align-items: stretch;
}

.am-mix-section .am-mix-big {
	margin-bottom: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--am-border, #e2e2e2);
	border-radius: 3px;
	overflow: hidden;
}

.am-mix-section .am-mix-big__thumb {
	flex: 0 0 260px;
	height: 260px;
	min-height: 260px;
	max-height: 260px;
}

.am-mix-section .am-mix-big__thumb a {
	display: block;
	width: 100%;
	height: 100%;
}

.am-mix-section .am-mix-big__thumb img,
.am-mix-section .am-mix-big__thumb .am-hero-mosaic__placeholder {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.am-mix-section .am-mix-small-grid {
	height: 100%;
	margin-bottom: 0;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--am-border, #e2e2e2);
	border-radius: 3px;
	overflow: hidden;
	background: var(--am-border, #e2e2e2);
	gap: 1px;
}

.am-mix-section .am-mix-small {
	flex: 1 1 0;
	min-height: 0;
	background: #fff;
}

.am-mix-section .am-mix-small__thumb {
	height: 100%;
	width: 110px;
	min-height: 72px;
}

.am-mix-section .am-mix-small__thumb a {
	display: block;
	height: 100%;
}

.am-mix-section .am-mix-small__thumb img,
.am-mix-section .am-mix-small__thumb .am-hero-mosaic__placeholder {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ── Latest posts list ── */
.am-latest-posts .am-post-item {
	display: grid;
	grid-template-columns: 220px 1fr;
	align-items: stretch;
	margin-bottom: 0;
}

.am-latest-posts .am-post-thumb {
	position: relative;
	width: 220px;
	height: auto;
	min-height: 100%;
	align-self: stretch;
	overflow: hidden;
}

.am-latest-posts .am-post-thumb > a {
	display: block;
	height: 100%;
	min-height: 100%;
}

.am-latest-posts .am-post-thumb img,
.am-latest-posts .am-post-thumb .am-hero-mosaic__placeholder {
	width: 100%;
	height: 100%;
	min-height: 180px;
	object-fit: cover;
	display: block;
}

.am-latest-posts .am-post-body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 14px 16px;
}

.am-latest-posts .am-post-body .am-readmore {
	margin-top: auto;
	padding-top: 8px;
}

/* Override style.css height:auto on post thumbnails */
.am-blog-home .am-hero-mosaic__media img,
.am-blog-home .am-mix-big__thumb img,
.am-blog-home .am-mix-small__thumb img,
.am-blog-home .am-post-thumb img {
	height: 100% !important;
	max-height: none;
}

/* ── Buttons (theme green) ── */
.am-blog-home .am-readmore {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 7px 16px;
	background: var(--am-teal, #03967c);
	color: #fff;
	border-radius: 3px;
	font-size: 13px;
	transition: background 0.2s;
}

.am-blog-home .am-readmore:hover {
	background: var(--am-teal-dark, #027a65);
	color: #fff;
}

/* ── Pagination ── */
.am-blog-home .am-pagination {
	text-align: center;
	margin-top: 14px;
}

.am-blog-home .am-pagination a,
.am-blog-home .am-pagination span {
	display: inline-block;
	padding: 6px 12px;
	margin: 0 2px;
	border: 1px solid var(--am-border, #ddd);
	border-radius: 3px;
	font-size: 13px;
}

.am-blog-home .am-pagination a:hover,
.am-blog-home .am-pagination .current {
	background: var(--am-teal, #03967c);
	color: #fff;
	border-color: var(--am-teal, #03967c);
}

/* ── Sidebar widgets ── */
.am-home-sidebar .am-widget {
	background: #fff;
	border: 1px solid var(--am-border, #ddd);
	margin-bottom: 14px;
	border-radius: 3px;
}

.am-home-sidebar .am-widget-title {
	border-bottom: 2px solid var(--am-teal, #03967c);
	padding: 10px 12px 6px;
	font-size: 14px;
	font-weight: 700;
	margin: 0;
}

.am-home-sidebar .am-widget-body {
	padding: 12px;
}

.am-featured-post img {
	width: 100%;
	height: auto;
	display: block;
	margin-bottom: 8px;
}

.am-featured-post__title {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.5;
}

.am-thumb-post {
	display: flex;
	gap: 8px;
	padding: 8px 0;
	border-bottom: 1px solid #eee;
}

.am-thumb-post:last-child {
	border-bottom: none;
}

.am-thumb-post__img {
	flex-shrink: 0;
	width: 86px;
	height: 64px;
	overflow: hidden;
}

.am-thumb-post__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.am-thumb-post__title {
	font-size: 13px;
	line-height: 1.45;
	font-weight: 600;
	display: block;
}

.am-thumb-post__date {
	font-size: 11px;
	color: #999;
}

.am-cat-list li a {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	padding: 7px 0;
	border-bottom: 1px dotted #ddd;
	font-size: 13px;
}

.am-cat-count {
	background: #eee;
	padding: 1px 8px;
	border-radius: 10px;
	font-size: 11px;
	color: #666;
}

.am-text-links li {
	border-bottom: 1px solid #eee;
	padding: 7px 0;
}

.am-text-links a {
	font-size: 13px;
	line-height: 1.45;
}

.am-instagram {
	text-align: center;
	padding: 18px 12px !important;
}

.am-instagram a {
	color: #333;
}

.am-instagram i {
	font-size: 36px;
	color: #e1306c;
	margin-bottom: 8px;
	display: block;
}

.am-instagram p {
	font-size: 13px;
	font-weight: 600;
	margin: 0;
}

.am-not-found {
	padding: 20px;
	text-align: center;
	color: var(--am-muted, #666);
}

/* ── Responsive ── */
@media (max-width: 991px) {
	.am-home-layout {
		grid-template-columns: 1fr;
	}

	.am-home-sidebar {
		order: -1;
	}

	.am-mix-section {
		grid-template-columns: 1fr;
	}

	.am-mix-section .am-mix-big__thumb {
		flex: 0 0 220px;
		height: 220px;
		min-height: 220px;
		max-height: 220px;
	}

	.am-mix-section .am-mix-small {
		flex: none;
		min-height: 80px;
	}

	.am-hero-mosaic__item--lg {
		height: 260px;
	}

	.am-hero-mosaic__item--sm {
		height: 190px;
	}
}

@media (max-width: 768px) {
	.am-hero-mosaic__row--top,
	.am-hero-mosaic__row--bottom {
		grid-template-columns: 1fr;
	}

	.am-hero-mosaic__item--lg,
	.am-hero-mosaic__item--sm {
		height: 220px;
	}

	.am-latest-posts .am-post-item {
		grid-template-columns: 1fr;
	}

	.am-latest-posts .am-post-thumb {
		width: 100%;
		height: 220px;
	}
}

@media (max-width: 480px) {
	.am-mix-section .am-mix-small {
		grid-template-columns: 90px 1fr;
	}

	.am-mix-section .am-mix-small__thumb {
		width: 90px;
	}
}
