/**
 * File: popups.css
 * Purpose: Front-end styling for the BTR Hub universal Popup system.
 *          Provides modal positioning, blurred backdrop, responsive sizing,
 *          animations, loading state and close controls.
 * Author: Emanuel Mandat
 * Company: Zuri IT
 * Modified: 10 September 2026
 */


/* =========================================================
   BODY STATE
   ========================================================= */

body.btr-popup-open {
	overflow: hidden;
}


/* =========================================================
   MAIN MODAL
   ========================================================= */

.btr-popup-modal {
	position: fixed;
	inset: 0;

	z-index: 999999;

	display: flex;
	align-items: center;
	justify-content: center;

	width: 100%;
	height: 100%;

	padding: 30px;

	visibility: hidden;
	opacity: 0;

	transition:
		opacity 0.25s ease,
		visibility 0.25s ease;
}


/*
 * WordPress / browser hidden attribute.
 */
.btr-popup-modal[hidden] {
	display: none !important;
}


/*
 * Active modal.
 */
.btr-popup-modal.is-open {
	visibility: visible;
	opacity: 1;
}


/* =========================================================
   BACKDROP
   ========================================================= */

.btr-popup-modal__backdrop {
	position: absolute;
	inset: 0;

	width: 100%;
	height: 100%;

	background: rgba(15, 23, 42, 0.55);

	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);

	cursor: pointer;
}


/* =========================================================
   DIALOG
   ========================================================= */

.btr-popup-modal__dialog {
	position: relative;
	z-index: 2;

	display: flex;
	flex-direction: column;

	width: 100%;

	max-height: calc(100vh - 60px);

	background: #ffffff;

	border-radius: 18px;

	box-shadow:
		0 25px 60px rgba(0, 0, 0, 0.25),
		0 8px 20px rgba(0, 0, 0, 0.12);

	overflow: hidden;

	opacity: 0;

	transform:
		translateY(20px)
		scale(0.97);

	transition:
		transform 0.25s ease,
		opacity 0.25s ease;
}


/*
 * Animate dialog into position.
 */
.btr-popup-modal.is-open .btr-popup-modal__dialog {
	opacity: 1;

	transform:
		translateY(0)
		scale(1);
}


/* =========================================================
   WIDTH SETTINGS
   ========================================================= */

.btr-popup-modal__dialog--small {
	max-width: 520px;
}

.btr-popup-modal__dialog--medium {
	max-width: 760px;
}

.btr-popup-modal__dialog--large {
	max-width: 1050px;
}

.btr-popup-modal__dialog--full {
	max-width: 1400px;
}


/* =========================================================
   HEIGHT SETTINGS
   ========================================================= */

.btr-popup-modal__dialog--height-auto {
	height: auto;
}

.btr-popup-modal__dialog--height-medium {
	height: min(650px, calc(100vh - 60px));
}

.btr-popup-modal__dialog--height-tall {
	height: min(850px, calc(100vh - 60px));
}


/* =========================================================
   INNER CONTENT AREA
   ========================================================= */

.btr-popup-modal__inner {
	position: relative;

	width: 100%;

	overflow-y: auto;
	overflow-x: hidden;

	-webkit-overflow-scrolling: touch;
}


/* =========================================================
   POPUP CONTENT
   ========================================================= */

.btr-popup-content {
	width: 100%;

	padding: 36px 40px 40px;
}


/* =========================================================
   POPUP TITLE
   ========================================================= */

.btr-popup-content__header {
	margin: 0 50px 24px 0;
}

.btr-popup-content__title {
	margin: 0;

	font-size: clamp(28px, 3vw, 38px);
	font-weight: 700;
	line-height: 1.15;

	color: #111827;
}


/* =========================================================
   STANDARD WORDPRESS CONTENT
   ========================================================= */

.btr-popup-content__body {
	margin-bottom: 25px;

	font-size: 16px;
	line-height: 1.7;

	color: #374151;
}

.btr-popup-content__body:last-child {
	margin-bottom: 0;
}

.btr-popup-content__body p:first-child {
	margin-top: 0;
}

.btr-popup-content__body p:last-child {
	margin-bottom: 0;
}


/* =========================================================
   IMAGES
   ========================================================= */

.btr-popup-content img {
	max-width: 100%;
	height: auto;
}


/* =========================================================
   EMBED CONTENT
   ========================================================= */

.btr-popup-content__embed {
	width: 100%;

	margin-top: 20px;
}

.btr-popup-content__embed:first-child {
	margin-top: 0;
}


/*
 * Prevent common embeds from exceeding popup width.
 */
.btr-popup-content__embed iframe {
	display: block;

	width: 100%;
	max-width: 100%;

	border: 0;
}


/* =========================================================
   CLOSE BUTTON
   ========================================================= */

.btr-popup-modal__close {
	position: absolute;

	top: 18px;
	right: 18px;

	z-index: 20;

	display: flex;
	align-items: center;
	justify-content: center;

	width: 44px;
	height: 44px;

	padding: 0;

	border: 0;
	border-radius: 50%;

	background: rgba(17, 24, 39, 0.07);

	color: #111827;

	font-family: Arial, Helvetica, sans-serif;
	font-size: 30px;
	font-weight: 300;
	line-height: 1;

	cursor: pointer;

	transition:
		background 0.2s ease,
		transform 0.2s ease;
}

