/*
Theme Name: toweb Starter
Theme URI: https://toweb.ch
Author: toweb
Author URI: https://toweb.ch
Description: Universelles Block Theme für Schweizer KMU – mit Setup-Assistent: Branche, Logo & CI, Header, Footer und Seiten in 5 Schritten.
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Version: 2.28.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: toweb-starter
Tags: block-theme, full-site-editing, business
*/

/* Globale Styles kommen aus theme.json – hier nur Ergänzungen. */

/* --- Logo / Titel-Fallback ---
   Wenn ein Logo gesetzt ist (body.wp-custom-logo), Titel ausblenden;
   ohne Logo den Titel als Marke anzeigen, das Logo-Element ausblenden. */
.toweb-brand-title {
	display: inline-block;
}
.wp-custom-logo .toweb-brand-title {
	display: none;
}
.wp-block-site-logo {
	display: none;
}
.wp-custom-logo .wp-block-site-logo {
	display: block;
}

/* --- Checkliste --- */
.wp-block-list.is-style-checklist {
	list-style: none;
	padding-left: 0;
}
.wp-block-list.is-style-checklist li {
	position: relative;
	padding-left: 1.9em;
}
.wp-block-list.is-style-checklist li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.15em;
	width: 1.2em;
	height: 1.2em;
	border-radius: 50%;
	background-color: var(--wp--preset--color--primary);
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='white' d='M9 16.2l-3.5-3.5L4 14.2 9 19.2 20 8.2l-1.5-1.5z'/></svg>") center / 75% no-repeat;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='white' d='M9 16.2l-3.5-3.5L4 14.2 9 19.2 20 8.2l-1.5-1.5z'/></svg>") center / 75% no-repeat;
}

/* --- Ohne Aufzählung --- */
.wp-block-list.is-style-no-bullets {
	list-style: none;
	padding-left: 0;
}

/* --- Kein Standard-Abstand zwischen Top-Level-Blöcken & Full-Width-Sektionen ---
   Entfernt das von WordPress generierte margin-block-start:24px dort, wo
   Sektionen bündig sitzen sollen. Fliesstext-Abstände bleiben erhalten. */
:root .wp-site-blocks > * {
	margin-block-start: 0;
}
:root .is-layout-flow > .wp-block-group.alignfull {
	margin-block-start: 0;
}

/* === Mobile-Menü-Stile (eine einheitliche Lösung für alle Header) ===
   Überschreibt das Standard-Vollbild-Overlay des Navigation-Blocks. */

/* Off-Canvas (Sidebar): Schublade statt Vollbild */
.toweb-mobilemenu--offcanvas-left .wp-block-navigation__responsive-container.is-menu-open,
.toweb-mobilemenu--offcanvas-right .wp-block-navigation__responsive-container.is-menu-open {
	width: min(330px, 85vw);
	max-width: 85vw;
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
}
.toweb-mobilemenu--offcanvas-right .wp-block-navigation__responsive-container.is-menu-open {
	left: auto;
	right: 0;
}
.toweb-mobilemenu--offcanvas-left .wp-block-navigation__responsive-container.is-menu-open {
	right: auto;
	left: 0;
}

/* Dropdown: Panel von oben mit automatischer Höhe */
.toweb-mobilemenu--dropdown .wp-block-navigation__responsive-container.is-menu-open {
	top: 0;
	left: 0;
	right: 0;
	bottom: auto;
	height: auto;
	max-height: 100vh;
	overflow-y: auto;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

/* === Header responsiv (Tablet + Mobile) ===
   WordPress zeigt den Burger erst < 600px. Wir ziehen das auf Tablet hoch,
   damit alle Header-Layouts sauber zu Logo + Burger kollabieren. */
@media (max-width: 781px) {
	/* Burger auch auf Tablet zeigen … */
	.toweb-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex !important;
	}
	/* … und das Inline-Menü ausblenden (ausser geöffnet) */
	.toweb-header .wp-block-navigation__responsive-container:not(.is-menu-open) {
		display: none !important;
	}
	/* Eigenständiger CTA-Button im Header mobil ausblenden (Link ist im Menü) */
	.toweb-header .wp-block-buttons {
		display: none !important;
	}
	/* Split-Header: Spalten nicht in drei Reihen stapeln, sondern eine Zeile */
	.toweb-header .wp-block-columns {
		flex-wrap: nowrap !important;
		align-items: center !important;
		gap: 12px;
	}
	.toweb-header .wp-block-columns > .wp-block-column {
		width: auto !important;
		flex: 1 1 auto !important;
	}
}

/* --- Sticky Header --- */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
}

/* --- Details / FAQ --- */
.wp-block-details summary {
	cursor: pointer;
	font-size: 1.05rem;
}
.wp-block-details[open] summary {
	margin-bottom: 0.75rem;
}

/* --- Karten-Hover auf Startseite --- */
.wp-block-column .wp-block-group.has-border-color {
	transition: transform .15s ease, box-shadow .15s ease;
}
.wp-block-column .wp-block-group.has-border-color:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

/* === Header/Footer Farbschema (Setup-Option Hell/Dunkel) === */

/* Dunkler Header: heller Text auf Kontrast-Hintergrund */
.toweb-header--dark .has-base-background-color {
	background-color: var(--wp--preset--color--contrast) !important;
	border-bottom-color: rgba(255, 255, 255, 0.14) !important;
}
.toweb-header--dark .wp-block-site-title,
.toweb-header--dark .wp-block-site-title a {
	color: var(--wp--preset--color--base) !important;
}
.toweb-header--dark nav.wp-block-navigation,
.toweb-header--dark .wp-block-navigation a,
.toweb-header--dark .wp-block-navigation .wp-block-navigation-item__content {
	color: var(--wp--preset--color--base) !important;
}

/* Heller Footer: dunkler Text auf hellem Hintergrund */
.toweb-footer--light .has-contrast-background-color {
	background-color: var(--wp--preset--color--base-alt) !important;
}
.toweb-footer--light .has-base-color {
	color: var(--wp--preset--color--secondary) !important;
}
.toweb-footer--light h3,
.toweb-footer--light h4,
.toweb-footer--light .wp-block-site-title,
.toweb-footer--light .wp-block-site-title a {
	color: var(--wp--preset--color--secondary) !important;
}
.toweb-footer--light a {
	color: var(--wp--preset--color--secondary) !important;
}
.toweb-footer--light .has-muted-color {
	color: var(--wp--preset--color--muted) !important;
}
.toweb-footer--light .wp-block-separator {
	background-color: var(--wp--preset--color--border) !important;
	color: var(--wp--preset--color--border) !important;
}
.toweb-footer--light .wp-social-link svg {
	fill: var(--wp--preset--color--secondary) !important;
}

/* --- Kontaktformular-Platzhalter --- */
.toweb-contact-form label {
	font-weight: 600;
	font-size: 0.9rem;
}
.toweb-contact-form input,
.toweb-contact-form textarea {
	font: inherit;
	margin-top: 0.3rem;
}
