/*
 * Popup Content & Image Slider
 * Frontend popup styles.
 */

/* =========================================================
 * Trigger Button
 * ========================================================= */

.pcis-shortcode-wrapper {
	box-sizing: border-box;
}

.pcis-trigger-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 11px 20px;
	border: 0;
	border-radius: 6px;
	background: #111827;
	color: #ffffff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color 0.2s ease,
		transform 0.2s ease,
		box-shadow 0.2s ease;
}

.pcis-trigger-button:hover,
.pcis-trigger-button:focus {
	background: #1f2937;
	color: #ffffff;
}

.pcis-trigger-button:hover {
	transform: translateY(-1px);
}

.pcis-trigger-button:focus-visible {
	outline: 3px solid rgba(17, 24, 39, 0.25);
	outline-offset: 3px;
}


/* =========================================================
 * Popup Overlay
 * ========================================================= */

.pcis-popup[hidden] {
	display: none !important;
}

.pcis-popup {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 24px;
	box-sizing: border-box;
	background: rgba(0, 0, 0, 0.72);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	transition:
		opacity 0.25s ease,
		visibility 0.25s ease;
}

.pcis-popup.pcis-popup-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}


/* =========================================================
 * Body Lock
 * ========================================================= */

body.pcis-popup-body-lock {
	overflow: hidden;
}


/* =========================================================
 * Popup Dialog
 * ========================================================= */

.pcis-popup-dialog {
	position: relative;
	width: min(760px, 100%);
	max-height: calc(100vh - 48px);
	margin: auto;
	padding: 28px;
	box-sizing: border-box;
	border-radius: 14px;
	background: #ffffff;
	color: #1f2937;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
	overflow-y: auto;
	transform: translateY(18px) scale(0.98);
	transition: transform 0.25s ease;
}

.pcis-popup.pcis-popup-open .pcis-popup-dialog {
	transform: translateY(0) scale(1);
}


/* =========================================================
 * Close Button
 * ========================================================= */

.pcis-popup-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 20;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(17, 24, 39, 0.08);
	color: #111827;
	font-size: 28px;
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
	transition:
		background-color 0.2s ease,
		color 0.2s ease,
		transform 0.2s ease;
}

.pcis-popup-close:hover,
.pcis-popup-close:focus {
	background: #111827;
	color: #ffffff;
}

.pcis-popup-close:hover {
	transform: rotate(4deg);
}

.pcis-popup-close:focus-visible {
	outline: 3px solid rgba(17, 24, 39, 0.25);
	outline-offset: 2px;
}


/* =========================================================
 * Header
 * ========================================================= */

.pcis-popup-header {
	padding-right: 48px;
	margin-bottom: 22px;
}

.pcis-popup-date {
	margin-bottom: 7px;
	color: #6b7280;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.02em;
}

.pcis-popup-title {
	margin: 0;
	color: #111827;
	font-size: clamp(24px, 4vw, 34px);
	font-weight: 700;
	line-height: 1.2;
}

.pcis-popup-subheading {
	margin-top: 8px;
	color: #6b7280;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.6;
}


/* =========================================================
 * Slider
 * ========================================================= */

.pcis-slider {
	position: relative;
	width: 100%;
	margin: 0 0 24px;
	border-radius: 10px;
	background: #f3f4f6;
	overflow: hidden;
}

.pcis-slide {
	display: none;
	position: relative;
	width: 100%;
}

.pcis-slide.pcis-slide-active {
	display: block;
}

.pcis-slide-image {
	display: block;
	width: 100%;
	height: auto;
	max-height: 480px;
	margin: 0;
	object-fit: contain;
	object-position: center;
	background: #f3f4f6;
}


/* =========================================================
 * Slider Navigation Arrows
 * ========================================================= */

.pcis-slider-prev,
.pcis-slider-next {
	position: absolute;
	top: 50%;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(17, 24, 39, 0.72);
	color: #ffffff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transform: translateY(-50%);
	transition:
		background-color 0.2s ease,
		transform 0.2s ease;
}

.pcis-slider-prev {
	left: 14px;
}

.pcis-slider-next {
	right: 14px;
}

.pcis-slider-prev:hover,
.pcis-slider-next:hover,
.pcis-slider-prev:focus,
.pcis-slider-next:focus {
	background: rgba(17, 24, 39, 0.95);
}

.pcis-slider-prev:hover {
	transform: translateY(-50%) translateX(-1px);
}

.pcis-slider-next:hover {
	transform: translateY(-50%) translateX(1px);
}

