/*
 * Hurlyvale Primary newsletters (hvnl-). Brand: primary #00B8E6, accent #4CDBFF, black #000, ink #080A12, white.
 * Own prefixed classes only; nothing here targets theme selectors.
 */

.hvnl,
.hvnl-modal {
	--hvnl-primary: #00B8E6;
	--hvnl-accent: #4CDBFF;
	--hvnl-ink: #080A12;
	--hvnl-black: #000;
	--hvnl-white: #fff;
	--hvnl-primary-text: #00667f; /* primary, darkened for text on white (AA) */
	--hvnl-font: Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-family: var(--hvnl-font);
}

/* ---------- Cards ---------- */

.hvnl {
	box-sizing: border-box;
	max-width: 1040px;
	margin: 2.5rem auto;
	padding: 0 16px;
	color: var(--hvnl-ink);
}

.hvnl *,
.hvnl *::before,
.hvnl *::after {
	box-sizing: border-box;
}

.hvnl__head {
	text-align: center;
	margin-bottom: 1.75rem;
}

.hvnl__eyebrow {
	display: inline-block;
	margin: 0 0 .6rem;
	padding: .35rem .85rem;
	border-radius: 999px;
	background: rgba(0, 184, 230, .12);
	color: var(--hvnl-primary-text);
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.hvnl__title {
	margin: 0 0 .5rem;
	font-family: var(--hvnl-font);
	font-size: clamp(1.4rem, 1.07vi + 1.16rem, 2.44rem);
	line-height: 1.15;
	font-weight: 700;
	color: var(--hvnl-ink);
}

.hvnl__lede {
	margin: 0 auto;
	max-width: 36rem;
	font-size: 1rem;
	line-height: 1.6;
	color: rgba(8, 10, 18, .75);
}

.hvnl__note {
	margin: 1.25rem 0 0;
	text-align: center;
	font-size: .95rem;
}

.hvnl__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 720px) {
	.hvnl__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 32px;
	}
}

.hvnl__item {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
}

.hvnl-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow: hidden;
	border-radius: 22px;
	background: var(--hvnl-white);
	box-shadow: 0 1px 2px rgba(8, 10, 18, .06), 0 14px 36px rgba(8, 10, 18, .12);
	transition: transform .25s ease, box-shadow .25s ease;
}

@media (hover: hover) {
	.hvnl-card:hover {
		transform: translateY(-4px);
		box-shadow: 0 2px 4px rgba(8, 10, 18, .08), 0 22px 48px rgba(0, 184, 230, .22);
	}
}

.hvnl .hvnl-card__open {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	color: inherit;
	text-decoration: none;
	box-shadow: none;
	border: 0;
	outline: 0;
	background: none;
}

.hvnl-card__cover {
	position: relative;
	display: flex;
	justify-content: center;
	padding: 34px 28px 0;
	background: linear-gradient(165deg, #dff7fd 0%, #f4fcfe 55%, #fff 100%);
}

.hvnl-card__img,
.hvnl-card__canvas {
	display: block;
	width: min(100%, 340px);
	height: auto;
	aspect-ratio: 595 / 842;
	object-fit: cover;
	border-radius: 6px 6px 0 0;
	background: #fff;
	box-shadow: 0 -2px 0 rgba(255, 255, 255, .6), 0 16px 38px rgba(8, 10, 18, .28);
	transition: transform .3s ease;
}

@media (hover: hover) {
	.hvnl-card:hover .hvnl-card__img,
	.hvnl-card:hover .hvnl-card__canvas {
		transform: translateY(-6px);
	}
}

.hvnl-card__badge {
	position: absolute;
	left: 50%;
	bottom: 18px;
	transform: translateX(-50%);
	padding: .55rem 1.1rem;
	border-radius: 999px;
	background: var(--hvnl-primary);
	color: var(--hvnl-ink);
	font-size: .85rem;
	font-weight: 700;
	letter-spacing: .02em;
	white-space: nowrap;
	box-shadow: 0 8px 18px rgba(0, 184, 230, .45);
}

.hvnl-card__body {
	display: flex;
	flex-direction: column;
	gap: .2rem;
	padding: 22px 26px 12px;
}

.hvnl-card__kicker {
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--hvnl-primary-text);
}

.hvnl-card__name {
	font-size: clamp(1.25rem, 0.73vi + 1.08rem, 1.95rem);
	line-height: 1.15;
	font-weight: 700;
	color: var(--hvnl-ink);
}

.hvnl-card__meta {
	font-size: .92rem;
	color: rgba(8, 10, 18, .7);
}

.hvnl .hvnl-card__dl {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	margin: 6px 26px 24px;
	min-height: 46px;
	padding: .6rem 1.1rem;
	border: 2px solid var(--hvnl-ink);
	border-radius: 12px;
	background: transparent;
	color: var(--hvnl-ink);
	font-family: var(--hvnl-font);
	font-size: .95rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	box-shadow: none;
	transition: background .2s ease, color .2s ease;
}

.hvnl .hvnl-card__dl:hover {
	background: var(--hvnl-ink);
	color: var(--hvnl-white);
}

