/* -------------------------------------------------- */
/* Kontakt-Modal                                        */
/* -------------------------------------------------- */

/* Reuses the .kontakt-layout / .kontakt-form / .kontakt-infos markup and
   styling from 15-kontakt.css as-is; this file only adds the overlay chrome
   around it. */

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

.kontakt-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: grid;
	place-items: center;
	padding: 2.5rem 1.5rem;
}

.kontakt-modal[hidden] {
	display: none;
}

.kontakt-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 17, 17, 0.6);
}

.kontakt-modal__dialog {
	--radius-child: var(--radius-nested);

	position: relative;
	width: 100%;
	max-width: 1080px;
	max-height: calc(100vh - 4rem);
	overflow-y: auto;
	background: #F4F4F4;
	border-radius: var(--radius);
	box-shadow: var(--shadow-float);
}

.kontakt-modal__close {
	position: sticky;
	float: right;
	top: 1rem;
	right: 1rem;
	margin: 1rem 1rem -2.5rem 0;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	/* A circle is a shape rather than a corner treatment, so the concentric
	   rule in 01-base.css has nothing to act on here. */
	border-radius: 50%;
	border: var(--border-hairline);
	background: #fff;
	color: var(--color-ink);
	font-size: var(--text-lg);
	line-height: 1;
	cursor: pointer;
	z-index: 1;
}

.kontakt-modal__close:hover {
	background: var(--color-bg-alt);
}

.kontakt-modal__content {
	padding: 3rem;
	clear: both;
}

.kontakt-modal .kontakt-layout {
	grid-template-columns: 1.5fr 1fr;
	gap: 2.5rem;
}

/* The one place two surfaces stack: the form is a card in its own right, and
   in here it sits inside the dialog's corner. It steps down like any other
   nested box. Written out rather than taken from --radius-child, because a
   custom property an element declares also applies to that element's own
   declarations — .kontakt-form sets the child value for its inputs, so reading
   it back here would round the form to it everywhere, modal or not. */
.kontakt-modal .kontakt-form {
	border-radius: var(--radius-nested);
}

@media (max-width: 720px) {
	.kontakt-modal {
		padding: 0;
	}

	.kontakt-modal__dialog {
		max-height: 100vh;
		border-radius: 0;
	}

	.kontakt-modal__content {
		padding: 5rem 1.5rem 2.5rem;
	}

	.kontakt-modal .kontakt-layout {
		grid-template-columns: 1fr;
	}
}