.btr-popup-modal__close:hover {
	background: rgba(17, 24, 39, 0.13);

	transform: rotate(4deg);
}

.btr-popup-modal__close:focus-visible {
	outline: 3px solid rgba(17, 24, 39, 0.25);
	outline-offset: 3px;
}


/* =========================================================
   LOADING STATE
   ========================================================= */

.btr-popup-modal__loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;

	min-height: 260px;

	padding: 50px;

	gap: 16px;

	font-size: 15px;

	color: #4b5563;
}


/* =========================================================
   LOADING SPINNER
   ========================================================= */

.btr-popup-modal__spinner {
	display: block;

	width: 40px;
	height: 40px;

	border: 4px solid rgba(17, 24, 39, 0.12);
	border-top-color: #111827;

	border-radius: 50%;

	animation:
		btr-popup-spinner 0.8s linear infinite;
}

@keyframes btr-popup-spinner {

	to {
		transform: rotate(360deg);
	}

}


/* =========================================================
   ERROR
   ========================================================= */

.btr-popup-modal__error {
	display: flex;
	align-items: center;
	justify-content: center;

	min-height: 220px;

	padding: 40px;

	text-align: center;

	color: #991b1b;
}


/* =========================================================
   SCREEN READER TEXT
   ========================================================= */

.btr-popup-modal .screen-reader-text {
	position: absolute !important;

	width: 1px;
	height: 1px;

	padding: 0;
	margin: -1px;

	overflow: hidden;

	clip: rect(0, 0, 0, 0);

	white-space: nowrap;

	border: 0;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

	.btr-popup-modal {
		padding: 20px;
	}

	.btr-popup-modal__dialog {
		max-height: calc(100vh - 40px);
	}

	.btr-popup-content {
		padding:
			32px
			30px
			35px;
	}

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

	.btr-popup-modal {
		align-items: center;

		padding: 10px;
	}


	.btr-popup-modal__dialog {
		width: 100%;

		max-width: none;

		max-height: calc(100vh - 20px);

		border-radius: 14px;
	}


	.btr-popup-content {
		padding:
			28px
			20px
			25px;
	}


	.btr-popup-content__header {
		margin:
			0
			45px
			20px
			0;
	}


	.btr-popup-content__title {
		font-size: 26px;
	}


	.btr-popup-modal__close {
		top: 12px;
		right: 12px;

		width: 40px;
		height: 40px;

		font-size: 27px;
	}


	.btr-popup-modal__loading {
		min-height: 220px;

		padding: 30px;
	}

}
/* =========================================================
   POPUP TRIGGER BUTTONS
   =========================================================
 *
 * Reusable BTR Hub button styles for popup shortcode links.
 *
 * Author: Emanuel Mandat
 * Company: Zuri IT
 * Modified: 10 September 2026
 */


/* ---------------------------------------------------------
   Shared button structure
   --------------------------------------------------------- */

.btr-popup-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;

	min-height: 56px;

	padding: 14px 38px;

	border: 2px solid transparent;
	border-radius: 12px;

	font-size: 17px;
	font-weight: 600;
	line-height: 1.2;

	text-decoration: none !important;

	cursor: pointer;

	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease,
		background-color 0.2s ease,
		border-color 0.2s ease;
}


/* Arrow */
.btr-popup-button::after {
	content: "→";

	display: inline-block;

	font-size: 20px;
	font-weight: 400;

	transition: transform 0.2s ease;
}


/* Arrow movement */
.btr-popup-button:hover::after {
	transform: translateX(4px);
}


/* ---------------------------------------------------------
   Purple Filled
   Similar to: Explore Training
   --------------------------------------------------------- */

.btr-popup-button--primary {
	background: #45247a;
	border-color: #45247a;

	color: #ffffff !important;

	box-shadow:
		0 12px 25px rgba(69, 36, 122, 0.20);
}


.btr-popup-button--primary:hover {
	background: #382064;
	border-color: #382064;

	color: #ffffff !important;

	transform: translateY(-2px);

	box-shadow:
		0 16px 30px rgba(69, 36, 122, 0.28);
}


/* ---------------------------------------------------------
   Purple Outline
   Similar to: Recruitment Services
   --------------------------------------------------------- */

.btr-popup-button--outline {
	background: transparent;

	border-color: #45247a;

	color: #45247a !important;
}


.btr-popup-button--outline:hover {
	background: #45247a;

	color: #ffffff !important;

	transform: translateY(-2px);
}


/* ---------------------------------------------------------
   White Filled
   Similar to: Contact Us on purple background
   --------------------------------------------------------- */

.btr-popup-button--light {
	background: #ffffff;

	border-color: #ffffff;

	color: #45247a !important;
}


.btr-popup-button--light:hover {
	background: #f5f1f8;

	border-color: #f5f1f8;

	color: #45247a !important;

	transform: translateY(-2px);
}


/* ---------------------------------------------------------
   White Outline
   Similar to: Book Consultation
   --------------------------------------------------------- */

.btr-popup-button--outline-light {
	background: transparent;

	border-color: rgba(255, 255, 255, 0.9);

	color: #ffffff !important;
}


.btr-popup-button--outline-light:hover {
	background: #ffffff;

	border-color: #ffffff;

	color: #45247a !important;

	transform: translateY(-2px);
}


/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */

@media (max-width: 600px) {

	.btr-popup-button {
		min-height: 52px;

		padding: 13px 28px;

		font-size: 16px;
	}

}