/*
 * Offer popup + minimized bar (port of knock-vi-web src/pages/_slug.vue).
 * Breakpoints match Knock: md = 980px, sm = 768px.
 * Selectors are prefixed with .kop and kept a notch more specific than the
 * Elementor kit / Hello theme resets (e.g. ".elementor-kit-N a:hover").
 */

.kop[hidden],
.kop [hidden] {
	display: none !important;
}

html.kop-open {
	overflow: hidden;
}

.kop {
	--kop-accent: #ffcb03;
	--kop-on-accent: #131212; /* text on accent-colored buttons (white is unreadable on yellow) */
	--kop-highlight: #ffcb03;
	--kop-left-bg: #1c1c1c;
	--kop-dark: #131212;
	--kop-light: #fff;
	--kop-muted: #606060;
	--kop-line: #ebe8e8;
}

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

/* Everything in the popup and minimized bar uses Syne. Form controls don't inherit
   fonts by default, and two classes outrank Elementor kit rules like ".elementor-kit-5 h2". */
.kop,
.kop .kop-box *,
.kop .kop-float *,
.kop .kop-form input::placeholder {
	font-family: "Syne", sans-serif;
}

/* ---- Overlay ------------------------------------------------------------ */

.kop .kop-overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgb(0 0 0 / 50%);
}

/* ---- Box ---------------------------------------------------------------- */

.kop .kop-box {
	position: relative;
	min-width: 280px;
	max-width: 960px;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	padding: 0;
	text-align: left;
	color: var(--kop-light);
	background: var(--kop-left-bg);
}

.kop .kop-close {
	position: absolute;
	top: 8px;
	right: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	cursor: pointer;
	touch-action: manipulation;
}

.kop .kop-close,
.kop .kop-close:hover,
.kop .kop-close:focus {
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: #d9d9d9; /* minus icon uses currentColor; sits on the dark columns */
}

.kop .kop-close:focus-visible {
	outline: 2px solid var(--kop-accent);
	outline-offset: -4px;
}

.kop .kop-columns {
	display: flex;
}

/* Mobile drag handle (the grey pill) */
.kop .kop-handle {
	display: none;
}

/* ---- Left column -------------------------------------------------------- */

/* Phone-only header pieces (see the sm breakpoint). */
.kop .kop-intro-image,
.kop .kop-mobile-name {
	display: none;
}

.kop .kop-left {
	flex: 0 0 620px;
	padding: 40px 0 0;
	background: var(--kop-left-bg);
}

.kop .kop-subtitle {
	display: block;
	margin: 0 0 28px 56px;
	font-size: 16px;
	line-height: 24px;
	font-weight: 500;
	text-transform: uppercase;
	color: var(--kop-highlight);
}

.kop .kop-title {
	margin: 0 56px 28px;
	padding: 0;
	font-size: 44px;
	line-height: 52px;
	font-weight: 700;
	text-transform: none;
	color: var(--kop-light);
}

/* Words wrapped in *asterisks* in the Title setting. */
.kop .kop-title .kop-highlight {
	color: var(--kop-highlight);
}

/* ---- Newsletter form (port of BlogForm.vue, minus the topic checkboxes) -- */

.kop .kop-form {
	position: relative;
	margin: 0 56px 40px;
	color: var(--kop-light);
}

.kop .kop-form-intro {
	margin: 0 0 28px;
	font-size: 18px;
	line-height: 28px;
	color: var(--kop-light);
}

/* Intro alone (no note under it) keeps the 28px gap above the email field. */
.kop .kop-form-intro:last-of-type {
	margin-bottom: 28px;
}

.kop .kop-form-note {
	margin: 0 0 28px;
	font-size: 16px;
	line-height: 24px;
	font-weight: 500;
	color: #9e9e9e;
}

/* Email field with the "Sign Me Up" button at its end; the underline spans both. */
.kop .kop-email-row {
	display: flex;
	align-items: center;
	margin: 0 0 20px;
}

.kop .kop-email-row:focus-within {
	border-bottom-color: var(--kop-accent);
	box-shadow: 0 1px 0 0 var(--kop-accent);
}

