/* Sod Yarok Gift Card - "new at Sod Yarok" announcement on the home page.
   Everything is scoped under .sygc-promo. Type and buttons follow the site's own sections. */
.sygc-promo {
	--gc-ink: #184828;
	--gc-text: #3a5f46;
	--gc-cream: #f7f2e9;
	--gc-paper: #fbf8f3;
	--gc-line: rgba(24, 72, 40, 0.14);
	--gc-accent: #b4571f;
	box-sizing: border-box;
	margin: 0;
	padding: clamp(18px, 3.4vw, 46px) 0;
	color: var(--gc-ink);
	font-family: inherit;
	text-align: right;
}

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

.sygc-promo__wrap {
	width: 100%;
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 clamp(16px, 4vw, 51.2px);
}

.sygc-promo__panel {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
	align-items: center;
	gap: clamp(20px, 3.4vw, 48px);
	padding: 0 clamp(26px, 4.4vw, 64px);
	border: 1px solid var(--gc-line);
	border-radius: 30px;
	background: var(--gc-paper);
	overflow: hidden;
}

/* the "new" ribbon lies diagonally across the top right corner of the panel */
.sygc-promo__ribbon {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 4;
	width: 150px;
	height: 150px;
	overflow: hidden;
	pointer-events: none;
}

.sygc-promo__ribbon > span {
	position: absolute;
	top: 30px;
	right: -54px;
	display: block;
	width: 200px;
	background: var(--gc-accent);
	box-shadow: 0 3px 8px rgba(60, 30, 10, 0.22);
	color: #fff;
	font-size: 13.5px;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 32px;
	text-align: center;
	white-space: nowrap;
	transform: rotate(45deg);
}

.sygc-promo__text {
	position: relative;
	min-width: 0;
	padding: calc(142px - clamp(26px, 4.4vw, 64px)) 0 clamp(30px, 4vw, 52px); /* the text starts under the ribbon */
}

.sygc-promo .sygc-promo__preview {
	display: inline-block;
	margin: 0 0 12px;
	padding: 5px 12px;
	border: 1px solid #e6c766;
	border-radius: 999px;
	background: #fff8dc;
	color: #5c4a10;
	font-size: 12.5px;
	line-height: 1.5;
}

.sygc-promo .sygc-promo__title {
	margin: 0;
	padding: 0;
	color: var(--gc-ink);
	font-family: inherit;
	font-size: clamp(27px, 3.1vw, 42px);
	font-weight: 700;
	letter-spacing: -0.015em;
	line-height: 1.14;
	text-align: right;
}

.sygc-promo .sygc-promo__lead {
	max-width: 27em;
	margin: 12px 0 0;
	padding: 0;
	color: var(--gc-text);
	font-size: 17px;
	line-height: 1.6;
	text-align: right;
	text-wrap: pretty;
}

.sygc-promo a.sygc-promo__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	margin: 22px 0 0;
	padding: 12px 34px;
	border: 1px solid var(--gc-ink);
	border-radius: 999px;
	background: var(--gc-ink);
	color: var(--gc-cream);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.sygc-promo a.sygc-promo__btn:hover,
.sygc-promo a.sygc-promo__btn:focus {
	background: #0f3a20;
	color: #fff;
	text-decoration: none;
}

.sygc-promo a.sygc-promo__btn:focus-visible {
	outline: 3px solid #7fbf8f;
	outline-offset: 2px;
}

/* ---------- the envelope and the cards
   Measures are fractions of the art box: its height is 66% of its width.
   Card: 31% wide. Envelope: 50% wide, at the bottom. The cards rest in a row along the top. */
.sygc-promo__art {
	position: relative;
	justify-self: center;
	width: min(100%, 520px);
	aspect-ratio: 100 / 66;
	margin: clamp(30px, 3.6vw, 46px) 0 clamp(26px, 3.4vw, 44px);
}

.sygc-promo__art > span {
	position: absolute;
	display: block;
}

.sygc-env {
	bottom: 0;
	left: 25%;
	width: 50%;
	aspect-ratio: 3 / 2;
	perspective: 900px;
	transform-origin: 50% 100%;
	transform: scale(0.85); /* resting state: a little smaller, under the row of cards */
}

.sygc-env.is-back { z-index: 1; }
.sygc-env__cards { inset: 0; z-index: 2; }
.sygc-env.is-front { z-index: 3; }

.sygc-env > i {
	position: absolute;
	display: block;
}

.sygc-env__back {
	inset: 0;
	border-radius: 10px;
	background: linear-gradient(180deg, #123a20 0%, #184828 70%);
	box-shadow: 0 30px 40px -28px rgba(24, 72, 40, 0.5);
}

.sygc-env__front {
	inset: 0;
	border-radius: 0 0 10px 10px;
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 200' preserveAspectRatio='none'%3E%3Cpath d='M0 200 L150 110 L300 200' fill='none' stroke='%23184828' stroke-opacity='.13' stroke-width='1.5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat,
		linear-gradient(180deg, #fffdf8 0%, #f1e9da 100%);
	-webkit-clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%);
	clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%);
}

/* the flap has two faces: the paper side closes the envelope, the green lining shows once it is open */
.sygc-env__flap {
	top: 0;
	right: 0;
	left: 0;
	height: 58%;
	-webkit-clip-path: polygon(0 0, 100% 0, 50% 100%);
	clip-path: polygon(0 0, 100% 0, 50% 100%);
	transform-origin: 50% 0;
}

