/*
Theme Name: Tagteam
Theme URI: https://tagteam.de
Author: fourplex GmbH
Author URI: https://fourplex.de
Description: Child-Theme von Twenty Twenty-Five für tagteam.de. Farben, Schriftgrößen und Verläufe stehen in der theme.json. Vorlagen, Template-Parts und Muster werden nur in Gutenberg (Website-Editor) gepflegt, nicht im Theme-Ordner.
Template: twentytwentyfive
Requires at least: 6.7
Requires PHP: 7.2
Version: 0.11.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tagteam
*/

/*
 * Damit die Gutenberg-Einstellung „Position: Sticky“ auch in Template-Parts wirkt.
 * Sonst klebt der Block nur innerhalb seines gleich hohen Wrappers und scrollt weg.
 */
.wp-block-template-part:has(> .is-position-sticky) {
	display: contents;
}

/*
 * Zeilenhöhe je Schriftgröße.
 * Die theme.json kann Zeilenhöhen nicht pro Preset setzen, deshalb hier.
 * Überschriften behalten ihre 1,15 aus der theme.json.
 */
p.has-medium-font-size {
	line-height: 1.4;
}

p.has-large-font-size {
	line-height: 1.35;
}

.has-x-large-font-size,
.has-xx-large-font-size {
	line-height: 1.15;
}

/*
 * Lange deutsche Wörter in großen Überschriften trennen statt seitlich überstehen.
 * Die Trennung greift nur, wenn ein Wort nicht in die Zeile passt.
 */
h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: break-word;
	hyphens: auto;
}

/*
 * Buttons: weicher Hover wie auf der alten Seite. Die Breite stellt man am Button-Block ein.
 */