.pcis-slider-prev:focus-visible,
.pcis-slider-next:focus-visible {
	outline: 3px solid rgba(255, 255, 255, 0.8);
	outline-offset: 2px;
}


/* =========================================================
 * Slider Dots
 * ========================================================= */

.pcis-slider-dots {
	position: absolute;
	left: 50%;
	bottom: 14px;
	z-index: 6;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	max-width: calc(100% - 30px);
	padding: 7px 10px;
	border-radius: 999px;
	background: rgba(17, 24, 39, 0.58);
	transform: translateX(-50%);
}

.pcis-slider-dot {
	display: block;
	width: 9px;
	height: 9px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.55);
	cursor: pointer;
	transition:
		background-color 0.2s ease,
		transform 0.2s ease;
}

.pcis-slider-dot:hover,
.pcis-slider-dot:focus {
	background: #ffffff;
}

.pcis-slider-dot.pcis-active,
.pcis-slider-dot.pcis-dot-active {
	background: #ffffff;
	transform: scale(1.2);
}

.pcis-slider-dot:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}


/* =========================================================
 * Popup Content
 * ========================================================= */

.pcis-popup-content {
	color: #374151;
	font-size: 16px;
	line-height: 1.75;
}

.pcis-popup-content > :first-child {
	margin-top: 0;
}

.pcis-popup-content > :last-child {
	margin-bottom: 0;
}

.pcis-popup-content p {
	margin: 0 0 1em;
}

.pcis-popup-content h1,
.pcis-popup-content h2,
.pcis-popup-content h3,
.pcis-popup-content h4,
.pcis-popup-content h5,
.pcis-popup-content h6 {
	margin: 1.4em 0 0.6em;
	color: #111827;
	line-height: 1.3;
}

.pcis-popup-content img {
	max-width: 100%;
	height: auto;
}

.pcis-popup-content a {
	color: #2563eb;
	text-decoration: underline;
}

.pcis-popup-content ul,
.pcis-popup-content ol {
	margin: 0 0 1em;
	padding-left: 1.5em;
}

.pcis-popup-content blockquote {
	margin: 1.2em 0;
	padding: 12px 18px;
	border-left: 4px solid #d1d5db;
	background: #f9fafb;
	color: #4b5563;
}


/* =========================================================
 * Responsive
 * ========================================================= */

@media (max-width: 767px) {

	.pcis-popup {
		align-items: flex-start;
		padding: 12px;
	}

	.pcis-popup-dialog {
		width: 100%;
		max-height: calc(100vh - 24px);
		margin: auto 0;
		padding: 20px;
		border-radius: 12px;
	}

	.pcis-popup-header {
		padding-right: 42px;
		margin-bottom: 18px;
	}

	.pcis-popup-title {
		font-size: 25px;
	}

	.pcis-popup-subheading {
		font-size: 15px;
	}

	.pcis-slide-image {
		max-height: 360px;
	}

	.pcis-slider-prev,
	.pcis-slider-next {
		width: 38px;
		height: 38px;
		font-size: 18px;
	}

	.pcis-slider-prev {
		left: 9px;
	}

	.pcis-slider-next {
		right: 9px;
	}

	.pcis-slider-dots {
		bottom: 9px;
	}

	.pcis-popup-content {
		font-size: 15px;
		line-height: 1.65;
	}

	.pcis-popup-close {
		top: 9px;
		right: 9px;
		width: 36px;
		height: 36px;
		font-size: 24px;
	}
}

@media (max-width: 480px) {

	.pcis-popup {
		padding: 8px;
	}

	.pcis-popup-dialog {
		max-height: calc(100vh - 16px);
		padding: 17px;
		border-radius: 10px;
	}

	.pcis-popup-title {
		font-size: 22px;
	}

	.pcis-popup-date {
		font-size: 12px;
	}

	.pcis-popup-subheading {
		font-size: 14px;
	}

	.pcis-slide-image {
		max-height: 300px;
	}

	.pcis-popup-content {
		font-size: 14px;
	}

	.pcis-trigger-button {
		min-height: 42px;
		padding: 10px 17px;
		font-size: 14px;
	}
}


/* =========================================================
 * Reduced Motion
 * ========================================================= */

@media (prefers-reduced-motion: reduce) {

	.pcis-popup,
	.pcis-popup-dialog,
	.pcis-trigger-button,
	.pcis-popup-close,
	.pcis-slider-prev,
	.pcis-slider-next,
	.pcis-slider-dot {
		transition: none;
	}

	.pcis-trigger-button:hover,
	.pcis-popup-close:hover,
	.pcis-slider-prev:hover,
	.pcis-slider-next:hover {
		transform: none;
	}
}
