/* escape. — сама карточка пригласительного.

   Живёт в плагине, а не в теме: одну и ту же карточку показывают конструктор
   /priglashenie/ и страница /i/{код}. Одни правила — одна карточка.

   Карточка свёрстана в НАСТОЯЩИХ пикселях картинки: 1080×1440. На экран она
   уменьшается одним transform: scale(). Благодаря этому у предпросмотра и у
   сохранённого файла одни и те же размеры шрифтов и отступов — их не нужно
   держать в голове в двух местах. Те же числа — в --esc-inv-* на карточке;
   холст конструктора читает их оттуда. */

.esc-inv-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 1080 / 1440;
	overflow: hidden;
	border-radius: 24px;
	background: var(--esc-inv-frame-bg, #1c1c1c);
	box-shadow: 0 0 40px rgba(0, 0, 0, .5);
}

.esc-inv-card {
	--esc-inv-w: 1080;
	--esc-inv-h: 1440;
	--esc-inv-pad: 64;
	--esc-inv-cover-short: 480;
	--esc-inv-cover-tall: 540;
	--bg: #1c1c1c;
	--surface: #242424;
	--text: #ffffff;
	--card-text: #f2f2f2;
	--muted: #b3b3b3;
	--muted-2: #8f8f8f;
	--accent: #ff0004;
	--accent-text: #ff6b6d;
	--accent-grad: linear-gradient(135deg, #ff3b3e 0%, #ff0004 100%);
	--accent-soft: rgba(255, 0, 4, .10);
	--accent-line: rgba(255, 0, 4, .32);
	--badge-text: #ffffff;
	--badge-bg: var(--accent);

	position: absolute;
	top: 0;
	left: 0;
	width: 1080px;
	height: 1440px;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--muted);
	font-family: 'Ubuntu', Arial, sans-serif;
	transform: scale(var(--esc-inv-k, .3));
	transform-origin: top left;
}

.esc-inv-card[data-esc-palette="light"] {
	--bg: #f4f1ee;
	--surface: #ffffff;
	--text: #1c1c1c;
	--card-text: #242424;
	--muted: #5c5c5c;
	--muted-2: #8f8f8f;
	--accent: #ff0004;
	--accent-text: #c40003;
	--accent-grad: linear-gradient(135deg, #ff3b3e 0%, #ff0004 100%);
	--accent-soft: rgba(255, 0, 4, .08);
	--accent-line: rgba(196, 0, 3, .35);
	--badge-text: #ffffff;
}

.esc-inv-card[data-esc-palette="pink"] {
	--bg: #f6e4ea;
	--surface: #fff5f8;
	--text: #2a1218;
	--card-text: #3a1a22;
	--muted: #6b4a54;
	--muted-2: #8a6a74;
	--accent: #ff0004;
	--accent-text: #b80d3c;
	--accent-grad: linear-gradient(135deg, #ff3b3e 0%, #ff0004 100%);
	--accent-soft: rgba(255, 0, 4, .10);
	--accent-line: rgba(184, 13, 60, .35);
	--badge-text: #ffffff;
}

.esc-inv-card[data-esc-palette="blue"] {
	--bg: #dceef8;
	--surface: #f3f9fc;
	--text: #0d2a3a;
	--card-text: #143445;
	--muted: #3d5a6c;
	--muted-2: #5a7584;
	--accent: #ff0004;
	--accent-text: #c40003;
	--accent-grad: linear-gradient(135deg, #ff3b3e 0%, #ff0004 100%);
	--accent-soft: rgba(255, 0, 4, .08);
	--accent-line: rgba(196, 0, 3, .35);
	--badge-text: #ffffff;
}

.esc-inv-card[data-esc-palette="red"] {
	--bg: #b10a12;
	--surface: #9a080e;
	--text: #ffffff;
	--card-text: #fff5f5;
	--muted: #ffd0d0;
	--muted-2: #f0b0b0;
	--accent: #fff4e0;
	--accent-text: #ffe4e4;
	--accent-grad: linear-gradient(135deg, #ffffff 0%, #ffe8c8 100%);
	--accent-soft: rgba(255, 255, 255, .14);
	--accent-line: rgba(255, 255, 255, .38);
	--badge-text: #b10a12;
}

.esc-inv-card[data-esc-palette="minecraft"] {
	--bg: #6EAFD8;
	--surface: #E6D2A2;
	--text: #1A2A12;
	--card-text: #1A2A12;
	--muted: #2E4A28;
	--muted-2: #3D5A36;
	--accent: #E6B422;
	--accent-text: #9A7208;
	--accent-grad: linear-gradient(135deg, #F5D04A 0%, #E6B422 100%);
	--accent-soft: rgba(230, 180, 34, .22);
	--accent-line: rgba(154, 114, 8, .40);
	--badge-text: #ffffff;
	--badge-bg: #3B7A1F;
}

.esc-inv-card[data-esc-palette="minecraft"] .esc-inv-body {
	position: relative;
	overflow: hidden;
	background: none;
}

.esc-inv-card[data-esc-palette="minecraft"] .esc-inv-body::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 96px;
	pointer-events: none;
	z-index: 0;
	background-image:
		repeating-linear-gradient(90deg, rgba(0, 0, 0, .25) 0 2px, transparent 2px 64px),
		linear-gradient(
			180deg,
			#5D9C42 0 12px,
			#4A7C32 12px 24px,
			#6B4F36 24px 60px,
			#8B5A2B 60px 96px
		);
}

.esc-inv-card[data-esc-palette="minecraft"] .esc-inv-body > * {
	position: relative;
	z-index: 1;
}

.esc-inv-card[data-esc-palette="minecraft"] .esc-inv-panel {
	border-radius: 4px;
}

.esc-inv-card :where(*, *::before, *::after) {
	box-sizing: border-box;
}

.esc-inv-card :where(h1, h2, h3, p, ul, li) {
	margin: 0;
}

.esc-inv-card :where(ul) {
	padding: 0;
	list-style: none;
}

.esc-inv-card :where(img) {
	display: block;
	max-width: 100%;
}

.esc-inv-cover {
	position: relative;
	flex: none;
	height: 480px;
	overflow: hidden;
	background: #111;
}

/* Заголовок в одну строку — фотографии отдаётся больше места. */
.esc-inv-card--tall .esc-inv-cover {
	height: 540px;
}

.esc-inv-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 40%;
}

.esc-inv-cover-fade {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 26%),
		linear-gradient(180deg, transparent 48%, var(--bg) 100%);
}

.esc-inv-logo {
	position: absolute;
	top: 56px;
	left: 64px;
	width: auto;
	height: 44px;
}

.esc-inv-badge {
	position: absolute;
	top: 56px;
	right: 64px;
	padding: 15px 28px;
	border-radius: 999px;
	background: var(--badge-bg);
	color: var(--badge-text);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	line-height: 1;
}

.esc-inv-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
	padding: 24px 64px 48px;
}

.esc-inv-lead {
	font-size: 42px;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--text);
}

