/* =============================================================
   Pulsar Newsletter Archive — Frontend Modal
   Loaded on pages that use [pulsar_news]. Renders newsletter
   content inside an iframe (?embed=1 endpoint) without leaving
   the news page.
   ============================================================= */

/* --- Backdrop ------------------------------------------------- */
.pna-modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(12, 11, 8, 0.78);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease, visibility 0s linear .25s;
}
.pna-modal-backdrop.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity .25s ease, visibility 0s linear 0s;
}

/* --- Modal shell ---------------------------------------------- */
.pna-modal {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -45%);
	width: min(92vw, 1000px);
	height: min(90vh, 1400px);
	z-index: 100001;
	background: #141410;
	border: 1px solid rgba(255,255,255,.10);
	border-radius: 14px;
	box-shadow: 0 24px 64px rgba(0,0,0,.6);
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.pna-modal.is-open {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, -50%);
	transition: opacity .25s ease, transform .25s ease, visibility 0s linear 0s;
}

@media (max-width: 720px) {
	.pna-modal {
		width: 100vw;
		height: 100vh;
		max-height: 100vh;
		border-radius: 0;
		border: 0;
	}
}

/* --- Header (title + close) ----------------------------------- */
.pna-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 22px;
	border-bottom: 1px solid rgba(255,255,255,.08);
	background: linear-gradient(180deg, #1f1c17 0%, #141410 100%);
	flex-shrink: 0;
}
.pna-modal-title-block {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	flex: 1;
}
.pna-modal-eyebrow {
	font-family: 'DM Mono', ui-monospace, monospace;
	font-size: 10px;
	letter-spacing: 0.25em;
	text-transform: uppercase;
	color: #c4a24a;
	margin: 0;
}
.pna-modal-title {
	font-family: 'Oswald', 'Inter', sans-serif;
	font-weight: 500;
	font-size: clamp(16px, 2vw, 20px);
	letter-spacing: 0.005em;
	color: #f0ece4;
	margin: 0;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.pna-modal-date {
	display: block;
	font-family: 'DM Mono', ui-monospace, monospace;
	font-size: 10px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: rgba(240, 236, 228, 0.55);
	margin-top: 4px;
}
.pna-modal-date:empty {
	display: none;
}

.pna-modal-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}
.pna-modal-link {
	font-family: 'DM Mono', ui-monospace, monospace;
	font-size: 11px;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: #d4cfc4;
	text-decoration: none;
	padding: 6px 10px;
	border-radius: 6px;
	border: 1px solid transparent;
	transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.pna-modal-link:hover {
	color: #c4a24a;
	border-color: rgba(196,162,74,.30);
	background: rgba(196,162,74,.05);
}
@media (max-width: 540px) {
	.pna-modal-link { display: none; }
}

.pna-modal-close {
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: 1px solid rgba(255,255,255,.18) !important;
	border-radius: 8px !important;
	width: 36px !important;
	height: 36px !important;
	min-width: 36px !important;
	min-height: 36px !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	color: #f0ece4 !important;
	cursor: pointer !important;
	transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
	padding: 0 !important;
	margin: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	font-family: inherit !important;
	line-height: 1 !important;
}
.pna-modal-close:hover,
.pna-modal-close:active {
	background: rgba(255,255,255,.06) !important;
	background-color: rgba(255,255,255,.06) !important;
	border-color: rgba(255,255,255,.35) !important;
	color: #f0ece4 !important;
}
.pna-modal-close:focus-visible {
	border-color: #c4a24a !important;
	box-shadow: 0 0 0 3px rgba(196,162,74,.25) !important;
}
.pna-modal-close svg {
	width: 18px !important;
	height: 18px !important;
	display: block !important;
}

/* Also tame the "Open in full page" link against theme styles. */
.pna-modal-link {
	background: transparent !important;
}
.pna-modal-link:focus-visible {
	outline: none !important;
	color: #c4a24a !important;
	border-color: #c4a24a !important;
	box-shadow: 0 0 0 3px rgba(196,162,74,.20) !important;
}

/* --- Body (iframe area) --------------------------------------- */
.pna-modal-body {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	background: #141410;
	position: relative;
}
.pna-modal-iframe {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 100%;
	border: 0;
	background: transparent;
}

/* --- Loading state -------------------------------------------- */
.pna-modal-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 14px;
	background: #141410;
	color: #8a857c;
	font-family: 'DM Mono', ui-monospace, monospace;
	font-size: 11px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	transition: opacity .25s ease;
}
.pna-modal-body.is-loaded .pna-modal-loading {
	opacity: 0;
	pointer-events: none;
}
.pna-modal-spinner {
	width: 26px;
	height: 26px;
	border: 2px solid rgba(196,162,74,.25);
	border-top-color: #c4a24a;
	border-radius: 50%;
	animation: pna-spin .9s linear infinite;
}
@keyframes pna-spin { to { transform: rotate(360deg); } }

/* --- Body scroll lock helper --------------------------------- */
body.pna-modal-open {
	overflow: hidden;
}
