.page-popup {
	position: fixed;
	inset: 0;
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.25s ease,
		visibility 0.25s ease;
}

.page-popup.is-active {
	opacity: 1;
	visibility: visible;
}

.page-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
}

.page-popup__dialog {
	position: relative;
	z-index: 1;
	width: min(1120px, calc(100vw - 40px));
	max-height: 90vh;
	margin: 5vh auto;
	background: #fff;
	border-radius: 8px;
	overflow-x: hidden;
	overflow-y: auto;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	transform: translateY(20px);
	opacity: 0;
	transition:
		transform 0.25s ease,
		opacity 0.25s ease;
}

.page-popup.is-active .page-popup__dialog {
	transform: translateY(0);
	opacity: 1;
}

.page-popup__inner {
	padding: 40px;
}

.page-popup__close {
	position: sticky;
	top: 0;
	left: 100%;
	z-index: 2;
	display: block;
	width: 48px;
	height: 48px;
	margin-left: auto;
	border: none;
	background: #222;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.page-popup__close:hover,
.page-popup__close:focus {
	background: #000;
}

.page-popup__title {
	margin: 0 0 24px;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.4;
}

.page-popup__content {
	max-width: 100%;
	overflow-wrap: break-word;
	word-break: normal;
}

.page-popup__content > *:first-child {
	margin-top: 0;
}

.page-popup__content > *:last-child {
	margin-bottom: 0;
}

.page-popup__content p {
	line-height: 1.9;
}

.page-popup__content h2,
.page-popup__content h3,
.page-popup__content h4 {
	line-height: 1.5;
}

.page-popup__content a {
	word-break: break-all;
}

.page-popup__content img {
	display: block;
	max-width: 100%;
	height: auto;
	margin-left: auto;
	margin-right: auto;
}

.page-popup__content figure,
.page-popup__content .wp-block-image {
	max-width: 100%;
}

.page-popup__content figcaption {
	margin-top: 0.5em;
	font-size: 0.9em;
	text-align: center;
}

.page-popup__content table {
	width: 100%;
	max-width: 100%;
	border-collapse: collapse;
}

.page-popup__content th,
.page-popup__content td {
	padding: 10px;
	border: 1px solid #ddd;
	word-break: break-word;
	overflow-wrap: break-word;
}

.page-popup__content .wp-block-table {
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.page-popup__content .wp-block-table table {
	min-width: 640px;
}

.page-popup__content iframe {
	display: block;
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
}

.page-popup__content .wp-block-embed,
.page-popup__content .wp-block-embed__wrapper {
	max-width: 100%;
}

.page-popup__content .wp-block-embed__wrapper {
	position: relative;
	aspect-ratio: 16 / 9;
}

.page-popup__content .wp-block-embed__wrapper iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.page-popup__content iframe[src*="youtube.com"],
.page-popup__content iframe[src*="youtu.be"] {
	width: 100%;
	height: 100%;
}

.page-popup__loading {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 240px;
}

.page-popup__loading::before {
	content: "";
	width: 40px;
	height: 40px;
	border: 4px solid #ddd;
	border-top-color: #333;
	border-radius: 50%;
	animation: popupSpin 0.8s linear infinite;
}

.page-popup__error {
	padding: 40px;
	text-align: center;
}

body.page-popup-open {
	overflow: hidden;
}

@keyframes popupSpin {
	to {
		transform: rotate(360deg);
	}
}

@media (max-width: 575.98px) {
	.page-popup__dialog {
		width: calc(100vw - 24px);
		max-height: 92vh;
		margin: 4vh auto;
		border-radius: 6px;
	}

	.page-popup__inner {
		padding: 24px 18px 28px;
	}

	.page-popup__close {
		width: 44px;
		height: 44px;
		font-size: 26px;
	}

	.page-popup__title {
		font-size: 22px;
	}

	.page-popup__content p {
		line-height: 1.8;
	}

	.page-popup__content .wp-block-table table {
		min-width: 560px;
	}

	.page-popup__content figcaption {
		font-size: 0.85em;
	}

	.page-popup__loading {
		min-height: 180px;
	}
}

@media screen and (max-width: 767px) {

.pop-table table,
.pop-table tbody,
.pop-table tr,
.pop-table th,
.pop-table td {
    display: block;
    width: 100%;
}

.pop-table tr {
    margin-bottom: 1rem;
    border: 1px solid #d9e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.pop-table th {
    width: 100%;
    padding: 0.75rem 1rem;
    margin: 0;
    border: none;
    background: #e2f4ff;
    font-weight: 700;
}

.pop-table td {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: #fff;
}
}