.esc-inv-title {
	margin-top: 14px;
	font-size: var(--esc-inv-title-size, 116px);
	line-height: 1.02;
	letter-spacing: -.01em;
	text-transform: uppercase;
	font-weight: 700;
}

.esc-inv-word {
	display: block;
	color: var(--text);
}

.esc-inv-word-accent {
	background: var(--accent-grad);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.esc-inv-name {
	display: flex;
	align-items: center;
	gap: 18px;
	margin-top: 20px;
	font-size: 34px;
	font-weight: 500;
	color: var(--card-text);
}

.esc-inv-dash {
	flex: none;
	width: 44px;
	height: 5px;
	border-radius: 999px;
	background: var(--accent);
}

.esc-inv-panels {
	display: flex;
	gap: 24px;
	margin-top: 20px;
}

.esc-inv-panel {
	border-radius: 24px;
	padding: 20px 28px;
}

.esc-inv-panel-when {
	flex: 1;
	min-width: 0;
	background: var(--surface);
}

.esc-inv-panel-note {
	display: flex;
	align-items: center;
	gap: 14px;
	flex: none;
	width: 332px;
	background: var(--accent-soft);
	border: 1px solid var(--accent-line);
	font-size: 24px;
	line-height: 1.3;
	color: var(--card-text);
}

.esc-inv-panel-note[hidden] {
	display: none;
}

.esc-inv-note-ic {
	flex: none;
	color: var(--accent);
}

.esc-inv-note-ic svg {
	width: 28px;
	height: 28px;
}

.esc-inv-panel-label {
	display: block;
	font-size: 20px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--accent-text);
}

.esc-inv-when {
	margin-top: 10px;
	font-size: 44px;
	font-weight: 700;
	line-height: 1.1;
	color: var(--text);
}

.esc-inv-when em {
	font-style: normal;
	font-size: 26px;
	font-weight: 400;
	color: var(--muted);
}

.esc-inv-where {
	margin-top: 8px;
	font-size: 22px;
	line-height: 1.35;
	color: var(--muted);
}

.esc-inv-message {
	margin-top: 20px;
	font-size: 26px;
	line-height: 1.45;
	color: var(--muted);
}

.esc-inv-closing {
	margin-top: 12px;
	font-size: 26px;
	font-weight: 700;
	color: var(--accent-text);
}

.esc-inv-spacer {
	flex: 1;
	min-height: 8px;
}

.esc-inv-perks {
	display: flex;
	gap: 24px;
}

.esc-inv-perks li {
	display: flex;
	flex: 1;
	min-width: 0;
	align-items: center;
	gap: 12px;
}

.esc-inv-perk-ic {
	flex: none;
	color: var(--accent);
}

.esc-inv-perk-ic svg {
	width: 30px;
	height: 30px;
}

.esc-inv-perk-tx b {
	display: block;
	font-size: 21px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--card-text);
}

.esc-inv-foot {
	display: flex;
	align-items: center;
	gap: 32px;
	margin-top: 28px;
}

/* Поле вокруг кода («тихая зона») входит в саму картинку QR: без него
   код с фотографии не читается. Поэтому padding здесь нулевой. */
.esc-inv-qr {
	flex: none;
	display: grid;
	place-items: center;
	width: 184px;
	height: 184px;
	padding: 0;
	overflow: hidden;
	border-radius: 16px;
	background: #fff;
}

.esc-inv-qr canvas,
.esc-inv-qr img {
	width: 100%;
	height: 100%;
	image-rendering: pixelated;
}

.esc-inv-qr-stub {
	padding: 12px;
	font-size: 18px;
	line-height: 1.25;
	font-weight: 500;
	text-align: center;
	color: #8f8f8f;
}

.esc-inv-contacts {
	flex: 1;
	min-width: 0;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px 24px;
}

.esc-inv-contact {
	display: flex;
	gap: 12px;
	font-size: 22px;
	line-height: 1.3;
	color: var(--muted);
}

.esc-inv-contact[hidden] {
	display: none;
}

.esc-inv-contact a {
	color: inherit;
	text-decoration: none;
}

.esc-inv-contact a:hover,
.esc-inv-contact a:focus-visible {
	color: var(--accent-text);
}

.esc-inv-contact-ic {
	flex: none;
	color: var(--accent);
}

.esc-inv-contact-ic svg {
	width: 26px;
	height: 26px;
}
