/* Das Template setzt overflow-x:hidden auf den body. Das macht den body zum Scroll-Container und verhindert "sticky"
   (die Schublade bliebe nicht oben). Auf html gesetzt gilt es für das ganze Fenster, ohne den body zum Container zu machen;
   das funktioniert in allen Browsern. */
html { overflow-x: hidden; }
body#sunfw-master { overflow-x: visible; overflow-y: visible; }

/* Scrollbar-Platz immer reservieren: kein seitliches Springen zwischen kurzen und langen Seiten */
html { overflow-y: scroll; }

/* ---------- Footer am unteren Fensterrand, wenn die Seite kurz ist ---------- */
body#sunfw-master {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	height: auto;
}
body#sunfw-master > #sunfw-wrapper {
	display: flex;
	flex-direction: column;
	flex: 1 0 auto;
	height: auto;
}
#sunfw-wrapper > .sunfw_section_footer {
	margin-top: auto;
}
/* immer etwas Luft zwischen Inhaltskarte und Footer */
#sunfw_section_allgemeine-inhalte {
	padding-bottom: 30px;
}

/* ---------- Formularfelder ---------- */
:root {
	--f-accent: #0093dd;
	--f-accent-dark: #006fa8;
	--f-border: #c3cdd6;
	--f-text: #2b3640;
	--f-bg: #fff;
}

body input[type="text"],
body input[type="search"],
body input[type="email"],
body input[type="number"],
body input[type="url"],
body input[type="password"],
body textarea,
body select {
	box-sizing: border-box;
	font: inherit;
	font-size: 0.95em;
	line-height: 1.3;
	color: var(--f-text);
	background-color: var(--f-bg);
	border: 1px solid var(--f-border);
	border-radius: 6px;
	padding: 0.4em 0.7em;
	min-height: 2.3em;
	transition: border-color 0.15s, box-shadow 0.15s;
}
body input[type="text"]:hover,
body input[type="search"]:hover,
body textarea:hover,
body select:hover {
	border-color: #94a4b3;
}
body input[type="text"]:focus,
body input[type="search"]:focus,
body input[type="email"]:focus,
body input[type="number"]:focus,
body input[type="url"]:focus,
body input[type="password"]:focus,
body textarea:focus,
body select:focus {
	outline: none;
	border-color: var(--f-accent);
	box-shadow: 0 0 0 3px rgba(0, 147, 221, 0.2);
}
body input::placeholder,
body textarea::placeholder {
	color: #8a97a3;
}

/* Dropdowns: eigener Pfeil statt Browser-Standard */
body select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding-right: 2.2em;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23526371' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75em center;
	background-size: 0.8em;
}
body select:disabled,
body input:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* Checkboxen und Radiobuttons */
body input[type="checkbox"],
body input[type="radio"] {
	accent-color: var(--f-accent);
	width: 1.05em;
	height: 1.05em;
	vertical-align: -0.15em;
	cursor: pointer;
}

/* Knöpfe */
body input[type="submit"],
body input[type="button"],
body input[type="reset"],
body button:not(.dropbtn):not(.close):not(.navbar-toggle):not(.sunfw-scrollup) {
	font: inherit;
	font-size: 0.95em;
	line-height: 1.3;
	color: #fff;
	background: var(--f-accent);
	border: 1px solid var(--f-accent);
	border-radius: 6px;
	padding: 0.4em 1em;
	min-height: 2.3em;
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
body input[type="submit"]:hover,
body input[type="button"]:hover,
body input[type="reset"]:hover,
body button:not(.dropbtn):not(.close):not(.navbar-toggle):not(.sunfw-scrollup):hover {
	background: var(--f-accent-dark);
	border-color: var(--f-accent-dark);
}
body input[type="submit"]:focus-visible,
body input[type="button"]:focus-visible,
body input[type="reset"]:focus-visible,
body button:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 147, 221, 0.3);
}
/* zweitrangige Knöpfe (Reset, Blättern) heller */
body button.suche_reset,
body button.blaettern_rueckwaerts,
body button.blaettern_vorwaerts,
body input[type="reset"] {
	color: var(--f-accent-dark);
	background: #fff;
	border-color: var(--f-border);
}
body button.suche_reset:hover,
body button.blaettern_rueckwaerts:hover,
body button.blaettern_vorwaerts:hover,
body input[type="reset"]:hover {
	color: var(--f-accent-dark);
	background: #eef6fb;
	border-color: var(--f-accent);
}

