/**
 * The blog's home (home.php, inc/blog-home.php). Loaded on /blog/ only, after magnet-overrides.css.
 * Magnetech's blue (#2563eb) and IRANSansX, cards with soft borders like the showcase box.
 */

.mb-home {
	--mb-blue: #2563eb;
	--mb-blue-soft: #eff6ff;
	--mb-ink: #0f172a;
	--mb-text: #334155;
	--mb-muted: #64748b;
	--mb-line: #e2e8f0;
	--mb-radius: 18px;
	font-family: 'IRANSansX', 'IRANSans', system-ui, sans-serif;
	width: 100%;
	max-width: 1240px;
	margin-inline: auto;
	padding-bottom: 1rem;
}

.mb-home a {
	text-decoration: none;
}

/* 1. Header ------------------------------------------------------------------------------------------------- */

.mb-head {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.25rem;
	padding: 2.25rem 0 1.75rem;
	border-bottom: 1px solid var(--mb-line);
	margin-bottom: 2rem;
}

.mb-head__kicker {
	margin: 0 0 0.4rem;
	color: var(--mb-blue);
	font-size: 0.85rem;
	font-weight: 700;
}

.mb-head__title {
	margin: 0;
	color: var(--mb-ink);
	font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem);
	font-weight: 800;
	line-height: 1.35;
}

/* A breadcrumb stands in the title's place; the title stays for screen readers and Google. */
.mb-head__title--hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.mb-crumbs ol {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--mb-text);
	font-size: 0.85rem;
	line-height: 1.8;
}

.mb-crumbs li {
	margin: 0;
}

.mb-crumbs li + li::before {
	content: "/";
	margin-inline-end: 0.5rem;
	color: #cbd5e1;
}

.mb-crumbs a {
	color: var(--mb-muted) !important;
}

.mb-crumbs a:hover {
	color: var(--mb-blue) !important;
}

.mb-crumbs [aria-current] {
	font-weight: 600;
}

.mb-head__intro {
	margin: 0.6rem 0 0;
	max-width: 46rem;
	color: var(--mb-muted);
	font-size: 1rem;
	line-height: 1.9;
}

.mb-search {
	position: relative;
	align-self: end;
	width: 100%;
	max-width: 26rem;
}

.mb-search input[type='search'] {
	width: 100%;
	height: 3rem;
	margin: 0;
	padding: 0 1.1rem 0 3.25rem;
	border: 1px solid var(--mb-line);
	border-radius: 999px;
	background: #f8fafc;
	color: var(--mb-ink);
	font: inherit;
	font-size: 0.95rem;
	box-shadow: none;
	transition: border-color 0.15s, background 0.15s;
}

.mb-search input[type='search']:focus {
	outline: none;
	border-color: var(--mb-blue);
	background: #fff;
	box-shadow: 0 0 0 4px rgb(37 99 235 / 0.12);
}

.mb-search button {
	position: absolute;
	inset-inline-end: 0.35rem;
	top: 50%;
	display: grid;
	place-items: center;
	width: 2.4rem;
	height: 2.4rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--mb-blue);
	color: #fff;
	cursor: pointer;
	transform: translateY(-50%);
}

