/* Sermon PDF Viewer — matches the HabiTheme orange palette (#ff7d1c), Montserrat / Open Sans. */

.spv-section {
	background: #f7f7f7;
	padding: 60px 0 50px;
}
.spv-section .section-header h3 { margin-bottom: 30px; }
.spv { scroll-margin-top: 110px; }
.spv-intro { max-width: 820px; margin: 0 auto 30px; text-align: center; color: #555; }

/* ---------- Category filter ---------- */
.spv-filter-select {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin: 0 0 35px;
}
.spv-filter-select label {
	margin: 0;
	font-family: "Montserrat", sans-serif;
	font-weight: 600;
	color: #333;
	white-space: nowrap;
}
.spv-select-wrap {
	position: relative;
	width: 100%;
	max-width: 340px;
}
.spv-select-wrap select {
	width: 100%;
	padding: 10px 44px 10px 18px;
	border: 2px solid #ff7d1c;
	border-radius: 50px;
	background: #fff;
	color: #333;
	font-family: "Montserrat", sans-serif;
	font-size: 15px;
	cursor: pointer;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}
.spv-select-wrap select:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(255, 125, 28, .3);
}
.spv-select-wrap .fa {
	position: absolute;
	top: 50%;
	right: 18px;
	transform: translateY(-50%);
	color: #ff7d1c;
	font-size: 20px;
	pointer-events: none;
}

/* ---------- Cards ---------- */
.spv-col { display: flex; margin-bottom: 30px; }
.spv-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow: hidden;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
	transition: transform .25s, box-shadow .25s;
}
.spv-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }

.spv-card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	background: #222;
	overflow: hidden;
}
.spv-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spv-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	background: linear-gradient(135deg, #ff7d1c, #ed3c0d);
	color: rgba(255, 255, 255, .9);
	font-size: 64px;
}
.spv-card__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 4px 12px;
	border-radius: 50px;
	background: rgba(0, 0, 0, .7);
	color: #fff;
	font-family: "Montserrat", sans-serif;
	font-size: 12px;
	font-weight: 500;
}

.spv-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 20px 22px 24px;
}
.spv-card__date { color: #ff7d1c; font-size: 13px; margin-bottom: 8px; }
.spv-card__date .fa { margin-right: 4px; }
.spv-card__title {
	margin: 0 0 10px;
	color: #111;
	font-family: "Montserrat", sans-serif;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.35;
}
.spv-card__desc {
	margin: 0 0 18px;
	color: #555;
	font-size: 14px;
	line-height: 1.65;
}
.spv-card .spv-btn { margin-top: auto; align-self: flex-start; }

/* ---------- Buttons ---------- */
.spv-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 26px;
	border: 2px solid #ff7d1c;
	border-radius: 50px;
	background: #ff7d1c;
	color: #fff;
	font-family: "Montserrat", sans-serif;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background .25s, color .25s;
}
.spv-btn:hover,
.spv-btn:focus { background: #fff; color: #ff7d1c; text-decoration: none; }
.spv-btn:focus-visible,
.spv-tool:focus-visible { outline: 3px solid rgba(255, 125, 28, .45); outline-offset: 2px; }
.spv-btn--sm { padding: 6px 16px; font-size: 13px; }

/* ---------- Pagination / empty ---------- */
.spv-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}
.spv-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border-radius: 50%;
	background: #fff;
	color: #333;
	box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
}
.spv-pagination .page-numbers.current,
.spv-pagination a.page-numbers:hover { background: #ff7d1c; color: #fff; text-decoration: none; }
.spv-pagination .screen-reader-text,
.spv .screen-reader-text {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}
.spv-empty { text-align: center; color: #666; padding: 30px 0; }

/* ---------- Viewer dialog ---------- */
html.spv-lock, html.spv-lock body { overflow: hidden; }

.spv-modal[hidden] { display: none; }
.spv-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}
.spv-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .8); }
.spv-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(1100px, 94vw);
	height: 92vh;
	height: 92dvh;
	overflow: hidden;
	border-radius: 8px;
	background: #3a3a3a;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.spv-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 18px;
	padding: 10px 14px 10px 20px;
	background: #111;
	border-bottom: 3px solid #ff7d1c;
	color: #fff;
}
.spv-toolbar__title {
	flex: 1 1 200px;
	min-width: 0;
	margin: 0;
	overflow: hidden;
	color: #fff;
	font-family: "Montserrat", sans-serif;
	font-size: 17px;
	font-weight: 600;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.spv-toolbar__group { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.spv-toolbar__actions { gap: 10px; }
.spv-tool {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .1);
	color: #fff;
	cursor: pointer;
	transition: background .2s;
}
.spv-tool:hover { background: #ff7d1c; }
.spv-tool--close { font-size: 18px; }
.spv-page-input {
	width: 48px;
	padding: 3px 4px;
	border: 1px solid #555;
	border-radius: 4px;
	background: #222;
	color: #fff;
	text-align: center;
	-moz-appearance: textfield;
}
.spv-page-input::-webkit-inner-spin-button,
.spv-page-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.spv-zoom-level { min-width: 46px; text-align: center; }
.spv-toolbar .spv-btn:hover { background: #111; }

.spv-stage {
	position: relative;
	flex: 1;
	overflow: auto;
	padding: 20px;
	-webkit-overflow-scrolling: touch;
	outline: none;
}
.spv-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; min-width: min-content; }
.spv-page {
	position: relative;
	max-width: none;
	background: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
}
.spv-page:not(.is-ready)::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 36px;
	height: 36px;
	margin: -18px 0 0 -18px;
	border: 3px solid #eee;
	border-top-color: #ff7d1c;
	border-radius: 50%;
	animation: spv-spin .8s linear infinite;
}
.spv-page canvas { display: block; }
.spv-status {
	padding: 40px 0;
	color: #eee;
	text-align: center;
	font-family: "Montserrat", sans-serif;
}
.spv-status[hidden] { display: none; }
.spv-frame { width: 100%; height: calc(92vh - 140px); border: 0; background: #fff; }
.spv-note { color: #ddd; text-align: center; font-size: 14px; margin: 10px 0 0; }

@keyframes spv-spin { to { transform: rotate(360deg); } }

/* ---------- Tablet ---------- */
@media (max-width: 991px) {
	.spv-section { padding: 45px 0 35px; }
	.spv-card__title { font-size: 18px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
	.spv-modal__dialog { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
	.spv-toolbar { padding: 8px 10px 8px 14px; gap: 8px 10px; }
	.spv-toolbar__title { flex-basis: calc(100% - 50px); order: 0; font-size: 15px; }
	.spv-toolbar__actions { order: 1; }
	.spv-toolbar__actions .spv-download { display: none; }
	.spv-toolbar__pages { order: 2; }
	.spv-toolbar__zoom { order: 3; margin-left: auto; }
	.spv-stage { padding: 10px; }
	.spv-frame { height: calc(100dvh - 130px); }
	.spv-mobile-download { display: flex !important; }
}

@media (max-width: 575px) {
	.spv-filter-select { flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 25px; }
	.spv-select-wrap { max-width: none; }
	.spv-section .section-header h3 { font-size: 26px; }
}

/* Download bar shown at the bottom of the viewer on phones. */
.spv-mobile-download {
	display: none;
	justify-content: center;
	padding: 10px;
	background: #111;
	border-top: 1px solid #333;
}
.spv-mobile-download .spv-btn { width: 100%; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
	.spv-card, .spv-card:hover { transition: none; transform: none; }
	.spv-page:not(.is-ready)::after { animation-duration: 2s; }
}
