/**
 * Avanti Selfie Postcard front end styles.
 * Tokens follow the GastroSuisse/Avanti design system.
 */

 body .block-animated-hero{
	margin-top: 0;
 }

.spc-root,
.spc-launcher,
.spc-overlay {
	--spc-black: #282828;
	--spc-yellow: #FFED00;
	--spc-grey: #9C9C9C;
	--spc-grey-light: #E6E6E6;
	--spc-beige: #DEC8B1;
	--spc-red: #E4032E;
	--spc-white: #fff;
	--spc-radius: 8px;
	--spc-font: "HelveticaNowText", Helvetica, Arial, sans-serif;
}

/* Launcher
------------------------------------------------------------------ */
.spc-launcher{
	margin: 60px auto;
	padding: 0 15px;
}

.spc-root{
	text-align: center;
	max-width: 480px;
	margin: 0 auto;
}
.spc-launcher,
.spc-root {
	font-family: var(--spc-font);
	color: var(--spc-black);
}

.spc-launcher--center,
.spc-launcher--center .spc-launcher__actions {
	text-align: center;
	justify-content: center;
}

.spc-launcher__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.spc-launcher__note {
	margin: 16px 0 0;
	max-width: 46em;
	font-size: 16px;
	line-height: 1.5;
}

.spc-launcher__note--error {
	color: var(--spc-red);
}

/* Buttons
------------------------------------------------------------------ */

.spc-btn {
	display: inline-block;
	padding: 10px 20px;
	border: 2px solid transparent;
	border-radius: 30px;
	background: var(--spc-grey);
	color: var(--spc-white);
	font-family: var(--spc-font);
	font-size: 18px;
	font-weight: 800;
	line-height: 46px;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.3s, color 0.3s, border-color 0.3s;
	line-height: 1;
}

.spc-btn:hover:not(:disabled) {
	background: var(--spc-black);
	border-color: var(--spc-black);
	color: var(--spc-white);
	font-style: italic;
}

.spc-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.spc-btn--primary {
	background: var(--spc-yellow);
	border-color: var(--spc-yellow);
	color: var(--spc-black);
}

.spc-btn--outline {
	background: #DEC8B1;
	border-color: var(--spc-black);
	color: var(--spc-black);
}

.spc-btn--dark {
	background: var(--spc-black);
	border-color: var(--spc-black);
	color: var(--spc-white);
}

.spc-btn--dark:hover:not(:disabled) {
	background: var(--spc-yellow);
	border-color: var(--spc-yellow);
	color: var(--spc-black);
}

.spc-circle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	padding: 0;
	border: 2px solid var(--spc-black);
	border-radius: 50%;
	background: transparent;
	color: var(--spc-black);
	cursor: pointer;
	transition: background-color 0.3s, color 0.3s;
}

.spc-circle:hover {
	background: var(--spc-black);
	color: var(--spc-white);
}

.spc-circle svg {
	width: 24px;
	height: 24px;
}

.spc-link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--spc-black);
	font-family: var(--spc-font);
	font-size: 15px;
	font-weight: 700;
	text-decoration: underline;
	cursor: pointer;
}

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

/* Offcanvas panel
------------------------------------------------------------------ */

body.spc-modal-open {
	overflow: hidden;
}

.spc-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	justify-content: flex-end;
	background: rgba(40, 40, 40, 0.55);
	font-family: var(--spc-font);
	color: var(--spc-black);
}

.spc-panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(760px, 100%);
	height: 100%;
	background: var(--spc-white);
	box-shadow: -12px 0 40px rgba(0, 0, 0, 0.2);
	animation: spc-slide-in 0.3s ease-out;
}

@keyframes spc-slide-in {
	from {
		transform: translateX(4%);
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.spc-panel {
		animation: none;
	}
}

.spc-panel__close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--spc-white);
	color: var(--spc-black);
	cursor: pointer;
}

.spc-panel__close svg {
	width: 22px;
	height: 22px;
}

.spc-panel__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 64px 32px 32px;
	-webkit-overflow-scrolling: touch;
}

.spc-panel__stage--done {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	justify-content: center;
	min-height: 60vh;
}

.spc-panel__title {
	margin: 0 0 16px;
	font-size: 28px;
	font-weight: 800;
	line-height: 1.1;
}

.spc-panel__footer {
	position: sticky;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 32px;
	border-top: 1px solid var(--spc-grey-light);
	background: var(--spc-white);
}

