/**
 * Premium bookshelf / bookcase styles
 * Shared by frontend shortcodes and admin bookcase view.
 */

.mfv-bc {
	--mfv-bc-wood-dark: #2b1810;
	--mfv-bc-wood: #7a4a2a;
	--mfv-bc-wood-mid: #9a6338;
	--mfv-bc-wood-light: #c08958;
	--mfv-bc-wood-hi: #d7a872;
	--mfv-bc-alcove: #efe4cf;
	--mfv-bc-alcove-deep: #e2d3b6;
	--mfv-bc-navy: #10182f;
	--mfv-bc-gold: #d4af37;
	--mfv-bc-burgundy: #5a1f2b;
	margin: 1.75rem 0;
	font-family: Georgia, "Times New Roman", Times, serif;
}

.mfv-bc__header {
	margin-bottom: 1.25rem;
	text-align: center;
}

.mfv-bc__title {
	color: #16367a;
	font-size: 1.85rem;
	letter-spacing: 0.02em;
	margin: 0;
}

.mfv-bc__description {
	color: #64748b;
	font-size: 1rem;
	line-height: 1.5;
	margin: 0.5rem auto 0;
	max-width: 42rem;
}

.mfv-bc__case {
	background: linear-gradient(180deg, #5a3420 0%, #3d2214 18%, #2b1810 100%);
	border: 2px solid var(--mfv-bc-gold);
	border-radius: 18px;
	box-shadow:
		0 22px 48px rgba(16, 24, 47, 0.28),
		inset 0 1px 0 rgba(255, 230, 180, 0.2),
		inset 0 0 0 8px rgba(90, 52, 32, 0.5);
	padding: 1.35rem 1.15rem 1.7rem;
	position: relative;
}

.mfv-bc__case::before {
	border-radius: 12px;
	box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.28);
	content: "";
	inset: 12px;
	pointer-events: none;
	position: absolute;
}

.mfv-bc__row {
	background: linear-gradient(180deg, var(--mfv-bc-alcove) 0%, var(--mfv-bc-alcove-deep) 100%);
	border-radius: 10px;
	box-shadow:
		inset 0 10px 18px rgba(90, 52, 32, 0.12),
		inset 0 -2px 0 rgba(255, 255, 255, 0.35);
	margin: 0 0 1.9rem;
	padding: 0.35rem 0.35rem 0;
	position: relative;
}

.mfv-bc__row:last-child {
	margin-bottom: 0.25rem;
}

.mfv-bc__ledge {
	background: linear-gradient(180deg, var(--mfv-bc-wood-hi) 0%, var(--mfv-bc-wood-mid) 35%, var(--mfv-bc-wood) 70%, var(--mfv-bc-wood-dark) 100%);
	border-radius: 0 0 4px 4px;
	bottom: -6px;
	box-shadow:
		0 10px 16px rgba(0, 0, 0, 0.35),
		inset 0 1px 0 rgba(255, 235, 200, 0.45),
		inset 0 -2px 0 rgba(0, 0, 0, 0.25);
	height: 18px;
	left: 0;
	position: absolute;
	right: 0;
	z-index: 2;
}

.mfv-bc__books {
	align-items: flex-start;
	display: flex;
	flex-wrap: nowrap;
	gap: 1.1rem;
	justify-content: center;
	min-height: 250px;
	overflow-x: auto;
	padding: 1.1rem 1rem 1.4rem;
	position: relative;
	-webkit-overflow-scrolling: touch;
	z-index: 1;
}

.mfv-bc__empty {
	color: #6d5b45;
	font-style: italic;
	margin: 0;
	padding: 2.4rem 1rem;
	text-align: center;
	width: 100%;
}

.mfv-bc-book {
	appearance: none;
	background: transparent;
	border: 0;
	color: var(--mfv-bc-navy);
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 0 0 auto;
	font-family: inherit;
	gap: 0.55rem;
	height: 100%;
	padding: 0;
	transform-style: preserve-3d;
	transition: transform 0.25s ease, filter 0.25s ease;
	width: 124px;
}

.mfv-bc-book:hover,
.mfv-bc-book:focus {
	filter: drop-shadow(0 14px 18px rgba(43, 24, 16, 0.28));
	outline: none;
	transform: translateY(-10px) scale(1.03);
}