/* Extra specificity beats Elementor kit input styles. */
.kop .kop-form input.kop-email[type="email"] {
	flex: 1 1 auto;
	min-width: 0;
	width: auto;
	height: auto;
	margin: 0;
	padding: 12px 0 12px 16px;
	font-family: "Syne", sans-serif;
	font-size: 18px;
	line-height: 24px;
	color: var(--kop-light);
	background: #2E2E2E;
	    border: 2px solid #2E2E2E;
	border-radius: 0;
	box-shadow: none;
}

.kop .kop-form input.kop-email[type="email"]::placeholder {
	color: #d9d9d9;
	opacity: 1;
}

.kop .kop-form input.kop-email[type="email"]:focus {
	outline: none;
}

.kop .kop-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.kop .kop-consent {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 20px 0;
}

.kop .kop-consent input[type="checkbox"] {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	margin: 0;
	cursor: pointer;
	accent-color: var(--kop-accent);
	appearance: none;
    -webkit-appearance: none;
    background-color: transparent;
    border: 1.5px solid #ffffff;
	display: inline-grid;
	place-content: center;
}

.kop .kop-consent input[type="checkbox"]:checked {
  background-color: var(--kop-accent);
  border: 1.5px solid var(--kop-accent);
}

.kop .kop-consent input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em #0F0F0F;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.kop .kop-consent input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.kop .kop-consent label {
	margin: 0;
	font-size: 14px;
	line-height: 24px;
	font-weight: 400;
	color: #D9D9D9;
	cursor: pointer;
}

/* "No thanks": styled as a text link, minimizes the popup. */
.kop .kop-form .kop-no-thanks,
.kop .kop-form .kop-no-thanks:hover,
.kop .kop-form .kop-no-thanks:focus {
	display: inline-block;
	margin: 0;
	padding: 4px 0;
	font-size: 14px;
	line-height: 20px;
	font-weight: 500;
	text-transform: none;
	text-decoration: underline;
	text-underline-offset: 3px;
	color: #9e9e9e;
	background: none;
	border: none;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
}

.kop .kop-form .kop-no-thanks:hover {
	color: var(--kop-light);
}

.kop .kop-form .kop-no-thanks:focus-visible {
	outline: 2px solid var(--kop-accent);
	outline-offset: 2px;
}

.kop .kop-form-error {
	margin: 16px 0;
	font-size: 14px;
	line-height: 20px;
	color: #ff7b6b;
}

/* ---- Before / after sign-up ---------------------------------------------
   The script adds .kop-is-done to .kop after a successful sign-up. */

.kop .kop-when-done,
.kop.kop-is-done .kop-when-ready,
.kop:not(.kop-is-done) .kop-done-only,
.kop.kop-is-done .kop-form-note,
.kop.kop-is-done .kop-email-row,
.kop.kop-is-done .kop-consent,
.kop.kop-is-done .kop-form-error {
	display: none;
}

.kop.kop-is-done .kop-when-done {
	display: inline;
}

/* "View Episodes" button: yellow outline, transparent background; fills on hover. */
.kop .kop-form a.kop-done-btn {
	display: none;
	width: fit-content;
	margin: 0 0 20px;
	padding: 12px 24px;
	font-family: "Syne", sans-serif;
	font-size: 18px;
	line-height: 20px;
	font-weight: 700;
	text-decoration: none;
	color: var(--kop-accent);
	background: transparent;
	border: 1px solid var(--kop-accent);
	border-radius: 0;
	transition: all 0.3s;
}

.kop.kop-is-done .kop-form a.kop-done-btn {
	display: block;
}

.kop .kop-form a.kop-done-btn:hover,
.kop .kop-form a.kop-done-btn:focus-visible {
	color: var(--kop-on-accent);
	background: var(--kop-accent);
}

.kop .kop-form a.kop-done-btn:focus-visible {
	outline: 1px solid var(--kop-accent);
	outline-offset: 2px;
}

/* Focus moves to the title after sign-up (for screen readers); no visible ring needed. */
.kop .kop-title:focus {
	outline: none;
}

.kop .kop-form .kop-submit,
.kop .kop-form .kop-submit:focus {
	flex: 0 0 auto;
	margin: 0;
	padding: 12px 28px;
	font-size: 20px;
	line-height: 24px;
	font-weight: 700;
	text-transform: none;
	white-space: nowrap;
	color: var(--kop-on-accent);
	background: var(--kop-accent);
	border: 2px solid var(--kop-accent);
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	transition: all 0.4s;
}

