/**
 * Relatia Book Grid – visual grid of published books.
 *
 * @since 1.0.0
 */

/* ── Wrapper ────────────────────────────────────────────── */
.relatia-book-grid-wrapper {
	margin: 0 auto;
	max-width: 1200px;
}

.relatia-book-grid-title {
	margin-bottom: 24px;
}

/* ── Filters ─────────────────────────────────────────── */
.relatia-book-grid-wrapper .relatia-book-grid-filters {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 24px;
	border-bottom: 1px solid #e5e7eb;
	padding-bottom: 12px;
}

.relatia-book-grid-wrapper .relatia-book-grid-search {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
}

.relatia-book-grid-wrapper .relatia-book-grid-search .material-icons-outlined {
	position: absolute;
	left: 8px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 18px;
	color: #9ca3af;
	pointer-events: none;
}

.relatia-book-grid-wrapper .relatia-book-grid-search-input,
.relatia-book-grid-wrapper input[type="search"].relatia-book-grid-search-input {
	width: 100%;
	height: 34px;
	padding: 0 12px 0 32px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 13px;
	background: transparent;
	color: #1f2937;
	box-sizing: border-box;
	box-shadow: none;
	margin: 0;
	line-height: 34px;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

.relatia-book-grid-wrapper .relatia-book-grid-search-input::placeholder {
	color: #9ca3af;
}

.relatia-book-grid-wrapper .relatia-book-grid-search-input:focus {
	outline: none;
	box-shadow: none;
	border-color: var(--relatia-bg-color-main, #4a90d9);
}

.relatia-book-grid-wrapper .relatia-book-grid-filter-group {
	display: none;
	align-items: center;
	gap: 2px;
	flex-shrink: 0;
}

.relatia-book-grid-wrapper .relatia-book-grid-filter-group.is-visible {
	display: flex;
	flex-basis: 100%;
	flex-wrap: wrap;
}

.relatia-book-grid-wrapper .relatia-book-grid-filter-sep {
	width: 1px;
	height: 18px;
	background: #d1d5db;
	flex-shrink: 0;
}

.relatia-book-grid-wrapper select.relatia-book-grid-filter {
	padding: 6px 20px 6px 8px;
	border: none;
	border-radius: 0;
	font-size: 13px;
	background-color: transparent;
	color: #6b7280;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239ca3af'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 4px center;
	background-size: 10px 6px;
	min-width: 0;
	box-shadow: none;
	margin: 0;
	line-height: normal;
}

.relatia-book-grid-wrapper select.relatia-book-grid-filter:focus {
	outline: none;
	box-shadow: none;
	border: none;
	color: #374151;
}

/* No results message */
.relatia-book-grid-wrapper .relatia-book-grid-no-results {
	display: none;
	text-align: center;
	padding: 40px 20px;
	color: #9ca3af;
	font-size: 14px;
}

/* ── Grid ────────────────────────────────────────────────── */
.relatia-book-grid {
	display: grid;
	grid-template-columns: repeat(var(--relatia-book-grid-columns, 4), 1fr);
	gap: 28px;
}

/* ── Card ────────────────────────────────────────────────── */
.relatia-book-grid-item {
	position: relative;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
	transition: box-shadow .25s ease, transform .25s ease;
}

.relatia-book-grid-item:hover {
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
	transform: translateY(-4px);
}

.relatia-book-grid-cover-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.relatia-book-grid-cover-link:hover,
.relatia-book-grid-cover-link:focus {
	text-decoration: none;
	color: inherit;
}

/* ── Cover / Thumbnail ──────────────────────────────────── */
.relatia-book-grid-cover {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: #f0f0f0;
	border-radius: 12px 12px 0 0;
}

.relatia-book-grid-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .3s ease;
}

.relatia-book-grid-item:hover .relatia-book-grid-img {
	transform: scale(1.04);
}

/* Placeholder when no thumbnail */
.relatia-book-grid-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
}

.relatia-book-grid-placeholder .dashicons {
	font-size: 64px;
	width: 64px;
	height: 64px;
	color: #7986cb;
	opacity: .6;
}

/* Age badge */
.relatia-book-grid-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: var(--relatia-color-main, #1565c0);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 6px;
	line-height: 1.3;
	letter-spacing: 0.02em;
}

