/*
Theme Name: Mini Bildi
Description: A WordPress block theme built with Shader and VX Framework, with block templates and theme.json.
Author: Shader
Author URI: https://vxframework.com
Text Domain: mini-bildi
Version: 0.1.0
Requires at least: 7.1
Requires PHP: 8.1
Update URI: false
*/

/*
 * Plumbing only. The look lives in theme.json; this file holds what theme.json
 * can't express. It loads on the site and in the editor, so its rules must hold
 * in both.
 */

/* Room for a scrollbar on every page, so a short page and a long one line up
   where scrollbars take space, as on Windows, instead of the layout jumping
   sideways between them. */
html {
	scrollbar-gutter: stable;
}

/* WordPress puts a block gap between the template's top-level blocks: the
   header part, main and the footer part. Sections own their spacing instead.
   The editor's canvas root is .wp-site-blocks too while it shows a template,
   but there WordPress prints that gap after this file, so :root makes this win. */
:root .wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* With that gap gone, main keeps its distance from the header and footer. A
   template whose main starts or ends with a full-bleed section adds the
   is-flush class to main. */
.wp-site-blocks main {
	padding-block: var(--wp--preset--spacing--50);
}

.wp-site-blocks main.is-flush {
	padding-block: 0;
}

/* Keyboard focus stays visible on every control, and only there: in the
   editor, the text being typed in has focus too. */
:where(a, button, input, select, textarea, summary, [tabindex]:not([contenteditable])):focus-visible {
	outline: 3px solid var(--wp--preset--color--brush);
	outline-offset: 3px;
}

/* The call and chat icons used by the phone and WhatsApp buttons and by phone links in text. */
:root {
	--mb-icon-call: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 2.5h2.9c.5 0 .9.3 1 .8l.8 3.4c.1.4 0 .8-.3 1.100L9.500 9.200a13 13 0 0 0 5.300 5.300l1.400-1.500c.3-.3.7-.4 1.100-.3l3.400.8c.5.100.8.500.8 1v2.900c0 1.200-1 2.200-2.200 2.200C10.700 19.600 4.400 13.300 4.400 4.700c0-1.200 1-2.200 2.200-2.200z'/%3E%3C/svg%3E");
	--mb-icon-chat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.500C6.800 2.500 2.600 6.400 2.600 11.200c0 1.900.7 3.700 1.800 5.100L3.300 21.500l5.300-1.600c1 .4 2.200.6 3.400.6 5.200 0 9.400-3.900 9.400-8.700S17.200 2.500 12 2.500z'/%3E%3C/svg%3E");
}
.wp-block-paragraph a[href^="tel:"]::before,
.wp-block-accordion-panel a[href^="tel:"]::before,
.wp-block-paragraph a[href^="https://wa.me/"]::before,
.wp-block-accordion-panel a[href^="https://wa.me/"]::before {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-right: 0.3em;
	vertical-align: -0.12em;
	background: currentColor;
}
.wp-block-paragraph a[href^="tel:"]::before,
.wp-block-accordion-panel a[href^="tel:"]::before { -webkit-mask: var(--mb-icon-call) center / contain no-repeat; mask: var(--mb-icon-call) center / contain no-repeat; }
.wp-block-paragraph a[href^="https://wa.me/"]::before,
.wp-block-accordion-panel a[href^="https://wa.me/"]::before { -webkit-mask: var(--mb-icon-chat) center / contain no-repeat; mask: var(--mb-icon-chat) center / contain no-repeat; }

