/**
 * PF CV Modal — the dialog the header CV button opens.
 *
 * Glass is the shared `.pf-glass` rules from pf-glass.css: this file only sets
 * the layout, the colour and the motion, and the panel takes its blur from the
 * two custom properties the PHP prints inline. The one thing this dialog has
 * that the Contact one does not is a document inside it — a PDF the browser
 * paints itself, on its own white, which is why the panel is a frame around a
 * page rather than a surface carrying text.
 */

.pf-cv-modal[hidden] {
	display: none;
}

.pf-cv-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.pf-cv-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 18, 26, 0.72);
	animation: pf-cv-modal-fade 0.18s ease-out;
}

.pf-cv-modal-panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(var(--pf-cv-modal-width, 1000px), 100%);
	height: var(--pf-cv-modal-height, 88vh);
	max-height: 100%;
	padding: 10px;
	overflow: hidden;
	background: #1e1a24;
	border: 1px solid rgba(245, 243, 247, 0.12);
	border-radius: var(--pf-cv-modal-radius, 20px);
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
	animation: pf-cv-modal-rise 0.2s cubic-bezier(0.2, 0.8, 0.3, 1);
}

/* The glass toggle replaces the flat surface above with the shared tint —
   see pf-glass.md. Without it the panel stays the solid plum surface. */
.pf-cv-modal-panel.pf-glass {
	border-color: rgba(245, 243, 247, 0.12);
}

/* ---------- the bar ------------------------------------------------------ */

.pf-cv-modal-bar {
	position: relative;
	z-index: 1;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 16px;
	padding: 2px 2px 10px 10px;
}

.pf-cv-modal-title {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	color: #f5f3f7;
	font-family: var(--global-heading-font-family);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pf-cv-modal-newtab {
	flex: 0 0 auto;
	color: #8a8394;
	font-size: 12px;
	text-decoration: none;
	transition: color 0.15s ease;
}

.pf-cv-modal-newtab:hover,
.pf-cv-modal-newtab:focus-visible {
	color: #b07bd8;
}

.pf-cv-modal-close {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	color: #8a8394;
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.pf-cv-modal-close:hover,
.pf-cv-modal-close:focus-visible {
	color: #b07bd8;
	background: rgba(245, 243, 247, 0.1);
}

.pf-cv-modal-newtab:focus-visible,
.pf-cv-modal-close:focus-visible {
	outline: 2px solid #c8a2e8;
	outline-offset: 2px;
}

/* ---------- the document ------------------------------------------------- */

/* The reader's own corner is the panel's, less the 10 px it is inset by — an
   inner radius that ignored the inset would read as a second, wrong corner. */
.pf-cv-modal-frame {
	position: relative;
	z-index: 1;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
	background: rgba(245, 243, 247, 0.06);
	border-radius: max(0px, calc(var(--pf-cv-modal-radius, 20px) - 10px));
}

.pf-cv-modal-doc {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

/* The scroll lock the script puts on the body while the dialog is open. */
.pf-cv-modal-open {
	overflow: hidden;
}

/* A phone only reaches this if the popup was switched on for phones as well.
   There is no room there for a margin around a document — it takes the screen. */
@media (max-width: 767px) {
	.pf-cv-modal {
		padding: 12px;
	}

	.pf-cv-modal-panel {
		height: 100%;
	}
}

@keyframes pf-cv-modal-fade {
	from {
		opacity: 0;
	}
}

@keyframes pf-cv-modal-rise {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.97);
	}
}

@media (prefers-reduced-motion: reduce) {
	.pf-cv-modal-backdrop,
	.pf-cv-modal-panel {
		animation: none;
	}
}