.mb-cats {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.mb-head--search .mb-cats {
	grid-column: 1 / -1;
}

.mb-cat {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	gap: 0.45rem;
	height: 2.5rem;
	padding: 0 1rem;
	border: 1px solid var(--mb-line);
	border-radius: 999px;
	background: #fff;
	color: var(--mb-text) !important;
	font-size: 0.9rem;
	font-weight: 600;
	white-space: nowrap;
	transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.mb-cat:hover {
	border-color: #bfdbfe;
	color: var(--mb-blue) !important;
}

.mb-cat.is-current {
	border-color: var(--mb-blue);
	background: var(--mb-blue);
	color: #fff !important;
}

/* «دسته‌بندی‌ها»: a drop-down beside «همه مطالب» (closed by a click outside or Escape, inc/blog-home.php). */
.mb-catmenu {
	position: relative;
}

.mb-catmenu summary {
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.mb-catmenu summary::-webkit-details-marker {
	display: none;
}

.mb-catmenu summary svg {
	transition: transform 0.15s;
}

.mb-catmenu[open] summary svg {
	transform: rotate(180deg);
}

.mb-catmenu__list {
	position: absolute;
	z-index: 30;
	top: calc(100% + 0.4rem);
	inset-inline-start: 0;
	min-width: 14rem;
	max-height: 60vh;
	overflow-y: auto;
	margin: 0;
	padding: 0.4rem;
	border: 1px solid var(--mb-line);
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 18px 40px -18px rgb(15 23 42 / 0.35);
	list-style: none;
}

.mb-catmenu__list li {
	margin: 0;
	padding: 0;
}

.mb-catmenu__list li::before {
	display: none;
}

.mb-catmenu__list a {
	display: block;
	padding: 0.55rem 0.8rem;
	border-radius: 10px;
	color: var(--mb-text) !important;
	font-size: 0.9rem;
	font-weight: 600;
	white-space: nowrap;
}

.mb-catmenu__list a:hover,
.mb-catmenu__list a.is-current {
	background: var(--mb-blue-soft);
	color: var(--mb-blue) !important;
}

/* 2. Cards -------------------------------------------------------------------------------------------------- */

.mb-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.mb-card__media {
	display: block;
	overflow: hidden;
	border-radius: var(--mb-radius);
	background: var(--mb-blue-soft);
	box-shadow: 0 6px 18px -8px rgb(15 23 42 / 0.22);
	aspect-ratio: 16 / 10;
}

.mb-card__img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.mb-card:hover .mb-card__img {
	transform: scale(1.04);
}

.mb-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding-top: 1rem;
}

.mb-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 0.75rem;
	color: var(--mb-muted);
	font-size: 0.8rem;
}

/* The theme sets every <time> to 16px / 600; here it is the size of the line it is in. */
.mb-card__meta time {
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	letter-spacing: inherit;
}

.mb-card__meta > * + *::before {
	content: '';
	display: inline-block;
	width: 4px;
	height: 4px;
	margin-inline-end: 0.75rem;
	border-radius: 50%;
	background: #cbd5e1;
	vertical-align: middle;
}

.mb-card__cat {
	color: var(--mb-blue) !important;
	font-weight: 700;
}

.mb-card__title {
	margin: 0.55rem 0 0;
	font-size: 1.08rem;
	font-weight: 700;
	line-height: 1.75;
}

.mb-card__title a {
	color: var(--mb-ink) !important;
	background: none !important;
}

.mb-card__title a::after {
	content: '';
	position: absolute;
	inset: 0;
}

.mb-card:hover .mb-card__title a {
	color: var(--mb-blue) !important;
}

.mb-card__meta a {
	position: relative;
	z-index: 1;
}

.mb-card__excerpt {
	display: -webkit-box;
	margin: 0.45rem 0 0;
	overflow: hidden;
	color: var(--mb-muted);
	font-size: 0.9rem;
	line-height: 1.9;
	text-align: start;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* The newest post */
.mb-top {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2rem;
	margin-bottom: 3rem;
}

.mb-card--featured .mb-card__media {
	aspect-ratio: 16 / 9;
	border-radius: 22px;
}

.mb-card--featured .mb-card__title {
	font-size: clamp(1.3rem, 1.05rem + 0.8vw, 1.75rem);
	font-weight: 800;
	line-height: 1.6;
}

.mb-card--featured .mb-card__excerpt {
	font-size: 0.98rem;
	-webkit-line-clamp: 3;
}

.mb-card__more {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 0.4rem;
	margin-top: 1.1rem;
	padding: 0.65rem 1.2rem;
	border-radius: 999px;
	background: var(--mb-blue);
	color: #fff !important;
	font-size: 0.9rem;
	font-weight: 700;
	transition: background 0.15s;
}

.mb-card__more:hover {
	background: #1d4ed8;
}

/* The three beside it */
.mb-top__side {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.mb-card--compact {
	flex-direction: row;
	align-items: center;
	gap: 1rem;
	padding: 0.75rem;
	border: 1px solid var(--mb-line);
	border-radius: var(--mb-radius);
	background: #fff;
	box-shadow: 0 8px 24px -12px rgb(15 23 42 / 0.16);
	transition: border-color 0.15s, box-shadow 0.15s;
}

.mb-card--compact:hover {
	border-color: #bfdbfe;
	box-shadow: 0 10px 24px -14px rgb(37 99 235 / 0.35);
}

.mb-card--compact .mb-card__media {
	flex: 0 0 9.5rem;
	aspect-ratio: 16 / 10;
	border-radius: 12px;
}

.mb-card--noimg .mb-card__body {
	padding-top: 0;
}

.mb-card--compact .mb-card__body {
	padding-top: 0;
}

.mb-card--compact .mb-card__title {
	margin-top: 0.35rem;
	font-size: 0.98rem;
	display: -webkit-box;
	overflow: hidden;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

/* 3. The grid ----------------------------------------------------------------------------------------------- */

.mb-section-head {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.mb-section-head h2 {
	margin: 0;
	color: var(--mb-ink);
	font-size: 1.35rem;
	font-weight: 800;
}

.mb-section-head::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--mb-line);
}

.mb-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2.25rem 1.75rem;
}

/* 4. Pages, products, newsletter ---------------------------------------------------------------------------- */

.mb-pages {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem;
	margin: 3rem 0 0;
}

.mb-pages .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 2.75rem;
	height: 2.75rem;
	padding: 0 0.9rem;
	border: 1px solid var(--mb-line);
	border-radius: 999px;
	color: var(--mb-text) !important;
	font-weight: 600;
}

.mb-pages .page-numbers.current {
	border-color: var(--mb-blue);
	background: var(--mb-blue);
	color: #fff !important;
}

.mb-pages a.page-numbers:hover {
	border-color: var(--mb-blue);
	color: var(--mb-blue) !important;
}

.mb-products {
	margin-top: 3.5rem;
}

.mb-products .magnetech-showcase-container {
	max-width: none;
	margin: 0;
}

.mb-empty {
	padding: 3rem 0;
	color: var(--mb-muted);
	text-align: center;
}

/* Wider screens --------------------------------------------------------------------------------------------- */

@media (min-width: 640px) {
	.mb-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 900px) {
	/* The title (or the breadcrumb) on the right, «همه مطالب» and the drop-down on the left. */
	.mb-head {
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: end;
		padding-top: 1rem;
	}

	.mb-head--crumbs {
		align-items: center;
	}

	.mb-head--search {
		grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
	}

	.mb-head:not(.mb-head--search) .mb-catmenu__list {
		inset-inline-start: auto;
		inset-inline-end: 0;
	}

	.mb-top {
		grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
	}

	.mb-top {
		align-items: stretch;
	}

	/* The three share the featured post's height. */
	.mb-top__side > .mb-card {
		flex: 1;
	}
}

@media (min-width: 1100px) {
	.mb-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Phones: a smaller thumbnail beside the three, the featured summary kept short. */
@media (max-width: 639px) {
	.mb-head {
		padding-top: 1.5rem;
	}

	.mb-search {
		max-width: none;
	}

	.mb-card--compact .mb-card__media {
		flex-basis: 7rem;
	}

	.mb-card--compact .mb-card__title {
		font-size: 0.92rem;
	}
}

/* 5. Archives, search, 404 (archive.php, search.php, 404.php) --------------------------------------------- */

.mb-head__intro p {
	margin: 0;
}

.mb-head__intro p + p {
	margin-top: 0.35rem;
}

.mb-head__count {
	color: var(--mb-blue);
	font-size: 0.9rem;
	font-weight: 700;
}

.mb-head__text--avatar {
	display: flex;
	align-items: center;
	gap: 1.1rem;
}

.mb-head__avatar img {
	display: block;
	width: 4.5rem;
	height: 4.5rem;
	border-radius: 50%;
	box-shadow: 0 0 0 4px var(--mb-blue-soft);
}

.mb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 2.9rem;
	padding: 0 1.5rem;
	border-radius: 999px;
	background: var(--mb-blue);
	color: #fff !important;
	font-weight: 700;
	transition: background 0.15s;
}

.mb-btn:hover {
	background: #1d4ed8;
}

.mb-empty .mb-btn {
	margin-top: 1rem;
}

.mb-empty p {
	margin: 0;
}

.mb-notfound {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	max-width: 36rem;
	margin: 0 auto 3.5rem;
	padding: 3rem 0 0;
	text-align: center;
}

.mb-notfound__code {
	margin: 0;
	color: var(--mb-blue);
	font-size: clamp(4.5rem, 3rem + 6vw, 7rem);
	font-weight: 900;
	line-height: 1;
	background: linear-gradient(180deg, #2563eb, #93c5fd);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.mb-notfound__title {
	margin: 0;
	color: var(--mb-ink);
	font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem);
	font-weight: 800;
}

.mb-notfound__text {
	margin: 0;
	color: var(--mb-muted);
	line-height: 1.9;
}

.mb-notfound .mb-search {
	max-width: 26rem;
	margin-top: 0.5rem;
}

/* An archive's grid follows the header without a heading on page 1. */
.mb-archive .mb-latest,
.mb-search-page .mb-latest:first-of-type {
	margin-top: 0;
}

.mb-card__media--blank {
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, #eff6ff, #dbeafe);
	color: #93c5fd;
}

/* 6. «محصولات مگنتک», a slider (magnet_blog_products(), home and posts) ------------------------------------ */

.mb-prods {
	margin: 3rem 0 1rem;
}

.mb-prods a {
	text-decoration: none;
}

.mb-prods__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.mb-prods__title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 800;
	line-height: 1.5;
}

