/* --- Modal --- */

.swtor-modal__backdrop {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.swtor-modal {
	position: relative;
	background-color: var(--wp--preset--color--modal-bg);
	background-clip: padding-box;
	max-width: 500px;
	width: 90%;
	text-align: center;
}

/* Ornate border — used for consent/content modals */
.swtor-modal--bordered {
	border-width: 20px;
	border-style: solid;
	border-image: url('../images/common/modal-border.png') 20 20 20 20 stretch;
}

/* Fixed-width variant for content designed at a set size, e.g. the two-column download
   panel. Overrides the base width: 90% so the modal does not scale with the viewport,
   matching the fixed-width layout used across the rest of the site. */
.swtor-modal--wide {
	width: 1060px;
	max-width: none;
}

/* Video/lightbox border — used for media image lightbox */
.swtor-modal--lightbox {
	background: transparent;
	background-clip: unset;
	border: none;
	max-width: none;
	width: auto;
	padding: 0;
}

.swtor-modal__close {
	position: absolute;
	top: 0px;
	right: 0px;
	width: 30px;
	height: 30px;
	background: none;
	border: none;
	color: var(--wp--preset--color--gold);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.7;
}

.swtor-modal--lightbox .swtor-modal__close {
	background: rgba(0, 0, 0, 0.6);
	top: 10px;
	right: 10px;
}

/* Modal YouTube player — gold frame around a 16:9 iframe */
.yt-modal__frame {
	position: relative;
	width: min(90vw, 1100px);
	aspect-ratio: 16 / 9;
	border-width: 7px 5px;
	border-style: solid;
	border-image: url('../images/video/video-border.png') 7 5 7 5 stretch;
	padding: 2px;
	background: #000 content-box;
}

/* Inside the frame's 2px padding, the same gap as the lightbox. */
.yt-modal__iframe {
	position: absolute;
	top: 2px;
	left: 2px;
	width: calc(100% - 4px);
	height: calc(100% - 4px);
	display: block;
}

.swtor-modal__close:hover,
.swtor-modal__close:focus {
	opacity: 1;
}

.swtor-modal h3 {
	color: var(--wp--preset--color--gold);
	font: 700 20px/1.2 var(--wp--preset--font-family--news-gothic);
	margin: 0 0 15px;
}

.swtor-modal p {
	color: var(--wp--preset--color--text, #fff);
	margin: 10px;
	line-height: 1.5;
	font-size: 14px;
	text-align: left;
	font: 400 14px/20px var(--wp--preset--font-family--system-sans);
}

.swtor-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	justify-content: center;
	margin-top: 20px;
	margin-bottom: 10px;
}

/* --- Lightbox --- */

.swtor-lightbox__frame {
	border-width: 7px 5px;
	border-style: solid;
	border-image: url('../images/video/video-border.png') 7 5 7 5 stretch;
	position: relative;
	display: inline-block;
	padding: 2px;
	line-height: 0;
}

.swtor-lightbox__image {
	max-width: 90vw;
	max-height: 80vh;
	width: auto;
	height: auto;
	display: block;
}

/* Over the bottom of the image, so a long caption wraps rather than widening the lightbox. With .swtor-modal so it
   takes priority over the .swtor-modal p rule above. */
.swtor-modal .swtor-lightbox__caption {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	margin: 0;
	padding: 2px 20px;
	background-color: var(--wp--preset--color--caption-overlay);
	font: 400 14px/24px var(--wp--preset--font-family--roboto);
	text-align: center;
	text-shadow: 0 1px 2px var(--wp--preset--color--base-dark);
	color: var(--wp--preset--color--heading);
}
