/*
Theme Name: Bäderwesen
Theme URI: https://baederwesen.at
Description: Eigenständiges Theme für Bäderwesen Consulting (Dr. Birgit Mindl). Nachbau des früheren Elementor-Designs ohne Seitenbaukasten, ohne externe Abhängigkeiten, lauffähig mit PHP 8.1–8.4. Enthält Kurs-Anmeldeformular, Terminliste und Einrichtungs-Werkzeug.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.0
Author: Bäderwesen Consulting
Text Domain: baederwesen
License: GPL-2.0-or-later
*/

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { margin: 0; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; height: auto; }
a { text-underline-offset: 3px; }
a:hover { color: var(--wp--preset--color--akzent); }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .6em; hyphens: auto; overflow-wrap: break-word; }
p { margin: 0 0 1em; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; clip: auto; width: auto; height: auto; padding: 10px 16px; background: #fff; }
:focus-visible { outline: 2px solid var(--wp--preset--color--akzent); outline-offset: 2px; }

.bw-container { width: 100%; max-width: calc(var(--wp--style--global--wide-size, 1320px) + 48px); margin: 0 auto; padding: 0 24px; }

/* ---------- Kopfbereich ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: #fff; box-shadow: 0 1px 0 rgba(32,36,62,.06); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }
.site-header .bw-container { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 92px; padding-top: 14px; padding-bottom: 14px; }
.site-logo img, .custom-logo { display: block; width: 250px; max-width: 46vw; height: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: flex-end; }
.main-nav a { position: relative; display: inline-block; padding: 6px 0; color: var(--wp--preset--color--navy); font-weight: 600; text-decoration: none; font-size: 1rem; }
.main-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: var(--wp--preset--color--blau); transform: scaleX(0); transition: transform .2s; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current_page_item > a { color: var(--wp--preset--color--blau); }
.main-nav a:hover::after, .main-nav .current-menu-item > a::after, .main-nav .current_page_item > a::after { transform: scaleX(1); }
.main-nav .sub-menu { display: none; }
.nav-toggle { display: none; background: var(--wp--preset--color--weiss); border: 0; padding: 10px; cursor: pointer; color: var(--wp--preset--color--akzent); }
.nav-toggle svg { width: 30px; height: 30px; display: block; }
@media (max-width: 1024px) {
	.nav-toggle { display: block; }
	.main-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--wp--preset--color--hell); display: none; box-shadow: 0 10px 20px rgba(0,0,0,.08); }
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; gap: 0; padding: 8px 0; }
	.main-nav a { display: block; padding: 12px 24px; font-size: 1.125rem; letter-spacing: 1px; }
	.main-nav a::after { display: none; }
}

/* ---------- Inhaltsbereich ---------- */
.site-main > .entry-content > *:not(.alignfull):not(.alignwide) { max-width: var(--wp--style--global--content-size); margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }
.site-main > .entry-content > .alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto; }
.site-main > .entry-content > .alignfull { max-width: none; }
.entry-content > * + * { margin-top: 0; }
.entry-content > .wp-block-group.alignfull { margin-top: 0; margin-bottom: 0; }

.page-header { background: var(--wp--preset--color--hell); padding: clamp(48px, 7vw, 96px) 0 clamp(36px, 5vw, 64px); }
.page-header h1 { margin: 0; font-size: clamp(2.25rem, 5vw, 3.5rem); }
.page-header .bw-meta { margin-top: 12px; color: var(--wp--preset--color--mittelgrau); font-size: .95rem; }
.page-header + .bw-featured { margin-top: -1px; }
.bw-featured img { display: block; width: 100%; max-height: 520px; object-fit: cover; }
.entry-content.is-plain { padding-top: 56px; padding-bottom: 72px; }
.entry-content.is-plain h2 { font-size: 1.6rem; margin-top: 1.6em; }
.entry-content.is-plain h3 { font-size: 1.3rem; margin-top: 1.4em; }

/* Abschnitte (aus Elementor-Sektionen) */
.bw-section { padding: clamp(48px, 7vw, 90px) 0; }
.bw-section + .bw-section:not(.has-background) { padding-top: clamp(24px, 4vw, 48px); }
.bw-hero { padding-top: clamp(40px, 6vw, 80px); }
.bw-hero h1, .bw-hero h2:first-of-type { font-size: clamp(2.4rem, 5.5vw, 3.75rem); line-height: 1.02; }
.bw-section > .wp-block-columns, .bw-section > * { margin-left: auto; margin-right: auto; }
.wp-block-columns { gap: 0; margin-bottom: 0; }
.wp-block-columns + .wp-block-columns { margin-top: 0; }
.wp-block-column { padding: clamp(16px, 2.5vw, 32px); }
.wp-block-column.has-background { padding: clamp(32px, 4.5vw, 64px); }
.wp-block-column > *:last-child { margin-bottom: 0; }
.has-weiss-color a:not(.wp-element-button) { color: inherit; }
.has-weiss-color .wp-block-button__link { background: var(--wp--preset--color--akzent); }
.has-akzent-background-color .wp-block-button__link { background: var(--wp--preset--color--navy); }

