/**
 * Blog page (stitch _13) — archive PHP template utilities.
 */

@media (min-width: 768px) {
	.md\:flex-row-reverse {
		flex-direction: row-reverse;
	}

	.md\:grid-cols-2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.md\:w-2\/5 {
		width: 40%;
	}

	.md\:w-3\/5 {
		width: 60%;
	}

	.md\:h-full {
		height: 100%;
	}

	.md\:w-72 {
		width: 18rem;
	}

	.md\:border-none {
		border-style: none;
	}

	.md\:text-headline-sm {
		font-size: 1.375rem;
		line-height: 1.35;
	}
}

@media (min-width: 1024px) {
	.lg\:grid-cols-12 {
		grid-template-columns: repeat(12, minmax(0, 1fr));
	}

	.lg\:col-span-8 {
		grid-column: span 8 / span 8;
	}

	.lg\:col-span-4 {
		grid-column: span 4 / span 4;
	}
}

.persian-title {
	font-family: var(--font-display);
}

.text-surface-container-lowest {
	color: var(--color-surface-container-lowest);
}

.text-primary-fixed {
	color: var(--color-primary-fixed);
}

.bg-primary-fixed {
	background-color: var(--color-primary-fixed);
}

.text-on-primary-fixed {
	color: var(--color-on-primary-fixed);
}

.border-primary-fixed {
	border-color: var(--color-primary-fixed);
}

.bg-\[\#0c0305\] {
	background-color: #0c0305;
}

.border-outline-variant\/10 {
	border-color: color-mix(in srgb, var(--color-outline-variant) 10%, transparent);
}

.border-outline-variant\/20 {
	border-color: color-mix(in srgb, var(--color-outline-variant) 20%, transparent);
}

.border-outline-variant\/30 {
	border-color: color-mix(in srgb, var(--color-outline-variant) 30%, transparent);
}

