/*
Theme Name: Salvia
Theme URI: https://example.com/salvia
Author: Tino Roth
Author URI: https://example.com
Description: Modernes Block-Theme (Full Site Editing) für Business- und Dienstleistungs-Websites. Mit frei einstellbaren Boxen (feste Größe, individuelle Eckenradien), Bildern mit frei verschiebbarem Text-Overlay, über 2.000 Icons, ausblendbarem Seitentitel und einem Farb- und Schriftkonzept in Salbeigrün.
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.1.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: salvia
Tags: full-site-editing, block-patterns, blog, business, portfolio, one-column, two-columns, custom-colors, custom-menu, custom-logo, editor-style, featured-images, block-styles, wide-blocks, accessibility-ready, translation-ready
*/

/* -------------------------------------------------------------------------
 * Salvia – globale Stile
 * Farben, Schriften, Abstände werden über theme.json gesteuert.
 * Diese Datei enthält nur, was theme.json nicht abbilden kann.
 * ---------------------------------------------------------------------- */

/* --- Grundlegendes ----------------------------------------------------- */

html {
	scroll-behavior: smooth;
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: clip;
}

:where(img, svg, video) {
	max-width: 100%;
	height: auto;
}

/* Sichtbarer Fokus-Rahmen für Tastaturbedienung */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--gruen-dunkel, #36602c);
	outline-offset: 2px;
	border-radius: 2px;
}

/* --- Seitentitel ausblenden -------------------------------------------- */

body.salvia-titel-aus .wp-block-post-title,
body.salvia-titel-aus .wp-site-blocks > .wp-block-post-title,
.salvia-titel-aus .salvia-entry-title {
	display: none !important;
}

/* --- Volle Bildschirmbreite -------------------------------------------- */

/*
 * Hilfsklasse: bricht aus jedem Container aus und geht über die komplette
 * Bildschirmbreite – auch innerhalb von Spalten oder Gruppen.
 * Kann jedem Block über "Erweitert → Zusätzliche CSS-Klasse" gegeben werden.
 */
.salvia-full-bleed,
.salvia-volle-breite {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

/* Randlos: volle Breite ohne seitliche Innenabstände */
.salvia-randlos {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Bilder, die immer die volle Breite füllen sollen */
.salvia-bild-fuellt img,
.salvia-bild-fuellt .wp-block-image img {
	width: 100%;
	object-fit: cover;
}

/* --- Gleich hohe Spalten ----------------------------------------------- */

/*
 * Spalten sind in WordPress schon gleich hoch (flex), aber die Blöcke darin
 * nicht. Enthält eine Spalte eine Box mit "Höhe an Spalte angleichen",
 * wird die Spalte zum Flex-Container und die Box füllt sie komplett aus.
 */
.wp-block-column:has(> .salvia-box--stretch),
.wp-block-column:has(> .salvia-gleich-hoch) {
	display: flex;
	flex-direction: column;
}

.wp-block-column > .salvia-box--stretch,
.wp-block-column > .salvia-gleich-hoch {
	flex: 1 1 auto;
	height: 100%;
}

/* Hilfsklasse für beliebige Blöcke in Spalten */
.salvia-gleich-hoch {
	height: 100%;
}

/* --- Kopf- und Fußbereich ---------------------------------------------- */

.salvia-header {
	position: relative;
	z-index: 20;
}

.salvia-header--sticky {
	position: sticky;
	top: 0;
	backdrop-filter: saturate(140%) blur(8px);
}

.admin-bar .salvia-header--sticky {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .salvia-header--sticky {
		top: 46px;
	}
}

/* --- Navigation --------------------------------------------------------- */

.wp-block-navigation .wp-block-navigation-item__content {
	padding-block: 0.35rem;
}

.wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--creme, #fffff7);
}

/* --- Feinschliff -------------------------------------------------------- */

.wp-block-image img {
	border-radius: inherit;
}

.wp-block-post-featured-image img {
	object-fit: cover;
}

.wp-block-separator:not(.is-style-wide):not(.alignwide):not(.alignfull) {
	width: 6rem;
	border-width: 0 0 2px 0;
}

/* Schreibschriften brauchen etwas mehr Zeilenhöhe */
.has-script-font-family,
.has-script-formal-font-family {
	line-height: 1.35;
	letter-spacing: 0.01em;
}

/* Skip-Link */
.skip-link.screen-reader-text {
	background-color: var(--wp--preset--color--creme, #fffff7);
	color: var(--wp--preset--color--gruen-dunkel, #36602c);
	font-size: 0.9rem;
	font-weight: 600;
	padding: 0.9rem 1.4rem;
	position: fixed;
	left: 6px;
	top: -100px;
	z-index: 100000;
	border-radius: 6px;
	text-decoration: none;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
	transition: top 0.15s ease;
}

.skip-link.screen-reader-text:focus {
	top: 6px;
	clip: auto;
	clip-path: none;
	height: auto;
	width: auto;
	overflow: visible;
}

/* --- Reduzierte Bewegung ------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