/* Post status badge (admin only, covers top half of cover) */
.relatia-book-grid-status-badge {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 10%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	opacity: .5;
}

.relatia-book-grid-status-publish {
	background: #4caf50;
}

.relatia-book-grid-status-draft {
	background: #9e9e9e;
}

.relatia-book-grid-status-pending {
	background: #ff9800;
}

.relatia-book-grid-status-future {
	background: #2196f3;
}

.relatia-book-grid-status-private {
	background: #9c27b0;
}

.relatia-book-grid-status-trash {
	background: #f44336;
}

.relatia-book-grid-status-new {
	background: #f44336;
	opacity: 1;
}

/* Star rating badge (top-right) */
.relatia-book-grid-rating {
	position: absolute;
	top: 10px;
	right: 10px;
	background: rgba(0, 0, 0, .6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 6px;
	line-height: 1.3;
	display: flex;
	align-items: center;
	gap: 4px;
}

.relatia-book-grid-rating-star {
	color: #fbbf24;
	font-size: 15px;
}

/* Reading progress badge (bottom-right) */
.relatia-book-grid-progress {
	position: absolute;
	bottom: 10px;
	right: 10px;
	background: rgba(0, 0, 0, .6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 6px;
	line-height: 1.3;
	display: flex;
	align-items: center;
}

.relatia-book-grid-check {
	color: #34d399;
	font-size: 18px;
}

/* Planning alert badge (bottom-left, pulsing) */
.relatia-book-grid-planning-alert {
	position: absolute;
	bottom: 10px;
	left: 10px;
	background: #ef4444;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 6px;
	line-height: 1.3;
	display: flex;
	align-items: center;
	gap: 4px;
	animation: relatia-planning-pulse 2.5s ease-in-out infinite;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.relatia-book-grid-planning-alert .material-icons-outlined {
	font-size: 14px;
}

@keyframes relatia-planning-pulse {

	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.4;
	}
}

@media (prefers-reduced-motion: reduce) {
	.relatia-book-grid-planning-alert {
		animation: none;
	}
}

[data-theme="dark"] .relatia-book-grid-planning-alert {
	background: #dc2626;
}

/* ── Action icons ──────────────────────────────────── */
.relatia-book-grid-actions {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 4px;
	padding: 8px 12px 0;
}

.relatia-book-grid-action-btn {
	background: none;
	border: none;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	min-width: 44px;
	min-height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #6b7280;
	transition: color .2s, background .2s, transform .2s;
	padding: 0;
	line-height: 1;
	text-decoration: none;
}

.relatia-book-grid-action-btn:hover,
.relatia-book-grid-action-btn:focus {
	background: rgba(0, 0, 0, 0.06);
	color: #374151;
	transform: scale(1.1);
	text-decoration: none;
}

.relatia-book-grid-action-btn .material-icons-outlined {
	font-size: 20px;
}

.relatia-book-grid-action-disabled {
	opacity: 0.3;
	pointer-events: none;
	cursor: default;
}

.relatia-book-grid-action-btn.is-favorited .material-icons-outlined {
	color: #ef4444;
}

.relatia-book-grid-action-btn.relatia-fav-loading {
	opacity: 0.5;
	pointer-events: none;
}

/* Override global .relatia-favorite-btn styles inside grid actions */
.relatia-book-grid-action-btn.relatia-favorite-btn {
	background: none;
	z-index: auto;
}

.relatia-book-grid-action-btn.relatia-favorite-btn .material-icons-outlined {
	font-size: 20px;
	color: #6b7280;
}

.relatia-book-grid-action-btn.relatia-favorite-btn:hover {
	background: rgba(0, 0, 0, 0.06);
	transform: scale(1.1);
}

.relatia-book-grid-action-btn.relatia-favorite-btn.is-favorited .material-icons-outlined {
	color: #ef4444;
}

/* Admin edit button — push to the left of the actions row */
.relatia-book-grid-action-edit {
	margin-right: auto;
}

.relatia-book-grid-action-edit:hover,
.relatia-book-grid-action-edit:focus {
	color: var(--relatia-color-main, #1565c0);
}

/* ── Info ────────────────────────────────────────────────── */
.relatia-book-grid-info {
	padding: 8px 18px 20px;
	border-radius: 0 0 12px 12px;
}

.relatia-book-grid-item-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 6px;
	line-height: 1.35;
	color: #1a1a2e;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.relatia-book-grid-item-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.relatia-book-grid-item-title a:hover {
	color: var(--relatia-color-main, #b84700);
}

.relatia-book-grid-author {
	font-size: 13px;
	color: #6b7280;
	margin: 0 0 6px;
}

.relatia-book-grid-genre {
	font-size: 12px;
	color: var(--relatia-color-main, #6366f1);
	margin: 0 0 4px;
	font-weight: 600;
}

.relatia-book-grid-theme {
	font-size: 12px;
	color: #6b7280;
	margin: 0 0 4px;
	display: flex;
	align-items: center;
	gap: 4px;
}

.relatia-book-grid-theme .material-icons-outlined {
	font-size: 14px;
	color: #9ca3af;
}

.relatia-book-grid-meta {
	font-size: 12px;
	color: #9ca3af;
	margin: 0 0 8px;
}

.relatia-book-grid-excerpt {
	font-size: 13px;
	color: #4b5563;
	margin: 0;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ── Favorite button (global – used in book panel and other contexts) ── */
.relatia-favorite-btn {
	background: rgba(255, 255, 255, 0.85);
	border: none;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 2;
	transition: transform 0.2s, background 0.2s;
	padding: 0;
	line-height: 1;
}

.relatia-favorite-btn .material-icons-outlined {
	font-size: 18px;
	color: #9ca3af;
}

.relatia-favorite-btn:hover {
	background: rgba(255, 255, 255, 1);
	transform: scale(1.15);
}

.relatia-favorite-btn.is-favorited .material-icons-outlined {
	color: #ef4444;
}

.relatia-favorite-btn.relatia-fav-loading {
	opacity: 0.5;
	pointer-events: none;
}

/* ── Filter Toggle Button ──────────────────────────────── */
.relatia-book-grid-filter-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fff;
	color: #666;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.relatia-book-grid-filter-toggle:hover {
	background: #f5f5f5;
	color: #333;
}

.relatia-book-grid-filter-toggle[aria-expanded="true"] {
	background: var(--relatia-bg-color-main, #4a90d9);
	color: #fff;
	border-color: var(--relatia-bg-color-main, #4a90d9);
}

.relatia-book-grid-filter-toggle i {
	font-size: 20px;
}

/* ── CSV Download Button ─────────────────────────────── */
.relatia-book-grid-csv-download {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fff;
	color: #666;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.relatia-book-grid-csv-download:hover {
	background: #f5f5f5;
	color: #333;
}

.relatia-book-grid-csv-download i {
	font-size: 20px;
}

/* ── Sort Button & Dropdown ──────────────────────────── */
.relatia-book-grid-wrapper .relatia-book-grid-sort-wrap {
	position: relative;
	flex-shrink: 0;
}

.relatia-book-grid-wrapper .relatia-book-grid-sort-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fff;
	color: #666;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.relatia-book-grid-wrapper .relatia-book-grid-sort-toggle:hover {
	background: #f5f5f5;
	color: #333;
}

.relatia-book-grid-wrapper .relatia-book-grid-sort-toggle[aria-expanded="true"] {
	background: var(--relatia-bg-color-main, #4a90d9);
	color: #fff;
	border-color: var(--relatia-bg-color-main, #4a90d9);
}

.relatia-book-grid-wrapper .relatia-book-grid-sort-toggle i {
	font-size: 20px;
}

.relatia-book-grid-wrapper .relatia-book-grid-sort-menu {
	display: none;
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 100;
	min-width: 190px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	padding: 6px 0;
	margin: 0;
	list-style: none;
}

.relatia-book-grid-wrapper .relatia-book-grid-sort-wrap.is-open .relatia-book-grid-sort-menu {
	display: block;
}

.relatia-book-grid-wrapper .relatia-book-grid-sort-menu li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.relatia-book-grid-wrapper .relatia-book-grid-sort-menu button {
	display: block;
	width: 100%;
	padding: 8px 16px;
	border: none;
	background: none;
	font-size: 13px;
	color: #4b5563;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
	white-space: nowrap;
	line-height: 1.4;
}

.relatia-book-grid-wrapper .relatia-book-grid-sort-menu button:hover {
	background: #f3f4f6;
	color: #1f2937;
}

.relatia-book-grid-wrapper .relatia-book-grid-sort-menu button.is-active {
	color: var(--relatia-color-main, #1565c0);
	font-weight: 600;
	background: rgba(21, 101, 192, 0.06);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
	.relatia-book-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px;
	}
}

@media (max-width: 500px) {
	.relatia-book-grid {
		grid-template-columns: repeat(1, 1fr);
		gap: 20px;
	}

	.relatia-book-grid-cover {
		aspect-ratio: 4 / 3;
	}

	.relatia-book-grid-item {
		border-radius: 10px;
	}

	.relatia-book-grid-wrapper .relatia-book-grid-filter-group {
		flex-direction: column;
		flex-basis: 100%;
		gap: 8px;
	}

	.relatia-book-grid-wrapper .relatia-book-grid-filter-group .relatia-book-grid-filter-sep {
		display: none;
	}

	.relatia-book-grid-wrapper .relatia-book-grid-filter-group select.relatia-book-grid-filter {
		width: 100%;
		padding: 10px 12px;
		font-size: 14px;
	}
}

/* ── Dark mode ─────────────────────────────────────────── */
[data-theme="dark"] .relatia-book-grid-wrapper .relatia-book-grid-filters {
	border-bottom-color: rgba(255, 255, 255, .1);
}

[data-theme="dark"] .relatia-book-grid-wrapper .relatia-book-grid-search-input {
	color: #e5e7eb;
	border-color: #555;
}

[data-theme="dark"] .relatia-book-grid-wrapper .relatia-book-grid-search-input:focus {
	border-color: var(--relatia-bg-color-main, #64b5f6);
}

[data-theme="dark"] .relatia-book-grid-wrapper .relatia-book-grid-search-input::placeholder {
	color: #6b7280;
}

[data-theme="dark"] .relatia-book-grid-wrapper select.relatia-book-grid-filter {
	color: #9ca3af;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E");
}

[data-theme="dark"] .relatia-book-grid-wrapper select.relatia-book-grid-filter:focus {
	color: #d1d5db;
}

[data-theme="dark"] .relatia-book-grid-wrapper .relatia-book-grid-filter-sep {
	background: rgba(255, 255, 255, .12);
}

[data-theme="dark"] .relatia-book-grid-csv-download,
[data-theme="dark"] .relatia-book-grid-filter-toggle,
[data-theme="dark"] .relatia-book-grid-wrapper .relatia-book-grid-sort-toggle {
	background: #333;
	border-color: #555;
	color: #9ca3af;
}

[data-theme="dark"] .relatia-book-grid-filter-toggle:hover,
[data-theme="dark"] .relatia-book-grid-wrapper .relatia-book-grid-sort-toggle:hover {
	background: #444;
	color: #d1d5db;
}

[data-theme="dark"] .relatia-book-grid-wrapper .relatia-book-grid-sort-menu {
	background: #2a2a2a;
	border-color: #444;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .relatia-book-grid-wrapper .relatia-book-grid-sort-menu button {
	color: #9ca3af;
}

[data-theme="dark"] .relatia-book-grid-wrapper .relatia-book-grid-sort-menu button:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #e5e7eb;
}

[data-theme="dark"] .relatia-book-grid-wrapper .relatia-book-grid-sort-menu button.is-active {
	color: var(--relatia-color-main, #64b5f6);
	background: rgba(100, 181, 246, 0.1);
}

[data-theme="dark"] .relatia-book-grid-wrapper .relatia-book-grid-no-results {
	color: #6b7280;
}

[data-theme="dark"] .relatia-favorite-btn {
	background: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .relatia-favorite-btn:hover {
	background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .relatia-book-grid-action-btn {
	color: #9ca3af;
}

[data-theme="dark"] .relatia-book-grid-action-btn:hover,
[data-theme="dark"] .relatia-book-grid-action-btn:focus {
	background: rgba(255, 255, 255, 0.1);
	color: #d1d5db;
}

[data-theme="dark"] .relatia-book-grid-action-btn.relatia-favorite-btn {
	background: none;
}

[data-theme="dark"] .relatia-book-grid-action-btn.relatia-favorite-btn .material-icons-outlined {
	color: #9ca3af;
}

[data-theme="dark"] .relatia-book-grid-action-btn.relatia-favorite-btn:hover {
	background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .relatia-book-grid-action-btn.relatia-favorite-btn.is-favorited .material-icons-outlined {
	color: #ef4444;
}

/* ── Share Popup ────────────────────────────────────────── */
.relatia-book-grid-wrapper .relatia-book-grid-share-wrap {
	position: relative;
}

.relatia-book-grid-wrapper .relatia-book-grid-share-popup {
	display: none;
	position: absolute;
	bottom: calc(100% + 8px);
	right: -4px;
	z-index: 100;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	padding: 20px;
	gap: 20px;
	grid-template-columns: repeat(2, 44px);
	justify-content: center;
}

.relatia-book-grid-wrapper .relatia-book-grid-share-wrap.is-open .relatia-book-grid-share-popup {
	display: grid;
}

.relatia-book-grid-wrapper .relatia-book-grid-share-popup::after {
	content: '';
	position: absolute;
	bottom: -6px;
	right: 14px;
	width: 12px;
	height: 12px;
	background: #fff;
	border-right: 1px solid #e5e7eb;
	border-bottom: 1px solid #e5e7eb;
	transform: rotate(45deg);
}

.relatia-book-grid-wrapper .relatia-book-grid-share-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	padding: 0;
	transition: transform 0.15s, opacity 0.15s;
}

.relatia-book-grid-wrapper .relatia-book-grid-share-btn img {
	display: block;
	width: 30px;
	height: 30px;
}

.relatia-book-grid-wrapper .relatia-book-grid-share-btn .material-icons-outlined {
	font-size: 30px;
	color: #fff;
}

.relatia-book-grid-wrapper .relatia-book-grid-share-btn:hover {
	transform: scale(1.15);
	opacity: 0.85;
}



/* Brand colors */
.relatia-book-grid-wrapper .relatia-book-grid-share-btn[data-network="tiktok"] {
	background: #010101;
}

.relatia-book-grid-wrapper .relatia-book-grid-share-btn[data-network="instagram"] {
	background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.relatia-book-grid-wrapper .relatia-book-grid-share-btn[data-network="x"] {
	background: #000;
}

.relatia-book-grid-wrapper .relatia-book-grid-share-btn[data-network="linkedin"] {
	background: #0A66C2;
}

.relatia-book-grid-wrapper .relatia-book-grid-share-btn[data-network="whatsapp"] {
	background: #25D366;
}

.relatia-book-grid-wrapper .relatia-book-grid-share-btn[data-network="copy"] {
	background: #95b4f4;
}

/* Copied indicator */
.relatia-book-grid-wrapper .relatia-book-grid-share-copied {
	display: none;
	font-size: 11px;
	font-weight: 600;
	color: #10b981;
	white-space: nowrap;
	padding: 0 4px;
	animation: relatiaShareCopiedFade 0.3s ease;
}

.relatia-book-grid-wrapper .relatia-book-grid-share-copied.is-visible {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	grid-column: 1 / -1;
}

@keyframes relatiaShareCopiedFade {
	from {
		opacity: 0;
		transform: translateY(4px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Dark theme share popup */
[data-theme="dark"] .relatia-book-grid-wrapper .relatia-book-grid-share-popup {
	background: #2a2a2a;
	border-color: #444;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .relatia-book-grid-wrapper .relatia-book-grid-share-popup::after {
	background: #2a2a2a;
	border-right-color: #444;
	border-bottom-color: #444;
}

/* ── Loading state ─────────────────────────────────────── */
.relatia-book-grid-wrapper.is-loading .relatia-book-grid {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* ── Pagination (compact arrow-based) ─────────────────── */
.relatia-book-grid-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 12px;
	margin-top: 20px;
	padding: 0;
}

.relatia-book-grid-page-arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: #fff;
	color: #4b5563;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.relatia-book-grid-page-arrow:hover:not(:disabled) {
	background: #f3f4f6;
	color: #1f2937;
	border-color: #d1d5db;
}

.relatia-book-grid-page-arrow:disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

.relatia-book-grid-page-arrow .material-icons-outlined {
	font-size: 20px;
}

.relatia-book-grid-page-info {
	font-size: 13px;
	font-weight: 500;
	color: #6b7280;
	white-space: nowrap;
	user-select: none;
}

[data-theme="dark"] .relatia-book-grid-page-arrow {
	background: #333;
	border-color: #555;
	color: #9ca3af;
}

[data-theme="dark"] .relatia-book-grid-page-arrow:hover:not(:disabled) {
	background: #444;
	color: #d1d5db;
}

[data-theme="dark"] .relatia-book-grid-page-info {
	color: #9ca3af;
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

	.relatia-book-grid-item,
	.relatia-book-grid-img,
	.relatia-favorite-btn,
	.relatia-book-grid-action-btn {
		transition: none;
	}

	.relatia-book-grid-item:hover {
		transform: none;
	}

	.relatia-book-grid-item:hover .relatia-book-grid-img {
		transform: none;
	}

	.relatia-favorite-btn:hover,
	.relatia-book-grid-action-btn:hover {
		transform: none;
	}
}

/* =====================================================================
   BOOK SLIDER (Owl Carousel)
   ===================================================================== */
.relatia-book-slider-wrapper {
	margin: 0 auto;
	max-width: 1200px;
	position: relative;
}

.relatia-book-slider-title {
	margin-top: 100px;
	margin-bottom: 20px;
}

/* Each card inside the slider */
.relatia-book-slider .relatia-book-grid-item {
	margin: 0;
	width: 100%;
	box-sizing: border-box;
}

/* Owl nav arrows */
.relatia-book-slider-wrapper .owl-nav {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	transform: translateY(-50%);
	margin: 0;
	pointer-events: none;
	display: flex;
	justify-content: space-between;
}

.relatia-book-slider-wrapper .owl-nav button.owl-prev,
.relatia-book-slider-wrapper .owl-nav button.owl-next {
	pointer-events: auto;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92) !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	color: #333;
	border: none;
	cursor: pointer;
	transition: background 0.15s, box-shadow 0.15s;
	margin: 0;
	padding: 0;
	line-height: 1;
}

.relatia-book-slider-wrapper .owl-nav button.owl-prev {
	margin-left: -22px;
}

.relatia-book-slider-wrapper .owl-nav button.owl-next {
	margin-right: -22px;
}

.relatia-book-slider-wrapper .owl-nav button.owl-prev:hover,
.relatia-book-slider-wrapper .owl-nav button.owl-next:hover {
	background: #fff !important;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
}

.relatia-book-slider-wrapper .owl-nav button.disabled {
	opacity: 0.3;
	cursor: default;
}

/* Owl dots */
.relatia-book-slider-wrapper .owl-dots {
	margin-top: 16px;
	text-align: center;
}

.relatia-book-slider-wrapper .owl-dots .owl-dot span {
	width: 8px;
	height: 8px;
	background: #d1d5db;
	border-radius: 50%;
	transition: background 0.2s;
}

.relatia-book-slider-wrapper .owl-dots .owl-dot.active span {
	background: var(--relatia-color-main, #4361ee);
}

/* ── Slider dark theme ──────────────────────────────────── */
[data-theme="dark"] .relatia-book-slider-wrapper .owl-nav button.owl-prev,
[data-theme="dark"] .relatia-book-slider-wrapper .owl-nav button.owl-next {
	background: rgba(30, 30, 46, 0.92) !important;
	color: #e0e0e0;
}

[data-theme="dark"] .relatia-book-slider-wrapper .owl-nav button.owl-prev:hover,
[data-theme="dark"] .relatia-book-slider-wrapper .owl-nav button.owl-next:hover {
	background: #2a2a3e !important;
}

[data-theme="dark"] .relatia-book-slider-wrapper .owl-dots .owl-dot span {
	background: #555;
}

/* ── Slider responsive ──────────────────────────────────── */
@media (max-width: 768px) {
	.relatia-book-slider-wrapper .owl-nav button.owl-prev {
		margin-left: -14px;
	}

	.relatia-book-slider-wrapper .owl-nav button.owl-next {
		margin-right: -14px;
	}

	.relatia-book-slider-wrapper .owl-nav button.owl-prev,
	.relatia-book-slider-wrapper .owl-nav button.owl-next {
		width: 40px;
		height: 40px;
		font-size: 22px;
	}
}