/* Subscribe popup (inc/subscribe-popup.php). 2026-12-05.
   The <dialog> fills the viewport and is transparent; the visible thing is .jk-sp__card. That
   way a click anywhere outside the card lands on the dialog itself and closes it.
   Motion: in 220 ms, out 160 ms, a short rise plus a fade. Slower reads as lag, a bare fade
   reads as a flash. On phones the card is a sheet that comes up from the bottom edge. */

.jk-sp {
	position: fixed; inset: 0;
	width: 100%; height: 100%; max-width: none; max-height: none;
	margin: 0; padding: 24px; border: 0;
	background: transparent; color: var(--jk-ink, #111);
	overflow: auto; overscroll-behavior: contain;
}
.jk-sp[open] { display: flex; align-items: center; justify-content: center; }
.jk-sp::backdrop {
	background: rgba(17, 17, 17, .5);
	/* Blur, not just a darker tint: the page behind stops competing with the card, which is
	   what made the card sink into busy photo grids. 6px reads as "behind glass", more turns
	   the page into mush. */
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

.jk-sp__card {
	position: relative; box-sizing: border-box;
	width: 100%; max-width: 460px; max-height: calc(100dvh - 48px); overflow: auto;
	padding: 32px 36px;
	background: var(--jk-tile, #fff);
	border-radius: var(--jk-r-panel, 20px);
	box-shadow: 0 24px 64px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .06);
}

/* Eyebrow and close button share one row: the button's right edge is the form's right edge
   and its centre sits on the eyebrow line, instead of floating in the card's corner. */
.jk-sp__card:focus { outline: none; }

.jk-sp__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.jk-sp__eb {
	margin: 0;
	font-family: var(--jk-font-mono, ui-monospace, monospace);
	font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
	color: var(--jk-muted, #6A6A6A);
}
.jk-sp__x {
	flex: none; display: grid; place-items: center;
	width: 40px; height: 40px; margin: -4px 0; padding: 0;
	border: 0; border-radius: var(--jk-r-pill, 999px); cursor: pointer;
	background: var(--jk-nm-face, #F5F6F8); color: var(--jk-ink, #111);
	box-shadow: var(--jk-nm-raise, 0 1px 2px rgba(0, 0, 0, .12));
	transition: box-shadow .12s ease;
}
.jk-sp__x:hover { box-shadow: var(--jk-nm-raise-hover, 0 2px 6px rgba(0, 0, 0, .14)); }
.jk-sp__x svg { display: block; }

.jk-sp__h { margin: 0 0 12px; font-family: var(--jk-font-head, Figtree, sans-serif); font-size: 30px; line-height: 1.15; font-weight: 400; color: inherit; }
.jk-sp__h strong { font-weight: 700; }
.jk-sp__p { margin: 0 0 24px; font-size: 16px; line-height: 1.6; color: #3A3A3A; }
.jk-sp .jk-news__msg { margin: 12px 0 0; }
.jk-sp__note { margin: 12px 0 0; font-size: 14px; color: var(--jk-muted, #6A6A6A); }

/* Page behind does not scroll while open. The gutter keeps the page from shifting sideways
   when the scrollbar goes away on desktop. */
html.jk-sp-lock { overflow: hidden; scrollbar-gutter: stable; }
html.jk-sp-lock #jk-scroll-top,
html.jk-sp-lock .crisp-client { display: none !important; }

/* Motion */
@keyframes jk-sp-in   { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes jk-sp-out  { to   { opacity: 0; transform: translateY(6px) scale(.99); } }
@keyframes jk-sp-fade-in  { from { opacity: 0; } }
@keyframes jk-sp-fade-out { to   { opacity: 0; } }
.jk-sp[open] .jk-sp__card { animation: jk-sp-in .22s cubic-bezier(.2, .8, .2, 1) both; }
.jk-sp[open]::backdrop    { animation: jk-sp-fade-in .2s ease both; }
.jk-sp.is-closing .jk-sp__card { animation: jk-sp-out .16s ease-in both; }
.jk-sp.is-closing::backdrop    { animation: jk-sp-fade-out .16s ease-in both; }

/* Phones, and a folding phone while it is closed: a sheet from the bottom, kept 16px off both
   sides and off the bottom (more if the phone has a home bar), so it never touches the glass.
   599 and not 767: an opened fold (~673-720) and an iPad mini (744) get the centred card, which
   is what a screen that wide looks right with. */
@media (max-width: 599px) {
	.jk-sp { padding: 16px 16px max(16px, env(safe-area-inset-bottom)); }
	.jk-sp[open] { align-items: flex-end; }
	.jk-sp__card { max-width: none; max-height: calc(100dvh - 32px); padding: 24px 20px 22px; }
	.jk-sp__h { font-size: 26px; }
	.jk-sp__p { margin-bottom: 20px; }
	@keyframes jk-sp-up   { from { opacity: 0; transform: translateY(28px); } }
	@keyframes jk-sp-down { to   { opacity: 0; transform: translateY(20px); } }
	.jk-sp[open] .jk-sp__card { animation: jk-sp-up .26s cubic-bezier(.2, .8, .2, 1) both; }
	.jk-sp.is-closing .jk-sp__card { animation: jk-sp-down .16s ease-in both; }
}

@media (prefers-reduced-motion: reduce) {
	.jk-sp[open] .jk-sp__card { animation: jk-sp-fade-in .12s ease both; }
	.jk-sp.is-closing .jk-sp__card { animation: none; }
}

/* Footer: the newsletter column keeps its heading and line, the form became this button. */
.jk-foot__news .jk-sp-open { margin: 0; }