.hvnl-card__size {
	font-weight: 500;
	opacity: .8;
}

.hvnl .hvnl-card__open:focus-visible,
.hvnl .hvnl-card__dl:focus-visible {
	outline: 3px solid var(--hvnl-ink);
	outline-offset: 3px;
	border-radius: 12px;
}

/* ---------- Full-screen modal (both views) ---------- */

html.hvnl-lock,
html.hvnl-lock body {
	overflow: hidden !important;
}

.hvnl-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	background: #0c121b;
	color: var(--hvnl-white);
	line-height: 1.3;
	text-align: left;
}

.hvnl-modal *,
.hvnl-modal *::before,
.hvnl-modal *::after {
	box-sizing: border-box;
}

.hvnl-modal:focus {
	outline: 0;
}

.hvnl-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.hvnl-modal__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	padding: 10px 14px;
	background: var(--hvnl-black);
	border-bottom: 3px solid var(--hvnl-primary);
}

.hvnl-modal__id {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1 1 180px;
}

.hvnl-modal__title {
	font-size: 1.05rem;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.hvnl-modal__status {
	font-size: .8rem;
	color: var(--hvnl-accent);
	font-variant-numeric: tabular-nums;
}

.hvnl-modal__tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.hvnl-modal .hvnl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .45rem;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0 .85rem;
	border: 1px solid rgba(255, 255, 255, .32);
	border-radius: 12px;
	background: rgba(255, 255, 255, .06);
	color: var(--hvnl-white);
	font-family: var(--hvnl-font);
	font-size: .9rem;
	font-weight: 600;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	box-shadow: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background .15s ease, border-color .15s ease;
}

.hvnl-modal .hvnl-btn:hover:not([disabled]) {
	background: rgba(255, 255, 255, .18);
	border-color: var(--hvnl-accent);
	color: var(--hvnl-white);
}

.hvnl-modal .hvnl-btn[disabled] {
	opacity: .35;
	cursor: default;
}

.hvnl-modal .hvnl-btn--primary {
	background: var(--hvnl-primary);
	border-color: var(--hvnl-primary);
	color: var(--hvnl-ink);
	font-weight: 700;
}

.hvnl-modal .hvnl-btn--primary:hover:not([disabled]) {
	background: var(--hvnl-accent);
	border-color: var(--hvnl-accent);
	color: var(--hvnl-ink);
}

.hvnl-modal .hvnl-btn:focus-visible,
.hvnl-modal__reader:focus-visible {
	outline: 3px solid var(--hvnl-accent);
	outline-offset: 2px;
}

.hvnl-modal__zoom {
	min-width: 3.4em;
	text-align: center;
	font-size: .85rem;
	font-variant-numeric: tabular-nums;
	color: rgba(255, 255, 255, .85);
}

.hvnl-modal__group {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.hvnl-modal__sep {
	width: 1px;
	height: 26px;
	background: rgba(255, 255, 255, .22);
	margin: 0 2px;
}

.hvnl-modal__stage {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
}

.hvnl-modal__msg {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	text-align: center;
	font-size: 1rem;
	color: rgba(255, 255, 255, .9);
	pointer-events: none;
}

.hvnl-modal__msg[hidden] {
	display: none;
}

/* ---------- Reader view ---------- */

.hvnl-modal__reader {
	position: absolute;
	inset: 0;
	overflow: auto;
	background: #1a2330;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x pan-y pinch-zoom;
}

.hvnl-pages {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	width: max-content;
	min-width: 100%;
	padding: 16px 12px 40px;
}

.hvnl-page {
	position: relative;
	flex: 0 0 auto;
	background: var(--hvnl-white);
	box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
}

.hvnl-page canvas {
	display: block;
	width: 100%;
	height: 100%;
}

.hvnl-page__label {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(8, 10, 18, .55);
	font-size: .9rem;
	font-weight: 600;
}

.hvnl-page.is-ready .hvnl-page__label {
	display: none;
}

/* ---------- Flip view ---------- */

.hvnl-modal__flipwrap {
	position: absolute;
	inset: 0;
	padding: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: radial-gradient(circle at 50% 40%, #243044 0%, #0c121b 70%);
}

.hvnl-flip {
	width: 100%;
	height: 100%;
}

.hvnl-fpage {
	background: var(--hvnl-white);
	overflow: hidden;
}

.hvnl-fpage canvas {
	display: block;
	width: 100%;
	height: 100%;
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
	.hvnl-modal__bar {
		padding: 8px 10px;
	}

	.hvnl-modal__tools {
		width: 100%;
		justify-content: space-between;
	}

	.hvnl-modal__sep,
	.hvnl-modal__zoom {
		display: none;
	}

	.hvnl-modal .hvnl-btn--hide-sm {
		display: none;
	}

	.hvnl-card__cover {
		padding: 30px 20px 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hvnl-card,
	.hvnl-card__img,
	.hvnl-card__canvas,
	.hvnl-modal .hvnl-btn {
		transition: none;
	}
}
