/*
 * Points map + point modal.
 * Reused by the "čo sme dokázali" and programme sections.
 */

.pmap__container {
	display: flex;
	flex-direction: column;
	gap: var(--space-7);
	margin-bottom: var(--space-section);
}

.pmap__top {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: flex-end;
	gap: var(--space-6);
	width: 100%;
}

.pmap__text {
	max-width: 34rem;
}

@media screen and (max-width: 900px) {
	.pmap__top {
		flex-direction: column;
		align-items: flex-start;
	}
}

.label--small.pmap__label {
	display: inline-block;
	align-self: flex-start;
	padding: 0.375rem 0.75rem;
	margin-bottom: var(--space-3);
	color: var(--color-white);
	background-color: var(--color-primary);
	border-radius: 999px;
}

.pmap__canvas {
	width: 100%;
	height: clamp(20rem, 52vh, 34rem);
	background-color: var(--color-light-gray);
	border-radius: 0.625rem;
	overflow: hidden;
}

/* ------------------------------------------------- list (fallback + a11y) */

.pmap__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: var(--space-3);
	list-style: none;
	margin: 0;
	padding: 0;
}

.pmap__list-button {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.25rem;

	width: 100%;
	padding: var(--space-4);

	font-family: "Gotham", sans-serif;
	text-align: left;
	color: var(--color-dark);

	background-color: var(--color-light-gray);
	border: 0;
	border-radius: 0.625rem;
	cursor: pointer;

	transition: background-color 0.22s ease-out, transform 0.22s ease-out;
}

@media (hover: hover) {
	.pmap__list-button:hover,
	.pmap__list-button:focus-visible {
		background-color: var(--color-white);
		transform: translateY(-2px);
	}
}

.pmap__list-title {
	font-weight: 450;
	font-size: var(--text-base);
}

.pmap__list-address {
	font-size: var(--text-sm);
	opacity: 0.7;
}

/* -------------------------------------------------------------- modal */

.pmap-modal {
	position: fixed;
	inset: 0;
	z-index: 200;

	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-5);
}

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

.pmap-modal__backdrop {
	position: absolute;
	inset: 0;
	background-color: rgb(2 4 38 / 0.6);
	animation: pmap-fade 0.2s ease-out;
}

.pmap-modal__dialog {
	position: relative;
	z-index: 1;

	width: min(38rem, 100%);
	max-height: 86vh;
	overflow-y: auto;

	background-color: var(--color-white);
	border-radius: 0.625rem;
	box-shadow: 0 2rem 4rem rgb(2 4 38 / 0.3);

	animation: pmap-rise 0.26s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.pmap-modal__close {
	position: absolute;
	top: var(--space-4);
	right: var(--space-4);
	z-index: 2;

	display: flex;
	align-items: center;
	justify-content: center;

	width: 2.25rem;
	height: 2.25rem;

	color: var(--color-dark);
	background-color: var(--color-white);
	border: 0;
	border-radius: 50%;
	cursor: pointer;

	transition: background-color 0.2s ease-out;
}

.pmap-modal__close:hover,
.pmap-modal__close:focus-visible {
	background-color: var(--color-light-gray);
}

.pmap-modal__media {
	margin: 0;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background-color: var(--color-light-gray);
}

.pmap-modal__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pmap-modal__body {
	padding: var(--space-6);
}

.pmap-modal__title {
	margin: 0 0 var(--space-2);
}

.pmap-modal__address {
	margin: 0 0 var(--space-4);
	font-size: var(--text-sm);
	color: var(--color-dark);
	opacity: 0.7;
}

.pmap-modal__content > :last-child {
	margin-bottom: 0;
}

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

@keyframes pmap-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes pmap-rise {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.pmap-modal__backdrop,
	.pmap-modal__dialog {
		animation: none;
	}

	.pmap__list-button {
		transition: none;
	}
}
