/* Modal sources (progressive enhancement): plain sections without JavaScript, native <dialog> with it. */

.thriveo-modal-source {
	border-top: 1px solid var(--thriveo-color-hairline);
	padding-bottom: var(--thriveo-space-6);
	padding-top: var(--thriveo-space-6);
}

.thriveo-modal-source.is-modal {
	border-top: 0;
	padding: 0;
}

.thriveo-modal-source > :first-child {
	margin-top: 0;
}

.thriveo-modal-open {
	overflow: hidden;
}

.thriveo-modal {
	background: transparent;
	border: 0;
	color: var(--thriveo-color-text);
	max-height: calc(100dvh - var(--thriveo-space-8));
	margin: auto;
	max-width: min(720px, calc(100vw - var(--thriveo-space-6)));
	padding: 0;
	width: 100%;
}

.thriveo-modal::backdrop {
	background: var(--thriveo-color-overlay);
}

.thriveo-modal[open] {
	animation: thriveo-modal-in var(--thriveo-duration-slow) var(--thriveo-ease-out);
}

.thriveo-modal__panel {
	background: var(--thriveo-color-surface);
	border: 1px solid var(--thriveo-color-hairline);
	border-radius: var(--thriveo-radius-xl);
	box-shadow: var(--thriveo-shadow-lg);
	max-height: calc(100dvh - var(--thriveo-space-8));
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: var(--thriveo-space-10) var(--thriveo-space-5) var(--thriveo-space-6);
	position: relative;
}

.thriveo-modal__close {
	align-items: center;
	background: transparent;
	border: 1px solid var(--thriveo-color-hairline);
	border-radius: var(--thriveo-radius-sm);
	color: var(--thriveo-color-text);
	cursor: pointer;
	display: inline-flex;
	height: 2.5rem;
	justify-content: center;
	padding: 0;
	position: absolute;
	right: var(--thriveo-space-3);
	top: var(--thriveo-space-3);
	width: 2.5rem;
}

.thriveo-modal__close:hover {
	border-color: var(--thriveo-color-link);
	color: var(--thriveo-color-link);
}

.thriveo-modal__body > .thriveo-modal-source > * + * {
	margin-top: var(--thriveo-space-4);
}

.thriveo-callout {
	background: var(--thriveo-color-surface-tint);
	border: 1px solid var(--thriveo-color-accent-line);
	border-radius: var(--thriveo-radius-md);
	padding: var(--thriveo-space-5);
}

/* GDPR rights trigger grid */
.thriveo-rights-grid {
	display: grid;
	gap: var(--thriveo-space-3);
	grid-template-columns: 1fr;
	list-style: none;
	margin: var(--thriveo-space-6) 0;
	padding: 0;
}

.thriveo-rights-grid__link {
	background: var(--thriveo-color-surface);
	border: 1px solid var(--thriveo-color-hairline);
	border-radius: var(--thriveo-radius-sm);
	color: var(--thriveo-color-text);
	display: block;
	height: 100%;
	padding: var(--thriveo-space-3) var(--thriveo-space-4);
	text-decoration: none;
	transition: border-color var(--thriveo-duration-base) var(--thriveo-ease-out);
}

.thriveo-rights-grid__link:hover,
.thriveo-rights-grid__link:focus-visible {
	border-color: var(--thriveo-color-link);
	color: var(--thriveo-color-text);
}

.thriveo-rights-grid__article {
	color: var(--thriveo-color-link);
	display: block;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	margin-bottom: var(--thriveo-space-1);
	text-transform: uppercase;
}

/* Call to book inside a modal, below the form */
.thriveo-modal__divider.wp-block-separator {
	border-color: var(--thriveo-color-hairline);
	margin-block: var(--thriveo-space-6);
}

.thriveo-modal__call {
	text-align: center;
}

.thriveo-modal__call > * {
	margin-bottom: 0;
	margin-top: 0;
}

.thriveo-modal__call > * + * {
	margin-top: var(--thriveo-space-3);
}

@keyframes thriveo-modal-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (min-width: 640px) {
	.thriveo-rights-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.thriveo-modal__panel {
		padding: var(--thriveo-space-12) var(--thriveo-space-10) var(--thriveo-space-8);
	}
}

@media (min-width: 900px) {
	.thriveo-rights-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.thriveo-modal[open] {
		animation: none;
	}
}