/* ---------- Header ---------- */
.site-header {
	background: var(--wp--preset--color--paper);
	border-bottom: 2px solid var(--wp--preset--color--ink);
}
/* The logo (a transparent PNG from the Mini Bildli settings page). */
.site-header .site-logo {
	margin: 0;
	flex: 0 0 auto;
}
.site-header .site-logo a { display: block; }
.site-header .site-logo img {
	display: block;
	width: clamp(9.5rem, 15vw, 12.5rem);
	height: auto;
	border-radius: 0;
}
.site-footer .footer-logo {
	width: fit-content;
	margin: 0;
	padding: 0.5rem 1rem;
	border-radius: 1.25rem;
	background: var(--wp--preset--color--paper);
}
.site-footer .footer-logo a { display: block; }
.site-footer .footer-logo img {
	display: block;
	width: 12rem;
	height: auto;
	border-radius: 0;
}
/* The menu stays on one line; where it would not fit, the header's request button gives way (the page has its own). */
.site-header .wp-block-navigation__container { gap: 0.1rem; flex-wrap: nowrap; }
.site-header .wp-block-navigation-item__content,
.site-header .wp-block-buttons .wp-element-button { white-space: nowrap; }
@media (max-width: 1180px) {
	.site-header .wp-block-buttons { display: none; }
}
/* Between a phone and a small laptop the menu sits behind the menu button, so it never runs off the screen. */
@media (min-width: 600px) and (max-width: 1040px) {
	.site-header .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none; }
	.site-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
}

/* ---------- Language switcher ---------- */
.language-switcher ul {
	display: flex;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}
.language-switcher a {
	display: block;
	padding: 0.3rem 0.6rem;
	border: 2px solid transparent;
	border-radius: var(--wp--custom--radius--pill);
	color: inherit;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
}
.language-switcher a:hover,
.language-switcher a:focus-visible { border-color: currentColor; }
.language-switcher a[aria-current] {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
}
.site-footer .language-switcher a[aria-current] {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--ink);
}
@media (max-width: 600px) {
	.site-header .language-switcher ul { gap: 0; }
	.site-header .language-switcher a { padding: 0.25rem 0.4rem; font-size: 0.8125rem; }
}
.site-header .wp-block-navigation__responsive-container-open svg,
.site-header .wp-block-navigation__responsive-container-close svg {
	width: 28px;
	height: 28px;
}
.site-header .wp-block-navigation-item__content {
	padding: 0.5rem 0.75rem;
	border-radius: var(--wp--custom--radius--pill);
	transition: background-color 0.2s ease;
}
.site-header .wp-block-navigation-item__content:hover,
.site-header .wp-block-navigation-item__content:focus-visible,
.site-header .wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content {
	background: var(--wp--preset--color--gold-soft);
}
.wp-block-navigation .wp-block-navigation__submenu-container {
	min-width: 18rem;
	padding: 0.5rem;
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: 1.25rem;
	background: var(--wp--preset--color--white);
	box-shadow: var(--wp--preset--shadow--pop);
}
.site-header .wp-block-buttons .wp-element-button {
	padding: 0.65em 1.2em;
	font-size: var(--wp--preset--font-size--small);
}
.wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	padding: var(--wp--preset--spacing--50);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--large);
}

