/*
Theme Name: TopFit OnePager
Description: Schlankes OnePager-Theme für TopFit Stromberg. Inhalte stehen in inc/content.php.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.3
Text Domain: topfit
*/

:root {
	--c-primary: #6b4c8f;
	--c-dark: #2f2f2f;
	--c-light: #eeeeee;
	--c-green: #b2c28b;
	--c-green-dark: #7f9358;
	--c-btn: #b2c28b;
	--c-red: #c0281e;
	--max: 1120px;
	--header-h: 84px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
	margin: 0;
	font: 18px/1.7 "Open Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--c-dark);
	background: linear-gradient(180deg, #f7f7f7 0%, #e6e6e6 100%) fixed;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-green-dark); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; }
h2, .intro h1 { position: relative; padding-bottom: .5em; }
h2::after, .intro h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 80px; height: 4px; border-radius: 2px; background: var(--c-green); }
h2, .intro h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }
.section:nth-of-type(even) { background: rgba(255, 255, 255, .55); }
.section-intro { max-width: 720px; margin-bottom: 2.5rem; }

/* Topbar */
.topbar { background: var(--c-btn); color: #fff; padding: 14px 16px; font-size: 1rem; text-align: center; }
.topbar a { color: #fff; text-decoration: none; margin: 0 14px; white-space: nowrap; }
.topbar a:hover { text-decoration: underline; }

/* Header */
.site-header {
	position: sticky; top: 0; z-index: 100;
	height: var(--header-h);
	background: #fff;
	backdrop-filter: blur(6px);
	box-shadow: 0 1px 8px rgba(0, 0, 0, .08);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.site-logo img { height: 64px; width: auto; }
.nav-toggle { display: none; }
.site-nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; color: var(--c-dark); font-weight: 600; font-size: 1rem; }
.site-nav a:hover, .site-nav a.active { color: var(--c-green-dark); }

/* Buttons */
.btn {
	display: inline-block; padding: 14px 28px; min-height: 48px; border-radius: 6px;
	background: var(--c-btn); color: #fff; text-decoration: none; font-weight: 700;
}
.btn:hover { filter: brightness(1.08); }
.btn-lg { padding: 16px 32px; font-size: 1.1rem; }
.btn.ghost { background: #fff; color: var(--c-green-dark); box-shadow: inset 0 0 0 2px var(--c-green); }
.more { margin-top: 1.8rem; }

/* Hero */
.hero { padding: 72px 0 64px; color: var(--c-dark); background: linear-gradient(135deg, #f3f6ec 0%, #e1ebcf 100%); }
.hero h1 { font-size: clamp(2rem, 5.5vw, 3.2rem); max-width: 18ch; margin-bottom: .5em; }
.hero p { max-width: 640px; font-size: 1.2rem; margin: 0 0 1.5rem; }
.hero .hero-actions { display: flex; flex-wrap: wrap; gap: 14px; max-width: none; }
.hero-grid { display: grid; gap: 32px; grid-template-columns: 1.2fr .8fr; align-items: center; }
.hero-img { width: 100%; max-width: 420px; justify-self: center; }
.nav-cta { margin-left: 22px; padding: 10px 20px; min-height: 44px; white-space: nowrap; }
.call-bar { display: none; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.contact-actions .btn { padding: 8px 16px; min-height: 40px; font-size: .95rem; }

/* Aufklappbare Karten */
.acc summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; font-size: 1.6rem; font-weight: 700; color: var(--c-green-dark); }
.acc[open] summary::after { content: "–"; }
.acc summary h3 { margin: 0; }
.acc[open] summary { margin-bottom: .6em; }

/* Detailseiten */
.detail-page h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); position: relative; padding-bottom: .5em; flex: 1; }
.detail-page h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 80px; height: 4px; border-radius: 2px; background: var(--c-green); }
.detail-page .section-head .brand-logo { width: auto; }
.feature img { max-width: 320px; justify-self: center; border-radius: 0; }
.feature + .blocks, .feature ~ .blocks { margin-top: 2rem; }
.back { margin: 0 0 1.5rem; font-size: .95rem; }
.prose { max-width: 760px; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 4px 0 4px 20px; position: relative; }
.plain li::before { content: "•"; position: absolute; left: 4px; color: var(--c-green-dark); }
.gallery.wide { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 0; }
.gallery.wide img { aspect-ratio: 4 / 3; }
.cta { text-align: center; }
.cta h2::after { left: 50%; transform: translateX(-50%); }
.cta .btn { margin: 6px; }

/* Content blocks */
.split { display: grid; gap: 40px; grid-template-columns: 1fr 1fr; align-items: center; }
.split img { width: 100%; border-radius: 6px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.section-head h2 { flex: 1; }
.section-head .brand-logo { max-height: 64px; width: auto; flex: none; }
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-top: 2rem; }
.gallery img { border-radius: 6px; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.team { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(200px, 260px)); }
.team figure { margin: 0; }
.team img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; }
.team figcaption { margin-top: 8px; font-weight: 600; }
.team figcaption small { display: block; font-weight: 400; opacity: .7; }
.info-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.info-grid h3 { color: var(--c-primary); }
.info-grid h4 { margin: 1em 0 .3em; color: var(--c-green-dark); }
.info-grid .note { margin-top: 1em; font-size: 1rem; }

/* Galerie */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 1.5rem; }
.filters button { font: inherit; font-weight: 600; padding: 10px 22px; min-height: 44px; border: 2px solid var(--c-btn); border-radius: 999px; background: #fff; color: var(--c-green-dark); cursor: pointer; }
.filters button.active, .filters button:hover { background: var(--c-btn); color: #fff; }
.masonry { columns: 4 200px; column-gap: 12px; }
.shot { display: block; break-inside: avoid; margin-bottom: 12px; border-radius: 6px; overflow: hidden; box-shadow: 0 4px 16px rgba(0, 0, 0, .08); }
.shot img { width: 100%; transition: transform .4s; }
.shot:hover img { transform: scale(1.05); }
.shot[hidden] { display: none; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh; overflow: visible; }
.lightbox::backdrop { background: rgba(0, 0, 0, .88); }
.lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 4px; margin: auto; }
.lightbox button { position: fixed; background: rgba(255, 255, 255, .15); color: #fff; border: 0; border-radius: 50%; width: 48px; height: 48px; font-size: 1.8rem; cursor: pointer; }
.lightbox button:hover { background: rgba(255, 255, 255, .3); }
.lightbox .lb-close { top: 16px; right: 16px; width: auto; height: 44px; padding: 0 18px; border-radius: 999px; background: #fff; color: #333; font-size: 1rem; font-weight: 700; z-index: 2; }
.lightbox .lb-close:hover { background: var(--c-btn); color: #fff; }
.lb-prev { left: 16px; top: 50%; }
.lb-next { right: 16px; top: 50%; }

/* Highlights & Info-Karten */
.highlights { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 10px 28px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.highlights li { padding-left: 28px; position: relative; font-weight: 600; }
.highlights li::before { content: "✓"; position: absolute; left: 0; color: var(--c-green-dark); font-weight: 700; }
.intro figure { margin: 0; max-width: 380px; justify-self: center; }
.intro figure img { aspect-ratio: 1; object-fit: cover; box-shadow: 0 6px 24px rgba(0, 0, 0, .12); }
.intro figcaption { margin-top: 10px; text-align: center; font-weight: 600; color: var(--c-primary); }
.sub { margin-top: 2rem; color: var(--c-primary); }
.sub + .highlights { margin-top: 1rem; }
.steps { list-style: none; counter-reset: step; margin: 1rem 0 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.steps li { counter-increment: step; background: #fff; border-radius: 6px; box-shadow: 0 6px 24px rgba(0, 0, 0, .08); padding: 20px 20px 20px 70px; position: relative; }
.steps li::before {
	content: counter(step); position: absolute; left: 18px; top: 18px; width: 38px; height: 38px;
	display: grid; place-items: center; border-radius: 50%; background: var(--c-green); color: #fff; font-weight: 700;
}
.blocks { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 2rem; }
.blocks .card { padding: 24px; border-top: 4px solid var(--c-green); }
.blocks h3 { color: var(--c-primary); }
.blocks p { margin: 0; }

/* Cards & Kursplan */
.card { background: #fff; border-radius: 6px; box-shadow: 0 6px 24px rgba(0, 0, 0, .08); padding: 32px; }
.schedule { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: 1rem; }
.day, .personal { border-top: 4px solid var(--c-green); padding: 24px; }
.day h3, .personal h3 { color: var(--c-primary); }
.day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.day li { position: relative; padding-left: 22px; display: grid; }
.day li::before { content: ""; position: absolute; left: 0; top: .55em; width: 10px; height: 10px; border-radius: 50%; background: var(--c-green); }
.day .time { color: var(--c-green-dark); font-weight: 700; font-size: .95rem; }
.day small { font-size: .95rem; opacity: .8; }
.course-logo { height: 44px; width: auto; margin-top: 8px; justify-self: start; }
.partner-logos { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 40px; margin-top: 1.2rem; }
.partner-logos img { height: 64px; width: auto; border-radius: 6px; }
.personal { margin-top: 24px; }
.personal p { margin: 0; }
.partners { margin: 1.2rem 0 0; font-weight: 600; color: var(--c-green-dark); }
.info-grid table { border-collapse: collapse; width: 100%; }
.info-grid td { padding: 4px 0; vertical-align: top; }
.info-grid td:first-child { padding-right: 14px; font-weight: 600; white-space: nowrap; }
.legal { font-size: .9rem; }

/* Footer (gleiches Design wie Header) */
.site-footer { position: static; margin-top: 0; }
.footer-copy { font-size: .9rem; opacity: .75; }
.site-footer .site-logo img { height: 48px; }

/* Rechtliche Unterseiten */
.narrow { max-width: 820px; }
.legal-page h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.legal-page h2 { font-size: 1.3rem; margin-top: 1.8em; padding-bottom: 0; }
.legal-page h2::after, .intro h1::after { display: none; }
.legal-page .stand { opacity: .7; font-size: .9rem; }
.map-consent { display: grid; place-items: center; text-align: center; gap: 14px; min-height: 320px; padding: 24px; background: #fff; border: 2px dashed var(--c-green); border-radius: 6px; }
.map-consent p { margin: 0; max-width: 520px; }
.map-consent iframe { width: 100%; height: 380px; border: 0; border-radius: 6px; }
.map-consent.loaded { display: block; padding: 0; border: 0; min-height: 0; }
.route { margin-top: .6rem; }
.contact-form { display: grid; gap: 16px; }
.contact-form label { display: grid; gap: 6px; font-weight: 600; }
.contact-form input[type=text], .contact-form input[type=email], .contact-form textarea { font: inherit; padding: 10px 12px; border: 1px solid #ccc; border-radius: 4px; width: 100%; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--c-green); border-color: var(--c-green); }
.contact-form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .9rem; }
.contact-form .check input { margin-top: 5px; }
.contact-form .btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; justify-self: start; }
.hp { position: absolute; left: -9999px; }
.form-msg { padding: 12px 16px; border-radius: 4px; font-weight: 600; }
.form-msg.ok { background: #e3e9d5; color: #4d5e2e; }
.form-msg.err { background: #f8dcd9; color: var(--c-red); }

@media (max-width: 860px) {
	.split { grid-template-columns: 1fr; }
	.nav-toggle { display: block; background: none; border: 0; font-size: 1.8rem; cursor: pointer; }
	.site-nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; background: #fff; box-shadow: 0 6px 10px rgba(0, 0, 0, .1); }
	.site-nav.open { display: block; }
	.site-nav ul { flex-direction: column; gap: 0; }
	.site-nav a { display: block; padding: 14px 20px; }
	.section { padding: 56px 0; }
	.nav-cta { display: none; }
	body { padding-bottom: 64px; }
	.call-bar {
		display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 120; padding: 16px;
		background: var(--c-btn); color: #fff; text-align: center; font-weight: 700; font-size: 1.1rem;
		text-decoration: none; box-shadow: 0 -2px 10px rgba(0, 0, 0, .2);
	}
	.hero { padding: 48px 0 44px; }
	.hero-grid { grid-template-columns: 1fr; }
	.hero-img { max-width: 260px; }
	.site-footer .wrap { flex-wrap: wrap; justify-content: center; gap: 8px 24px; padding: 12px 20px; }
	.site-footer { height: auto; }
	.site-footer .site-nav { display: block; position: static; box-shadow: none; background: none; }
	.site-footer .site-nav ul { flex-direction: row; }
	.site-footer .site-nav a { padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
