/*
Theme Name: Kompaneers
Theme URI: https://www.kompaneers.de
Description: Child-Theme von GeneratePress für die Kompaneers-Website. Enthält nur kleine, globale Ergänzungen; Farben, Schriften und Abstände werden im Customizer bzw. in GenerateBlocks gepflegt.
Author: Kompaneers
Template: generatepress
Version: 1.0.0
Text Domain: kompaneers
*/

/* --- Markenfarbe im Detail: Textlinks mit gelber Unterstreichung --- */
.entry-content a:not(.gb-button):not(.button):not(.wp-element-button):not(.gb-text-link),
.site-footer .inside-footer-widgets a,
.site-footer .inside-site-info a {
	text-decoration-thickness: 2px;
	text-underline-offset: 0.18em;
	text-decoration-color: var(--accent);
}
.entry-content a:not(.gb-button):not(.button):not(.wp-element-button):hover {
	text-decoration-color: currentColor;
}

/* Textauswahl und Fokus in Markengelb */
::selection {
	background: var(--accent);
	color: var(--contrast);
}
:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
}

/* Hauptnavigation: gelbe Markierung unter dem aktiven bzw. gehoverten Punkt */
.main-navigation .main-nav > ul > li > a {
	position: relative;
}
.main-navigation .main-nav > ul > li > a::after {
	content: "";
	position: absolute;
	left: 18px;
	right: 18px;
	bottom: 18px;
	height: 3px;
	background: var(--accent);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.2s ease;
}
.main-navigation .main-nav > ul > li > a:hover::after,
.main-navigation .main-nav > ul > li.current-menu-item > a::after,
.main-navigation .main-nav > ul > li.current-menu-ancestor > a::after {
	transform: scaleX(1);
}
@media (prefers-reduced-motion: reduce) {
	.main-navigation .main-nav > ul > li > a::after {
		transition: none;
	}
}

/* Standard-Buttons (Formulare, Core-Buttons) */
button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button,
.wp-element-button {
	border-radius: 4px;
	font-weight: 600;
	letter-spacing: 0.01em;
}

/* Formularfelder */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="password"],
textarea,
select {
	border-radius: 4px;
	border-width: 1px;
}

/* --- Navigation: Kontakt als Button (Menüpunkt mit CSS-Klasse k-nav-cta) --- */
.main-navigation .main-nav > ul > li.k-nav-cta > a {
	background: var(--accent);
	color: var(--contrast);
	border-radius: 4px;
	line-height: 1.2;
	padding: 12px 20px;
	margin: 0 0 0 12px;
	transition: background-color 0.2s ease, color 0.2s ease;
}
.main-navigation .main-nav > ul > li.k-nav-cta > a:hover,
.main-navigation .main-nav > ul > li.k-nav-cta > a:focus-visible {
	background: var(--contrast);
	color: var(--base);
}
.main-navigation .main-nav > ul > li.k-nav-cta > a::after {
	display: none;
}
@media (min-width: 1025px) {
	.main-navigation .main-nav > ul > li.k-nav-cta {
		display: flex;
		align-items: center;
	}
}
/* Im mobilen Menü als normaler Punkt */
@media (max-width: 1024px) {
	.main-navigation .main-nav > ul > li.k-nav-cta > a {
		background: transparent;
		color: inherit;
		padding: 0 20px;
		margin: 0;
		line-height: inherit;
	}
}

/* --- Sprachumschalter (TranslatePress) in der Menüleiste --- */
.k-lang {
	display: flex;
	align-items: center;
	padding: 0 4px 0 12px;
}
.k-lang .trp-shortcode-switcher__wrapper {
	--bg: var(--base) !important;
	--bg-hover: var(--base-2) !important;
	--text: var(--contrast) !important;
	--text-hover: var(--contrast) !important;
	--border: 0 !important;
	--border-width: 0 !important;
	--border-radius: 4px !important;
	--font-size: 14px !important;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.k-lang .trp-flag-image {
	display: none !important;
}
.k-lang .trp-switcher-dropdown-list {
	box-shadow: 0 8px 24px rgba(50, 50, 50, 0.15);
	border-radius: 4px;
}
@media (max-width: 1024px) {
	.k-lang {
		padding: 0 8px;
	}
}

/* --- Sticky-Header: feiner Schatten beim Andocken --- */
.main-navigation.is_stuck,
#mobile-header.is_stuck {
	box-shadow: 0 2px 12px rgba(50, 50, 50, 0.08);
}

