/*
 * Mine Pligter: CSS that theme.json can't express.
 * Colours, fonts and sizes come from theme.json presets; don't add new values here.
 */

/* Phones: long German and Polish words in headings break with a hyphen (uses the page's lang). */
@media (max-width: 600px) {
	h1,
	h2 {
		-webkit-hyphens: auto;
		hyphens: auto;
	}
}

/* ---------- Header ---------- */

/* Sticky, below the admin bar when logged in. */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 100;
}

@media (max-width: 600px) {
	/* The admin bar scrolls away on phones. */
	.wp-site-blocks > header.wp-block-template-part {
		top: 0;
	}
}

/*
 * Frosted background on a pseudo-element: backdrop-filter on the header itself
 * would trap the mobile menu overlay (position: fixed) inside the header box.
 */
.minepligter-header {
	position: relative;
	isolation: isolate;
}

.minepligter-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: color-mix(in srgb, var(--wp--preset--color--base) 88%, transparent);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	backdrop-filter: saturate(180%) blur(14px);
}

/* A soft shadow fades in once the page scrolls (browsers without scroll timelines: none). */
@supports (animation-timeline: scroll()) {
	.minepligter-header::before {
		animation: minepligter-header-shadow linear both;
		animation-timeline: scroll(root);
		animation-range: 0 96px;
	}
}

@keyframes minepligter-header-shadow {
	to {
		box-shadow: 0 8px 24px -16px color-mix(in srgb, var(--wp--preset--color--contrast) 45%, transparent);
	}
}

/* No white strip between the header, the first section and the footer (the root block gap). */
.wp-site-blocks > header.wp-block-template-part + *,
.wp-site-blocks > footer.wp-block-template-part {
	margin-block-start: 0;
}

/* Anchored sections (#features, #faq, #download) stop below the sticky header. */
:where([id]) {
	scroll-margin-top: 6rem;
}

.minepligter-header-actions .wp-block-navigation {
	font-size: var(--wp--preset--font-size--small);
}

.minepligter-header-cta .wp-block-button__link {
	padding: 0.6em 1.15em;
	font-size: var(--wp--preset--font-size--small);
	white-space: nowrap;
}

@media (max-width: 599px) {
	/* Phones: icon, name, download button, menu. Languages are in the footer. */
	.minepligter-header-languages {
		display: none;
	}

	.minepligter-header-actions .wp-block-navigation {
		order: 3;
	}

	.minepligter-header .minepligter-brand-name {
		font-size: var(--wp--preset--font-size--medium);
	}
}

/* ---------- Brand (header and footer) ---------- */

.minepligter-brand {
	position: relative;
}

.minepligter-brand-icon {
	flex-shrink: 0;
	margin: 0;
}

.minepligter-brand-icon img {
	display: block;
	border-radius: 22.5%;
	box-shadow: 0 1px 3px color-mix(in srgb, var(--wp--preset--color--contrast) 18%, transparent);
}

.wp-block-site-title.minepligter-brand-name {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 900;
	letter-spacing: -0.01em;
	line-height: 1.15;
	text-transform: none;
}

.minepligter-brand-name a {
	color: inherit;
	text-decoration: none;
}

/* The whole brand (icon + name) is one click target. */
.minepligter-brand-name a::after {
	content: "";
	position: absolute;
	inset: 0;
}

/* ---------- App Store badge ---------- */

.minepligter-app-badge {
	display: inline-block;
	line-height: 0;
	border-radius: 10px;
}

.minepligter-app-badge img {
	display: block;
	width: auto;
}

.minepligter-app-badge:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
	.minepligter-app-badge {
		transition: transform 0.15s ease;
	}

	.minepligter-app-badge:hover {
		transform: translateY(-2px);
	}
}

/* ---------- Footer ---------- */

.minepligter-footer {
	font-size: var(--wp--preset--font-size--small);
}

.minepligter-footer a,
.minepligter-footer .wp-block-navigation .wp-block-navigation-item__content {
	color: var(--wp--preset--color--base-2);
	text-decoration: none;
}

.minepligter-footer a:hover,
.minepligter-footer .wp-block-navigation .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--accent);
	text-decoration: underline;
}

.minepligter-footer .wp-block-site-title.minepligter-brand-name,
.minepligter-footer .minepligter-brand-name a {
	color: var(--wp--preset--color--base);
}

.minepligter-footer .minepligter-brand-name a:hover {
	text-decoration: none;
}

.minepligter-footer-tagline {
	max-width: 22rem;
}

.wp-block-heading.minepligter-footer-heading {
	margin-bottom: var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--base);
	font-size: 0.8125rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.minepligter-footer .wp-block-navigation {
	gap: 0.7rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
}

.minepligter-footer-address {
	line-height: 1.7;
}

.minepligter-footer-bottom {
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--base) 14%, transparent);
}

.minepligter-footer-bottom p {
	margin: 0;
}

/* "Other languages:" and Polylang's horizontal switcher (a list) on one line. */
.minepligter-footer-languages {
	flex-wrap: nowrap !important;
	align-items: baseline !important;
}

.minepligter-footer-languages p {
	white-space: nowrap;
}

.minepligter-footer-languages a {
	padding: 0 !important;
}

.minepligter-footer-languages ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 781px) {
	/* Columns stack on phones and small tablets; keep the two menus side by side. */
	.minepligter-footer-columns {
		flex-wrap: wrap !important;
	}

	.minepligter-footer-columns > .wp-block-column:first-child,
	.minepligter-footer-columns > .wp-block-column:last-child {
		flex-basis: 100% !important;
	}

	.minepligter-footer-columns > .wp-block-column:nth-child(2),
	.minepligter-footer-columns > .wp-block-column:nth-child(3) {
		flex-basis: calc(50% - var(--wp--preset--spacing--60) / 2) !important;
		flex-grow: 0;
	}
}
