/* ALO E-Library, Books & Agreements Portrait Grid (Matching alolabor.org/ebook/) */
.alo-pub-section {
	direction: rtl;
	text-align: right;
	padding: 35px 0;
	margin: 20px 0;
	font-family: 'Cairo', 'Tajawal', Tahoma, Arial, sans-serif;
}

.alo-pub-header {
	text-align: center;
	margin-bottom: 28px;
}

.alo-pub-section-title {
	font-size: 28px !important;
	font-weight: 700 !important;
	color: var(--alo-pub-primary, #0b4f8a);
	margin: 0 0 10px 0 !important;
	position: relative;
	display: inline-block;
	padding-bottom: 10px;
}

.alo-pub-section-title::after {
	content: '';
	position: absolute;
	bottom: 0;
	right: 50%;
	transform: translateX(50%);
	width: 65px;
	height: 3px;
	background: var(--alo-pub-accent, #168a59);
	border-radius: 2px;
}

.alo-pub-section-subtitle {
	font-size: 15px;
	color: #64748b;
	max-width: 680px;
	margin: 0 auto;
	line-height: 1.6;
}

.alo-pub-toolbar {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 18px;
	margin-bottom: 24px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.alo-pub-search-box {
	display: flex;
	align-items: stretch;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.alo-pub-search-box:focus-within {
	border-color: var(--alo-pub-primary, #0b4f8a);
	box-shadow: 0 0 0 3px rgba(11, 79, 138, 0.12);
}

.alo-pub-search-input {
	flex: 1;
	border: 0 !important;
	padding: 11px 16px !important;
	font-size: 14px !important;
	font-family: inherit !important;
	color: #1e293b;
	background: transparent !important;
	outline: none !important;
	box-shadow: none !important;
}

.alo-pub-search-btn {
	background: var(--alo-pub-primary, #0b4f8a);
	color: #fff;
	border: 0;
	padding: 0 20px;
	cursor: pointer;
	font-size: 15px;
	transition: opacity 0.2s ease;
}

.alo-pub-search-btn:hover {
	opacity: 0.9;
}

.alo-pub-selects-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
	gap: 12px;
}

.alo-pub-select {
	width: 100%;
	padding: 10px 14px !important;
	border: 1px solid #cbd5e1 !important;
	border-radius: 9px !important;
	background-color: #ffffff !important;
	color: #334155 !important;
	font-size: 13.5px !important;
	font-weight: 600 !important;
	font-family: inherit !important;
	cursor: pointer;
	outline: none;
	height: auto !important;
}

.alo-pub-select:focus {
	border-color: var(--alo-pub-primary, #0b4f8a) !important;
}

.alo-pub-results-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	padding: 0 4px;
	font-size: 13.5px;
	color: #475569;
}

.alo-pub-wrapper {
	position: relative;
	min-height: 260px;
}

.alo-pub-loader {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.85);
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	font-weight: 600;
	color: var(--alo-pub-primary, #0b4f8a);
	border-radius: 12px;
}

.alo-pub-spinner {
	width: 22px;
	height: 22px;
	border: 3px solid #cbd5e1;
	border-top-color: var(--alo-pub-primary, #0b4f8a);
	border-radius: 50%;
	animation: aloPubSpin 0.7s linear infinite;
	display: inline-block;
}

@keyframes aloPubSpin {
	to { transform: rotate(360deg); }
}

.alo-pub-grid {
	display: grid;
	gap: 22px;
}

.alo-pub-cols-3 {
	grid-template-columns: repeat(3, 1fr);
}

.alo-pub-cols-4 {
	grid-template-columns: repeat(4, 1fr);
}

.alo-pub-cols-5 {
	grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1024px) {
	.alo-pub-cols-4,
	.alo-pub-cols-5 {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 767px) {
	.alo-pub-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 14px;
	}
}

@media (max-width: 460px) {
	.alo-pub-grid {
		grid-template-columns: 1fr;
	}
}

.alo-pub-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.alo-pub-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.alo-pub-cover-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 4.2;
	background: #f1f5f9;
	overflow: hidden;
	border-bottom: 1px solid #e2e8f0;
}

.alo-pub-cover-link {
	display: block;
	width: 100%;
	height: 100%;
}

.alo-pub-cover-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.alo-pub-card:hover .alo-pub-cover-wrap img {
	transform: scale(1.04);
}

.alo-pub-placeholder-cover {
	width: 100%;
	height: 100%;
	background: linear-gradient(160deg, var(--alo-pub-primary, #0b4f8a) 0%, #07335a 100%);
	color: #fff;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 20px;
	text-align: center;
	box-sizing: border-box;
	border-right: 8px solid rgba(255, 255, 255, 0.18);
}

.alo-pub-placeholder-cover i {
	font-size: 36px;
	margin-bottom: 12px;
	opacity: 0.85;
}

.alo-pub-placeholder-cover span {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.5;
}

.alo-pub-doc-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	background: var(--alo-pub-accent, #168a59);
	color: #fff;
	padding: 3px 10px;
	border-radius: 6px;
	font-size: 11.5px;
	font-weight: 700;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.alo-pub-year-badge {
	position: absolute;
	bottom: 10px;
	left: 10px;
	background: rgba(15, 23, 42, 0.85);
	color: #fff;
	padding: 3px 10px;
	border-radius: 6px;
	font-size: 11.5px;
	font-weight: 700;
}

.alo-pub-body {
	padding: 14px 16px 16px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.alo-pub-cat-row {
	margin-bottom: 8px;
}

.alo-pub-cat {
	display: inline-block;
	background: #eff6ff;
	color: var(--alo-pub-primary, #0b4f8a);
	padding: 3px 10px;
	border-radius: 6px;
	font-size: 11.5px;
	font-weight: 700;
}

.alo-pub-title {
	font-size: 14.5px !important;
	font-weight: 700 !important;
	line-height: 1.55 !important;
	margin: 0 0 14px 0 !important;
	flex: 1;
}

.alo-pub-title a {
	color: #1e293b;
	text-decoration: none;
	transition: color 0.2s ease;
}

.alo-pub-title a:hover {
	color: var(--alo-pub-primary, #0b4f8a);
}

.alo-pub-actions {
	display: flex;
	gap: 8px;
	margin-top: auto;
	padding-top: 10px;
	border-top: 1px solid #f1f5f9;
}

.alo-pub-btn {
	text-align: center;
	padding: 8px 12px;
	border-radius: 8px;
	font-size: 12.5px;
	font-weight: 700;
	text-decoration: none !important;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.alo-pub-btn-details {
	flex: 1;
	background: #f1f5f9;
	color: var(--alo-pub-primary, #0b4f8a) !important;
}

.alo-pub-btn-details:hover {
	background: var(--alo-pub-primary, #0b4f8a);
	color: #fff !important;
}

.alo-pub-btn-pdf {
	background: var(--alo-pub-accent, #168a59);
	color: #fff !important;
	padding: 8px 12px;
}

.alo-pub-btn-pdf:hover {
	opacity: 0.9;
}

.alo-pub-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 6px;
	margin-top: 28px;
}

.alo-pub-page-btn {
	min-width: 36px;
	height: 36px;
	border: 1px solid #cbd5e1;
	background: #fff;
	color: #334155;
	border-radius: 8px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: inherit;
}

.alo-pub-page-btn:hover {
	border-color: var(--alo-pub-primary, #0b4f8a);
	color: var(--alo-pub-primary, #0b4f8a);
}

.alo-pub-page-btn.active {
	background: var(--alo-pub-primary, #0b4f8a);
	color: #fff;
	border-color: var(--alo-pub-primary, #0b4f8a);
}

.alo-pub-page-dots {
	padding: 0 4px;
	color: #94a3b8;
}

.alo-pub-empty {
	text-align: center;
	padding: 40px 20px;
	background: #f8fafc;
	border-radius: 12px;
	border: 1px dashed #cbd5e1;
}


/* Homepage CTA Button ("عرض كافة الكتب والإصدارات") - Hardened against Sahifa .entry a overrides */
.alo-pub-cta-wrap {
	display: flex !important;
	justify-content: center !important;
	align-items: center !important;
	width: 100% !important;
	text-align: center !important;
	margin-top: 32px !important;
	clear: both !important;
}

.alo-pub-all-btn,
.entry a.alo-pub-all-btn,
a.alo-pub-all-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 10px !important;
	background: var(--alo-pub-primary, #0b4f8a) !important;
	color: #ffffff !important;
	padding: 13px 32px !important;
	border-radius: 999px !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	text-decoration: none !important;
	border: 0 !important;
	box-shadow: 0 6px 18px rgba(11, 79, 138, 0.25) !important;
	transition: all 0.25s ease !important;
	line-height: 1.5 !important;
}

.alo-pub-all-btn:hover,
.entry a.alo-pub-all-btn:hover,
a.alo-pub-all-btn:hover {
	background: var(--alo-pub-accent, #168a59) !important;
	color: #ffffff !important;
	transform: translateY(-2px) !important;
	box-shadow: 0 8px 22px rgba(22, 138, 89, 0.28) !important;
}
