/***********************************************************************
*  Modal / Lightbox (JS driven)
**********************************************************************/
.modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 9999;
	padding: 10px;
	background-color: rgba(0, 0, 0, 0.95);
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.modal.is-open {
	display: flex;
	align-items: center;
	justify-content: center;
}

.modal-content {
	position: relative;
	width: 92vw;
	height: 92vh;
	margin: 0 auto;
	display: flex;
	text-align: center;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

.doc-modal .modal-content {
	background: #0f1726;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	padding: 18px;
	align-items: stretch;
	justify-content: flex-start;
	gap: 12px;
}

.doc-modal__title {
	color: #f5f7ff;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	font-size: 12px;
	text-align: left;
}

.doc-modal__frame {
	width: 100%;
	flex: 1 1 auto;
	border: 0;
	border-radius: 8px;
	background: #0b0f1a;
}

@media (max-width: 720px) {
	.doc-modal {
		padding: 0;
	}

	.doc-modal .modal-content {
		width: 100vw;
		height: 100vh;
		border-radius: 0;
		padding: 12px;
	}

	.doc-modal__frame {
		border-radius: 6px;
	}
}

/***********************************************************************
*  Portfolio gallery modal
**********************************************************************/
.portfolio-modal .modal-content {
	background: #0f1726;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	padding: 18px;
	align-items: stretch;
	justify-content: flex-start;
	gap: 12px;
}

.portfolio-modal__close {
	position: absolute;
	top: 6px;
	right: 10px;
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 32px;
	cursor: pointer;
}

.portfolio-modal__header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding-right: 44px;
}

.portfolio-modal__title {
	color: #f5f7ff;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	font-size: 12px;
}

.portfolio-modal__meta {
	color: rgba(255, 255, 255, 0.6);
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.portfolio-modal__body {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.portfolio-modal__media {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	width: 100%;
}

.portfolio-modal__main {
	width: 100%;
	max-height: 65vh;
	object-fit: contain;
	border-radius: 8px;
	background: #0b0f1a;
	flex: 1 1 0;
	min-width: 0;
	max-width: 100%;
}

.portfolio-modal__nav {
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: rgba(15, 23, 38, 0.6);
	color: #fff;
	width: 36px;
	height: 36px;
	border-radius: 999px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	flex: 0 0 auto;
}

.portfolio-modal__nav:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.portfolio-modal__thumbs {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: center;
	overflow-x: auto;
}

.portfolio-modal__thumbs img {
	height: 64px;
	flex: 0 0 auto;
	opacity: 0.6;
	cursor: pointer;
	border-radius: 6px;
}

.portfolio-modal__thumbs img.is-active,
.portfolio-modal__thumbs img:hover {
	opacity: 1;
}

@media (max-width: 900px) {
	.portfolio-modal .modal-content {
		padding: 14px;
	}

	.portfolio-modal__close {
		top: 8px;
		right: 12px;
		font-size: 28px;
	}

	.portfolio-modal__header {
		padding-right: 40px;
	}

	.portfolio-modal__main {
		max-height: 55vh;
	}

	.portfolio-modal__nav {
		width: 32px;
		height: 32px;
		font-size: 16px;
	}

	.portfolio-modal__thumbs img {
		height: 56px;
	}
}

#lb-main-img {
	margin: 0;
	display: block;
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
	max-height: calc(92vh - 170px);
	object-fit: contain;
	margin: 0 auto;
}

.prev,
.next {
	cursor: pointer;
	position: absolute;
	top: 50%;
	padding: 18px;
	margin-top: -34px;
	color: #fff;
	font-weight: bold;
	font-size: 42px;
	user-select: none;
	text-decoration: none;
	transform: translateY(-50%);
}

.prev {
	left: 0;
}
.next {
	right: 0;
}

.prev:hover,
.close:hover,
.next:hover {
	background-color: rgba(0, 0, 0, 0.35);
	color: #999;
}

.numbertext {
	position: absolute;
	top: 0;
	left: 0;
	color: #f2f2f2;
	font-size: 18px;
}

.close {
	position: absolute;
	top: 0;
	right: 0;
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 44px;
	font-weight: bold;
	cursor: pointer;
}

.modal-nav {
	flex: 0 0 auto;
}

.caption-container {
	color: #fff;
	margin: 0 0 10px;
}

.lb-thumbs {
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.lb-thumbs img {
	height: 64px;
	flex: 0 0 auto;
	opacity: 0.6;
	cursor: pointer;
}

.lb-thumbs img.is-active,
.lb-thumbs img:hover {
	opacity: 1;
}

html.lb-lock,
body.lb-lock {
	overflow: hidden;
	height: 100%;
	touch-action: none;
}