/* Startseite: Suchfeld im Banner behält sein eigenes Aussehen (templates/.../custom.css) */
body form#_searchForm input[type="search"],
body form#_searchForm button {
	min-height: 0;
	border-radius: 0;
	box-shadow: none;
}
body form#_searchForm button {
	padding: 0 0.8em;
}

/* ---------- Hamburger-Menü: Symbol im Kopfbalken, Schublade darunter ---------- */
#sunfw_section_header { position: relative; }
body#sunfw-master button.hz-burger {
	position: absolute;
	top: 50%;
	left: 14px;
	z-index: 5;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 5px;
	cursor: pointer;
}
body#sunfw-master button.hz-burger:hover { background: rgba(255, 255, 255, 0.18); }
body#sunfw-master button.hz-burger:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: none; }
.hz-burger span {
	display: block;
	width: 24px;
	height: 2px;
	border-radius: 1px;
	background: #fff;
}
.hz-scrim {
	display: none;
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1200;
	background: rgba(0, 0, 0, 0.4);
}
/* Die Schublade steht im Seitenfluss direkt unter dem Kopfbalken und bleibt beim Scrollen oben haften (sticky).
   Der Anfangszustand kommt allein aus CSS (breit: offen, schmal: zu), damit beim Seitenwechsel nichts springt. */
.hz-drawer {
	display: none;
	position: sticky;
	top: 0;
	align-self: flex-start;
	z-index: 1201;
	width: 280px;
	max-width: 85vw;
	height: 100vh;
	height: var(--hz-h, 100vh); /* menu.js kürzt sie auf den Platz unter dem Kopf, damit sie nicht über den Footer hinausragt */
	margin-bottom: -100vh; /* braucht keinen eigenen Platz im Fluss */
	margin-bottom: calc(-1 * var(--hz-h, 100vh));
	box-sizing: border-box;
	padding: 8px 0 24px;
	overflow-y: auto;
	background: #fff;
	box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
}
.hz-menu, .hz-sub { list-style: none; margin: 0; padding: 0; }
.hz-menu a,
body#sunfw-master button.hz-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	box-sizing: border-box;
	min-height: 48px;
	padding: 0 20px;
	font: inherit;
	font-size: 1.05em;
	line-height: 1.2;
	color: #2b3640;
	text-align: left;
	text-decoration: none;
	background: none;
	border: 0;
	border-radius: 0;
	cursor: pointer;
}
.hz-menu a:hover,
body#sunfw-master button.hz-toggle:hover { background: #eef6fb; color: #006fa8; }
.hz-menu a.current { background: #dfe5ea; font-weight: 600; }
.hz-menu a:focus-visible,
body#sunfw-master button.hz-toggle:focus-visible { outline: 2px solid #0093dd; outline-offset: -2px; }
body#sunfw-master button.hz-toggle::after {
	content: "";
	flex: 0 0 auto;
	width: 0.7em;
	height: 0.7em;
	margin-left: 0.8em;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23526371' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform 0.15s;
}
.hz-group.open > button.hz-toggle::after { transform: rotate(180deg); }
.hz-sub { display: none; background: #f6f8fa; }
.hz-group.open > .hz-sub { display: block; }
.hz-sub a { padding-left: 36px; font-size: 0.98em; }

/* Kopfbalken: Hamburger ganz links, Logo und Titel direkt daneben (wie idiotikon.ch), Siegel rechts */
#sunfw_section_header .container {
	width: auto;
	max-width: none;
	padding-left: 66px;
	padding-right: 24px;
}

/* schmale Fenster: Schublade liegt über dem Inhalt, wenn geöffnet */
@media (max-width: 1279px) {
	body.hz-nav-open .hz-scrim { display: block; }
	body.hz-nav-open .hz-drawer { display: block; animation: hz-slide-in 0.2s ease; }
}
@keyframes hz-slide-in { from { transform: translateX(-100%); } }

/* breite Fenster: Schublade offen unter dem Kopf, der Inhalt rückt nach rechts (zu, wenn body.hz-nav-closed) */
@media (min-width: 1280px) {
	.hz-drawer { display: block; box-shadow: 1px 0 0 rgba(0, 0, 0, 0.12); }
	body.hz-nav-closed .hz-drawer { display: none; }
	body:not(.hz-nav-closed) #sunfw-wrapper > .sunfw-section:not(.sunfw_section_social_media):not(.sunfw_section_header) { margin-left: 280px; }
	body:not(.hz-nav-closed) #sunfw-wrapper > .sunfw-section:not(.sunfw_section_social_media):not(.sunfw_section_header) .container {
		width: auto;
		max-width: 1170px;
	}
}
@media (prefers-reduced-motion: reduce) {
	.hz-drawer { animation: none !important; }
}