@media (max-width: 640px) {
	.spc-panel__body {
		padding: 56px 20px 24px;
	}

	.spc-panel__footer {
		padding: 12px 20px;
	}

	.spc-panel__title {
		font-size: 22px;
	}

}

/* Postcard preview
------------------------------------------------------------------ */

.spc-card {
	position: relative;
	width: 100%;
	max-width: 560px;
	margin: 0 auto 24px;
	aspect-ratio: 1819 / 1311;
	perspective: 1600px;
	container-type: inline-size;
}

.spc-card__inner {
	position: relative;
	width: 100%;
	height: 100%;
	transform-style: preserve-3d;
	transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.spc-card.is-flipped .spc-card__inner {
	transform: rotateY(180deg);
}

@media (prefers-reduced-motion: reduce) {
	.spc-card__inner {
		transition: none;
	}
}

.spc-card__face {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: var(--spc-white);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

.spc-card__face--back {
	transform: rotateY(180deg);
}

.spc-card__photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.spc-card__placeholder {
	width: 100%;
	height: 100%;
	background: var(--spc-beige);
}

.spc-card__flip {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--spc-black);
	color: var(--spc-white);
	cursor: pointer;
}

.spc-card__flip svg {
	width: 22px;
	height: 22px;
}

.spc-card__back-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4%;
	width: 100%;
	height: 100%;
	padding: 6%;
	box-sizing: border-box;
}

.spc-card__message {
	padding-right: 5%;
	border-right: 2px solid var(--spc-black);
	overflow: hidden;
	font-size: 12px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-break: break-word;
}

.spc-card__address {
	display: flex;
	flex-direction: column;
	gap: 6%;
}

.spc-card__stamp-row {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 6%;
}

.spc-card__postmark {
	width: 30%;
	max-width: 84px;
}

.spc-card__stamp {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60%;
	/* Same frame as the stamp block Swiss Post prints (343 x 248). */
	aspect-ratio: 343 / 248;
	box-sizing: border-box;
	background: var(--spc-white);
	overflow: hidden;
}

.spc-card__stamp img {
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: contain;
}

.spc-card__sender {
	margin: 0;
	padding-bottom: 2%;
	border-bottom: 1px solid var(--spc-black);
	font-size: 10px;
	line-height: 1.3;
	min-height: 1.3em;
}

.spc-card__recipient {
	display: flex;
	flex-direction: column;
	gap: 0.35em;
	padding-left: 5%;
	border-left: 3px solid var(--spc-black);
	font-size: 12px;
	line-height: 1.35;
	min-height: 4em;
}

@supports (font-size: 1cqw) {
	.spc-card__message,
	.spc-card__recipient {
		font-size: 2.6cqw;
	}

	.spc-card__sender {
		font-size: 2.1cqw;
	}
}

/* Cropper
------------------------------------------------------------------ */

.spc-cropper__frame {
	position: relative;
	width: 100%;
	max-width: 560px;
	margin: 0 auto;
	aspect-ratio: 1819 / 1311;
	overflow: hidden;
	background: var(--spc-black);
	/* Same lift as the postcard, so the overlay's white border stays visible
	   against the white panel. */
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12), 0 12px 30px rgba(0, 0, 0, 0.15);
	cursor: grab;
	touch-action: none;
	user-select: none;
}

.spc-cropper__frame:active {
	cursor: grabbing;
}

/* Clips the photo. With an overlay it sits 2px inside the frame so the photo
   cannot show past the overlay's edge. */
.spc-cropper__photo {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}

.spc-cropper__frame.has-overlay {
	background: var(--spc-white);
}

.spc-cropper__frame.has-overlay .spc-cropper__photo {
	inset: 2px;
}

.spc-cropper__stage {
	position: absolute;
	top: 0;
	left: 0;
	will-change: transform;
	pointer-events: none;
}

/* The stage is measured against the frame, so it shifts back by the inset. */
.spc-cropper__frame.has-overlay .spc-cropper__stage {
	top: -2px;
	left: -2px;
}

.spc-cropper__image {
	position: absolute;
	top: 50%;
	left: 50%;
	/* Themes cap images with max-width:100%, which would squeeze the zoomed
	   image horizontally because the height comes from the inline style. */
	max-width: none;
	max-height: none;
	min-width: 0;
	min-height: 0;
	transform-origin: 50% 50%;
	will-change: transform;
	pointer-events: none;
}

.spc-cropper__logo {
	position: absolute;
	height: auto;
	pointer-events: none;
	filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.65));
}

/* Stretched edge to edge, the same way the server burns it in. */
.spc-cropper__overlay {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: fill;
	pointer-events: none;
}

