/* Unified book card typography + cover frames across listings */

/*
 * Fixed 2:3 cover slot — absolute fill so intrinsic image size cannot shrink the frame.
 * object-fit: cover fills the slot (same visual footprint even when the JPG has padding).
 */
.h_gallery_item:not(.bn-editura-card):not(.bn-autor-card),
.bn-site-search__card.h_gallery_item,
.author-books-grid .speaker {
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

.h_gallery_item:not(.bn-editura-card):not(.bn-autor-card) > div:first-child,
.bn-site-search__thumb,
.author-books-grid .speaker > a:first-of-type {
	position: relative;
	display: block;
	width: 100%;
	max-width: 240px;
	margin-left: auto;
	margin-right: auto;
	aspect-ratio: 2 / 3;
	background: #f4f1ef;
	overflow: hidden;
	border-radius: 4px;
	box-shadow: 0 8px 18px rgba(40, 24, 18, 0.1);
	flex: 0 0 auto;
}

.h_gallery_item:not(.bn-editura-card):not(.bn-autor-card) > div:first-child a,
.bn-site-search__thumb a {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	text-decoration: none;
}

.author-books-grid .speaker > a:first-of-type {
	/* frame is the <a> itself */
}

.h_gallery_item:not(.bn-editura-card):not(.bn-autor-card) img.img-fluid,
.author-books-grid .coperta,
.bn-site-search__thumb img {
	position: absolute !important;
	inset: 0;
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: cover !important;
	object-position: center top !important;
	margin: 0 !important;
}

/* Unified book card typography across /carti/, /autori/, /edituri/, /cauta/, /biblioteca/ */

.h_gallery_item .g_item_text h2,
.h_gallery_item .g_item_text h2 a,
.bn-site-search__card .g_item_text h3,
.bn-site-search__card .g_item_text h3 a,
.author-books-grid .name,
.author-books-grid .name a,
.bn-biblioteca-title,
#left-area .bn-biblioteca-title,
.et_pb_text .bn-biblioteca-title {
	font-family: "Open Sans", sans-serif !important;
	font-size: 1rem !important;
	font-weight: 700 !important;
	font-style: normal !important;
	line-height: 1.35 !important;
	letter-spacing: normal !important;
	color: #3E4A64 !important;
	text-decoration: none !important;
}

.h_gallery_item .g_item_text h2 a:hover,
.bn-site-search__card .g_item_text h3 a:hover,
.author-books-grid .name a:hover,
.bn-biblioteca-link:hover .bn-biblioteca-title {
	color: #BF5D54 !important;
}

.h_gallery_item .g_item_text h2,
.bn-site-search__card .g_item_text h3,
.author-books-grid .name,
.bn-biblioteca-title,
#left-area .bn-biblioteca-title,
.et_pb_text .bn-biblioteca-title {
	margin: 0.5rem 0 0.15rem !important;
	padding: 0 !important;
	text-align: center !important;
}

.h_gallery_item .book-author,
.h_gallery_item .autor-container,
.bn-site-search__card .book-author,
.bn-site-search__meta,
.author-books-grid .book-author,
.bn-biblioteca-author {
	display: block;
	margin: 0 0 0.35rem !important;
	padding: 0 !important;
	text-align: center;
	font-family: "Open Sans", sans-serif !important;
	font-size: 0.875rem !important;
	font-weight: 400 !important;
	font-style: italic !important;
	line-height: 1.35 !important;
	color: #6d7585 !important;
}

.h_gallery_item .book-author a,
.h_gallery_item .autor-container a,
.h_gallery_item .autor,
.author-books-grid .book-author a,
.bn-biblioteca-author a {
	font-family: inherit !important;
	font-size: inherit !important;
	font-weight: inherit !important;
	font-style: inherit !important;
	line-height: inherit !important;
	color: #6d7585 !important;
	text-decoration: none !important;
	padding: 0 !important;
	background: none !important;
	border-radius: 0 !important;
}

.h_gallery_item .book-author a:hover,
.h_gallery_item .autor-container a:hover,
.h_gallery_item .autor:hover,
.author-books-grid .book-author a:hover,
.bn-biblioteca-author a:hover {
	color: #BF5D54 !important;
	text-decoration: underline !important;
}

/* Legacy pill authors on /carti/ → plain inline list */
.h_gallery_item .autor-container {
	display: block;
}

.h_gallery_item .autor-container .autor {
	display: inline;
}

.h_gallery_item .autor-container .autor:not(:last-child)::after {
	content: ", ";
	font-style: italic;
	color: #6d7585;
}

.bn-biblioteca-item {
	text-align: center;
}

.bn-biblioteca-title {
	display: block;
}

.bn-biblioteca-author {
	display: block;
	text-align: center !important;
}

@media (max-width: 767px) {
	.h_gallery_item .g_item_text h2,
	.h_gallery_item .g_item_text h2 a,
	.bn-site-search__card .g_item_text h3,
	.bn-site-search__card .g_item_text h3 a,
	.author-books-grid .name,
	.author-books-grid .name a,
	.bn-biblioteca-title,
	#left-area .bn-biblioteca-title,
	.et_pb_text .bn-biblioteca-title {
		font-size: 0.95rem !important;
	}

	.h_gallery_item .book-author,
	.h_gallery_item .autor-container,
	.bn-site-search__card .book-author,
	.bn-site-search__meta,
	.author-books-grid .book-author,
	.bn-biblioteca-author {
		font-size: 0.8rem !important;
	}
}
