/* ============================================================
 * VIVA-COM — Animationen Pro
 * Eigene Bibliothek (kein AOS / kein Framework).
 * Aktiviert durch JS (animations.js) über data-Attribute.
 * ============================================================ */

/* -----------------------------------------
 * 0. Globale Token-Wiederverwendung
 * (das Theme liefert sie schon via assets/css/style.css,
 *  hier nur Fallbacks falls die Datei separat geladen wird).
 * ----------------------------------------- */
:where(html) {
	scroll-behavior: smooth;
	scroll-padding-top: 96px; /* compensiert sticky navbar */
}

/* -----------------------------------------
 * 1. Sticky-Navbar Shrink
 * ----------------------------------------- */
.navbar {
	transition: padding 0.28s ease, box-shadow 0.28s ease, background 0.28s ease, backdrop-filter 0.28s ease;
	will-change: padding, box-shadow;
}
.navbar.is-scrolled {
	padding: 10px 0;
	box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
	background: rgba(255, 255, 255, 0.95) !important;
	backdrop-filter: saturate(180%) blur(20px);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
}
.navbar.is-scrolled .logo img {
	transform: scale(0.88);
	transition: transform 0.28s ease;
}
.logo img { transition: transform 0.28s ease; }

/* -----------------------------------------
 * 2. Reveal on scroll (data-reveal)
 * ----------------------------------------- */
[data-reveal] {
	opacity: 0;
	transform: translateY(28px);
	transition:
		opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: opacity, transform;
}
[data-reveal="fade-up"]     { transform: translateY(28px); }
[data-reveal="fade-down"]   { transform: translateY(-28px); }
[data-reveal="fade-left"]   { transform: translateX(-28px); }
[data-reveal="fade-right"]  { transform: translateX(28px); }
[data-reveal="zoom-in"]     { transform: scale(0.94); }
[data-reveal="fade"]        { transform: none; }

[data-reveal].is-visible {
	opacity: 1;
	transform: none;
}

/* Stagger (data-reveal-delay="100" → délai ms) */
[data-reveal-delay] { transition-delay: 0ms; }

/* -----------------------------------------
 * 3. Hero séquentiel (déjà partiellement en style.css — on harmonise)
 * ----------------------------------------- */
.hero .hero-eyebrow { animation-delay: 0.05s !important; }
.hero h1            { animation-delay: 0.20s !important; }
.hero .hero-sub     { animation-delay: 0.45s !important; }
.hero .hero-actions { animation-delay: 0.70s !important; }
.hero .hero-stats   { animation-delay: 0.95s !important; }

/* -----------------------------------------
 * 4. CountUp — chiffres animés (.stat-number)
 * Le JS modifie data-target → met le state .is-counting pendant l'anim.
 * ----------------------------------------- */
.stat-number {
	font-variant-numeric: tabular-nums;
	transition: color 0.3s ease, transform 0.4s ease;
}
.stat-number.is-counting {
	color: var(--primary, #1F6F3D);
}
.stat.is-counting .stat-label { opacity: 0.65; }

/* -----------------------------------------
 * 5. Boutons — shimmer + scale au hover
 * ----------------------------------------- */
.btn, .btn-primary, .btn-ghost {
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

.btn-primary::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(120deg,
		transparent 25%,
		rgba(255, 255, 255, 0.25) 50%,
		transparent 75%);
	background-size: 250% 100%;
	background-position: 100% 0;
	transition: background-position 0.6s ease;
	pointer-events: none;
	z-index: -1;
}
.btn-primary:hover::after { background-position: -100% 0; }
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost:hover { transform: translateY(-1px); }

/* -----------------------------------------
 * 6. Cartes — hover lift, glow, image zoom
 * ----------------------------------------- */
.panel-card,
.testimonial-card,
.trust-badge,
.contact-card,
.about-image-card,
.faq-item,
.artikel-card,
.dashboard-tile,
.intranet-card {
	transition:
		transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 0.35s ease,
		border-color 0.25s ease;
	will-change: transform;
}

.panel-card:hover,
.testimonial-card:hover,
.trust-badge:hover,
.contact-card:hover,
.about-image-card:hover,
.artikel-card:hover,
.dashboard-tile:hover {
	transform: translateY(-4px);
}

.panel-card:hover { box-shadow: 0 14px 40px rgba(15, 23, 42, 0.12); }
.testimonial-card:hover { box-shadow: 0 10px 28px rgba(15, 23, 42, 0.10); }
.trust-badge:hover { box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08); }
.contact-card:hover { box-shadow: 0 10px 28px rgba(15, 23, 42, 0.10); }