.spc-cropper__controls {
	display: flex;
	align-items: center;
	gap: 16px;
	max-width: 560px;
	margin: 16px auto 0;
}

.spc-cropper__zoom {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 12px;
	font-size: 14px;
	font-weight: 700;
}

.spc-cropper__zoom input {
	flex: 1 1 auto;
	accent-color: var(--spc-black);
}

.spc-cropper__rotate {
	display: flex;
	flex: 0 0 auto;
	gap: 8px;
}

.spc-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--spc-black);
	border-radius: 50%;
	background: var(--spc-white);
	color: var(--spc-black);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.spc-icon-btn:hover,
.spc-icon-btn:focus-visible {
	background: var(--spc-black);
	color: var(--spc-white);
}

.spc-icon-btn svg {
	width: 20px;
	height: 20px;
}

.spc-cropper__hint {
	max-width: 560px;
	margin: 8px auto 0;
	font-size: 14px;
	color: #575757;
}

/* Camera
------------------------------------------------------------------ */

.spc-camera__stage {
	position: relative;
	width: 100%;
	max-width: 560px;
	margin: 0 auto;
	aspect-ratio: 1819 / 1311;
	overflow: hidden;
	background: var(--spc-black);
}

.spc-camera__stage video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.spc-camera__stage video.is-mirrored {
	transform: scaleX(-1);
}

.spc-camera__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	justify-content: center;
	margin-top: 20px;
}

/* Form
------------------------------------------------------------------ */

.spc-form {
	margin-top: 8px;
}

.spc-form__progress {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 500;
	color: #575757;
}

.spc-form__note {
	margin: -8px 0 20px;
	font-size: 15px;
	color: #575757;
}

.spc-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

@media (min-width: 560px) {
	.spc-grid {
		grid-template-columns: 1fr 1fr;
	}
}

.spc-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.spc-field__label {
	font-size: 14px;
	font-weight: 700;
}

.spc-field__label em {
	font-style: normal;
}

.spc-field__input {
	width: 100%;
	padding: 12px 16px;
	border: 2px solid var(--spc-black);
	border-radius: var(--spc-radius);
	background: var(--spc-white);
	box-sizing: border-box;
	font-family: var(--spc-font);
	font-size: 16px;
	color: var(--spc-black);
}

.spc-field__input:focus {
	outline: 2px solid var(--spc-yellow);
	outline-offset: 1px;
}

.spc-field__input--area {
	min-height: 140px;
	resize: vertical;
	line-height: 1.5;
}

.spc-field.has-error .spc-field__input {
	border-color: var(--spc-red);
	color: var(--spc-red);
}

.spc-field__error {
	font-size: 13px;
	font-weight: 500;
	color: var(--spc-red);
}

.spc-field__hint {
	font-size: 13px;
	color: #575757;
}

.spc-summary {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	margin: 0 0 24px;
}

@media (min-width: 560px) {
	.spc-summary {
		grid-template-columns: 1fr 1fr;
	}
}

.spc-summary dt {
	margin-bottom: 4px;
	font-size: 14px;
	font-weight: 700;
}

.spc-summary dd {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
}

.spc-consent {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 8px;
	font-size: 15px;
	line-height: 1.45;
	cursor: pointer;
}

.spc-consent input {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	margin: 0;
	accent-color: var(--spc-black);
}

.spc-consent.has-error span {
	color: var(--spc-red);
}

.spc-terms {
	margin: 12px 0;
	padding: 16px;
	border: 1px solid var(--spc-grey-light);
	border-radius: var(--spc-radius);
	background: #FAFAFA;
	font-size: 14px;
	line-height: 1.5;
}

.spc-terms p {
	margin: 0 0 10px;
}

.spc-terms ul {
	margin: 0 0 10px;
	padding-left: 20px;
}

.spc-terms li {
	margin-bottom: 6px;
}

.spc-recaptcha {
	margin: 16px 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: #575757;
}

.spc-recaptcha a {
	color: inherit;
	text-decoration: underline;
}

.spc-recaptcha a + a {
	margin-left: 8px;
}

/* Notices
------------------------------------------------------------------ */

.spc-notice {
	margin: 16px 0 0;
	padding: 12px 16px;
	border-radius: var(--spc-radius);
	font-size: 15px;
	line-height: 1.45;
}

.spc-notice--error {
	background: #FDECEF;
	color: var(--spc-red);
}

.spc-notice--warning {
	background: #FFF9DB;
	color: #6B5B00;
}
