/* Site notice (inc/notices.php, assets/js/notice.js): a card bottom right above a round button,
   minimizable to just the button, like a chat widget. Styled after the site's own blocks: muted
   blue-grey with the white hero wave, the Famiski mountain icon and the site's buttons. */

.famiski-notice {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 900;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 14px;
	max-width: calc(100vw - 32px);
	font-family: var(--famiski-font);
	color: var(--famiski-text-body);
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.3s ease, transform 0.3s ease;
	/* The empty area around the card and button must not block clicks on the page. */
	pointer-events: none;
}

.famiski-notice > * {
	pointer-events: auto;
}

.famiski-notice[hidden] {
	display: none;
}

.famiski-notice.is-visible {
	opacity: 1;
	transform: none;
}

/* The filter modals (travel party etc.) take the whole screen; keep the notice out of the way. */
body.tn-filter-modal-open .famiski-notice {
	display: none;
}

/* Card */

.famiski-notice__panel {
	width: 360px;
	max-width: 100%;
	max-height: calc(100vh - 150px);
	overflow-y: auto;
	background: var(--famiski-white);
	border-radius: 14px;
	box-shadow: 0 18px 50px rgba(7, 46, 66, 0.18), 0 2px 8px rgba(7, 46, 66, 0.08);
	transform-origin: bottom right;
}

.famiski-notice:not(.is-open) .famiski-notice__panel {
	display: none;
}

.famiski-notice.is-open .famiski-notice__panel {
	animation: famiski-notice-pop 0.25s ease-out;
}

@keyframes famiski-notice-pop {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.96);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

.famiski-notice__header {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.85rem;
	min-height: 64px;
	padding: 1.1rem 3rem 1.6rem 1.25rem;
	/* The site's white wave closes the header, as under the hero and info cards. */
	background: url("../images/hero-wave.svg") no-repeat center bottom / 220% 24px, var(--famiski-info-cards-bg);
}

.famiski-notice__icon {
	flex-shrink: 0;
	width: 40px;
	height: auto;
}

.famiski-notice__title {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--famiski-text);
}

.famiski-notice__minimize {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: var(--famiski-white);
	color: var(--famiski-text);
	font-size: 0.8rem;
	box-shadow: 0 1px 4px rgba(7, 46, 66, 0.12);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.famiski-notice__minimize:hover,
.famiski-notice__minimize:focus-visible {
	background: var(--famiski-primary);
	color: var(--famiski-white);
}

/* Content (block editor / HTML) */

.famiski-notice__content {
	padding: 0.4rem 1.25rem 1.35rem;
	font-size: 0.95rem;
	line-height: 1.55;
}

.famiski-notice__content > :first-child {
	margin-top: 0;
}

.famiski-notice__content > :last-child {
	margin-bottom: 0;
}

.famiski-notice__content p {
	margin: 0 0 0.75rem;
}

.famiski-notice__content h2,
.famiski-notice__content h3,
.famiski-notice__content h4 {
	margin: 0 0 0.5rem;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--famiski-text);
}

.famiski-notice__content ul {
	margin: 0 0 0.75rem;
	padding-left: 1.2rem;
}

.famiski-notice__content a:not(.wp-block-button__link) {
	color: var(--famiski-primary);
	font-weight: 600;
}

.famiski-notice__content img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: 10px;
}

.famiski-notice__content .wp-block-image {
	margin: 0 0 0.85rem;
}

/* Block editor buttons look like the site's .famiski-btn--primary, with its sliding chevron. */
.famiski-notice__content .wp-block-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 1rem 0 0;
}

.famiski-notice__content .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 11px 20px 9px;
	border: 1px solid var(--famiski-primary);
	border-radius: var(--famiski-radius);
	background: var(--famiski-primary);
	color: var(--famiski-white);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	transition: all 0.3s ease;
}

.famiski-notice__content .wp-block-button__link::after {
	content: "\f054";
	font-family: "Font Awesome 7 Free";
	font-size: 13px;
	font-weight: 900;
	transition: transform 0.3s ease;
}

.famiski-notice__content .wp-block-button__link:hover {
	border-color: var(--famiski-primary-hover);
	background: var(--famiski-primary-hover);
	color: var(--famiski-white);
}

.famiski-notice__content .wp-block-button__link:hover::after {
	transform: translateX(4px);
}

/* "Omlijnd" button style in the block editor: the site's secondary button. */
.famiski-notice__content .is-style-outline .wp-block-button__link {
	background: var(--famiski-white);
	color: var(--famiski-primary);
}

.famiski-notice__content .is-style-outline .wp-block-button__link:hover {
	background: var(--famiski-primary);
	color: var(--famiski-white);
}

/* Round button */

.famiski-notice__launcher {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	padding: 0;
	border: 2px solid var(--famiski-white);
	border-radius: 50%;
	background: var(--famiski-white);
	color: var(--famiski-primary);
	font-size: 1.2rem;
	box-shadow: 0 8px 24px rgba(7, 46, 66, 0.22);
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.famiski-notice__launcher:hover,
.famiski-notice__launcher:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 12px 28px rgba(7, 46, 66, 0.28);
}

.famiski-notice.is-open .famiski-notice__launcher {
	background: var(--famiski-primary);
	border-color: var(--famiski-primary);
	color: var(--famiski-white);
}

.famiski-notice__launcher-open {
	width: 32px;
	height: auto;
}

.famiski-notice.is-open .famiski-notice__launcher-open,
.famiski-notice:not(.is-open) .famiski-notice__launcher-close {
	display: none;
}

/* Small orange dot on the minimized button, so the notice is noticed. */
.famiski-notice__badge {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 14px;
	height: 14px;
	border: 2px solid var(--famiski-white);
	border-radius: 50%;
	background: #e8730c;
}

.famiski-notice.is-open .famiski-notice__badge {
	display: none;
}

@media (max-width: 767px) {
	.famiski-notice {
		right: 16px;
		bottom: calc(16px + env(safe-area-inset-bottom));
		gap: 10px;
	}

	.famiski-notice__panel {
		width: calc(100vw - 32px);
		max-height: 60vh;
	}

	.famiski-notice__launcher {
		width: 54px;
		height: 54px;
	}

	.famiski-notice__launcher-open {
		width: 28px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.famiski-notice,
	.famiski-notice.is-open .famiski-notice__panel {
		transition: none;
		animation: none;
	}
}