.mfv-bc-book__cover {
	background: linear-gradient(165deg, #1a2748 0%, #10182f 55%, #0a1020 100%);
	border: 2px solid var(--mfv-bc-gold);
	border-radius: 3px 8px 8px 3px;
	box-shadow:
		0 12px 24px rgba(0, 0, 0, 0.18),
		4px 8px 16px rgba(43, 24, 16, 0.3),
		inset -8px 0 14px rgba(0, 0, 0, 0.22),
		inset 0 0 0 1px rgba(255, 255, 255, 0.14);
	display: flex;
	align-items: center;
	flex: 0 0 172px;
	height: 172px;
	justify-content: center;
	max-height: 172px;
	min-height: 172px;
	overflow: hidden;
	perspective: 800px;
	position: relative;
	transform: perspective(900px) rotateY(-4deg);
	transform-style: preserve-3d;
	width: 100%;
}

.mfv-bc-book:hover .mfv-bc-book__cover {
	box-shadow:
		0 16px 32px rgba(22, 54, 122, 0.28),
		4px 10px 20px rgba(43, 24, 16, 0.28),
		inset -8px 0 14px rgba(0, 0, 0, 0.2);
}

.mfv-bc-book__cover::before {
	background: linear-gradient(90deg, rgba(0, 0, 0, 0.3), rgba(255, 255, 255, 0.08));
	bottom: 0;
	content: "";
	left: 0;
	pointer-events: none;
	position: absolute;
	top: 0;
	width: 9px;
	z-index: 1;
}

.mfv-bc-book--tone-0 .mfv-bc-book__cover { background: linear-gradient(165deg, #1a2748 0%, #10182f 55%, #0a1020 100%); }
.mfv-bc-book--tone-1 .mfv-bc-book__cover { background: linear-gradient(165deg, #243965 0%, #162447 55%, #10182f 100%); }
.mfv-bc-book--tone-2 .mfv-bc-book__cover { background: linear-gradient(165deg, #2c4570 0%, #1a3058 55%, #121f3a 100%); }
.mfv-bc-book--tone-3 .mfv-bc-book__cover { background: linear-gradient(165deg, #334e7a 0%, #1e3360 55%, #152748 100%); }

.mfv-bc-book__cover img {
	display: block;
	height: 100% !important;
	max-height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center top;
	width: 100% !important;
}

.mfv-bc-book__spine-title {
	color: #f7f1e3;
	display: block;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1.3;
	padding: 0.75rem 0.6rem;
	text-align: center;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.mfv-bc-book__meta {
	align-items: center;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 0.25rem;
	justify-content: flex-start;
	min-height: 3.6rem;
	padding: 0.1rem 0.1rem 0;
	width: 100%;
}

.mfv-bc-book__label {
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	color: #10182f;
	display: -webkit-box;
	font-size: 0.86rem;
	font-weight: 700;
	line-height: 1.25;
	min-height: 2.5em;
	overflow: hidden;
	text-align: center;
	word-break: break-word;
}

.mfv-bc-book__type {
	background: rgba(255, 255, 255, 0.58);
	border: 1px solid rgba(90, 31, 43, 0.2);
	border-radius: 999px;
	color: var(--mfv-bc-burgundy);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	margin-top: auto;
	padding: 0.15rem 0.45rem;
	text-transform: uppercase;
}

.mfv-bc-book--locked .mfv-bc-book__cover::after {
	background: rgba(90, 31, 43, 0.95);
	border: 1px solid var(--mfv-bc-gold);
	border-radius: 3px;
	color: #f7f1e3;
	content: "Locked";
	font-size: 0.6rem;
	font-weight: 700;
	left: 0.4rem;
	letter-spacing: 0.06em;
	padding: 0.18rem 0.4rem;
	position: absolute;
	text-transform: uppercase;
	top: 0.4rem;
	z-index: 2;
}

/* Grid / carousel layouts */
.mfv-bc--grid .mfv-bc__case {
	background: #f5f7fb;
	border-color: #e2e8f0;
	box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

.mfv-bc--grid .mfv-bc__row {
	background: transparent;
	box-shadow: none;
	margin: 0;
}

.mfv-bc--grid .mfv-bc__ledge {
	display: none;
}

.mfv-bc--grid .mfv-bc__books {
	align-items: stretch;
	display: grid;
	gap: 1.25rem;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	justify-items: center;
	min-height: 0;
	overflow: visible;
	padding-top: 1.25rem;
	padding-bottom: 1.25rem;
}

.mfv-bc--grid .mfv-bc-book {
	width: 140px;
}

.mfv-bc--grid .mfv-bc-book__cover {
	transform: none;
}

.mfv-bc--carousel .mfv-bc__row {
	overflow: hidden;
	padding-left: 0.35rem;
	padding-right: 0.35rem;
}

.mfv-bc--carousel .mfv-bc__books {
	align-items: flex-start;
	display: flex;
	flex-wrap: nowrap;
	gap: 1.1rem;
	justify-content: flex-start;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.mfv-bc--carousel .mfv-bc__books::-webkit-scrollbar {
	display: none;
}

.mfv-bc--carousel .mfv-bc-book {
	flex: 0 0 auto;
	scroll-snap-align: start;
}

.mfv-bc__nav {
	align-items: center;
	appearance: none;
	background: rgba(255, 255, 255, 0.94);
	border: 1px solid rgba(212, 175, 55, 0.55);
	border-radius: 999px;
	box-shadow: 0 8px 22px rgba(16, 24, 47, 0.22);
	color: #16367a;
	cursor: pointer;
	display: inline-flex;
	font-size: 1.75rem;
	font-weight: 700;
	height: 42px;
	justify-content: center;
	line-height: 1;
	padding: 0;
	position: absolute;
	top: 42%;
	transform: translateY(-50%);
	transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
	width: 42px;
	z-index: 5;
}

.mfv-bc__nav:hover,
.mfv-bc__nav:focus {
	background: #fff;
	outline: none;
	transform: translateY(-50%) scale(1.05);
}

.mfv-bc__nav:disabled {
	cursor: default;
	opacity: 0.35;
	pointer-events: none;
}

.mfv-bc__nav--prev {
	left: 10px;
}

.mfv-bc__nav--next {
	right: 10px;
}

.mfv-bc--carousel .mfv-bc__books {
	padding-left: 3rem;
	padding-right: 3rem;
}

.mfv-bc--admin .mfv-bc-book[disabled] {
	cursor: default;
	opacity: 1;
}

.mfv-bc--admin .mfv-bc-book[disabled]:hover {
	filter: none;
	transform: none;
}

@media (max-width: 640px) {
	.mfv-bc-book {
		width: 96px;
	}

	.mfv-bc-book__cover {
		flex-basis: 140px;
		height: 140px;
		max-height: 140px;
		min-height: 140px;
	}

	.mfv-bc__nav {
		height: 36px;
		width: 36px;
		font-size: 1.45rem;
	}

	.mfv-bc--carousel .mfv-bc__books {
		padding-left: 2.4rem;
		padding-right: 2.4rem;
	}

	.mfv-bc--grid .mfv-bc-book {
		width: 110px;
	}
}
