/* Blog listing pages: home.php (ai-news) and category.php archives */

.blog-tabs {
	max-width: 960px;
	margin-inline: auto;
	background: var(--color-lavender);
	border-radius: 10px;
	padding: 22px 28px;
	margin-block-end: 32px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
}

.blog-tabs__links {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 28px;
}

.blog-tabs__link {
	font-size: 15px;
	font-weight: 500;
	color: var(--color-text);
}

.blog-tabs__link:hover {
	color: var(--color-purple);
}

.blog-tabs__link.is-active {
	font-weight: 700;
	color: var(--color-purple);
}

.blog-tabs__search {
	display: flex;
	align-items: center;
}

.blog-tabs__search-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	padding: 0;
	background: none;
	border: none;
	color: var(--color-text);
	cursor: pointer;
	flex-shrink: 0;
}

.blog-tabs__search-toggle:hover {
	color: var(--color-purple);
}

.blog-tabs__search-input {
	width: 0;
	padding: 4px 0;
	border: none;
	border-bottom: 1px solid var(--color-purple);
	background: transparent;
	font-size: 14px;
	color: var(--color-text);
	opacity: 0;
	transition: width .25s ease, opacity .2s ease, margin .25s ease;
}

.blog-tabs__search.is-open .blog-tabs__search-input {
	width: 200px;
	opacity: 1;
	margin-inline-end: 10px;
}

.blog-list {
	max-width: 960px;
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.blog-card {
	background: var(--color-teal-light);
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 10px 30px rgba(20, 20, 60, .08);
}

/* Every image is the same width. Its natural ratio then sets its height, and the
   card takes that height, so ratios are preserved and cards vary in height. */
.blog-card__link {
	display: flex;
	align-items: stretch;
}

.blog-card__image {
	position: relative;
	flex: 0 0 58%;
	align-self: stretch;
	width: 58%;
	height: auto;
	/* The column is at least as tall as the ratio wants. If the text column is
	   taller, stretch wins and the blurred fill below covers the difference. */
	aspect-ratio: var(--card-img-ratio, 1.6);
	overflow: hidden;
	background: var(--color-teal-light);
}

/* A cropped, blurred copy of the same image, so any leftover band above or below
   the uncropped image reads as a deliberate backdrop. */
.blog-card__image::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: var(--card-img-url);
	background-size: cover;
	background-position: center;
	filter: blur(22px) saturate(1.2);
	/* Scaled up so the blur does not fade out against the card edges. */
	transform: scale(1.2);
}

.blog-card__image img {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	/* contain keeps the full uncropped image, centred on both axes. */
	object-fit: contain;
	object-position: center;
}

.blog-card__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 26px 40px;
	background: var(--color-teal-light);
}

.blog-card__meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.blog-card__date {
	font-size: 14px;
	color: var(--color-text);
}

.blog-card__category {
	font-size: 14px;
	color: #6b6b7a;
}

/* Clamped so the text can never outgrow the fixed card height. */
.blog-card__title {
	margin-top: 14px;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--color-purple);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.blog-card__excerpt {
	margin-top: 14px;
	font-size: 15px;
	color: #666;
	line-height: 1.8;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.blog-card__footer {
	margin-top: auto;
	padding-top: 16px;
	border-top: 1px solid rgba(0, 0, 0, .12);
}

.blog-card__reading-time {
	font-size: 14px;
	color: #6b6b7a;
}

.blog-empty {
	max-width: var(--container-width);
	margin-inline: auto;
	padding: 40px 24px 100px;
	text-align: center;
	font-size: 17px;
	color: #666;
}

.blog-archive__body {
	max-width: var(--container-width);
	margin-inline: auto;
	padding: 56px 24px 40px;
}

.blog-pagination {
	margin-top: 48px;
	padding-bottom: 80px;
	display: flex;
	justify-content: center;
	gap: 10px;
}

.blog-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	border-radius: 50%;
	font-size: 14px;
	background: #fff;
	box-shadow: 0 2px 8px rgba(20, 20, 60, .08);
}

.blog-pagination .page-numbers.current {
	background: var(--color-purple);
	color: #fff;
}

/* Blog archive hero: centered with "חדשות AI" as the prominent heading
   above and the description as a centered subtitle below. */
.blog-archive .legal-hero__inner {
	text-align: center;
}

.blog-archive .legal-hero__eyebrow {
	font-size: clamp(28px, 4vw, 42px);
	font-weight: 700;
	opacity: 1;
	margin: 0 0 12px;
	background: linear-gradient(90deg, #A5D9D0 0%, #5CC2EF 37.72%, #886CEA 66.67%, #595BA7 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
	filter: drop-shadow(1.41px 1.41px 2px rgba(0, 0, 0, .6));
}

.blog-archive .legal-hero__title {
	font-size: clamp(18px, 2.2vw, 24px);
	font-weight: 400;
	background: none;
	-webkit-background-clip: initial;
	background-clip: initial;
	-webkit-text-fill-color: initial;
	color: rgba(255, 255, 255, 0.85);
	filter: none;
	max-width: none;
	margin-inline: auto;
}

@media (max-width: 900px) {
	.blog-card__link {
		flex-direction: column;
		height: auto;
	}

	.blog-card__image {
		flex-basis: auto;
		width: 100%;
		min-width: 0;
		max-width: none;
		aspect-ratio: 16 / 10;
	}

	.blog-card__image img {
		object-fit: cover;
	}

	.blog-card__body {
		padding: 28px 24px;
	}

	.blog-card__title {
		font-size: 21px;
	}
}