/* Bild füllt Spalte (frühere Hintergrundbilder) */
.wp-block-column:has(> .bw-fill) { padding: 0; min-height: 320px; }
.wp-block-image.bw-fill { margin: 0; height: 100%; }
.wp-block-image.bw-fill img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; display: block; }

/* Listen mit Strich wie im Original */
.entry-content ul.wp-block-list { list-style: none; padding-left: 0; }
.entry-content ul.wp-block-list > li { position: relative; padding-left: 1.4em; margin-bottom: .25em; letter-spacing: .3px; }
.entry-content ul.wp-block-list > li::before { content: "–"; position: absolute; left: 0; color: var(--wp--preset--color--akzent); }

/* Buttons */
.wp-element-button, .wp-block-button__link { transition: background .2s, color .2s; }
.wp-block-buttons { margin: 1.5em 0; }

/* Tabellen (Stundenplan) */
.wp-block-table { overflow-x: auto; margin: 0 0 1.5em; }
.wp-block-table table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: .92rem; table-layout: auto; }
.wp-block-table table.has-fixed-layout { table-layout: auto; }
.wp-block-table th, .wp-block-table td { border: 0; border-bottom: 1px solid #dfe3e8; padding: 10px 8px; text-align: left; vertical-align: top; }
.wp-block-table thead th { background: var(--wp--preset--color--navy); color: #fff; font-weight: 600; white-space: nowrap; }
.wp-block-table tbody tr:nth-child(even) td { background: rgba(240,246,246,.7); }
.wp-block-table td:last-child { white-space: nowrap; font-weight: 600; }

/* Aufklapper (Module) */
.wp-block-details { border-top: 1px solid rgba(32,36,62,.2); padding: 12px 0; margin-top: 1em; }
.wp-block-details summary { cursor: pointer; font-weight: 600; color: var(--wp--preset--color--blau); }
.has-weiss-color .wp-block-details summary { color: inherit; }
.wp-block-details[open] summary { margin-bottom: .6em; }

/* ---------- Terminliste ---------- */
.bw-termine { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 24px; margin: 1.5em 0; }
.bw-termin { position: relative; display: flex; align-items: flex-end; min-height: 320px; overflow: hidden; background: var(--wp--preset--color--navy); color: #fff; text-decoration: none; }
.bw-termin img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.bw-termin::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(32,36,62,.85) 0%, rgba(32,36,62,.15) 60%, rgba(32,36,62,0) 100%); }
.bw-termin:hover img { transform: scale(1.04); }
.bw-termin:hover { color: #fff; }
.bw-termin__body { position: relative; z-index: 1; padding: 24px; }
.bw-termin__cat { display: inline-block; font-size: .75rem; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; opacity: .9; }
.bw-termin__title { font-size: 1.35rem; font-weight: 600; line-height: 1.2; margin: 0; }

/* Archivliste */
.bw-archive { padding: 56px 0 80px; }

/* ---------- Formulare ---------- */
.bw-form { margin: 1.5em 0; }
.bw-form fieldset { border: 0; padding: 0; margin: 0 0 1.25em; }
.bw-form legend { font-weight: 600; margin-bottom: .5em; }
.bw-form .bw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.bw-form .bw-full { grid-column: 1 / -1; }
@media (max-width: 640px) { .bw-form .bw-grid { grid-template-columns: 1fr; } }
.bw-form label { display: block; font-size: .9rem; margin-bottom: 4px; }
.bw-form input[type=text], .bw-form input[type=email], .bw-form input[type=tel], .bw-form input[type=date], .bw-form textarea {
	width: 100%; padding: 11px 12px; border: 1px solid #c9ced6; background: #fff; font: inherit; color: inherit; border-radius: 0;
}
.bw-form input:focus, .bw-form textarea:focus { border-color: var(--wp--preset--color--akzent); outline: none; box-shadow: 0 0 0 2px rgba(66,191,221,.25); }
.bw-form textarea { min-height: 120px; resize: vertical; }
.bw-form .bw-check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; font-size: .95rem; }
.bw-form .bw-check input { margin-top: 4px; flex: none; width: 18px; height: 18px; accent-color: var(--wp--preset--color--akzent); }
.bw-form .bw-req { color: #c0392b; }
.bw-form .bw-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.bw-form .bw-rechnung[hidden] { display: none; }
.bw-form button { border: 0; cursor: pointer; font-family: inherit; }
.bw-notice { padding: 16px 20px; margin: 1em 0; border-left: 4px solid var(--wp--preset--color--akzent); background: var(--wp--preset--color--hell); color: var(--wp--preset--color--navy); }
.bw-notice.is-error { border-color: #c0392b; background: #fdf0ee; }

/* ---------- Fußbereich ---------- */
.footer-cta { position: relative; padding: clamp(56px, 8vw, 90px) 0; text-align: center; color: #fff; background: var(--wp--preset--color--navy) center / cover no-repeat; }
.footer-cta.has-image::before { content: ""; position: absolute; inset: 0; background: rgba(32,36,62,.45); }
.footer-cta > * { position: relative; }
.footer-cta h2 { color: #fff; font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin-bottom: .4em; }
.footer-cta p { margin: 0; }
.footer-cta a { color: #fff; text-decoration: underline; }
.footer-main { background: var(--wp--preset--color--akzent); color: var(--wp--preset--color--navy); padding: 40px 0 48px; }
.footer-main .bw-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; align-items: start; }
.footer-main p { margin: 0 0 .6em; }
.footer-main a { color: inherit; text-decoration: none; }
.footer-main a:hover { text-decoration: underline; color: inherit; }
.footer-main .footer-col-3 { text-align: center; }
.footer-main img { max-width: 200px; height: auto; }
.footer-main .widget-title { font-size: 1rem; margin-bottom: .5em; }
.footer-bottom { background: var(--wp--preset--color--navy); color: #fff; padding: 16px 0; font-size: .95rem; }
.footer-bottom .bw-container { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-bottom a { color: #fff; text-decoration: none; }
.footer-bottom a:hover { text-decoration: underline; }
.footer-bottom ul { list-style: none; margin: 0; padding: 0; display: inline; }
.footer-bottom li { display: inline; }
.footer-bottom li + li::before { content: " I "; }
.footer-icons { display: flex; gap: 14px; }
.footer-icons svg { width: 20px; height: 20px; fill: currentColor; display: block; }
@media (max-width: 767px) {
	.footer-main .bw-container { grid-template-columns: 1fr; text-align: left; }
	.footer-main .footer-col-3 { text-align: left; }
}

/* ---------- Sonstiges ---------- */
.bw-404 { text-align: center; padding: 100px 0; }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 40px; }
.pagination .page-numbers { padding: 6px 12px; border: 1px solid #dfe3e8; text-decoration: none; }
.pagination .current { background: var(--wp--preset--color--navy); color: #fff; }

@media (max-width: 781px) {
	.wp-block-columns { flex-wrap: wrap !important; }
	.wp-block-column { flex-basis: 100% !important; }
}

/* Logo-Reihen (z. B. „Unsere Kunden“) nicht zu groß darstellen */
.wp-block-columns:has(> .wp-block-column:nth-child(3)) .wp-block-image:not(.bw-fill) img { max-height: 150px; width: auto; }

/* Spalten mit Hintergrundbild (Cover) randlos füllen */
.wp-block-column:has(> .wp-block-cover:only-child) { padding: 0; display: flex; }
.wp-block-column > .wp-block-cover:only-child { flex: 1; min-height: 360px; padding: clamp(32px, 4.5vw, 64px); margin: 0; }
.wp-block-cover { color: #fff; }
.wp-block-cover .wp-block-cover__inner-container { width: 100%; }
.wp-block-cover h1, .wp-block-cover h2, .wp-block-cover h3 { color: #fff; }
.wp-block-cover.bw-section { min-height: 0; }

/* Startseiten-Titel in Akzentfarbe wie im Original */
.home .bw-hero h1 { color: var(--wp--preset--color--akzent); }

/* Heller Video-Hintergrund (Startseite): dunkler Text, Video als ruhige Fläche */
.wp-block-cover.bw-video { color: var(--wp--preset--color--navy); min-height: 70vh; background: #fff; }
.wp-block-cover.bw-video .wp-block-cover__video-background { opacity: .9; }
.wp-block-cover.bw-video h1, .wp-block-cover.bw-video h2, .wp-block-cover.bw-video h3 { color: inherit; }
.home .wp-block-cover.bw-video.bw-hero h1 { color: var(--wp--preset--color--akzent); }
@media (prefers-reduced-motion: reduce) { .wp-block-cover.bw-video video { display: none; } }
