/*
Theme Name: HGK
Theme URI: https://hgkoehler.de/
Author: Kampagnenreiter
Description: Block-Theme für hgkoehler.de, ohne Page Builder. Farben, Schriften und Abstände liegen in theme.json, Abschnitte als Blockstile und Vorlagen.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 0.2.5
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hgk
*/

/* ---------- Abschnitte stoßen ohne Lücke aneinander ---------- */

.wp-site-blocks > main,
.wp-site-blocks > footer,
.wp-block-post-content > .alignfull {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* ---------- Header: bleibt beim Scrollen oben ---------- */

.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 100;
	box-shadow: 0 2px 12px rgba(12, 39, 67, 0.08);
}

@media (max-width: 600px) {
	/* Die Admin-Leiste scrollt auf kleinen Bildschirmen mit */
	.wp-site-blocks > header.wp-block-template-part {
		top: 0;
	}
}

.hgk-topbar {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	font-size: 14px;
	padding-top: 10px;
	padding-bottom: 10px;
}

/* .wp-site-blocks davor, damit die globale Linkfarbe aus theme.json hier nicht greift */
.wp-site-blocks .hgk-topbar a {
	color: var(--wp--preset--color--base);
	text-decoration: none;
}

.wp-site-blocks .hgk-topbar a:hover,
.wp-site-blocks .hgk-topbar a:focus {
	color: var(--wp--preset--color--secondary);
}

.hgk-mainbar {
	background-color: var(--wp--preset--color--base);
	padding-top: 15px;
	padding-bottom: 15px;
}

.hgk-mainbar .wp-block-site-title a {
	text-decoration: none;
}

.hgk-mainbar .wp-block-navigation a {
	text-decoration: none;
}

/* ---------- Icons vor Telefon und E-Mail ---------- */

.is-style-hgk-icon-phone::before,
.is-style-hgk-icon-mail::before {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-right: 10px;
	vertical-align: -0.15em;
	background-color: currentColor;
	-webkit-mask: var(--hgk-icon) no-repeat center / contain;
	mask: var(--hgk-icon) no-repeat center / contain;
}

.is-style-hgk-icon-phone {
	--hgk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8c1.4 2.8 3.8 5.1 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1C10.6 21 3 13.4 3 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.3 0 .7-.2 1z'/%3E%3C/svg%3E");
}

.is-style-hgk-icon-mail {
	--hgk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5z'/%3E%3C/svg%3E");
}

/* ---------- Abschnitte (Blockstile für Gruppen) ---------- */

/* Hero: oben Gold, unten ein weißer Streifen, Text weiß */
.is-style-hgk-hero {
	background: linear-gradient(to bottom, var(--wp--preset--color--secondary) 80%, var(--wp--preset--color--base) 80%);
	padding-top: var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--50);
}

.is-style-hgk-hero :is(h1, h2, h3, p) {
	color: var(--wp--preset--color--base);
}

/* Gold: ganze Fläche Gold, Text weiß */
.is-style-hgk-gold {
	background-color: var(--wp--preset--color--secondary);
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--60);
}

.is-style-hgk-gold :is(h1, h2, h3, p) {
	color: var(--wp--preset--color--base);
}

/* Textlinks auf goldenem Grund weiß */
:is(.is-style-hgk-hero, .is-style-hgk-gold) a:where(:not(.wp-element-button)) {
	color: var(--wp--preset--color--base);
}

/* Goldstreifen: weiß mit goldenem Streifen unten, das Bild ragt hinein */
.is-style-hgk-goldstreifen {
	background: linear-gradient(to bottom, var(--wp--preset--color--base) 80%, var(--wp--preset--color--secondary) 80%);
	padding-top: var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--40);
}

/* Spalten, die auf dem Handy die Reihenfolge tauschen (Text vor Bild) */
@media (max-width: 781px) {
	.wp-block-columns.is-style-hgk-umgekehrt {
		flex-direction: column-reverse;
	}
}

/* ---------- Bilder: leichte Bewegung beim Scrollen (ersetzt Elementor Motion Effects) ---------- */

@keyframes hgk-parallax {
	from {
		transform: translateY(50px);
	}
	to {
		transform: translateY(-50px);
	}
}

@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: view()) {
		.is-style-hgk-parallax img {
			animation: hgk-parallax linear both;
			animation-timeline: view();
		}
	}
}

/* ---------- Buttons auf dem Handy über die volle Breite ---------- */

@media (max-width: 781px) {
	.wp-block-post-content .wp-block-buttons > .wp-block-button {
		flex-basis: 100%;
	}

	.wp-block-post-content .wp-block-button__link {
		width: 100%;
	}
}

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

.hgk-footer {
	position: relative;
	padding-top: 33px;
	padding-bottom: 33px;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.hgk-footer .wp-block-navigation {
	font-size: 20px;
}

.hgk-footer .wp-block-navigation a {
	text-decoration: none;
}

/* ---------- Goldlinie: weißer Abschnitt mit schmaler goldener Linie unten ---------- */

.is-style-hgk-goldlinie {
	border-bottom: 4px solid var(--wp--preset--color--secondary);
}

/* ---------- Aufklapp-Texte (Fragen und Antworten) ---------- */

.wp-block-details {
	border-bottom: 1px solid rgba(12, 39, 67, 0.2);
	padding-block: 15px;
}

.wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--wp--preset--color--primary);
}

.wp-block-details[open] summary {
	margin-bottom: 0.75em;
}

/* ---------- Trennlinien ---------- */

.wp-block-separator {
	border: 0;
	border-top: 1px solid rgba(12, 39, 67, 0.25);
	margin-block: var(--wp--preset--spacing--40);
}

/* ---------- Kontaktformular (inc/kontaktformular.php) ---------- */

.hgk-kontakt {
	display: flex;
	flex-wrap: wrap;
	gap: 0 26px;
	max-width: 850px;
	margin-inline: auto;
	padding: clamp(24px, 5vw, 42px) clamp(20px, 6vw, 68px);
	background-color: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--base);
	text-align: left;
}

.hgk-kontakt__feld,
.hgk-kontakt__senden,
.hgk-kontakt__fehler {
	flex: 1 1 100%;
	margin: 0 0 24px;
}

.hgk-kontakt__feld--halb {
	flex: 1 1 calc(50% - 13px);
	min-width: 220px;
}

.hgk-kontakt label {
	display: block;
	font-size: 20px;
}

.hgk-kontakt :is(input[type="text"], input[type="email"], select, textarea) {
	box-sizing: border-box;
	width: 100%;
	min-height: 40px;
	padding: 8px 16px;
	border: 0;
	border-radius: 0;
	background-color: var(--wp--preset--color--base);
	color: #000;
	font: inherit;
	font-size: 16px;
}

.hgk-kontakt__feld--zustimmung {
	display: flex;
	gap: 10px;
	align-items: flex-start;
}

.hgk-kontakt__feld--zustimmung input {
	margin-top: 4px;
}

.hgk-kontakt__feld--zustimmung label {
	font-size: 14px;
}

.hgk-kontakt a {
	color: var(--wp--preset--color--base);
	text-decoration: underline;
}

.hgk-kontakt__senden {
	text-align: center;
}

.hgk-kontakt button {
	padding: 15px 30px;
	border: 0;
	border-radius: 0;
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	cursor: pointer;
}

.hgk-kontakt button:hover,
.hgk-kontakt button:focus {
	background-color: var(--wp--preset--color--primary);
}

.hgk-kontakt__fehler {
	padding: 10px 16px;
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--accent);
}

/* Für Menschen unsichtbar, Bots füllen es aus */
.hgk-kontakt__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