.mb-prods__title a {
	color: var(--mb-ink) !important;
}

.mb-prods__title a:hover {
	color: var(--mb-blue) !important;
}

.mb-prods__tools {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.mb-prods__all {
	margin-inline-end: 0.5rem;
	color: var(--mb-blue) !important;
	font-size: 0.9rem;
	font-weight: 700;
	white-space: nowrap;
}

.mb-prods__arrow {
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 1px solid var(--mb-line);
	border-radius: 50%;
	background: #fff;
	color: var(--mb-ink);
	cursor: pointer;
	transition: border-color 0.15s, color 0.15s, opacity 0.15s;
}

.mb-prods__arrow:hover:not(:disabled) {
	border-color: var(--mb-blue);
	color: var(--mb-blue);
}

.mb-prods__arrow:disabled {
	background: #fff !important;
	color: var(--mb-ink) !important;
	opacity: 0.35;
	cursor: default;
}

.mb-prods__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 3rem) / 4);
	gap: 1rem;
	margin: 0;
	padding: 2px 2px 10px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	list-style: none;
}

.mb-prods__track::-webkit-scrollbar {
	display: none;
}

.mb-prods__track:focus-visible {
	outline: 2px solid var(--mb-blue);
	outline-offset: 4px;
	border-radius: var(--mb-radius);
}

