/* ============================================================
   Books (book) post-type archive — hero + shared inner wrapper.
   Figma values applied: «كتب المركز» + «Mob_كتب المركز» frames.
   Widget: acs-books-hero (this file).
   Dependencies: acs-home (brand tokens, .acs-breadcrumb),
                 acs-single (chips / filter panel).
   RTL: first DOM child = RIGHT; margin-inline-start:auto pushes LEFT.
   ============================================================ */

/* ── Shared max-width inner wrapper ─────────────────────────────────────────
   Every acs-books-* widget wraps its content in .acs-books__inner so all
   sections align vertically regardless of how the Bricks template nests roots.
   Mirrors .acs-pubs__inner (pubs-archive.css) and .acs-news__inner. */
.acs-books__inner {
	max-width: 1320px;
	margin-inline: auto;
	padding-inline: 16px;
}

/* ── Hero band ──────────────────────────────────────────────────────────────
   Breadcrumb + H1 sit in the header band; the featured layout sits below. */
.acs-books-hero {
	background: #fff;
	padding-block-end: 0;
}

/* Site rule: breadcrumb 32px below the top menu; the 32px to the H1 comes from
   the title's margin-block-start. */
.acs-books-hero .acs-breadcrumb {
	margin-block: 32px 0;
}

/* H1: Readex Pro 32 / 600 */
.acs-books-hero__title {
	font-family: 'Readex Pro', sans-serif;
	font-size: 32px;
	font-weight: 600;
	line-height: 150%;
	color: #231F20;
	text-align: right;
	margin-block: 32px 32px;
}

/* ── Featured book layout ───────────────────────────────────────────────────
   Cover on the lead (right) side; text column on the trailing (left) side.
   In RTL: first DOM child = right, second = left — so cover is first. */
.acs-books-hero__featured {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 24px;
	padding-block: 0 32px;
}

/* ── Cover FRAME (lead / right in RTL) ───────────────────────────────────── */
.acs-books-hero__cover-wrap {
	position: relative;
	flex: 0 0 376px;
	width: 376px;
	height: 404px;
	box-sizing: border-box;
	background: rgba(156, 153, 154, 0.08);
	border-radius: 4px;
	padding: 16px 24px 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: visible;
	box-shadow: none;
	text-decoration: none;
}

/* ── Cover IMAGE (floating inside frame) ─────────────────────────────────── */
.acs-books-hero__cover {
	width: 210px;
	height: 280px;
	object-fit: cover;
	border-radius: 3.5px;
	box-shadow:
		0px 7.01px 8.76px -5.25px rgba(0, 0, 0, 0.1),
		0px 17.52px 21.89px -4.38px rgba(0, 0, 0, 0.1);
}

/* Placeholder when no thumbnail is set */
.acs-books-hero__cover-placeholder {
	width: 210px;
	height: 280px;
	background: #e8e4df;
	border-radius: 3.5px;
}

/* ── «صدر حديثاً» badge — overlays top-right corner of the cover frame ───── */
.acs-books-hero__badge {
	position: absolute;
	top: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 143px;
	min-height: 47px;
	padding: 10px 20px;
	box-sizing: border-box;
	background: rgba(229, 239, 237, 0.88);
	backdrop-filter: blur(6.52px);
	-webkit-backdrop-filter: blur(6.52px);
	border-top-right-radius: 6.52px;
	border-bottom-left-radius: 6.52px;
	border-top-left-radius: 0;
	border-bottom-right-radius: 0;
	font-family: 'Readex Pro', sans-serif;
	font-weight: 500;
	font-size: 14px;
	line-height: 150%;
	color: #068788;
}

/* ── Text column (trailing / left in RTL) ───────────────────────────────── */
.acs-books-hero__body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* Book title */
.acs-books-hero__book-title {
	font-family: 'Readex Pro', sans-serif;
	font-weight: 500;
	font-size: 32px;
	line-height: 150%;
	color: #231F20;
	text-decoration: none;
	padding-block-start: 16px;
	margin-block-end: 16px;
}
.acs-books-hero__book-title:hover {
	color: #068788;
}

/* Excerpt */
.acs-books-hero__excerpt {
	font-family: 'Readex Pro', sans-serif;
	font-weight: 300;
	font-size: 18px;
	line-height: 150%;
	color: #231F20;
	margin: 0 0 27px;
}

/* Meta rows: label + value */
.acs-books-hero__meta-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px;
	font-family: 'Readex Pro', sans-serif;
	line-height: 150%;
	margin-block-end: 8px;
}

.acs-books-hero__meta-label {
	font-weight: 500;
	font-size: 16px;
	color: #9C999A;
	white-space: nowrap;
}

.acs-books-hero__authors {
	font-weight: 500;
	font-size: 14px;
	color: #9C999A;
}

.acs-books-hero__publisher {
	font-weight: 300;
	font-size: 14px;
	color: #9C999A;
}

.acs-books-hero__date {
	font-weight: 500;
	font-size: 14px;
	color: #9C999A;
}

/* Author link styles (generated by acs_book_authors_line()) */
.acs-books-hero__authors .acs-bookcard__author {
	font-size: inherit; /* 14px — inherits from .acs-books-hero__authors */
	color: #068788;
	text-decoration: none;
}
.acs-books-hero__authors .acs-bookcard__author:hover {
	text-decoration: underline;
}
.acs-books-hero__authors .acs-bookcard__sep {
	margin-inline: 4px;
	color: #9C999A;
}

/* ── Placeholder / empty state ──────────────────────────────────────────── */
.acs-books-hero .acs-empty {
	padding-block: 32px;
	font-family: 'Readex Pro', sans-serif;
	font-size: 15px;
	color: #9C999A;
}

/* ── Filter section: archive-filter bar page-scoped margin ──────────────── */
body.post-type-archive-book .acs-archive-filter {
	margin-block: 32px;
}

/* Books have no content-type / publication-type — always hide those two filter
   fields on the books archive (zero-config; the empty selects submit nothing). */
body.post-type-archive-book .acs-topic__filter-field:has(select[name="sptype[]"]),
body.post-type-archive-book .acs-topic__filter-field:has(select[name="stype[]"]) {
	display: none;
}

/* ── Books list section ──────────────────────────────────────────────────── */
.acs-books-list {
	background: #F7F7F7;
	padding-block: 32px 0;
}

.acs-books-list .acs-booksgrid {
	padding-block-start: 0;
}

/* Empty state */
.acs-books__empty {
	text-align: center;
	color: #9C999A;
	padding-block: 48px;
	font-family: "Readex Pro", sans-serif;
	font-size: 15px;
}

/* Pager spacing below the grid */
.acs-books-list .acs-pager {
	margin-block-start: 48px;
	padding-block-end: 48px;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
	.acs-books-hero__title {
		font-size: 24px; /* inferred */
		margin-block: 24px 24px; /* inferred */
	}

	/* Stack cover above text on mobile */
	.acs-books-hero__featured {
		flex-direction: column;
		gap: 24px;
	}

	/* Cover frame stretches to full width, capped at original max, centered */
	.acs-books-hero__cover-wrap {
		width: 100%;
		max-width: 376px;
		flex: 0 0 auto;
		align-self: center;
		height: auto; /* inferred — let the frame height adapt on narrow screens */
		padding-block: 32px; /* inferred */
	}

	.acs-books-hero__book-title {
		font-size: 24px;
	}

	.acs-books-hero__excerpt {
		font-size: 16px; /* inferred */
	}
}

@media (max-width: 480px) {
	.acs-books-hero__cover-wrap {
		padding-block: 24px; /* inferred */
	}
}