.kop .kop-form .kop-submit:hover {
	color: var(--kop-accent);
	background: transparent;
	border: 2px solid var(--kop-accent);
	box-shadow: none;
}

.kop .kop-form .kop-submit:focus-visible {
	outline: 2px solid var(--kop-light);
	outline-offset: 2px;
}

.kop .kop-form .kop-submit[disabled] {
	opacity: 0.6;
	cursor: wait;
}

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

/* ---- Right column ------------------------------------------------------- */

/* Column stretches to the popup's full height; the image is pushed to the
   bottom and sits flush with the popup's bottom edge (no bottom padding). */
.kop .kop-right {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 40px 0 0;
	color: var(--kop-line);
	background: var(--kop-dark);
}

.kop .kop-right-text {
	padding: 0 40px;
}

.kop .kop-right-subtitle {
	display: block;
	margin: 0 0 8px;
	font-size: 14px;
	line-height: 20px;
	font-weight: 500;
	text-transform: uppercase;
	color: #d9d9d9;
}

.kop .kop-right-title {
	margin: 0 0 12px;
	padding: 0;
	font-size: 22px;
	line-height: 30px;
	font-weight: 700;
	text-transform: none;
	color: var(--kop-highlight);
}

.kop .kop-right-description {
	font-size: 14px;
	line-height: 22px;
	font-weight: 700;
	color: var(--kop-light);
}

.kop .kop-right-description p {
	margin: 0 0 8px;
}

.kop .kop-right-description > :last-child {
	margin-bottom: 0;
}

.kop .kop-right-description a {
	color: var(--kop-accent);
}

.kop .kop-right-image {
	display: block;
	max-width: 100%;
    width: 100%;
    height: 420px;
	margin: auto auto 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: cover;
    object-position: 100% 28%;
}

/* After sign-up the --done image replaces the original (--swap). */
.kop .kop-right-image--done,
.kop.kop-is-done .kop-right-image--swap {
	display: none;
}

.kop.kop-is-done .kop-right-image--done {
	display: block;
}

/* ---- Button (Knock ".btn.orange" as used in the popup) ------------------ */

/* A <span> label inside the minimized bar; the bar itself is the button. */
.kop .kop-btn {
	display: inline-block;
	padding: 16px 48px;
	font-size: 15px;
	line-height: 24px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	color: var(--kop-on-accent);
	background: var(--kop-accent);
	border: 2px solid var(--kop-accent);
	border-radius: 0;
	transition: all 0.4s;
}

.kop .kop-float:hover .kop-btn,
.kop .kop-float:focus-visible .kop-btn {
	color: var(--kop-accent);
	background: var(--kop-dark);
	border-color: var(--kop-dark);
}

/* ---- Minimized bar ------------------------------------------------------ */

.kop .kop-float {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99998;
	border-top: 3px solid #FFCB03;
	padding: 14px 16px;
	background: #1C1C1C;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	touch-action: manipulation;
}

.kop .kop-float:focus-visible {
	outline: 2px solid var(--kop-accent);
	outline-offset: 2px;
}

.kop .kop-float-holder {
	display: flex;
	align-items: center;
	gap: 14px;
}

/* Image in a 56x56 yellow circle, left of the text. */
.kop .kop-float-image {
	flex: 0 0 56px;
	width: 56px;
	height: 56px;
	border: 3px solid #FFCB03;
	border-radius: 50%;
	overflow: hidden;
}

.kop .kop-float-image img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	border-radius: 0;
	object-fit: cover;
}

.kop .kop-float-text {
	display: flex;
	flex-direction: column;
	margin-right: auto;
}

/* Explicit Syne on the bar text (on top of the inherited rule above). */
.kop .kop-float .kop-float-text span,
.kop .kop-float .kop-float-text b,
.kop .kop-float .kop-btn {
	font-family: "Syne", sans-serif;
}

.kop .kop-float-text span {
	font-size: 12px;
	line-height: 20px;
	font-weight: 500;
	white-space: nowrap;
	color: var(--kop-accent);
}

.kop .kop-float-text b {
    color: #fff;
    font-size: 18px;
	font-weight: 700;
}

.kop .kop-float .kop-btn {
	padding: 10px 16px;
}

.kop .kop-float svg {
	flex: 0 0 auto;
}

.kop .kop-drag-spacer {
	height: 0;
	transition: height 0.2s ease;
}