.wp-element-button,
.wp-block-button__link {
	text-align: center;
	transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

/*
 * Formularfelder von Contact Form 7. Gutenberg hat für Formularfelder keine Einstellungen.
 * Transparent mit Rahmen in Schriftfarbe wie auf der alten Seite. Der Absende-Knopf
 * trägt im Formular die Klasse wp-element-button und kommt damit aus der theme.json.
 */
.wpcf7 label {
	display: block;
}

.wpcf7 input:where([type="text"], [type="email"], [type="tel"], [type="url"]),
.wpcf7 textarea {
	box-sizing: border-box;
	width: 100%;
	margin-top: 0.25rem;
	padding: 0.75rem 1rem;
	border: 1px solid currentColor;
	border-radius: 0;
	background: transparent;
	color: inherit;
	font: inherit;
}

.wpcf7 :is(input, textarea):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/*
 * Seitenleiste mit Burger (Skript: assets/js/tagteam.js).
 * Zugeklappt nur Icons, aufgeklappt 538 px breit nach links über dem Inhalt wie auf der alten Seite.
 * Im Editor tragen Blöcke die Klasse block-editor-block-list__block. Dort bleibt die Leiste offen,
 * damit man die Beschriftungen bearbeiten kann.
 */
.tt-seitenleiste:not(.block-editor-block-list__block) {
	overflow: hidden;
	transition: width 0.35s ease, margin-left 0.35s ease;
}

.tt-seitenleiste.is-open {
	width: 538px;
	margin-left: calc(var(--tt-breite-zu, 140px) - 538px);
}

/*
 * Logo und Burger bleiben beim Aufklappen rechts stehen. Der Kopf ist so breit wie der Inhalt
 * der zugeklappten Leiste, damit beide zugeklappt mittig stehen.
 */
.tt-seitenleiste:not(.block-editor-block-list__block) .tt-kopf {
	align-self: flex-end;
	min-width: calc(var(--tt-breite-zu, 140px) - 2 * var(--wp--preset--spacing--40));
}

/*
 * Zeilen aus Icon und Beschriftung: Zugeklappt fällt der Abstand zur versteckten Beschriftung weg,
 * sonst stehen die Icons nicht mittig und werden gestaucht. Aufgeklappt stehen die Icons links untereinander.
 */
.tt-seitenleiste:not(.block-editor-block-list__block) :has(> .tt-label) {
	transition: column-gap 0.35s ease;
}

.tt-seitenleiste:not(.block-editor-block-list__block):not(.is-open) :has(> .tt-label) {
	column-gap: 0;
}

.tt-seitenleiste.is-open :has(> .tt-label) {
	justify-content: flex-start;
}

.tt-seitenleiste:not(.block-editor-block-list__block) .tt-label {
	max-width: 0;
	overflow: hidden;
	white-space: nowrap;
	visibility: hidden;
	opacity: 0;
}

.tt-seitenleiste.is-open .tt-label {
	max-width: 25rem;
	visibility: visible;
	opacity: 1;
	transition: max-width 1.5s ease;
}

.tt-seitenleiste .tt-label a {
	text-decoration: none;
}

/*
 * Karussell: Jede Gruppe mit der Klasse tt-karussell wird wischbar (Skript: assets/js/tagteam.js).
 * Wie das Swiper-Karussell der alten Seite: Desktop drei Karten, Handy und Tablet eine.
 * Den Abstand übernimmt das Skript aus der Block-Einstellung. Im Editor bleibt die Gruppe ein Raster.
 */
.wp-block-group.tt-karussell:not(.block-editor-block-list__block) {
	--tt-karussell-sichtbar: 3;
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	cursor: grab;
}

.wp-block-group.tt-karussell:not(.block-editor-block-list__block)::-webkit-scrollbar {
	display: none;
}

.wp-block-group.tt-karussell:not(.block-editor-block-list__block) > * {
	flex: 0 0 calc((100% - (var(--tt-karussell-sichtbar) - 1) * var(--tt-karussell-abstand, 1.125rem)) / var(--tt-karussell-sichtbar));
	margin: 0;
	scroll-snap-align: start;
}

.wp-block-group.tt-karussell.is-dragging {
	scroll-snap-type: none;
	scroll-behavior: auto;
	cursor: grabbing;
	user-select: none;
}

@media (width <= 782px) {
	.wp-block-group.tt-karussell:not(.block-editor-block-list__block) {
		--tt-karussell-sichtbar: 1;
	}
}

/* Punkte unter dem Karussell, der aktive im Tagteam-Verlauf. */
.tt-karussell__punkte {
	display: flex;
	justify-content: center;
	gap: 1rem;
	margin-block-start: 1.5rem;
}

.tt-karussell__punkt {
	width: 1rem;
	height: 1rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: color-mix(in srgb, currentColor 30%, transparent);
	cursor: pointer;
}

.tt-karussell__punkt[aria-current="true"] {
	background: var(--wp--preset--gradient--tagteam-diagonal);
}

.tt-karussell__punkt:focus-visible,
.wp-block-group.tt-karussell:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/*
 * Zielgruppen-Panels: Spalten-Block mit der Klasse tt-panels, je Spalte ein Cover (Skript: assets/js/tagteam.js).
 * Wie auf der alten Seite: Das Panel unter der Maus wächst, dunkelt ab und zeigt Text und Button.
 * Die Titel stehen senkrecht an der Naht. Auf dem Handy öffnet ein Tippen das Panel.
 * Die Abdunklung im aktiven Zustand kommt aus der Overlay-Einstellung des Cover-Blocks.
 */
.tt-panels:not(.block-editor-block-list__block) {
	--tt-panels-faktor: 2.75;
}

.tt-panels:not(.block-editor-block-list__block) > .wp-block-column {
	min-width: 0;
	transition: flex-grow 1s ease-in-out;
}

/* Nur seitlich abschneiden: Die Titel dürfen wie auf der alten Seite oben und unten überstehen. */
.tt-panels:not(.block-editor-block-list__block) .wp-block-cover {
	height: 100%;
	overflow-x: clip;
	overflow-y: visible;
}

@media (width > 782px) {
	.tt-panels:not(.block-editor-block-list__block) {
		container-type: inline-size;
	}

	.tt-panels:not(.block-editor-block-list__block) > .wp-block-column.is-active {
		flex-grow: var(--tt-panels-faktor);
	}

	/*
	 * Der Text behält die Breite aus dem offenen Zustand. So bricht er beim Auf- und Zuklappen nicht um,
	 * und das schmale Panel wird nicht höher. Überstehendes schneidet das Cover ab.
	 */
	.tt-panels:not(.block-editor-block-list__block) .wp-block-cover {
		justify-content: safe center;
	}

	.tt-panels:not(.block-editor-block-list__block) .wp-block-cover__inner-container {
		flex-shrink: 0;
		box-sizing: border-box;
		width: max(100%, 100cqw * var(--tt-panels-faktor) / (var(--tt-panels-faktor) + 1) - 2 * var(--wp--preset--spacing--50));
	}
}

.tt-panels:not(.block-editor-block-list__block) .wp-block-cover__background {
	transition: opacity 1s ease;
}

.tt-panels:not(.block-editor-block-list__block) > .wp-block-column:not(.is-active) .wp-block-cover__background {
	opacity: 0.15;
}

/* Titel senkrecht, von unten nach oben gelesen, an der Naht zwischen den Panels. Sie richten sich am Cover aus. */
.tt-panels:not(.block-editor-block-list__block) .wp-block-cover__inner-container {
	position: static;
}

.tt-panels:not(.block-editor-block-list__block) .wp-block-cover__inner-container > :not(h2) {
	position: relative;
}

.tt-panels:not(.block-editor-block-list__block) .wp-block-cover h2 {
	position: absolute;
	z-index: 1;
	margin: 0;
	line-height: 1;
	white-space: nowrap;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
}

/* Wie auf der alten Seite versetzt: links endet der Titel oben, rechts beginnt er bei 61 % der Höhe. */
.tt-panels:not(.block-editor-block-list__block) > .wp-block-column:first-child h2 {
	top: var(--wp--preset--spacing--40);
	right: var(--wp--preset--spacing--40);
}

.tt-panels:not(.block-editor-block-list__block) > .wp-block-column:last-child h2 {
	bottom: 39%;
	left: var(--wp--preset--spacing--40);
}

/* Platz für den Titel, damit der Text ihn nicht überdeckt. */
.tt-panels:not(.block-editor-block-list__block) > .wp-block-column:first-child .wp-block-cover__inner-container {
	padding-right: calc(var(--wp--preset--font-size--xx-large) + var(--wp--preset--spacing--40));
}

.tt-panels:not(.block-editor-block-list__block) > .wp-block-column:last-child .wp-block-cover__inner-container {
	padding-left: calc(var(--wp--preset--font-size--xx-large) + var(--wp--preset--spacing--40));
}

/* Text und Button blenden im aktiven Panel verzögert ein. */
.tt-panels:not(.block-editor-block-list__block) .wp-block-cover__inner-container > :not(h2) {
	transition: opacity 0.5s ease 0.5s, visibility 0s linear 0.5s;
}

.tt-panels:not(.block-editor-block-list__block) > .wp-block-column:not(.is-active) .wp-block-cover__inner-container > :not(h2) {
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

/* „Mehr erfahren“ setzt das Skript ein: auf dem Handy sichtbar, am Desktop nur bei Tastatur-Fokus. */
.tt-panels__mehr {
	position: absolute;
	z-index: 2;
	bottom: var(--wp--preset--spacing--50);
	transition: opacity 0.5s ease;
}

.tt-panels > .wp-block-column:first-child .tt-panels__mehr {
	left: var(--wp--preset--spacing--50);
}

.tt-panels > .wp-block-column:last-child .tt-panels__mehr {
	right: var(--wp--preset--spacing--50);
}

.tt-panels > .wp-block-column.is-active .tt-panels__mehr:not(:focus-visible) {
	opacity: 0;
	pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
	.tt-panels__mehr:not(:focus-visible) {
		opacity: 0;
		pointer-events: none;
	}
}

html {
	scroll-behavior: smooth;
}

.bg_is_t_left  .wp-block-cover__image-background{
    transform: translateX(35vw);
max-width: 65%;
}

.custom_transform > .wp-block-cover__image-background
{
    transform: translateY(500px);
  filter: opacity(.2);
}

.is_gray .wp-block-cover__image-background{
    filter: grayscale(1) !important;
}

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

	.wp-element-button,
	.wp-block-button__link,
	.tt-seitenleiste:not(.block-editor-block-list__block),
	.tt-seitenleiste:not(.block-editor-block-list__block) :has(> .tt-label),
	.tt-seitenleiste.is-open .tt-label {
		transition: none;
	}

	.wp-block-group.tt-karussell:not(.block-editor-block-list__block) {
		scroll-behavior: auto;
	}

	.tt-panels:not(.block-editor-block-list__block) > .wp-block-column,
	.tt-panels:not(.block-editor-block-list__block) .wp-block-cover__background,
	.tt-panels:not(.block-editor-block-list__block) .wp-block-cover__inner-container > :not(h2),
	.tt-panels__mehr {
		transition: none !important;
	}
}