/* ---------- Footer ---------- */
/* The faces from the stationery, in the brand blue, on paper above the dark footer. */
.footer-faces {
	height: clamp(7rem, 17vw, 13rem);
	background: var(--wp--preset--color--paper) url(assets/images/faces.png) center bottom / cover no-repeat;
}
.site-footer {
	position: relative;
	margin-top: calc(var(--wp--preset--spacing--50) * -1);
	border-radius: 2.5rem 2.5rem 0 0;
}
.site-footer {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
}
.site-footer a,
.site-footer .wp-block-navigation-item__content {
	color: var(--wp--preset--color--paper);
	text-decoration: none;
}
.site-footer a:hover,
.site-footer a:focus-visible,
.site-footer .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--gold);
	text-decoration: underline;
}
.site-footer .wp-block-heading,
.site-footer .footer-label {
	color: var(--wp--preset--color--gold);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.site-footer .wp-block-site-title a { color: var(--wp--preset--color--paper); }
.site-footer .wp-block-site-title a::before { content: none; }
.site-footer .wp-block-navigation { gap: 0.5rem; }
.site-footer .wp-block-navigation__container { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
.site-footer .wp-element-button { background: var(--wp--preset--color--gold); color: var(--wp--preset--color--ink); border-color: var(--wp--preset--color--paper); box-shadow: 4px 4px 0 var(--wp--preset--color--paper); }
.site-footer .wp-element-button:hover { background: var(--wp--preset--color--paper); }
.site-footer .is-style-outline .wp-element-button { background: transparent; color: var(--wp--preset--color--paper); box-shadow: none; }
.site-footer .is-style-outline .wp-element-button:hover { background: var(--wp--preset--color--paper); color: var(--wp--preset--color--ink); }
.site-footer .language-switcher img { display: inline-block; vertical-align: middle; }
.site-footer .language-switcher ul { flex-wrap: wrap; }
.site-footer .wp-block-buttons {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.85rem;
	max-width: 22rem;
}
.site-footer .wp-block-buttons > .wp-block-button { width: 100%; margin: 0; }
.site-footer .wp-block-buttons .wp-element-button {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	padding: 0.7em 1em;
	font-size: 0.9375rem;
	text-align: center;
}
/* The footer columns stack: two on a tablet, one on a phone. */
@media (max-width: 960px) {
	.site-footer > .wp-block-group.alignwide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	.site-footer > .wp-block-group.alignwide { grid-template-columns: minmax(0, 1fr); }
}

/* Long German words never push a headline past the screen. */
.wp-block-heading,
.wp-block-post-title,
.wp-block-query-title {
	overflow-wrap: break-word;
	hyphens: auto;
}

/* ---------- Page breadcrumbs ---------- */
.wp-block-breadcrumbs {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--ink-soft);
}
.wp-block-breadcrumbs a { color: inherit; text-decoration: none; font-weight: 700; }
.wp-block-breadcrumbs a:hover { text-decoration: underline; }
.wp-block-breadcrumbs ol { padding-left: 0; }

/* ---------- Accordion: the FAQ ---------- */
.wp-block-accordion { display: grid; gap: var(--wp--preset--spacing--30); }
.wp-block-accordion-item {
	background: var(--wp--preset--color--white);
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: 1.25rem;
	overflow: hidden;
	transition: box-shadow 0.2s ease, background-color 0.2s ease;
}
.wp-block-accordion-item.is-open { box-shadow: var(--wp--preset--shadow--pop); background: var(--wp--preset--color--gold-soft); }
.wp-block-accordion-heading { margin: 0; }
.wp-block-accordion-heading__toggle {
	padding: 1.1rem 1.4rem;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
	line-height: 1.25;
	text-align: left;
}
.wp-block-accordion-heading__toggle-icon { font-size: 1.5rem; font-weight: 700; }
.wp-block-accordion-panel { padding: 0 1.4rem 1.2rem; }
.wp-block-accordion-panel > * { margin-block: 0; }

/* ---------- Lists of cards (reviews, search results): three across, two on a tablet, one on a phone ---------- */
.wp-block-post-template.is-layout-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: start;
	gap: var(--wp--preset--spacing--40);
}
@media (max-width: 960px) {
	.wp-block-post-template.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	.wp-block-post-template.is-layout-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Page rhythm ---------- */
.wp-block-post-content > .wp-block-group.alignfull:last-child { margin-bottom: 0; }
.has-small-font-size.price-note { color: var(--wp--preset--color--ink-soft); }

/* ---------- Reveal on scroll (theme.js adds .is-reveal-ready only once it runs) ---------- */
@media (prefers-reduced-motion: no-preference) {
	.is-reveal-ready:not(.is-revealed) {
		opacity: 0;
		translate: 0 1.25rem;
	}
	.is-reveal-ready.is-revealed {
		animation: mb-reveal 0.6s ease backwards;
	}
	@keyframes mb-reveal {
		from {
			opacity: 0;
			translate: 0 1.25rem;
		}
	}
}