.kop .kop-float.kop-dragging .kop-drag-spacer {
	transition: none;
}

/* ---- md: <= 980px ------------------------------------------------------- */

@media screen and (max-width: 980px) {
	.kop .kop-overlay {
		padding: 24px;
	}

	.kop .kop-box {
		max-width: 100%;
		max-height: 90vh;
	}

	.kop .kop-columns {
		flex-direction: column;
	}

	.kop .kop-left {
		flex-basis: auto;
		padding: 32px 0 0;
	}

	.kop .kop-right {
		padding: 32px 24px 0;
	}

	.kop .kop-subtitle {
		margin: 0 24px 12px;
	}

	.kop .kop-title {
		margin: 0 24px 20px;
	}

	.kop .kop-form {
		margin: 0 24px 32px;
	}
}

/* ---- sm: <= 768px (bottom sheet) ---------------------------------------- */

@media screen and (max-width: 768px) {
	.kop .kop-overlay {
		align-items: flex-end;
		padding: 0;
	}

	.kop .kop-box {
		width: 100%;
		max-height: 95vh;
		border-top: 3px solid #FFCB03;
		/* Snaps back when a drag-down to minimize is let go too early. */
		transition: transform 0.2s ease;
	}

	/* Follow the finger exactly while dragging the sheet down. */
	.kop .kop-box.kop-sheet-dragging {
		transition: none;
	}

	.kop .kop-close {
		top: 10px;
		right: 2px;
	}

	.kop .kop-close svg {
		margin-bottom: 15px;
	}

	.kop .kop-handle {
		display: block;
		width: 40px;
		height: 4px;
		margin: 10px auto 10px;
		border-radius: 4px;
		background: #616161;
	}

	.kop .kop-left {
		padding: 12px 0 0;
	}

	/* Image circle to the left of "Nate Berger" + sub title. */
	.kop .kop-intro {
		display: flex;
		align-items: center;
		gap: 12px;
		margin: 0 20px 12px;
	}

	.kop .kop-intro-image {
		display: block;
		flex: 0 0 56px;
		width: 56px;
		height: 56px;
		border: 2px solid #FFCB03;
		border-radius: 50%;
		overflow: hidden;
	}

	.kop .kop-intro-image img {
		display: block;
		width: 100%;
		height: 100%;
		max-width: none;
		border-radius: 0;
		object-fit: cover;
	}

	.kop .kop-mobile-name {
		display: block;
		font-size: 16px;
		line-height: normal;
		font-weight: 700;
		color: #fff;
	}

	.kop .kop-subtitle {
		font-size: 14px;
		margin: 0;
	}

	.kop .kop-title {
		margin: 0 20px 12px;
		font-size: 32px;
		line-height: normal;
	}

	.kop .kop-form {
		margin: 0 20px 28px;
	}

	.kop .kop-form-intro {
		font-size: 16px;
		line-height: 24px;
		margin: 0 0 16px;
	}

	.kop .kop-form-note {
		margin: 0 0 16px;
	}

	.kop .kop-form input.kop-email[type="email"] {
		font-size: 16px;
	}

	.kop .kop-form .kop-submit,
	.kop .kop-form .kop-submit:focus,
	.kop .kop-form .kop-submit:hover {
		font-size: 18px;
		padding: 10px 16px;
	}

	.kop .kop-email-row {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
		margin: 0 0 16px;
	}

	.kop .kop-consent {
		margin: 16px 0;
	}

	.kop .kop-consent label {
		line-height: 18px;
	}

	.kop.kop-is-done .kop-form a.kop-done-btn {
    	width: 100%;
    	text-align: center;
	}

	.kop .kop-form .kop-no-thanks {
		width: 100%;
	}

	.kop .kop-right {
		display: none;
		padding: 24px 20px 0;
		text-align: center;
	}

	.kop .kop-right-text {
		padding-bottom: 24px;
	}

	.kop .kop-float {
		right: 0;
		bottom: 0;
		left: 0;
		padding: 10px 16px 28px;
	}

	.kop .kop-float-image {
		flex: 0 0 44px;
    	width: 44px;
    	height: 44px;
	}

	.kop .kop-float .kop-btn {
		display: none;
	}

	.kop .kop-float-holder {
		justify-content: space-between;
		gap: 12px;
	}
}