/* Image dans about-image-card : zoom doux au hover */
.about-image-card img,
.panel-image img,
.artikel-card-img img {
	transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.about-image-card:hover img,
.panel-card:hover .panel-image img,
.artikel-card:hover .artikel-card-img img {
	transform: scale(1.04);
}

/* -----------------------------------------
 * 7. Leistungen tabs — transition entre panels
 * ----------------------------------------- */
.leistungen-tab {
	transition:
		background 0.25s ease,
		color 0.25s ease,
		transform 0.18s ease,
		box-shadow 0.25s ease;
}
.leistungen-tab:hover { transform: translateY(-1px); }

.leistungen-panel {
	display: none;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.4s ease, transform 0.4s ease;
}
.leistungen-panel.active {
	display: block;
	animation: vivaPanelIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes vivaPanelIn {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: none; }
}

/* -----------------------------------------
 * 8. FAQ — accordéon animé
 * details/summary : par défaut snap. On utilise grid trick.
 * ----------------------------------------- */
.faq-item summary {
	transition: color 0.2s ease, background 0.2s ease;
	cursor: pointer;
}
.faq-item summary i {
	transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.faq-item[open] summary i { transform: rotate(180deg); }

.faq-content {
	overflow: hidden;
	display: grid;
	grid-template-rows: 1fr;
	transition: grid-template-rows 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.faq-content > p {
	min-height: 0;
}

/* -----------------------------------------
 * 9. Contact form — focus glow + label flottant
 * ----------------------------------------- */
.contact-form input,
.contact-form textarea {
	transition:
		border-color 0.2s ease,
		box-shadow 0.25s ease,
		background 0.2s ease;
}
.contact-form input:focus,
.contact-form textarea:focus {
	box-shadow: 0 0 0 4px rgba(31, 111, 61, 0.12);
}
.contact-form input:hover:not(:focus),
.contact-form textarea:hover:not(:focus) {
	border-color: rgba(15, 23, 42, 0.25);
}

/* Bouton submit avec mini-pulse */
.contact-form .btn-primary {
	transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.2s ease;
}

/* -----------------------------------------
 * 10. Section-titles — soulignement animé
 * ----------------------------------------- */
.section-title {
	position: relative;
	display: inline-block;
}
.section-title::after {
	content: '';
	position: absolute;
	left: 50%;
	bottom: -10px;
	transform: translateX(-50%);
	width: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--primary, #1F6F3D), var(--primary-dark, #166134));
	border-radius: 2px;
	transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}
[data-reveal].is-visible .section-title::after,
.section-title.is-revealed::after {
	width: 60px;
}

/* -----------------------------------------
 * 11. Footer — fade-in au scroll
 * ----------------------------------------- */
.footer-col { transition: transform 0.4s ease, opacity 0.4s ease; }

/* -----------------------------------------
 * 12. Chat widget — pulse subtil au repos
 * ----------------------------------------- */
.chat-widget-btn:not(.open) {
	animation: vivaChatPulse 2.8s ease-in-out infinite;
}
@keyframes vivaChatPulse {
	0%, 100% { box-shadow: 0 6px 20px rgba(31, 111, 61, 0.35); }
	50%      { box-shadow: 0 6px 32px rgba(31, 111, 61, 0.55), 0 0 0 12px rgba(31, 111, 61, 0.08); }
}

/* -----------------------------------------
 * 13. Page transitions — apparition du body
 * ----------------------------------------- */
body {
	animation: vivaBodyIn 0.4s ease-out both;
}
@keyframes vivaBodyIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* -----------------------------------------
 * 14. Mobile — animations allégées
 * ----------------------------------------- */
@media (max-width: 768px) {
	[data-reveal] { transition-duration: 0.5s; }
	.panel-card:hover,
	.testimonial-card:hover,
	.artikel-card:hover,
	.dashboard-tile:hover {
		transform: none; /* pas de lift au tap sur mobile */
	}
}

/* -----------------------------------------
 * 15. prefers-reduced-motion — respect strict
 * ----------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
	[data-reveal] {
		opacity: 1 !important;
		transform: none !important;
	}
}

/* ============================================================
 * Contact form — AJAX feedback inline
 * ============================================================ */
.contact-feedback {
	margin-top: 16px;
	padding: 0 16px;
	border-radius: 12px;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.5;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transform: translateY(-6px);
	transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.3s ease, transform 0.35s ease, margin-top 0.3s ease;
	border: 1px solid transparent;
}
.contact-feedback.show {
	padding: 14px 18px;
	max-height: 200px;
	opacity: 1;
	transform: none;
	animation: vivaFeedbackIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes vivaFeedbackIn {
	from { opacity: 0; transform: translateY(-8px); }
	to   { opacity: 1; transform: none; }
}
.contact-feedback.success {
	background: linear-gradient(135deg, rgba(31, 111, 61, 0.08), rgba(31, 111, 61, 0.14));
	border-color: rgba(31, 111, 61, 0.3);
	color: #143D24;
}
.contact-feedback.error {
	background: linear-gradient(135deg, rgba(220, 38, 38, 0.06), rgba(220, 38, 38, 0.12));
	border-color: rgba(220, 38, 38, 0.3);
	color: #7F1D1D;
}

/* Bouton submit — état loading avec spinner */
#vivaContactSubmit {
	position: relative;
	min-width: 200px;
	transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.25s ease;
}
#vivaContactSubmit .btn-spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2.5px solid rgba(255, 255, 255, 0.35);
	border-top-color: #FFFFFF;
	border-radius: 50%;
	animation: vivaSpin 0.7s linear infinite;
	margin-left: 8px;
}
#vivaContactSubmit.is-loading .btn-label { opacity: 0.7; }
#vivaContactSubmit.is-loading .btn-spinner { display: inline-block; vertical-align: middle; }
#vivaContactSubmit:disabled { cursor: wait; opacity: 0.85; }

@keyframes vivaSpin {
	to { transform: rotate(360deg); }
}

/* ============================================================
 * Impressum — Photo Geschäftsführer
 * ============================================================ */
.viva-impressum-leitung {
	display: flex;
	justify-content: flex-start;
	margin: 18px 0 24px;
}
.viva-leitung-photo {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	margin: 0;
	padding: 14px;
	background: var(--white, #FFFFFF);
	border: 1px solid var(--color-border, #E2E8F0);
	border-radius: 16px;
	box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
	max-width: 220px;
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
	animation: vivaCardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.viva-leitung-photo:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}
.viva-leitung-photo img {
	width: 180px;
	height: 180px;
	border-radius: 50%;
	object-fit: cover;
	object-position: center top;
	border: 4px solid var(--primary, #1F6F3D);
	box-shadow: 0 6px 18px rgba(31, 111, 61, 0.18);
}
.viva-leitung-photo figcaption {
	margin-top: 12px;
	text-align: center;
	font-size: 0.92rem;
	line-height: 1.45;
	color: var(--slate-700, #334155);
}
.viva-leitung-photo figcaption strong {
	display: block;
	color: var(--slate-950, #020617);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	margin-bottom: 2px;
}
.viva-leitung-photo figcaption span {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--primary, #1F6F3D);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

@keyframes vivaCardIn {
	from { opacity: 0; transform: translateY(12px) scale(0.96); }
	to   { opacity: 1; transform: none; }
}

@media (max-width: 540px) {
	.viva-leitung-photo img { width: 140px; height: 140px; }
}

/* ============================================================
 * Pages légales — mise en forme professionnelle + responsive
 * (Impressum, Datenschutz, AGB, Widerruf)
 * ============================================================ */

/* Body : fond gris très clair, contenu centré */
body.page-template-default.page,
body:has(article#post-52),
body:has(article#post-53),
body:has(article#post-54),
body:has(article#post-55) {
	background: var(--slate-50, #F8FAFC);
}

/* Container principal des pages */
.content-area .container {
	max-width: 820px !important;
	background: var(--white, #FFFFFF);
	border: 1px solid var(--color-border, #E2E8F0);
	border-radius: 18px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 24px rgba(15, 23, 42, 0.05);
	padding: 48px 56px !important;
	margin: 40px auto;
	position: relative;
	overflow: hidden;
}

.content-area .container::before {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 3px;
	background: linear-gradient(90deg, transparent 0%, var(--primary, #1F6F3D) 50%, transparent 100%);
}

/* Titre principal de la page */
.page-template-default .page-title,
.content-area .page-header h1,
.content-area .page-title {
	font-size: clamp(1.8rem, 4vw, 2.4rem) !important;
	font-weight: 800 !important;
	color: var(--slate-950, #020617) !important;
	letter-spacing: -0.03em !important;
	margin-bottom: 8px !important;
	line-height: 1.15 !important;
}

.content-area .page-header {
	border-bottom: 1px solid var(--color-border, #E2E8F0);
	padding-bottom: 20px;
	margin-bottom: 32px !important;
}

.content-area .page-header::after {
	content: '';
	display: block;
	width: 50px;
	height: 3px;
	background: var(--primary, #1F6F3D);
	border-radius: 2px;
	margin-top: 14px;
}

/* H2 dans le contenu : style de section pro */
.page-content h2,
.content-area article h2 {
	font-size: 1.25rem !important;
	font-weight: 700 !important;
	color: var(--slate-950, #020617) !important;
	letter-spacing: -0.01em !important;
	margin: 36px 0 12px !important;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--color-border, #E2E8F0);
	display: flex;
	align-items: center;
	gap: 10px;
	scroll-margin-top: 120px;
}

.page-content h2:first-child {
	margin-top: 0 !important;
}

.page-content h2::before {
	content: '';
	width: 4px;
	height: 1.1em;
	background: var(--primary, #1F6F3D);
	border-radius: 2px;
	flex-shrink: 0;
}

.page-content h3,
.content-area article h3 {
	font-size: 1.05rem !important;
	font-weight: 600 !important;
	color: var(--slate-900, #0F172A) !important;
	margin: 24px 0 8px !important;
}

/* Paragraphes */
.page-content p,
.content-area article p {
	font-size: 0.96rem !important;
	line-height: 1.75 !important;
	color: var(--slate-700, #334155) !important;
	margin-bottom: 14px !important;
}

.page-content strong { color: var(--slate-950, #020617); font-weight: 700; }

.page-content a,
.content-area article a {
	color: var(--primary, #1F6F3D);
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.15s ease;
}
.page-content a:hover { color: var(--primary-dark, #166134); }

.page-content ul,
.page-content ol {
	margin: 12px 0 16px 24px;
	padding: 0;
}
.page-content ul li,
.page-content ol li {
	font-size: 0.96rem;
	line-height: 1.7;
	color: var(--slate-700, #334155);
	margin-bottom: 6px;
	padding-left: 4px;
}
.page-content ul li::marker { color: var(--primary, #1F6F3D); }

/* Carte Geschäftsführer (Impressum) — header avec photo + infos */
.viva-impressum-leitung {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 28px;
	align-items: center;
	background: linear-gradient(135deg, var(--slate-50, #F8FAFC), var(--white, #FFFFFF));
	border: 1px solid var(--color-border, #E2E8F0);
	border-radius: 16px;
	padding: 28px;
	margin: 0 0 36px !important;
	position: relative;
	overflow: hidden;
}

.viva-impressum-leitung::before {
	content: '';
	position: absolute;
	top: 0; left: 0; bottom: 0;
	width: 4px;
	background: linear-gradient(180deg, var(--primary, #1F6F3D), var(--primary-light, #34A85C));
}

.viva-leitung-photo {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.viva-leitung-photo img {
	width: 160px;
	height: 160px;
	border-radius: 50%;
	object-fit: cover;
	object-position: center 15%;
	border: 4px solid var(--white, #FFFFFF);
	box-shadow: 0 8px 24px rgba(31, 111, 61, 0.18), 0 0 0 2px var(--primary, #1F6F3D);
	transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.viva-leitung-photo:hover img { transform: scale(1.03); }

.viva-leitung-photo figcaption {
	margin-top: 14px;
	text-align: center;
	line-height: 1.4;
}
.viva-leitung-photo figcaption strong {
	display: block;
	font-size: 1rem;
	font-weight: 700;
	color: var(--slate-950, #020617);
	letter-spacing: -0.01em;
}
.viva-leitung-photo figcaption span {
	display: block;
	margin-top: 4px;
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--primary, #1F6F3D);
	text-transform: uppercase;
	letter-spacing: 0.12em;
}

.viva-leitung-text {
	min-width: 0;
}
.viva-leitung-text p {
	margin: 0 0 10px !important;
	line-height: 1.6 !important;
	font-size: 0.92rem !important;
}
.viva-leitung-text .viva-leitung-name {
	font-size: 1.1rem !important;
	color: var(--slate-950, #020617) !important;
	margin-bottom: 12px !important;
}
.viva-leitung-text i {
	color: var(--primary, #1F6F3D);
	width: 16px;
	margin-right: 6px;
}
.viva-leitung-text a {
	font-weight: 500;
}

/* Source/footer de la page légale */
.viva-impressum-source {
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid var(--color-border, #E2E8F0);
	font-size: 0.82rem !important;
	color: var(--slate-500, #64748B) !important;
	font-style: italic;
	text-align: center;
}

/* ----- Mobile responsive ----- */
@media (max-width: 768px) {
	.content-area .container {
		padding: 28px 22px !important;
		margin: 16px 12px !important;
		border-radius: 14px;
	}

	.page-content h2,
	.content-area article h2 {
		font-size: 1.1rem !important;
		margin: 28px 0 10px !important;
	}

	.viva-impressum-leitung {
		grid-template-columns: 1fr;
		gap: 18px;
		padding: 22px 18px;
		text-align: center;
	}
	.viva-impressum-leitung::before {
		width: 100%;
		height: 4px;
		bottom: auto;
		background: linear-gradient(90deg, var(--primary, #1F6F3D), var(--primary-light, #34A85C));
	}
	.viva-leitung-photo img {
		width: 130px;
		height: 130px;
	}
	.viva-leitung-text p {
		text-align: center;
	}
}

@media (max-width: 540px) {
	.content-area .container {
		padding: 22px 16px !important;
		margin: 12px 8px !important;
		border-radius: 12px;
	}
	.page-content p,
	.content-area article p {
		font-size: 0.92rem !important;
		line-height: 1.7 !important;
	}
}