/* --- Logo-Laufband (Klassen k-marquee / k-marquee__track aus GenerateBlocks) --- */
@keyframes k-marquee-scroll {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}
.k-marquee:hover .k-marquee__track,
.k-marquee:focus-within .k-marquee__track {
	animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
	.k-marquee__track {
		animation: none;
		flex-wrap: wrap;
		justify-content: center;
		width: auto;
	}
	.k-marquee__track > [aria-hidden="true"] {
		display: none;
	}
}

/* --- Dynamik: Einblenden beim Scrollen (reines CSS, ohne Skript) --- */
@keyframes k-reveal {
	from { opacity: 0; transform: translateY(56px); }
	to { opacity: 1; transform: none; }
}
@supports (animation-timeline: view()) {
	.entry-content .k-card,
	.entry-content .k-grid-2 > *,
	.entry-content .k-grid-3 > *,
	.entry-content .k-grid-4 > *,
	.entry-content .k-marquee,
	.entry-content h2.k-linie,
	.entry-content .k-reveal {
		animation: k-reveal 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
		animation-timeline: view();
		animation-range: entry 0% entry 60%;
	}
	.entry-content .k-grid-2 > :nth-child(2),
	.entry-content .k-grid-3 > :nth-child(2),
	.entry-content .k-grid-4 > :nth-child(2) {
		animation-range: entry 12% entry 72%;
	}
	.entry-content .k-grid-3 > :nth-child(3),
	.entry-content .k-grid-4 > :nth-child(3) {
		animation-range: entry 24% entry 84%;
	}
	.entry-content .k-grid-4 > :nth-child(4) {
		animation-range: entry 36% entry 96%;
	}
}

/* --- Dynamik: langsamer Zoom im Foto-Hero (Klasse k-kenburns auf dem Bild) --- */
@keyframes k-kenburns {
	from { transform: scale(1); }
	to { transform: scale(1.16); }
}
.k-kenburns {
	animation: k-kenburns 14s ease-in-out infinite alternate;
	transform-origin: 60% 50%;
}

/* --- Dynamik: sehr langsam drehende Windrose (Klasse k-windrose auf dem Abschnitt) --- */
@keyframes k-pendel {
	from { rotate: -5deg; }
	to { rotate: 5deg; }
}
.k-windrose::before {
	animation: k-pendel 9s ease-in-out infinite alternate;
}

@media (prefers-reduced-motion: reduce) {
	.entry-content .k-card,
	.entry-content .k-grid-2 > *,
	.entry-content .k-grid-3 > *,
	.entry-content .k-grid-4 > *,
	.entry-content .k-marquee,
	.entry-content h2.k-linie,
	.entry-content .k-reveal,
	.k-kenburns,
	.k-windrose::before {
		animation: none;
	}
}