.bg-primary\/20 {
	background-color: color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.bg-white\/10 {
	background-color: rgb(255 255 255 / 0.1);
}

.border-white\/20 {
	border-color: rgb(255 255 255 / 0.2);
}

.border-b-2 {
	border-bottom-width: 2px;
	border-bottom-style: solid;
}

.h-80 {
	height: 20rem;
}

.h-48 {
	height: 12rem;
}

.h-32 {
	height: 8rem;
}

.w-32 {
	width: 8rem;
}

.w-14 {
	width: 3.5rem;
}

.h-14 {
	height: 3.5rem;
}

.w-fit {
	width: fit-content;
}

.text-\[11px\] {
	font-size: 11px;
}

.text-\[18px\] {
	font-size: 18px;
}

.text-headline-sm-mobile {
	font-size: 1.125rem;
	line-height: 1.35;
}

.-mr-16 {
	margin-inline-end: -4rem;
}

.-mt-16 {
	margin-top: -4rem;
}

.blur-3xl {
	filter: blur(64px);
}

.hover\:shadow-md:hover {
	box-shadow: var(--elevation-hover);
}

.hover\:translate-x-\[-4px\]:hover {
	transform: translateX(-4px);
}

.hover\:text-primary-fixed:hover {
	color: var(--color-primary-fixed);
}

.hover\:brightness-110:hover {
	filter: brightness(1.1);
}

.active\:scale-\[0\.98\]:active {
	transform: scale(0.98);
}

.group:hover .group-hover\:scale-105 {
	transform: scale(1.05);
}

.group:hover .group-hover\:text-primary {
	color: var(--color-primary);
}

.duration-500 {
	transition-duration: 500ms;
}

.opacity-60 {
	opacity: 0.6;
}

.opacity-80 {
	opacity: 0.8;
}

.bottom-8 {
	bottom: var(--space-xl);
}

.right-8 {
	right: var(--space-xl);
}

.fixed {
	position: fixed;
}

.z-40 {
	z-index: 40;
}

.obc-blog-nav .text-surface-container-lowest,
.obc-blog-nav a.text-surface-container-lowest {
	color: var(--color-surface-container-lowest);
}

.obc-blog-nav a.text-primary-fixed {
	color: var(--color-primary-fixed);
}

.obc-blog-card {
	transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.obc-blog-card:hover {
	border-color: var(--color-primary);
}

.backdrop-blur-md {
	backdrop-filter: blur(12px);
}

.bg-\[\#0c0305\]\/95 {
	background-color: rgb(12 3 5 / 0.95);
}

.obc-blog-back-to-top {
	opacity: 0;
}

.obc-blog-back-to-top.is-visible {
	opacity: 1;
}

.obc-blog-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding-inline: var(--space-sm);
	border-radius: var(--radius-lg);
	border: 1px solid var(--color-outline-variant);
	color: var(--color-on-surface);
	text-decoration: none;
	font-family: var(--font-label);
	font-size: 0.875rem;
	transition: background-color var(--transition-fast);
}

.obc-blog-pagination .page-numbers.current {
	background-color: var(--color-primary);
	border-color: var(--color-primary);
	color: var(--color-on-primary);
}

.obc-blog-pagination .page-numbers:hover:not(.current) {
	background-color: var(--color-surface-container);
}

.obc-blog-page input[type='search'],
.obc-blog-filters input[type='email'] {
	color: var(--color-on-surface);
}

.obc-blog-newsletter {
	color: var(--color-on-surface);
}

.obc-blog-newsletter__title {
	color: var(--color-on-surface);
	margin: 0 0 var(--space-md);
	font-size: 1.5rem;
	line-height: 1.33;
	font-weight: 600;
}

.obc-blog-newsletter__desc {
	color: var(--color-on-surface-variant);
	margin: 0 0 var(--space-lg);
	line-height: 1.6;
}

.obc-blog-newsletter-form {
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
}

.obc-blog-newsletter__input {
	background-color: var(--color-surface-container-lowest);
	border: 1px solid var(--color-outline-variant);
	color: var(--color-on-surface);
	transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.obc-blog-newsletter__input::placeholder {
	color: var(--color-on-surface-variant);
	opacity: 0.7;
}

.obc-blog-newsletter__input:focus {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

.obc-blog-newsletter__submit {
	background-color: var(--color-primary);
	color: var(--color-on-primary);
	transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.obc-blog-newsletter__submit:hover {
	background-color: var(--color-secondary);
}

.obc-blog-newsletter__submit:active {
	transform: scale(0.98);
}

.obc-blog-filters {
	scrollbar-width: thin;
}

/* Category pills — flow naturally so the first pill ("همه خبرها") sits at the
   start of the RTL row (i.e. on the right). */
.obc-blog-filters__pills {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-sm);
	width: 100%;
	min-width: 0;
}

@media (min-width: 768px) {
	.obc-blog-filters__pills {
		width: auto;
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: thin;
	}
}

.obc-blog-pill {
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
	padding: 0.375rem 0.875rem;
	border-radius: var(--radius-full);
	border: 1px solid transparent;
	background-color: var(--color-surface-container-low);
	color: var(--color-on-surface-variant);
	font-family: var(--font-label);
	font-size: 0.8125rem;
	line-height: 1.4;
	text-decoration: none;
	transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.obc-blog-pill:hover {
	background-color: var(--color-surface-container-high);
	color: var(--color-on-surface);
	border-color: var(--color-outline-variant);
}

.obc-blog-filters .obc-blog-pill--active,
.obc-blog-filters .obc-blog-pill--active:hover,
.obc-blog-filters .obc-blog-pill--active:focus,
.obc-blog-filters .obc-blog-pill--active:visited {
	background-color: var(--color-primary);
	color: var(--color-on-primary);
	border-color: var(--color-primary);
	font-weight: 600;
}

/* Search field on the blog filter row — matched to the pill aesthetic. */
.obc-blog-search {
	flex-shrink: 0;
}

/* Pin the search icon to the physical left edge so it clears the right-aligned
   placeholder text regardless of how the inline direction resolves. */
.obc-blog-search .obc-search-field__icon {
	inset-inline-start: auto;
	inset-inline-end: auto;
	left: var(--space-md);
	right: auto;
}

.obc-blog-search .obc-search-field__input {
	height: 2.5rem;
	padding-block: 0;
	padding-inline: 0;
	padding-left: calc(var(--space-md) + 1.5rem);
	padding-right: var(--space-md);
	box-sizing: border-box;
	background-color: var(--color-surface-container-lowest);
	border: 1px solid var(--color-outline-variant);
	border-radius: var(--radius-full);
	color: var(--color-on-surface);
	font-family: var(--font-body);
	font-size: 0.875rem;
	text-align: right;
	transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.obc-blog-search .obc-search-field__input::placeholder {
	color: var(--color-on-surface-variant);
	opacity: 0.7;
}

.obc-blog-search .obc-search-field__input:focus {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.obc-blog-sidebar {
	align-self: start;
}

@media (min-width: 1024px) {
	.obc-blog-sidebar {
		position: sticky;
		top: 5.5rem;
	}
}

/* Popular-posts widget — tighten typography for the compact sidebar column.
   The default title/rank sizes (text-title-lg 1.2rem, text-headline-md 1.875rem)
   are sized for full-width cards and look bulky in a 345px sidebar. */
.obc-blog-sidebar .space-y-6 > a h4 {
	font-size: 1rem;
	line-height: 1.45;
}

.obc-blog-sidebar .space-y-6 > a > span:first-child {
	font-size: 1.25rem;
	line-height: 1.2;
}

/* Featured post card — image and text share one row on desktop.
   Use aspect-ratio on the media so the image keeps a balanced shape
   without forcing the whole card to a fixed height (which left empty
   space below the shorter text column). On mobile the image stacks
   above the text and uses a fixed 16:9 box. */
.obc-blog-featured__media {
	aspect-ratio: 16 / 9;
}

.obc-blog-featured__media img {
	width: 100%;
	height: 100%;
	display: block;
}

@media (min-width: 768px) {
	.obc-blog-featured {
		min-height: 0;
	}

	/* On desktop the image fills the row height (driven by the text column),
	   so drop the aspect-ratio constraint and let it stretch. */
	.obc-blog-featured__media {
		aspect-ratio: auto;
		min-height: 22rem;
	}

	.obc-blog-featured .md\:h-full,
	.obc-blog-featured__media {
		min-height: 22rem;
	}
}

/* Blog category badge with improved readability - reduced opacity green background */
.obc-blog-card .bg-secondary-container {
	background-color: color-mix(in srgb, var(--color-secondary-container) 60%, var(--color-surface-container-lowest) 40%);
	color: var(--color-on-secondary-container);
}

/* Blog single post */

/*
 * Prevent wide content (tables, images, embeds) from blowing out the
 * 12-col grid: grid items default to min-width: auto, so a child wider
 * than its track forces the whole row — and the page — to overflow.
 */
.obc-blog-layout > * {
	min-width: 0;
}

.obc-blog-single__hero {
	height: 20rem;
	max-width: 100%;
}

@media (min-width: 768px) {
	.obc-blog-single__hero {
		height: 24rem;
	}
}

.obc-blog-breadcrumb span:last-child {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100%;
	display: inline-block;
	vertical-align: bottom;
}

/* Rank Math breadcrumb styling - all breadcrumb types */
.obc-blog-breadcrumb,
.obc-page-breadcrumb,
.obc-archive-breadcrumb,
.obc-search-breadcrumb,
.obc-tenders-breadcrumb,
.obc-blog-home-breadcrumb,
.obc-services-archive-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-xs);
}

/* Rank Math breadcrumb links */
.obc-blog-breadcrumb a,
.obc-page-breadcrumb a,
.obc-archive-breadcrumb a,
.obc-search-breadcrumb a,
.obc-tenders-breadcrumb a,
.obc-blog-home-breadcrumb a,
.obc-services-archive-breadcrumb a {
	color: var(--color-primary);
	text-decoration: none;
	transition: color var(--transition-fast);
}

.obc-blog-breadcrumb a:hover,
.obc-page-breadcrumb a:hover,
.obc-archive-breadcrumb a:hover,
.obc-search-breadcrumb a:hover,
.obc-tenders-breadcrumb a:hover,
.obc-blog-home-breadcrumb a:hover,
.obc-services-archive-breadcrumb a:hover {
	color: var(--color-primary-container);
}

/* Rank Math breadcrumb separators */
.obc-blog-breadcrumb .rank-math-breadcrumb p,
.obc-page-breadcrumb .rank-math-breadcrumb p,
.obc-archive-breadcrumb .rank-math-breadcrumb p,
.obc-search-breadcrumb .rank-math-breadcrumb p,
.obc-tenders-breadcrumb .rank-math-breadcrumb p,
.obc-blog-home-breadcrumb .rank-math-breadcrumb p,
.obc-services-archive-breadcrumb .rank-math-breadcrumb p {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-xs);
}

/* Current page item styling for all breadcrumbs */
.obc-blog-breadcrumb span:last-child,
.obc-page-breadcrumb span:last-child,
.obc-archive-breadcrumb span:last-child,
.obc-search-breadcrumb span:last-child,
.obc-tenders-breadcrumb span:last-child,
.obc-blog-home-breadcrumb span:last-child,
.obc-services-archive-breadcrumb span:last-child {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100%;
	display: inline-block;
	vertical-align: bottom;
}

.obc-blog-single .entry-content h1,
.obc-blog-single .entry-content h2,
.obc-blog-single .entry-content h3,
.obc-blog-single .entry-content h4,
.obc-blog-single .entry-content h5,
.obc-blog-single .entry-content h6 {
	font-family: var(--font-display);
	color: var(--color-on-surface);
	margin-top: var(--space-xl);
	margin-bottom: var(--space-md);
	line-height: 1.35;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.obc-blog-single .entry-content h1 {
	font-size: 1.75rem;
	line-height: 1.3;
}

.obc-blog-single .entry-content h2 {
	font-size: 1.5rem;
	line-height: 1.3;
}

.obc-blog-single .entry-content h3 {
	font-size: 1.25rem;
	line-height: 1.35;
}

.obc-blog-single .entry-content h4 {
	font-size: 1.125rem;
	line-height: 1.4;
}

.obc-blog-single .entry-content h5,
.obc-blog-single .entry-content h6 {
	font-size: 1rem;
	line-height: 1.45;
}

.obc-blog-single .entry-content p {
	margin-bottom: var(--space-md);
	line-height: 1.85;
}

.obc-blog-single .entry-content li {
	line-height: 1.85;
}

.obc-blog-single .entry-content ul,
.obc-blog-single .entry-content ol {
	margin-bottom: var(--space-md);
	padding-inline-start: var(--space-lg);
}

.obc-blog-single .entry-content blockquote {
	margin: var(--space-lg) 0;
	padding: var(--space-md) var(--space-lg);
	border-inline-start: 4px solid var(--color-primary);
	background-color: var(--color-surface-container-low);
	border-radius: var(--radius-md);
}

.obc-blog-single .entry-content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--radius-xl);
	margin-block: var(--space-md);
}

/* Contain wide post body content so it scrolls instead of overflowing the page */
.obc-blog-single .entry-content {
	overflow-wrap: anywhere;
	word-break: break-word;
}

.obc-blog-single .entry-content pre,
.obc-blog-single .entry-content table {
	overflow-x: auto;
	max-width: 100%;
	display: block;
}

.obc-blog-single .entry-content iframe,
.obc-blog-single .entry-content video,
.obc-blog-single .entry-content .wp-video,
.obc-blog-single .entry-content .wp-block-embed,
.obc-blog-single .entry-content figure {
	max-width: 100%;
}

.obc-blog-single .entry-content a {
	word-break: break-word;
}

/* Mobile: shrink body-content headings so pasted-from-docs content (which
   may contain h1/h2 from the source doc) stays readable on phones. The
   global heading scale is meant for page titles, not in-article headings. */
@media (max-width: 767px) {
	.obc-blog-single .entry-content h1 {
		font-size: 1.5rem;
		line-height: 1.3;
	}

	.obc-blog-single .entry-content h2 {
		font-size: 1.375rem;
		line-height: 1.3;
	}

	.obc-blog-single .entry-content h3 {
		font-size: 1.25rem;
		line-height: 1.35;
	}

	.obc-blog-single .entry-content h4 {
		font-size: 1.125rem;
		line-height: 1.4;
	}
}

.obc-blog-post-nav__link {
	/* Allow flex items to shrink below content min-size so flex-1 enforces equal
	   widths and the title truncation chain works instead of overflowing. */
	min-width: 0;
}

.obc-blog-post-nav__link .truncate {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.obc-blog-related .obc-blog-grid {
	margin-top: 0;
}

@media (min-width: 768px) {
	.obc-blog-related .md\:grid-cols-2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Blog comments */
.obc-blog-comments .comments-area {
	margin-top: 0;
}

.obc-blog-comment-form .comment-form-author,
.obc-blog-comment-form .comment-form-email,
.obc-blog-comment-form .comment-form-url,
.obc-blog-comment-form .comment-form-comment {
	margin-bottom: var(--space-md);
}

.obc-blog-comment-form .input,
.obc-blog-comment-form textarea.input {
	width: 100%;
	box-sizing: border-box;
}

.obc-blog-comment-form .comment-form-cookies-consent {
	display: flex;
	align-items: flex-start;
	gap: var(--space-sm);
	margin-bottom: var(--space-md);
	font-size: 0.875rem;
	color: var(--color-on-surface-variant);
}

.obc-blog-comment-form .form-submit {
	margin-top: var(--space-md);
}

.obc-blog-comment .children {
	list-style: none;
	margin: var(--space-md) 0 0;
	padding-inline-start: var(--space-lg);
}

.obc-blog-comments .comment-navigation {
	display: flex;
	justify-content: space-between;
	gap: var(--space-md);
	margin-top: var(--space-lg);
	font-family: var(--font-label);
	font-size: 0.875rem;
}

.obc-blog-comments .comment-navigation a {
	color: var(--color-primary);
	text-decoration: none;
}

.obc-blog-comments .comment-navigation a:hover {
	color: var(--color-primary-container);
}

.obc-blog-comment__body img.avatar {
	border-radius: var(--radius-full);
}

.obc-blog-comment-submit {
	margin-top: var(--space-sm);
}

