/**
 * GM Theme – shared components (4.0.4): one style for buttons and form
 * fields on every page – since 4.0.7 again including the newsletter in the
 * footer (owner's choice).
 *
 * Before, the site had gold buttons with 15 px corners (home page,
 * downloads, forms) next to a black comment button and differently sized
 * form fields. Now every button is the gold button of the original design
 * (same height, corners, text) and every field matches it.
 *
 * Many rules need !important: blocks and Fluent Forms carry inline styles.
 */

:root {
	--gm-accent: #bf9a54; /* gold of the site's buttons */
	--gm-radius: 15px; /* corner radius of the site's buttons */
	--gm-control-h: 46px;
	--gm-field-line: #d2d2d7;
	--gm-ink: #1d1d1f;
}

/* ---------- Buttons ---------- */

.wp-block-button__link,
.wp-element-button,
.fluentform .ff-btn-submit,
.wp-block-search__button,
.comment-form input[type="submit"],
.wp-block-post-comments-form input[type="submit"] {
	box-sizing: border-box;
	min-height: var(--gm-control-h);
	padding: 0.75rem 1.5rem !important;
	border: 0 !important;
	border-radius: var(--gm-radius) !important;
	background: var(--gm-accent) !important;
	color: #fff !important;
	font-family: inherit !important;
	font-size: 0.9375rem !important;
	font-weight: 500 !important;
	line-height: 1.25 !important;
	letter-spacing: 0 !important;
	text-align: center;
	text-decoration: none !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: filter 0.2s ease;
}

.wp-block-button__link:hover,
.wp-element-button:hover,
.fluentform .ff-btn-submit:hover,
.wp-block-search__button:hover,
.comment-form input[type="submit"]:hover,
.wp-block-post-comments-form input[type="submit"]:hover {
	color: #fff !important;
	filter: brightness(0.92);
	opacity: 1 !important;
}

.wp-block-button__link:focus-visible,
.wp-element-button:focus-visible,
.fluentform .ff-btn-submit:focus-visible,
.wp-block-search__button:focus-visible,
.comment-form input[type="submit"]:focus-visible,
.wp-block-post-comments-form input[type="submit"]:focus-visible {
	outline: 2px solid var(--gm-ink);
	outline-offset: 3px;
}

/* ---------- Form fields (contact, order forms, comments) ---------- */

.fluentform .ff-el-form-control,
.comment-form :is(input[type="text"], input[type="email"], input[type="url"], textarea),
.wp-block-post-comments-form :is(input[type="text"], input[type="email"], input[type="url"], textarea) {
	box-sizing: border-box;
	min-height: var(--gm-control-h);
	padding: 0.7rem 1rem !important;
	border: 1px solid var(--gm-field-line) !important;
	border-radius: var(--gm-radius) !important;
	background: #fff !important;
	color: var(--gm-ink) !important;
	font-family: inherit !important;
	font-size: 0.9375rem !important;
	line-height: 1.4 !important;
	box-shadow: none !important;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fluentform textarea.ff-el-form-control,
.comment-form textarea,
.wp-block-post-comments-form textarea {
	min-height: 8rem;
}

.fluentform .ff-el-form-control::placeholder,
.comment-form :is(input, textarea)::placeholder,
.wp-block-post-comments-form :is(input, textarea)::placeholder {
	color: #86868b;
	opacity: 1;
}

.fluentform .ff-el-form-control:focus,
.comment-form :is(input, textarea):focus,
.wp-block-post-comments-form :is(input, textarea):focus {
	border-color: var(--gm-ink) !important;
	box-shadow: 0 0 0 3px rgba(29, 29, 31, 0.08) !important;
	outline: none;
}

/* ---------- Search fields (404 page and others) ----------
   White field like all other fields (the blog search adds its icon in
   blog.css). */

.wp-block-search .wp-block-search__inside-wrapper {
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: none !important;
}

.wp-block-search .wp-block-search__input {
	box-sizing: border-box;
	min-height: 2.5rem;
	padding: 0.6rem 1rem !important;
	border: 1px solid var(--gm-field-line) !important;
	border-radius: var(--gm-radius) !important;
	background: #fff !important;
	color: var(--gm-ink) !important;
	font-family: inherit !important;
	font-size: 0.9375rem !important;
	box-shadow: none !important;
}

.wp-block-search .wp-block-search__input::placeholder {
	color: #86868b;
	opacity: 1;
}

.wp-block-search .wp-block-search__input:focus {
	border-color: var(--gm-ink) !important;
	box-shadow: 0 0 0 3px rgba(29, 29, 31, 0.08) !important;
	outline: none;
}

/* The 404 title like all other page titles. */
body.error404 h1.wp-block-heading {
	font-size: clamp(1.875rem, 1.5rem + 1.5vw, 2.5rem) !important;
	font-weight: 500 !important;
	line-height: 1.15 !important;
	letter-spacing: -0.018em !important;
}

/* ---------- Page title for pages without one in the content ----------
   (inc/page-title.php) – same size and place as the other page titles. */

.wp-block-post-title.gm-page-title {
	box-sizing: border-box;
	max-width: calc(var(--wp--style--global--wide-size, 1200px) + 2 * var(--wp--preset--spacing--40, 1rem));
	margin: 0 auto !important;
	padding: var(--wp--preset--spacing--40, 1rem) var(--wp--preset--spacing--40, 1rem) var(--wp--preset--spacing--60, 2.25rem) !important;
	font-size: clamp(1.875rem, 1.5rem + 1.5vw, 2.5rem) !important;
	font-weight: 500 !important;
	line-height: 1.15 !important;
	letter-spacing: -0.018em !important;
	text-align: center;
	text-wrap: balance;
}

/* ---------- Long web addresses (sources) wrap on phones ---------- */

.wp-block-post-content :is(p, li) a {
	overflow-wrap: anywhere;
}

/* ---------- Galleries placed directly in a page ----------
   (Alpen, Vögel aus Afrika): same width and side space as all other
   gallery pages, whose gallery sits in a section (no overflow on phones). */

.wp-block-post-content > .gm-gallery-block {
	box-sizing: border-box;
	max-width: calc(1800px + 2 * var(--wp--preset--spacing--40, 1rem)) !important;
	margin-left: auto !important;
	margin-right: auto !important;
	padding-left: var(--wp--preset--spacing--40, 1rem);
	padding-right: var(--wp--preset--spacing--40, 1rem);
}

@media (prefers-reduced-motion: reduce) {

	.wp-block-button__link,
	.wp-element-button,
	.fluentform .ff-btn-submit,
	.fluentform .ff-el-form-control {
		transition: none;
	}
}
