/*
Theme Name: Brunnenwärterhaus
Description: Eigenes Block-Theme für das Restaurant Das Brunnenwärterhaus in Bad Nauheim. Farben nach dem Logo, Schriften lokal eingebunden (DSGVO-freundlich).
Version: 1.2.1
Requires at least: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: brunnenwaerterhaus
*/

/* Kleine Ergänzungen, die theme.json nicht abdeckt */
html { scroll-behavior: smooth; }
:target { scroll-margin-top: 24px; }

.bwh-eyebrow {
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.bwh-card {
	border: 1px solid #EADFD8;
	border-radius: 6px;
	overflow: hidden;
	height: 100%;
}

.bwh-dish {
	border-bottom: 1px solid #93302A;
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	border-width: 1.5px;
}

.bwh-on-dark .wp-block-button.is-style-outline > .wp-block-button__link {
	color: #FBF8F4;
	border-color: #D9928A;
}

.bwh-on-dark a:where(:not(.wp-element-button)) {
	color: #FBF8F4;
}

.bwh-btn-light .wp-block-button__link {
	background-color: #FFFFFF !important;
	color: #6E100C !important;
}

.wp-block-navigation a:where(:not(.wp-element-button)) {
	text-decoration: none;
}

/* ============ Reservierungsformular ============ */

.bwh-res {
	background: #FFFFFF;
	border: 1px solid #EADFD8;
	border-radius: 8px;
	padding: clamp(20px, 4vw, 36px);
	display: flex;
	flex-direction: column;
	gap: 8px;
	box-shadow: 0 18px 40px rgba(66, 10, 7, 0.06);
}
.bwh-res fieldset {
	border: 0;
	margin: 0 0 12px;
	padding: 0;
	min-width: 0;
}
.bwh-res legend {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 28px;
	font-weight: 600;
	color: #6E100C;
	margin-bottom: 12px;
	padding: 0;
}
.bwh-res-feld {
	margin: 0 0 18px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.bwh-res-feld > br,
.bwh-res > p:empty,
.bwh-res fieldset > p:empty,
.bwh-res-feld > p:empty {
	display: none;
}
.bwh-res-feld label {
	display: block;
	margin: 0;
	font-weight: 500;
	font-size: 15px;
	line-height: 1.3;
	color: #2B1D1A;
}
.bwh-res-hinweis {
	font-weight: 400;
	color: #5E4C48;
}
.bwh-res input[type="text"],
.bwh-res input[type="tel"],
.bwh-res input[type="email"],
.bwh-res input[type="date"],
.bwh-res select,
.bwh-res textarea {
	font: inherit;
	font-size: 16px;
	color: #2B1D1A;
	background: #FBF8F4;
	border: 1.5px solid #D8C6BF;
	border-radius: 6px;
	padding: 12px 14px;
	height: 50px;
	line-height: 1.3;
	width: 100%;
	margin: 0;
	box-sizing: border-box;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
/* Auswahlfelder in allen Browsern gleich hoch wie die Textfelder (Safari ignoriert sonst die Höhe) */
.bwh-res select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding-right: 44px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23B31515' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 14px;
	cursor: pointer;
}
.bwh-res input[type="date"] {
	-webkit-appearance: none;
	appearance: none;
	display: flex;
	align-items: center;
}
.bwh-res input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.bwh-res textarea { height: auto; }
.bwh-res textarea { min-height: 110px; resize: vertical; }
.bwh-res input:focus,
.bwh-res select:focus,
.bwh-res textarea:focus {
	outline: none;
	border-color: #B31515;
	background: #FFFFFF;
	box-shadow: 0 0 0 3px rgba(179, 21, 21, 0.15);
}
.bwh-res select:disabled {
	color: #5E4C48;
	cursor: not-allowed;
}
.bwh-res-zeile {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 0 16px;
}
.bwh-res-tagesinfo {
	margin: -8px 0 14px;
	font-size: 15px;
	color: #5E4C48;
	min-height: 0;
}
.bwh-res-tagesinfo:empty { display: none; }
.bwh-res-tagesinfo.is-fehler { color: #B31515; font-weight: 500; }
.bwh-res-nachricht summary {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: #B31515;
	font-weight: 500;
	cursor: pointer;
	list-style: none;
	padding: 8px 0;
	min-height: 44px;
}
.bwh-res-nachricht summary::-webkit-details-marker { display: none; }
.bwh-res-nachricht summary svg { flex: none; display: block; }
.bwh-res-nachricht summary:hover { color: #8C1410; }
.bwh-res-nachricht[open] summary { margin-bottom: 8px; }
.bwh-res-einwilligung {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	font-size: 14px;
	line-height: 1.55;
	color: #4A3936;
	margin: 0 0 20px;
}
.bwh-res-einwilligung input {
	width: 20px;
	height: 20px;
	margin-top: 2px;
	flex: none;
	accent-color: #B31515;
}
.bwh-res-absenden .wp-block-button__link {
	width: 100%;
	border: 0;
	cursor: pointer;
	font-size: 17px;
	padding-top: 16px;
	padding-bottom: 16px;
}
.bwh-res-absenden .wp-block-button__link:disabled { opacity: 0.7; cursor: wait; transform: none; }
.bwh-res-falle {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.bwh-res-meldung {
	border-radius: 8px;
	padding: 24px 28px;
	margin-bottom: 16px;
}
.bwh-res-meldung p { margin: 0; }
.bwh-res-meldung-titel {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 28px;
	font-weight: 600;
	margin-bottom: 8px !important;
}
.bwh-res-ok { background: #FFFFFF; border: 1.5px solid #B31515; color: #2B1D1A; }
.bwh-res-ok .bwh-res-meldung-titel { color: #6E100C; }
.bwh-res-fehler { background: #FBEAEA; border: 1.5px solid #B31515; color: #6E100C; }

/* ============ Effekte ============ */

/* Fixierter Kopfbereich, wird beim Scrollen kompakter */
header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
}
.admin-bar header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) {
	.admin-bar header.wp-block-template-part { top: 46px; }
}
header.wp-block-template-part > .wp-block-group {
	transition: padding 0.35s ease, box-shadow 0.35s ease, background-color 0.35s ease;
}
.bwh-scrolled header.wp-block-template-part > .wp-block-group {
	padding-top: 8px !important;
	padding-bottom: 8px !important;
	background-color: rgba(251, 248, 244, 0.94) !important;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	box-shadow: 0 6px 24px rgba(66, 10, 7, 0.08);
}
header .wp-block-site-logo img {
	transition: width 0.35s ease, height 0.35s ease;
}
.bwh-scrolled header .wp-block-site-logo img {
	width: 130px !important;
	height: auto !important;
}
:target { scroll-margin-top: 110px; }

/* Menüpunkte: Unterstrich wächst beim Darüberfahren */
header .wp-block-navigation-item__content {
	position: relative;
	padding: 6px 0;
}
header .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: #B31515;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.3s ease;
}
header .wp-block-navigation-item__content:hover::after,
header .wp-block-navigation-item__content:focus-visible::after {
	transform: scaleX(1);
}

/* Buttons: sanfter Farbwechsel und leichtes Anheben */
.wp-element-button,
.wp-block-button__link {
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.wp-block-button__link:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(66, 10, 7, 0.18);
}
.bwh-on-dark .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background-color: #FBF8F4;
	color: #6E100C;
	border-color: #FBF8F4;
}

/* Veranstaltungskarten heben sich beim Darüberfahren, das Bild zoomt leicht */
.bwh-card {
	transition: transform 0.35s ease, box-shadow 0.35s ease, opacity 0.7s ease;
}
.bwh-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 18px 40px rgba(66, 10, 7, 0.12);
}
.wp-block-cover {
	overflow: hidden;
}
.wp-block-cover .wp-block-cover__image-background {
	transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.bwh-card:hover .wp-block-cover__image-background,
.wp-block-column > .wp-block-cover:hover .wp-block-cover__image-background {
	transform: scale(1.06);
}

/* Speisen: Zeile hellt beim Darüberfahren auf */
.bwh-dish {
	transition: background-color 0.3s ease, padding 0.3s ease;
}
.bwh-dish:hover {
	background-color: rgba(255, 255, 255, 0.05);
	padding-left: 10px !important;
	padding-right: 10px !important;
}

/* Links im Text: Farbe wechselt weich */
a { transition: color 0.2s ease; }

/* Inhalte gleiten beim Scrollen ein (nur mit JavaScript aktiv) */
.bwh-js .bwh-reveal {
	opacity: 0;
	transform: translateY(28px);
	transition-property: opacity, transform;
	transition-duration: 0.8s;
	transition-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
}
.bwh-js .bwh-reveal.is-visible {
	opacity: 1;
	transform: none;
}
.bwh-js .bwh-card.bwh-reveal.bwh-revealed {
	transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.bwh-js .bwh-card.bwh-reveal.bwh-revealed:hover {
	transform: translateY(-6px);
}
.bwh-js .wp-block-cover.bwh-reveal {
	transform: scale(0.97);
}
.bwh-js .wp-block-cover.bwh-reveal.is-visible {
	transform: none;
}

/* Wer im System "Bewegung reduzieren" eingestellt hat, bekommt keine Animationen */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		transition: none !important;
		animation: none !important;
	}
	.bwh-js .bwh-reveal { opacity: 1; transform: none; }
}
