/* Swissprofi – Ergänzende Gestaltung zum theme.json */

:root {
	--sp-red: var(--wp--preset--color--primary);
	--sp-ink: var(--wp--preset--color--ink);
	--sp-grey: var(--wp--preset--color--grey);
	--sp-line: var(--wp--preset--color--line);
	--sp-soft: var(--wp--preset--color--soft);
	--sp-radius: var(--wp--custom--radius, 12px);
	--sp-shadow: var(--wp--custom--shadow);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { -webkit-font-smoothing: antialiased; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: break-word; hyphens: manual; }

/* Abstände zwischen Kopf, Inhalt, Fuss und vollbreiten Abschnitten */
.wp-site-blocks > * { margin-block-start: 0; }
.wp-block-post-content > .alignfull,
.wp-block-post-content > .sp-sec { margin-block-start: 0; margin-block-end: 0; }
.sp-main { margin-block: 0; }

/* ---------- Kopfzeile ---------- */
.sp-header { position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 50; background: #fff; }
.sp-topbar { background: var(--sp-ink); color: #d9dbde; font-size: 0.8125rem; padding-block: 0.4rem; }
.sp-topbar .wp-block-group { gap: 1.5rem; }
.sp-topbar p { margin: 0; }
.sp-topbar a { color: inherit; text-decoration: none; }
.sp-topbar a:hover { color: #fff; }
.sp-header-main { border-bottom: 1px solid var(--sp-line); padding-block: 0.8rem; background: #fff; }
.sp-header-nav { gap: 1.75rem; }
.sp-brand { gap: 0.75rem; }
.sp-brand .wp-block-site-logo img { height: auto; max-height: 84px; }
.sp-brand:has(.wp-block-site-logo img) .wp-block-site-title { display: none; }
.sp-header .wp-block-navigation a { text-decoration: none; }
.sp-header .wp-block-navigation .wp-block-navigation-item__content:hover { color: var(--sp-red); }
.sp-header .wp-block-navigation__submenu-container { border: 1px solid var(--sp-line) !important; border-radius: 10px; padding: 0.5rem 0; box-shadow: var(--sp-shadow); min-width: 300px !important; }
.sp-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content { white-space: nowrap; }
.sp-header .wp-block-navigation__submenu-container a { padding: 0.5rem 1.1rem !important; }
.wp-block-navigation__responsive-container.is-menu-open { padding: 1.5rem max(16px, 4vw); }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { font-size: 1.15rem; gap: 1rem; }
.wp-block-navigation__responsive-container-open { border: 1px solid var(--sp-line); border-radius: 8px; padding: 6px; }

@media (max-width: 781px) {
	.sp-topbar { display: none; }
	.sp-header .sp-header-cta { display: none; }
	.sp-header .wp-block-site-title { font-size: 1.05rem; }
	.sp-brand .wp-block-site-logo img { max-height: 52px; width: auto; max-width: min(240px, 62vw); }
	.sp-brand .wp-block-site-logo, .sp-brand .wp-block-site-logo a { max-width: min(240px, 62vw); }
}

/* ---------- Abschnitte ---------- */
.sp-sec { padding-block: var(--wp--preset--spacing--60); }
.sp-sec.has-soft-bg { background: var(--sp-soft); }
.sp-sec.has-ink-bg { background: var(--sp-ink); color: #c4c8cd; }
.sp-sec.has-ink-bg :where(h1, h2, h3) { color: #fff; }
.sp-sec.has-primary-bg { background: var(--sp-red); color: #ffe2df; }
.sp-sec.has-primary-bg :where(h1, h2, h3) { color: #fff; }
.sp-sec-logos { padding-block: 1.25rem; border-block: 1px solid var(--sp-line); }
.sp-sec-head { margin-bottom: 2rem; gap: 1.5rem; }
.sp-sec-head > .wp-block-group > * { margin-block: 0; }
.sp-sec-head > .wp-block-group > * + * { margin-block-start: 0.4rem; }
.sp-muted { color: var(--sp-grey); }
.sp-maxw { max-width: 46ch; }
.sp-text { max-width: 65ch; font-size: 1.03rem; line-height: 1.75; color: #3d4249; }
.has-ink-bg .sp-text, .has-primary-bg .sp-text { color: inherit; }
.sp-lead { font-size: var(--wp--preset--font-size--large); color: var(--sp-grey); max-width: 50ch; }
.sp-mt { margin-top: 2.5rem !important; }
.sp-rounded img { border-radius: 14px; width: 100%; height: auto; object-fit: cover; aspect-ratio: 4 / 3.3; }

/* Überzeile & Etikett */
.is-style-eyebrow { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sp-red); margin-bottom: 0.5rem !important; }
.has-ink-bg .is-style-eyebrow { color: #ff8a82; }
.has-primary-bg .is-style-eyebrow { color: #fff; }
.is-style-eyebrow + :is(h1, h2) { margin-top: 0 !important; }
.is-style-pill { display: inline-block; font-size: 0.8125rem; font-weight: 600; color: var(--sp-red); background: var(--wp--preset--color--primary-light); padding: 0.3rem 0.85rem; border-radius: 99px; }

/* Häkchen-Liste */
.is-style-checks { list-style: none; padding-left: 0; display: grid; gap: 0.6rem; }
.is-style-checks li { position: relative; padding-left: 1.6rem; }
.is-style-checks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--sp-red); font-weight: 800; }
.is-style-checks.sp-inline { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 0.9rem; font-weight: 500; }

/* Chips (Intervalle) */
.sp-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sp-chips li { border: 1.5px solid var(--sp-red); color: var(--sp-red); background: #fff; font-weight: 600; font-size: 0.8125rem; padding: 0.3rem 0.9rem; border-radius: 99px; }

/* Buttons */
.wp-block-button.is-style-outline > .wp-block-button__link { border: 1.5px solid currentColor; background: transparent; color: var(--sp-ink); padding-block: calc(0.8rem - 1.5px); }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--sp-ink); color: #fff; }
.wp-block-button.is-style-white > .wp-block-button__link { background: #fff; color: var(--sp-red); }
.wp-block-button.is-style-white > .wp-block-button__link:hover { background: var(--sp-soft); color: var(--wp--preset--color--primary-dark); }
.wp-block-button.is-style-outline-white > .wp-block-button__link { background: transparent; border: 1.5px solid #fff; color: #fff; }
.wp-block-button.is-style-outline-white > .wp-block-button__link:hover { background: #fff; color: var(--sp-red); }
.has-ink-bg .is-style-outline > .wp-block-button__link { color: #fff; }

/* ---------- Hero ---------- */
.sp-hero { background: linear-gradient(180deg, var(--sp-soft), #fff); }
.sp-hero.has-soft-bg { background: linear-gradient(180deg, var(--sp-soft), #fff 140%); }
.sp-hero-cols, .sp-center-cols { gap: clamp(1.75rem, 5vw, 3.5rem) !important; align-items: center !important; }
.sp-hero h1 { margin-top: 0.75rem; }
.sp-hero h1 mark { background: none; color: var(--sp-red); }
.sp-h1-sub { display: block; font-size: 0.48em; font-weight: 700; color: var(--sp-grey); letter-spacing: -0.01em; margin-top: 0.5rem; line-height: 1.25; }
.sp-subtitle { font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 1.25rem; color: var(--sp-red); margin-top: 0.5rem !important; }
.sp-hero-small { padding-block: var(--wp--preset--spacing--50); }

/* ---------- Slideshow (Galerie-Stil) ---------- */
body:not(.editor-styles-wrapper) .wp-block-gallery.is-style-slideshow {
	display: block !important; position: relative; aspect-ratio: 4 / 3.3; max-width: 100%;
	border-radius: 14px; overflow: hidden; background: var(--sp-soft); margin: 0;
}
body:not(.editor-styles-wrapper) .wp-block-gallery.is-style-slideshow > .wp-block-image {
	position: absolute !important; inset: 0; width: 100% !important; height: 100%; margin: 0 !important;
	opacity: 0; transition: opacity 0.9s ease; pointer-events: none;
}
body:not(.editor-styles-wrapper) .wp-block-gallery.is-style-slideshow > .wp-block-image:first-child,
body:not(.editor-styles-wrapper) .wp-block-gallery.is-style-slideshow[data-sp-slideshow] > .wp-block-image { opacity: 0; }
body:not(.editor-styles-wrapper) .wp-block-gallery.is-style-slideshow > .wp-block-image:first-child { opacity: 1; }
body:not(.editor-styles-wrapper) .wp-block-gallery.is-style-slideshow[data-sp-slideshow] > .wp-block-image.is-active { opacity: 1; pointer-events: auto; }
body:not(.editor-styles-wrapper) .wp-block-gallery.is-style-slideshow[data-sp-slideshow] > .wp-block-image:first-child:not(.is-active) { opacity: 0; }
body:not(.editor-styles-wrapper) .wp-block-gallery.is-style-slideshow > .wp-block-image img {
	width: 100% !important; height: 100% !important; object-fit: cover; border-radius: 0 !important;
}
.wp-block-gallery.is-style-slideshow .wp-element-caption:not(.blocks-gallery-caption) { display: none; }
.sp-slideshow-dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.sp-slideshow-dots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 0; background: rgba(255,255,255,.6); box-shadow: 0 1px 4px rgba(0,0,0,.3); cursor: pointer; transition: width .3s, background .3s; }
.sp-slideshow-dots button[aria-current="true"] { width: 26px; border-radius: 6px; background: #fff; }
.sp-slideshow-dots button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { body:not(.editor-styles-wrapper) .wp-block-gallery.is-style-slideshow > .wp-block-image { transition: none; } }

/* ---------- Kundenlogos ---------- */
.sp-logos { gap: 0.75rem 2rem; align-items: center; }
.sp-logos p { margin: 0; }
.sp-logo-name { font-family: var(--wp--preset--font-family--heading); font-weight: 700; color: #a9a4a1; font-size: 1rem; }
.sp-logos .is-style-eyebrow { color: var(--sp-grey); font-size: 0.7rem; }
.sp-logos img { max-height: 40px; width: auto; filter: grayscale(1); opacity: 0.7; }

/* ---------- Karten ---------- */
.is-style-card { background: #fff; border: 1px solid var(--sp-line); border-radius: var(--sp-radius); padding: 1.4rem; }
.is-style-card > * { margin-block: 0; }
.is-style-card > * + * { margin-block-start: 0.6rem; }
.sp-service-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.sp-service-card > :not(figure) { padding-inline: 1.3rem; }
.sp-service-card > figure { margin: 0 !important; }
.sp-service-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; display: block; }
.sp-service-card > h3 { margin-top: 1.1rem !important; }
.sp-service-card > p { color: var(--sp-grey); font-size: 0.92rem; }
.sp-more { margin-top: auto !important; padding-top: 0.5rem; padding-bottom: 1.3rem; font-weight: 600; font-size: 0.92rem; }
.sp-more a { text-decoration: none; }
.sp-card-red { background: var(--sp-red); border-color: var(--sp-red); color: #ffe2df; display: flex; flex-direction: column; justify-content: center; }
.sp-card-red h3 { color: #fff; }
.sp-card-red .wp-block-buttons { margin-top: 1rem !important; }
.sp-item-card p:not(.sp-icon) { color: var(--sp-grey); font-size: 0.95rem; }
.sp-small-card { padding: 1rem 1.2rem; }
.sp-small-card h3 { font-size: 1rem; }
.sp-small-card p { font-size: 0.92rem; }

.sp-icon { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--sp-line); background: #fff; display: grid; place-items: center; color: var(--sp-red); font-family: var(--wp--preset--font-family--heading); font-weight: 800; font-size: 0.95rem; margin: 0; }
.sp-icon + h3 { margin-top: 0.9rem !important; }

/* Kacheln (Vorteile) */
.sp-tile { border: 1px solid var(--sp-line); border-top: 3px solid var(--sp-red); border-radius: var(--sp-radius); padding: 1.2rem; }
.sp-tile > * { margin: 0; }
.sp-tile p { margin-top: 0.4rem; color: var(--sp-grey); font-size: 0.92rem; }

/* Ablauf */
.sp-step > * { margin-block: 0; }
.sp-step > * + * { margin-block-start: 0.4rem; }
.sp-step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--sp-red); color: #fff; display: grid; place-items: center; font-family: var(--wp--preset--font-family--heading); font-weight: 800; margin-bottom: 0.75rem !important; }
.sp-step p:not(.sp-step-num) { color: var(--sp-grey); }

/* Solar */
.sp-bignum { font-family: var(--wp--preset--font-family--heading); font-weight: 800; font-size: clamp(3rem, 8vw, 5rem); line-height: 1; letter-spacing: -0.03em; color: #ff5a4f; margin: 0.25rem 0 0 !important; }

/* Rote Band-Zeile */
.sp-band { padding-block: var(--wp--preset--spacing--50); }
.sp-band h2 { margin: 0; }
.sp-band .wp-block-column:last-child { display: flex; justify-content: flex-end; }
@media (max-width: 781px) { .sp-band .wp-block-column:last-child { justify-content: flex-start; } }

/* Weitere Leistungen */
.sp-linkcard { margin: 0; }
.sp-linkcard a { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; height: 100%; border: 1px solid var(--sp-line); border-radius: var(--sp-radius); padding: 1.1rem 1.2rem; font-family: var(--wp--preset--font-family--heading); font-weight: 700; color: var(--sp-ink); text-decoration: none; }
.sp-linkcard a:hover { border-color: var(--sp-red); color: var(--sp-red); }
.sp-linkcard span { color: var(--sp-red); }

/* FAQ */
.sp-faq-cols { gap: clamp(1.5rem, 5vw, 3.5rem) !important; }
.is-style-faq { background: #fff; border: 1px solid var(--sp-line); border-radius: 10px; padding: 0.9rem 1.15rem; margin-block: 0 0.7rem !important; }
.is-style-faq summary { font-family: var(--wp--preset--font-family--heading); font-weight: 700; cursor: pointer; }
.is-style-faq p { color: var(--sp-grey); margin-top: 0.6rem; font-size: 0.95rem; }

/* Über uns */
.sp-portrait img { aspect-ratio: 4 / 5; }
.sp-quote { border-left: 3px solid var(--sp-red); padding-left: 1rem; font-family: var(--wp--preset--font-family--heading); font-weight: 600; font-size: 1.1rem; color: var(--sp-ink); }

/* Kontakt / Formular */
.sp-contact-cols { gap: clamp(1.5rem, 5vw, 3.5rem) !important; }
.sp-contact-cols .sp-small-card { margin-top: 0.75rem; }
.sp-formbox { background: var(--sp-soft); border-radius: 14px; padding: clamp(1.25rem, 3vw, 2rem); }
.sp-form-hint { border: 1.5px dashed #cfc9c6; border-radius: 10px; padding: 1rem; color: var(--sp-grey); font-size: 0.9rem; }
.sp-formbox :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="url"], select, textarea) {
	width: 100%; max-width: 100%; box-sizing: border-box; font: inherit; color: var(--sp-ink);
	background: #fff; border: 1px solid var(--sp-line); border-radius: 8px; padding: 0.7rem 0.85rem;
}
.sp-formbox :is(input, select, textarea):focus { outline: 2px solid var(--sp-red); outline-offset: 1px; border-color: transparent; }
.sp-formbox label { font-weight: 500; font-size: 0.9rem; }
.sp-formbox :is(input[type="submit"], button[type="submit"], .wpforms-submit) {
	background: var(--sp-red) !important; color: #fff !important; border: 0 !important; border-radius: 8px !important;
	font: 600 0.95rem var(--wp--preset--font-family--body) !important; padding: 0.85rem 1.4rem !important; cursor: pointer;
}

/* ---------- Brotkrumen & Seitentitel ---------- */
.sp-crumbs { border-bottom: 1px solid var(--sp-line); font-size: 0.8125rem; color: var(--sp-grey); padding-block: 0.7rem; }
.sp-breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.sp-breadcrumbs li + li::before { content: "›"; margin-right: 0.5rem; color: #b5b0ad; }
.sp-breadcrumbs a { color: inherit; text-decoration: none; }
.sp-breadcrumbs a:hover { color: var(--sp-red); }
.sp-breadcrumbs [aria-current] { color: var(--sp-ink); font-weight: 600; }
.sp-page-title { padding-block: var(--wp--preset--spacing--50) 0; }
.sp-page-content { padding-block: 1.5rem var(--wp--preset--spacing--60); }
.sp-404 { padding-block: var(--wp--preset--spacing--70); }

/* ---------- Fusszeile ---------- */
.sp-footer { background: #0f1113; color: #b9bdc2; font-size: 0.92rem; padding-block: var(--wp--preset--spacing--60) 0; }
.sp-footer a { color: #d9dbde; text-decoration: none; }
.sp-footer a:hover { color: #fff; }
.sp-footer .wp-block-site-title a { color: #fff; }
.sp-footer-h { color: #fff !important; font-size: 0.95rem !important; margin-bottom: 0.8rem; }
.sp-footer-list { list-style: none; padding: 0; display: grid; gap: 0.4rem; }
.sp-footer-legal { border-top: 1px solid #23262a; margin-top: 2.5rem !important; padding-block: 1rem; font-size: 0.8125rem; }
.sp-footer-legal p { margin: 0; }

/* Raster: auf Tablets 2, auf Handys 1 Spalte */
@media (max-width: 1024px) {
	.sp-sec .wp-block-group.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 600px) {
	.sp-sec .wp-block-group.is-layout-grid { grid-template-columns: minmax(0, 1fr) !important; }
	.sp-logos { justify-content: flex-start !important; gap: 0.5rem 1.5rem; }
	.sp-logos .is-style-eyebrow { width: 100%; }
}

/* ---------- Feste Leiste auf dem Handy ---------- */
.sp-mobilebar { display: none !important; }
@media (max-width: 781px) {
	.sp-mobilebar {
		display: grid !important; grid-template-columns: 1fr 1fr; gap: 0.5rem;
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; margin: 0 !important;
		background: #fff; border-top: 1px solid var(--sp-line);
		padding: 0.6rem max(12px, env(safe-area-inset-right)) calc(0.6rem + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
	}
	.sp-mobilebar .wp-block-buttons, .sp-mobilebar .wp-block-button { width: 100%; margin: 0; }
	.sp-mobilebar .wp-block-button__link { width: 100%; text-align: center; padding-inline: 0.5rem; }
	body { padding-bottom: 72px; }
	.sp-hero .wp-block-buttons { flex-wrap: wrap; }
	.sp-hero .wp-block-button { flex: 1 1 auto; }
	.sp-hero .wp-block-button__link { width: 100%; }
}

/* Im Editor die Handy-Leiste immer zeigen, damit sie bearbeitet werden kann */
.editor-styles-wrapper .sp-mobilebar { display: grid !important; grid-template-columns: 1fr 1fr; gap: 0.5rem; position: static; padding: 0.75rem; border-top: 2px dashed var(--sp-line); }
.editor-styles-wrapper .sp-mobilebar::before { content: "Feste Leiste auf dem Handy"; grid-column: 1 / -1; font-size: 12px; color: var(--sp-grey); }
/* Handy-Menü (Overlay): links ausgerichtet, mit Abstand zum Rand, Untermenü ohne Kasten */
.sp-header .wp-block-navigation__responsive-container.is-menu-open { padding: 1.25rem max(24px, 6vw) 6rem !important; }
.sp-header .is-menu-open .wp-block-navigation__responsive-container-content { align-items: stretch !important; padding-top: 2.5rem !important; }
.sp-header .is-menu-open .wp-block-navigation__container { align-items: stretch !important; width: 100%; gap: 0 !important; }
.sp-header .is-menu-open .wp-block-navigation-item { width: 100%; align-items: flex-start !important; border-bottom: 1px solid var(--sp-line); }
.sp-header .is-menu-open .wp-block-navigation-item__content { padding: 0.9rem 0 !important; font-size: 1.15rem; font-weight: 600; }
.sp-header .is-menu-open .wp-block-navigation__submenu-container { border: 0 !important; box-shadow: none !important; min-width: 0 !important; width: 100%; padding: 0 0 0.6rem 1rem !important; }
.sp-header .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item { border: 0; }
.sp-header .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 0.45rem 0 !important; font-size: 1rem; font-weight: 500; color: var(--sp-grey); white-space: normal; }
.sp-header .is-menu-open .wp-block-navigation__responsive-container-close { top: 1.25rem; right: max(24px, 6vw); }

/* Rechtstexte (Impressum, Datenschutz) */
.sp-rechtstext h2 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); margin-top: 2.2em; margin-bottom: .5em; }
.sp-rechtstext h2:first-child { margin-top: 0; }
.sp-rechtstext p, .sp-rechtstext li { line-height: 1.7; }
.sp-rechtstext a { color: var(--wp--preset--color--primary); }
mark.sp-platzhalter { background: #fff3c4; color: inherit; padding: 0 .2em; border-radius: 3px; }
.sp-page-title:not(:has(*)) { display: none; }
.wp-block-image img[width][height] { height: auto; }