.sygc-env__flap.is-closed {
	background: linear-gradient(180deg, #fffdf8 0%, #efe6d6 100%);
	transform: rotateX(90deg);
	opacity: 0;
}

.sygc-env__flap.is-open {
	background: linear-gradient(0deg, #1d5732 0%, #184828 100%);
	transform: rotateX(180deg);
}

.sygc-env__seal {
	top: 58%;
	left: 50%;
	width: 13%;
	aspect-ratio: 1;
	border-radius: 50%;
	background:
		radial-gradient(circle at 50% 50%, #f7f2e9 0 17%, transparent 18%),
		radial-gradient(circle at 50% 50%, transparent 0 30%, #f7f2e9 31% 37%, transparent 38%),
		#a8232a;
	box-shadow: 0 3px 6px rgba(60, 10, 14, 0.3);
	transform: translate(-50%, -50%) scale(0);
	opacity: 0;
}

/* a card starts inside the envelope (54.5% down) and ends in the row along the top */
.sygc-promo .sygc-env__card {
	position: absolute;
	top: 54.5%;
	left: 34.5%;
	display: block;
	width: 31%;
	max-width: none;
	height: auto;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	filter: drop-shadow(0 8px 10px rgba(24, 40, 30, 0.2));
	will-change: transform;
}

/* resting places, right to left: design 1, design 2, design 3 */
.sygc-env__card.is-1 { transform: translate(111.3%, -185.6%); z-index: 2; }
.sygc-env__card.is-2 { transform: translate(0, -185.6%); z-index: 1; }
.sygc-env__card.is-3 { transform: translate(-111.3%, -185.6%); z-index: 3; }

/* ---------- motion: closed -> the flap opens -> one card after the other rises straight up
   and steps aside -> the envelope settles a little smaller under the row */
.sygc-promo__art.is-ready .sygc-env {
	transform: scale(1);
}

.sygc-promo__art.is-ready .sygc-env__flap.is-closed {
	transform: rotateX(0deg);
	opacity: 1;
}

.sygc-promo__art.is-ready .sygc-env__flap.is-open {
	transform: rotateX(90deg);
	opacity: 0;
}

.sygc-promo__art.is-ready .sygc-env__seal {
	transform: translate(-50%, -50%) scale(1);
	opacity: 1;
}

.sygc-promo__art.is-ready .sygc-env__card {
	transform: translate(0, 0);
}

.sygc-promo__art.is-ready.is-in .sygc-env__seal {
	animation: sygc-seal 0.3s 0.15s ease-in both;
}

.sygc-promo__art.is-ready.is-in .sygc-env__flap.is-closed {
	animation: sygc-flap-a 0.32s 0.4s ease-in both;
}

.sygc-promo__art.is-ready.is-in .sygc-env__flap.is-open {
	animation: sygc-flap-b 0.34s 0.72s ease-out both;
}

.sygc-promo__art.is-ready.is-in .sygc-env__card.is-3 {
	animation: sygc-out-left 0.95s 1.1s cubic-bezier(0.3, 0.7, 0.2, 1) both;
}

.sygc-promo__art.is-ready.is-in .sygc-env__card.is-1 {
	animation: sygc-out-right 0.95s 1.7s cubic-bezier(0.3, 0.7, 0.2, 1) both;
}

.sygc-promo__art.is-ready.is-in .sygc-env__card.is-2 {
	animation: sygc-out-up 0.6s 2.3s cubic-bezier(0.3, 0.7, 0.2, 1) both;
}

.sygc-promo__art.is-ready.is-in .sygc-env {
	animation: sygc-settle 0.5s 2.85s ease-in-out both;
}

@keyframes sygc-seal {
	from { transform: translate(-50%, -50%) scale(1); opacity: 1; }
	to { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
}

@keyframes sygc-flap-a {
	0% { transform: rotateX(0deg); opacity: 1; }
	99% { transform: rotateX(90deg); opacity: 1; }
	100% { transform: rotateX(90deg); opacity: 0; }
}

@keyframes sygc-flap-b {
	0% { transform: rotateX(90deg); opacity: 0; }
	1% { transform: rotateX(90deg); opacity: 1; }
	100% { transform: rotateX(180deg); opacity: 1; }
}

@keyframes sygc-out-up {
	from { transform: translate(0, 0); }
	to { transform: translate(0, -185.6%); }
}

@keyframes sygc-out-left {
	0% { transform: translate(0, 0); }
	55% { transform: translate(0, -185.6%); }
	100% { transform: translate(-111.3%, -185.6%); }
}

@keyframes sygc-out-right {
	0% { transform: translate(0, 0); }
	55% { transform: translate(0, -185.6%); }
	100% { transform: translate(111.3%, -185.6%); }
}

@keyframes sygc-settle {
	from { transform: scale(1); }
	to { transform: scale(0.85); }
}

/* ---------- narrow screens: the text first, the envelope under it */
@media (max-width: 860px) {
	.sygc-promo__panel {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
		padding: 0;
		border-radius: 24px;
	}

	.sygc-promo__text {
		padding: 98px 22px 0; /* the title starts under the ribbon */
	}

	.sygc-promo__ribbon {
		width: 124px;
		height: 124px;
	}

	.sygc-promo__ribbon > span {
		top: 24px;
		right: -52px;
		width: 180px;
		font-size: 12.5px;
		line-height: 28px;
	}

	.sygc-promo .sygc-promo__title {
		font-size: clamp(23px, 6.8vw, 30px);
		text-wrap: balance;
	}

	.sygc-promo .sygc-promo__lead {
		font-size: 16px;
	}

	.sygc-promo__art {
		width: min(100% - 32px, 420px);
		margin: 32px auto 26px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sygc-promo * {
		animation: none !important;
		transition: none !important;
	}
}