/* --- Dynamik: Einstieg im Statement- und Foto-Hero (gestaffelt) --- */
@keyframes k-hero-in {
	from { opacity: 0; transform: translateY(32px); }
	to { opacity: 1; transform: none; }
}
.k-section--schwarz > .k-container > *,
.k-hero-foto > .k-container > * {
	animation: k-hero-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.k-section--schwarz > .k-container > :nth-child(2),
.k-hero-foto > .k-container > :nth-child(2) { animation-delay: 0.18s; }
.k-section--schwarz > .k-container > :nth-child(3),
.k-hero-foto > .k-container > :nth-child(3) { animation-delay: 0.36s; }
.k-hero-foto > .k-container > :nth-child(4) { animation-delay: 0.54s; }
@supports (animation-timeline: view()) {
	.entry-content .k-marker {
		animation: k-reveal 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
		animation-timeline: view();
		animation-range: entry 0% entry 55%;
	}
	.entry-content .k-marker:nth-child(2) { animation-range: entry 10% entry 65%; }
	.entry-content .k-marker:nth-child(3) { animation-range: entry 20% entry 75%; }
	.entry-content .k-marker:nth-child(4) { animation-range: entry 30% entry 85%; }
}
@media (prefers-reduced-motion: reduce) {
	.k-section--schwarz > .k-container > *, .k-hero-foto > .k-container > *, .entry-content .k-marker { animation: none; }
}

/* --- Stimmen-Wechsler: eine Kundenstimme zur Zeit, 10 s pro Stimme --- */
@keyframes k-slide-2 { 0% { opacity: 0; } 3% { opacity: 1; } 47% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 0; } }
@keyframes k-slide-3 { 0% { opacity: 0; } 3% { opacity: 1; } 31% { opacity: 1; } 33.34% { opacity: 0; } 100% { opacity: 0; } }
@keyframes k-slide-4 { 0% { opacity: 0; } 3% { opacity: 1; } 23% { opacity: 1; } 25% { opacity: 0; } 100% { opacity: 0; } }
@keyframes k-slide-5 { 0% { opacity: 0; } 3% { opacity: 1; } 18% { opacity: 1; } 20% { opacity: 0; } 100% { opacity: 0; } }
@keyframes k-slide-6 { 0% { opacity: 0; } 3% { opacity: 1; } 14.7% { opacity: 1; } 16.67% { opacity: 0; } 100% { opacity: 0; } }
.k-slides:hover .k-slide,
.k-slides:focus-within .k-slide {
	animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
	.k-slides { display: flex; flex-direction: column; row-gap: 40px; }
	.k-slide { opacity: 1; animation: none; }
}

/* --- Zahnräder im Hero: physikalisch passende Drehung (Dauer je Zahnrad im SVG) --- */
@keyframes k-zahnrad-cw { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes k-zahnrad-ccw { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) { .k-zahnrad { animation: none !important; } }

/* --- Buttons: Farben gegen die Link-Regeln von GeneratePress durchsetzen (.inside-article a:hover) --- */
.inside-article a.k-btn,
.inside-article a.k-btn:link,
.inside-article a.k-btn:visited,
.site a.k-btn,
.site a.k-btn:link,
.site a.k-btn:visited {
	color: var(--contrast);
}
.inside-article a.k-btn:hover,
.inside-article a.k-btn:focus-visible,
.inside-article a.k-btn:active,
.site a.k-btn:hover,
.site a.k-btn:focus-visible,
.site a.k-btn:active {
	color: var(--base);
}
.inside-article a.k-btn--hell,
.inside-article a.k-btn--hell:link,
.inside-article a.k-btn--hell:visited,
.site a.k-btn--hell,
.site a.k-btn--hell:link,
.site a.k-btn--hell:visited {
	color: var(--base);
}
.inside-article a.k-btn--hell:hover,
.inside-article a.k-btn--hell:focus-visible,
.inside-article a.k-btn--hell:active,
.site a.k-btn--hell:hover,
.site a.k-btn--hell:focus-visible,
.site a.k-btn--hell:active {
	color: var(--contrast);
}

/* --- Hero-Hintergrundvideo (core/video mit Klasse k-hero-video) --- */
.k-hero-foto figure.k-hero-video {
	position: absolute;
	inset: 0;
	margin: 0;
	z-index: 0;
	pointer-events: none;
}
.k-hero-foto figure.k-hero-video video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center right;
	display: block;
}
@media (prefers-reduced-motion: reduce) {
	.k-hero-foto figure.k-hero-video { display: none; }
}

/* --- Blog: Raster, Karten, Filter --- */
.k-blog { display: flex; flex-direction: column; row-gap: 36px; }
.k-filter, .k-chips, .k-teilen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.k-chip { display: inline-block; padding: 5px 12px; border-radius: 4px; background: var(--base); border: 1px solid var(--base-3); font-size: 13px; font-weight: 600; color: var(--contrast); text-decoration: none; line-height: 1.4; }
.k-filter .k-chip { padding: 8px 16px; font-size: 14px; }
.site a.k-chip:hover, .site a.k-chip:focus-visible, .site .k-chip.ist-aktiv { background: var(--contrast); border-color: var(--contrast); color: var(--base); }
.k-beitrag { padding: 0; overflow: hidden; row-gap: 0; }
.k-beitrag__bild { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--base-2); }
.k-beitrag__bild img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.k-beitrag:hover .k-beitrag__bild img { transform: scale(1.04); }
.k-beitrag__body { display: flex; flex-direction: column; row-gap: 12px; padding: 24px 28px 28px; flex: 1; }
.k-beitrag__titel { font-size: 21px; line-height: 1.3; margin: 0; }
.site .k-beitrag__titel a { color: var(--contrast); text-decoration: none; }
.site .k-beitrag__titel a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: .15em; }
.k-beitrag__text { margin: 0; color: var(--contrast-2); }
.k-beitrag__meta { margin: auto 0 0; padding-top: 8px; font-size: 14px; color: var(--contrast-3); }
.k-seiten { display: flex; gap: 8px; justify-content: center; }
.k-seiten__nr { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; border-radius: 4px; border: 1px solid var(--base-3); font-weight: 600; color: var(--contrast); text-decoration: none; }
.site a.k-seiten__nr:hover, .k-seiten__nr.ist-aktiv { background: var(--contrast); border-color: var(--contrast); color: var(--base); }