.mb-prods__card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.55rem;
	margin: 0;
	padding: 1rem;
	border: 1px solid var(--mb-line);
	border-radius: var(--mb-radius);
	background: #fff;
	scroll-snap-align: start;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.mb-prods__card::before {
	display: none;
}

.mb-prods__card:hover {
	border-color: #bfdbfe;
	box-shadow: 0 12px 28px -18px rgb(37 99 235 / 0.4);
}

.mb-prods__media {
	display: grid;
	place-items: center;
	align-self: stretch;
	aspect-ratio: 16 / 10;
	margin-bottom: 0.2rem;
	overflow: hidden;
	border-radius: 12px;
	background: #f8fafc;
}

/* The whole logo or poster, letterboxed (the theme's img { height: auto } would crop a tall one). */
.mb-prods__media {
	position: relative;
}

.mb-prods__media img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	padding: 0.5rem;
	object-fit: contain;
}

.mb-prods__media span {
	color: var(--mb-blue);
	font-size: 2rem;
	font-weight: 800;
}

.mb-prods__cat {
	max-width: 100%;
	padding: 0.2rem 0.65rem;
	overflow: hidden;
	border-radius: 999px;
	background: #f1f5f9;
	color: var(--mb-muted);
	font-size: 0.75rem;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mb-prods__name {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	font-size: 1rem;
	font-weight: 800;
	line-height: 1.65;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.mb-prods__name a {
	color: var(--mb-ink) !important;
}

.mb-prods__name a:hover {
	color: var(--mb-blue) !important;
}

.mb-prods__line {
	display: -webkit-box;
	width: 100%;
	margin: 0;
	overflow: hidden;
	color: var(--mb-muted);
	font-size: 0.85rem;
	line-height: 1.8;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.mb-prods__go {
	margin-top: auto;
	padding-top: 0.3rem;
	color: var(--mb-blue) !important;
	font-size: 0.88rem;
	font-weight: 700;
}

@media (max-width: 1099px) {
	.mb-prods__track {
		grid-auto-columns: calc((100% - 2rem) / 3);
	}
}

@media (max-width: 899px) {
	.mb-prods__track {
		grid-auto-columns: calc((100% - 1rem) / 2);
	}
}

@media (max-width: 639px) {
	.mb-prods__track {
		grid-auto-columns: 78%;
	}

	.mb-prods__all {
		display: none;
	}
}

/* 7. Authors (inc/blog-authors.php): the author page's header and the links under a post's author box ---------- */

.mb-archive .mb-head__text--avatar {
	align-items: flex-start;
	gap: 1.5rem;
}

.mb-archive .mb-head__avatar img {
	width: 7.5rem;
	height: 7.5rem;
	object-fit: cover;
}

.mb-head__role {
	margin: 0.15rem 0 0;
	color: var(--mb-blue);
	font-size: 0.95rem;
	font-weight: 700;
}

.mb-head__bio {
	max-width: 44rem;
	margin-top: 0.6rem !important;
	color: var(--mb-text);
	text-align: justify;
}

.mb-head__authorfoot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.25rem;
	margin-top: 0.85rem;
}

.mb-head__authorfoot .mb-head__count {
	margin: 0;
}

.mb-author-links {
	display: flex;
	gap: 0.4rem;
}

.mb-author-links__item {
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	border: 1px solid var(--mb-line);
	border-radius: 50%;
	background: #fff;
	color: var(--mb-muted) !important;
	text-decoration: none !important;
	transition: border-color 0.15s, color 0.15s;
}

.mb-author-links__item:hover {
	border-color: var(--mb-blue);
	color: var(--mb-blue) !important;
}

.mp-author__name a {
	color: inherit !important;
	text-decoration: none !important;
}

.mp-author__title {
	margin-inline-start: 0.35rem;
	color: var(--mb-muted);
	font-size: 0.85rem;
	font-weight: 600;
}

.mp-author__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-top: 0.5rem;
}

@media (max-width: 639px) {
	.mb-archive .mb-head__text--avatar {
		flex-direction: column;
		gap: 1rem;
	}

	.mb-archive .mb-head__avatar img {
		width: 5.5rem;
		height: 5.5rem;
	}
}

.mp-author__foot .mp-author__link {
	margin-top: 0;
}
