/* ===================================================
   BIBLIOTECA GUANELLIENE v4
   =================================================== */

.bg-wrap {
	max-width: 1060px;
	margin: 0 auto;
	font-family: 'Quicksand', 'Poppins', sans-serif;
}

/* ---- Filtre ---- */
.bg-filtre-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 28px;
	flex-wrap: wrap;
}

.bg-filtre-label {
	font-weight: 800;
	color: #5b1a5e;
	font-size: 0.85em;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	white-space: nowrap;
}

.bg-cat-btns {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 4px;
	flex-wrap: nowrap;
	scrollbar-width: thin;
	scrollbar-color: #d0c0d4 transparent;
}

.bg-cat-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: #f3edf3;
	color: #5b1a5e;
	border: 2px solid transparent;
	border-radius: 999px;
	padding: 5px 13px;
	font-family: inherit;
	font-size: 0.82em;
	font-weight: 800;
	cursor: pointer;
	white-space: nowrap;
	flex-shrink: 0;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.bg-cat-btn:hover { background: #e0d6e0; border-color: #5b1a5e; }
.bg-cat-btn.active { background: #5b1a5e; color: #fff; border-color: #5b1a5e; }
.bg-cat-carti.active             { background: #5b1a5e; border-color: #5b1a5e; }
.bg-cat-piese-de-teatru.active   { background: #e8783c; border-color: #e8783c; }
.bg-cat-rugaciuni.active         { background: #8a6d8e; border-color: #8a6d8e; }
.bg-cat-cantece-bisericesti.active { background: #2f9e8f; border-color: #2f9e8f; }

.bg-cat-count {
	background: rgba(0,0,0,0.12);
	border-radius: 999px;
	padding: 0 6px;
	font-size: 0.8em;
	font-weight: 600;
}

/* ---- Grid ---- */
.bg-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
}

@media (min-width: 540px) {
	.bg-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

@media (min-width: 860px) {
	.bg-grid { grid-template-columns: repeat(4, 1fr); gap: 24px; }
}

/* ---- Card ---- */
.bg-card {
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(91,26,94,0.10);
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s, transform 0.18s;
}

.bg-card:hover {
	box-shadow: 0 8px 28px rgba(91,26,94,0.18);
	transform: translateY(-3px);
}

/* ---- Copertă ---- */
.bg-card-cover {
	position: relative;
	width: 100%;
	padding-top: 140%;
	overflow: hidden;
	flex-shrink: 0;
}

.bg-card-cover img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Fundal copertă per categorie */
.bg-cover-carti             { background: linear-gradient(160deg, #e8d5ec 0%, #c9a8d4 100%); }
.bg-cover-piese-de-teatru   { background: linear-gradient(160deg, #fce4d4 0%, #f0b895 100%); }
.bg-cover-rugaciuni         { background: linear-gradient(160deg, #e8e0f0 0%, #c8b4d8 100%); }
.bg-cover-cantece-bisericesti { background: linear-gradient(160deg, #d4ede9 0%, #9dd0c4 100%); }

/* Placeholder — ocupa tot spatiul copertei */
.bg-cover-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 28px 18px 20px;
	text-align: center;
}

/* Linie decorativă sus */
.bg-cover-placeholder::before {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 5px;
}
.bg-cover-carti .bg-cover-placeholder::before             { background: #7b2d8b; }
.bg-cover-piese-de-teatru .bg-cover-placeholder::before   { background: #e8783c; }
.bg-cover-rugaciuni .bg-cover-placeholder::before         { background: #7b2d8b; }
.bg-cover-cantece-bisericesti .bg-cover-placeholder::before { background: #2f9e8f; }

/* Iconiță mică sus */
.bg-cover-placeholder::after {
	content: '✦';
	position: absolute;
	top: 14px;
	font-size: 10px;
	opacity: 0.35;
	color: #3d1240;
}

/* Titlul pe copertă */
.bg-cover-title {
	font-family: 'Quicksand', 'Poppins', sans-serif;
	font-size: clamp(0.85rem, 2.2vw, 1.05rem);
	font-weight: 800;
	color: #2d0a35;
	line-height: 1.35;
	text-align: center;
	word-break: break-word;
	hyphens: auto;
	max-width: 100%;
	/* Linie subtilă sub titlu */
	padding-bottom: 12px;
	position: relative;
}

.bg-cover-title::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 30px;
	height: 2px;
	border-radius: 2px;
	background: rgba(61,18,64,0.25);
}

/* Badge categorie */
.bg-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 0.62em;
	font-weight: 800;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	line-height: 1.6;
	backdrop-filter: blur(4px);
}

.bg-badge-carti               { background: rgba(91,26,94,0.85); }
.bg-badge-piese-de-teatru     { background: rgba(232,120,60,0.9); }
.bg-badge-rugaciuni           { background: rgba(138,109,142,0.85); }
.bg-badge-cantece-bisericesti { background: rgba(47,158,143,0.85); }

/* ---- Corp card ---- */
.bg-card-body {
	padding: 12px 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 5px;
	flex: 1;
}

.bg-card-title {
	margin: 0;
	font-size: 0.85em;
	font-weight: 800;
	color: #3a1040;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.bg-card-meta {
	margin: 0;
	font-size: 0.72em;
	color: #999;
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
}

.bg-autor { font-style: italic; }

.bg-card-desc {
	margin: 0;
	font-size: 0.78em;
	color: #888;
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	flex: 1;
}

/* Buton descărcare */
.bg-btn-download {
	display: block;
	margin-top: 10px;
	padding: 9px 8px;
	background: #5b1a5e;
	color: #fff;
	border-radius: 8px;
	text-align: center;
	text-decoration: none;
	font-weight: 800;
	font-size: 0.78em;
	letter-spacing: 0.02em;
	transition: background 0.15s;
}

.bg-btn-download:hover { background: #7a2480; color: #fff; }

.bg-no-pdf {
	display: block;
	margin-top: 8px;
	font-size: 0.72em;
	color: #bbb;
	font-style: italic;
	text-align: center;
}

.bg-no-results {
	color: #999;
	font-style: italic;
	padding: 20px 0;
	font-size: 0.95em;
	grid-column: 1 / -1;
}

/* ===================================================
   Single material
   =================================================== */
.bg-single-wrap {
	max-width: 780px;
	margin: 30px auto;
	padding: 0 16px;
	font-family: 'Quicksand', 'Poppins', sans-serif;
}

.bg-single {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 4px 20px rgba(91,26,94,0.09);
	overflow: hidden;
}

.bg-single-inner { display: flex; }

.bg-single-cover {
	width: 220px;
	flex-shrink: 0;
	min-height: 280px;
	position: relative;
	overflow: hidden;
}

.bg-single-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.bg-single-cover-placeholder {
	width: 100%;
	height: 100%;
	min-height: 280px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 4em;
	opacity: 0.4;
}

.bg-single-body {
	flex: 1;
	padding: 24px 28px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bg-single-badge { align-self: flex-start; }

.bg-single-title {
	font-size: 1.5em;
	font-weight: 900;
	color: #5b1a5e;
	margin: 0;
	line-height: 1.25;
}

.bg-single-meta {
	font-size: 0.88em;
	color: #999;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.bg-single-content {
	color: #444;
	font-size: 0.93em;
	line-height: 1.7;
	flex: 1;
}

.bg-single-content p { margin-bottom: 0.8em; }

.bg-single-actiuni {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	padding-top: 12px;
	border-top: 1px solid #f0e8f0;
}

.bg-btn-back {
	display: inline-block;
	padding: 8px 16px;
	border-radius: 7px;
	text-decoration: none;
	font-weight: 800;
	font-size: 0.85em;
	background: #f3edf3;
	color: #5b1a5e;
	transition: background 0.15s;
}

.bg-btn-back:hover { background: #e0d6e0; color: #3c0a40; }

@media (max-width: 580px) {
	.bg-single-inner { flex-direction: column; }
	.bg-single-cover { width: 100%; min-height: 200px; }
	.bg-single-cover-placeholder { min-height: 160px; font-size: 3em; }
	.bg-single-body { padding: 16px; }
	.bg-single-title { font-size: 1.2em; }
}