/* --- Einzelbeitrag --- */
.k-beitrag-hero { padding-top: 96px; padding-bottom: 72px; }
.k-beitrag-hero > img { filter: grayscale(1); }
.k-beitrag-hero h1 { max-width: 22ch; margin-bottom: 0; }
.k-beitrag-hero .k-lead { color: var(--base-3); max-width: 62ch; margin-bottom: 0; }
.k-beitrag-hero__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; font-size: 14px; font-weight: 600; }
.k-beitrag-hero__meta > a { color: var(--accent); text-decoration: none; }
.k-chips--hell .k-chip { background: transparent; border-color: var(--base-3); color: var(--base); }
.k-beitrag-hero__zeile { margin: 0; color: var(--base-3); font-size: 15px; }
.single-post .site-content { padding-top: 56px; padding-bottom: 56px; }
.single-post .content-area { max-width: 820px; margin-left: auto; margin-right: auto; }
.single-post .inside-article { padding: 0; }
.single-post .entry-content { font-size: 18px; line-height: 1.75; }
.single-post .entry-content > p:first-child { font-size: 20px; }
.single-post .entry-content h2 { font-size: 30px; margin-top: 48px; margin-bottom: 16px; }
.single-post .entry-content h3 { font-size: 23px; margin-top: 36px; margin-bottom: 12px; }
.single-post .entry-content h4 { font-size: 19px; margin-top: 28px; margin-bottom: 8px; }
.single-post .entry-content ul, .single-post .entry-content ol { padding-left: 1.3em; }
.single-post .entry-content li { margin-bottom: .4em; }
.single-post .entry-content .wp-block-image { margin: 36px 0; }
.single-post .entry-content .wp-block-image img { border-radius: 6px; width: 100%; height: auto; }
.single-post .entry-content .wp-block-quote { border-left: 4px solid var(--accent); padding-left: 24px; font-style: italic; color: var(--contrast-2); }
.single-post .entry-content .wp-block-table table { font-size: 16px; }
.single-post .entry-content .k-buttons { margin: 32px 0; }
.k-beitrag-ende { margin-top: 56px; display: flex; flex-direction: column; row-gap: 32px; }
.k-teilen span { font-weight: 600; margin-right: 8px; }
.k-autor { display: flex; flex-direction: column; row-gap: 8px; padding: 28px 32px; background: var(--base-2); border-left: 4px solid var(--accent); }
.k-autor__name { margin: 0; font-weight: 700; font-size: 18px; }
.k-autor__text { margin: 0 0 8px; color: var(--contrast-2); }
@media (max-width: 767px) {
	.k-beitrag-hero { padding-top: 56px; padding-bottom: 48px; }
	.k-beitrag__body { padding: 20px; }
	.single-post .entry-content { font-size: 17px; }
}

/* --- Zoho-Formular: kompakter darstellen (Schriftgröße im iFrame selbst kommt aus Zoho Forms > Designs) --- */
.k-zoho { width: 100%; }
.k-zoho iframe { zoom: 0.85; width: 100% !important; display: block; }

/* --- Silbentrennung: lange Wörter in Überschriften auf kleinen Bildschirmen trennen statt abschneiden --- */
@media (max-width: 767px) {
	.entry-content h1,
	.entry-content h2 {
		-webkit-hyphens: auto;
		hyphens: auto;
		hyphenate-limit-chars: 14 6 6;
		overflow-wrap: break-word;
	}
}
