/**
 * Theme Name:     BodenManufaktur (Floorzy Child)
 * Theme URI:      https://bodenmanufaktur-erding.de
 * Author:         Francesco Ciotti
 * Author URI:     https://bodenmanufaktur-erding.de
 * Template:       floorzy
 * Text Domain:    floorzy-child
 * Description:    Child theme di Floorzy per BodenManufaktur Erding. Override palette brand (Navy/Ocra), font self-hosted Barlow + Inter (DSGVO), tipografia e pulsanti.
 * Version:        0.2.0
 * License:        GNU General Public License v3 or later.
 * License URI:    https://www.gnu.org/licenses/gpl-3.0.html
 * Tags:           block-patterns,block-styles,custom-menu,full-site-editing
 */

/*
 * Brand palette CSS variables.
 * Forniamo sia gli slug "brand-*" (riferiti dai nostri styles in theme.json)
 * sia l'override dei "gv-color-*" originali di Floorzy: WP non fa merge per slug
 * tra palette parent e child, quindi qui rimappiamo i token Floorzy ai colori brand.
 */
:root:root,
.editor-styles-wrapper {
	/* Brand tokens espliciti */
	--wp--preset--color--brand-navy: #161B36;
	--wp--preset--color--brand-navy-deep: #161B36;
	--wp--preset--color--brand-ocra: #E6A817;
	--wp--preset--color--brand-ocra-hover: #C68F0F;
	--wp--preset--color--brand-sand: #F6F2EA;
	--wp--preset--color--brand-stein: #D9D4CB;
	--wp--preset--color--brand-anthrazit: #1C1C1C;
	--wp--preset--color--brand-grau: #5A5A5A;

	/* Floorzy/Gutenverse tokens rimappati su brand */
	--wp--preset--color--gv-color-primary: #E6A817;            /* Ocra */
	--wp--preset--color--gv-color-secondary: #F6F2EA;          /* Sand */
	--wp--preset--color--gv-color-text-primary: #1C1C1C;       /* Anthrazit */
	--wp--preset--color--gv-color-text-secondary: #5A5A5A;     /* Grau */
	--wp--preset--color--gv-color-accent: #E6A817;             /* Ocra */
	--wp--preset--color--gv-color-accent-hover: #C68F0F;       /* Ocra Tiefer */
	--wp--preset--color--gv-color-background-primary: #161B36; /* Navy Indigo */
	--wp--preset--color--gv-color-background-secondary: #F6F2EA;
	--wp--preset--color--gv-color-background-tertiary: #161B36;
	--wp--preset--color--gv-color-border: #D9D4CB;
	--wp--preset--color--gv-color-border-input: rgba(28, 28, 28, 0.20);
	--wp--preset--color--gv-color-text-placeholder: rgba(90, 90, 90, 0.60);

	/* Dark variants — usate su sezioni navy */
	--wp--preset--color--gv-color-dark-primary: #E6A817;
	--wp--preset--color--gv-color-dark-secondary: #F6F2EA;
	--wp--preset--color--gv-color-dark-accent: #E6A817;
	--wp--preset--color--gv-color-dark-accent-hover: #C68F0F;
	--wp--preset--color--gv-color-dark-background-primary: #161B36;
	--wp--preset--color--gv-color-dark-background-secondary: #F6F2EA;
	--wp--preset--color--gv-color-dark-background-tertiary: #161B36;
}

/* Background/text/border helpers per gli slug brand-* (WP non li auto-genera
   perché brand-* è definito solo via CSS vars, non in theme.json palette) */
.has-brand-navy-background-color { background-color: #161B36 !important; }
.has-brand-navy-deep-background-color { background-color: #0F1428 !important; }
.has-brand-ocra-background-color { background-color: #E6A817 !important; }
.has-brand-ocra-hover-background-color { background-color: #C68F0F !important; }
.has-brand-sand-background-color { background-color: #F6F2EA !important; }
.has-brand-stein-background-color { background-color: #D9D4CB !important; }
.has-brand-anthrazit-background-color { background-color: #1C1C1C !important; }
.has-brand-grau-background-color { background-color: #5A5A5A !important; }

.has-brand-navy-color { color: #161B36 !important; }
.has-brand-navy-deep-color { color: #0F1428 !important; }
.has-brand-ocra-color { color: #E6A817 !important; }
.has-brand-ocra-hover-color { color: #C68F0F !important; }
.has-brand-sand-color { color: #F6F2EA !important; }
.has-brand-stein-color { color: #D9D4CB !important; }
.has-brand-anthrazit-color { color: #1C1C1C !important; }
.has-brand-grau-color { color: #5A5A5A !important; }

/* Selezione testo branded */
::selection {
	background: #E6A817;
	color: #161B36;
}

/* Smooth scroll per la navigazione onepage (ancore #start, #ueber-uns, ecc.) */
html { scroll-behavior: smooth; scroll-padding-top: 90px; }

/* Header — navy brand, logo originale visibile */
header.bm-header,
.bm-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: #161B36 !important;
	color: #ffffff !important;
	box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.bm-header * { color: #ffffff; }
.bm-header .wp-block-button .wp-block-button__link { color: #ffffff !important; }
.wp-admin-bar-front .bm-header { top: 32px; }
@media (max-width: 782px) {
	.wp-admin-bar-front .bm-header { top: 46px; }
}
.bm-header .wp-block-site-logo a { display: block; line-height: 0; }
.bm-header .wp-block-site-logo img { max-height: 72px; width: auto; }
.bm-nav a { color: #ffffff; text-decoration: none; transition: color 0.15s ease; }
.bm-nav a:hover { color: #E6A817; }

/* Hamburger toggle hidden on desktop */
.bm-mobile-toggle { display: none; }
.bm-burger { display: none; cursor: pointer; width: 32px; height: 28px; position: relative; flex-direction: column; justify-content: space-between; padding: 4px 0; box-sizing: border-box; }
.bm-burger span { display: block; height: 3px; width: 100%; background: #ffffff; border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease; transform-origin: center; }

@media (max-width: 900px) {
	.bm-header-inner { position: relative; flex-wrap: wrap !important; }
	.bm-burger { display: flex; order: 3; margin-left: auto; }
	.bm-header-cta { order: 2; }
	.bm-header-cta .wp-block-button__link { padding: 0.5rem 0.9rem !important; font-size: 0.8125rem; }
	.bm-nav {
		order: 4;
		flex-basis: 100%;
		flex-direction: column !important;
		gap: 0 !important;
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.35s ease;
		background: #161B36;
		margin-top: 0 !important;
	}
	.bm-nav p { padding: 0.85rem 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
	.bm-nav p:last-child { border-bottom: 0; }
	.bm-mobile-toggle:checked ~ .bm-nav { max-height: 500px; padding-top: 0.5rem; padding-bottom: 0.5rem; }
	.bm-mobile-toggle:checked ~ .bm-burger span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
	.bm-mobile-toggle:checked ~ .bm-burger span:nth-child(2) { opacity: 0; }
	.bm-mobile-toggle:checked ~ .bm-burger span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
}

/* Footer: navy match logo, link bianchi che diventano ocra in hover */
footer.bm-footer,
.bm-footer {
	background-color: #161B36 !important;
	color: #ffffff !important;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.bm-footer a { color: #ffffff; text-decoration: none; transition: color 0.15s ease; }
.bm-footer a:hover { color: #E6A817; }
.bm-footer h4 { margin-bottom: 0.75rem; }

/* Hero CTA outline: hover -> riempi con ocra */
.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background-color: #E6A817 !important;
	border-color: #E6A817 !important;
	color: #ffffff !important;
}

/* Leistungen — 4 card stessa altezza, indipendentemente dal testo */
#leistungen .wp-block-columns { align-items: stretch; }
#leistungen .wp-block-column { display: flex; }
#leistungen .wp-block-column > .wp-block-group {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	height: 100%;
}
#leistungen .wp-block-column > .wp-block-group > * { text-align: left !important; }
#leistungen .wp-block-column h3 {
	text-align: left !important;
	align-self: flex-start;
	font-size: 1.0625rem !important;
	line-height: 1.25 !important;
	white-space: nowrap;
	overflow-wrap: normal;
}
@media (max-width: 1100px) {
	#leistungen .wp-block-column h3 { font-size: 1rem !important; white-space: normal; }
}

/* Über uns USP card — stesso trattamento */
#ueber-uns .wp-block-columns:last-of-type { align-items: stretch; }
#ueber-uns .wp-block-columns:last-of-type .wp-block-column { display: flex; }
#ueber-uns .wp-block-columns:last-of-type .wp-block-column > .wp-block-group {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	height: 100%;
}

/* Über uns — incapsulamento via CSS sulle wp:columns esistenti (no markup change) */
#ueber-uns .wp-block-columns.are-vertically-aligned-center {
	background: #ffffff;
	border: 1px solid rgba(217, 212, 203, 0.55);
	border-radius: 8px;
	padding: 2.5rem;
	box-shadow: 0 14px 40px rgba(22, 27, 54, 0.10);
	margin-bottom: 3.5rem;
	gap: 3.5rem !important;
}
#ueber-uns .wp-block-columns.are-vertically-aligned-center > .wp-block-column:first-child {
	padding-right: 1.5rem;
}
#ueber-uns .wp-block-columns.are-vertically-aligned-center .wp-block-image { margin: 0; }
#ueber-uns .wp-block-columns.are-vertically-aligned-center .wp-block-image img { border-radius: 6px; display: block; }
@media (max-width: 780px) {
	#ueber-uns .wp-block-columns.are-vertically-aligned-center { padding: 1.5rem; }
}

/* Stats strip sotto hero (no border, separatore = stacco di sfondo con sezione successiva) */
.bm-stats { background: #ffffff; }
.bm-stats .wp-block-columns { gap: 1.5rem !important; }
.bm-stats .bm-stat {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.25rem 0 0.25rem 1.25rem;
	border-left: 3px solid #E6A817;
}
.bm-stats .bm-stat-num {
	font-family: var(--wp--preset--font-family--primary);
	font-size: 2rem;
	font-weight: 700;
	color: #161B36;
	line-height: 1;
}
.bm-stats .bm-stat-label {
	font-size: 0.875rem;
	color: #5A5A5A;
	line-height: 1.4;
}
@media (max-width: 900px) {
	.bm-stats .bm-stat-num { font-size: 1.625rem; }
}

/* Galerie: bordi uniformi (background sand chiarissimo invece di navy per non saturare) */
.bm-gallery {
	display: grid !important;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
}
@media (max-width: 900px) {
	.bm-gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.bm-gallery { grid-template-columns: 1fr; }
}
.bm-gallery .wp-block-image {
	margin: 0;
	overflow: hidden;
	border-radius: 4px;
	aspect-ratio: 4 / 3;
	background: #161B36;
	position: relative;
}
/* Featured tile (Best of Interior badge) */
.bm-gallery .bm-featured-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	background: #E6A817;
	color: #161B36;
	font-family: var(--wp--preset--font-family--primary);
	font-weight: 700;
	font-size: 0.6875rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 0.4rem 0.7rem;
	border-radius: 2px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.25);
	z-index: 2;
	pointer-events: none;
}
.bm-gallery .wp-block-image > figure,
.bm-gallery figure {
	margin: 0;
	height: 100%;
}
.bm-gallery .wp-block-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.45s ease;
}
.bm-gallery .wp-block-image:hover img {
	transform: scale(1.04);
}

/* Form Fluent Forms — stile coerente brand, compatto */
.bm-form-wrap {
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
	max-width: 540px;
	margin-left: auto !important;
	margin-right: auto !important;
}
.bm-form-wrap .ff-el-form-control,
.bm-form-wrap input[type="text"],
.bm-form-wrap input[type="email"],
.bm-form-wrap input[type="tel"],
.bm-form-wrap textarea,
.bm-form-wrap select {
	border: 1px solid #E2DED3 !important;
	border-radius: 3px !important;
	background: #FAF8F3 !important;
	color: #1C1C1C !important;
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: 0.9375rem !important;
	padding: 0.65rem 0.85rem !important;
	width: 100% !important;
	box-sizing: border-box !important;
	transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.bm-form-wrap input:hover,
.bm-form-wrap textarea:hover,
.bm-form-wrap select:hover {
	background: #ffffff !important;
	border-color: #D9D4CB !important;
}
.bm-form-wrap input:focus,
.bm-form-wrap textarea:focus,
.bm-form-wrap select:focus {
	border-color: #E6A817 !important;
	outline: none !important;
	box-shadow: 0 0 0 3px rgba(230, 168, 23, 0.18) !important;
	background: #ffffff !important;
}
.bm-form-wrap textarea { min-height: 110px; resize: vertical; }
.bm-form-wrap .ff-el-input--label { margin-bottom: 0.35rem !important; }
.bm-form-wrap .ff-el-input--label label,
.bm-form-wrap label {
	color: #5A5A5A !important;
	font-weight: 600 !important;
	font-size: 0.6875rem !important;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
/* Name fields side-by-side */
.bm-form-wrap .ff-el-form-control-wrapper.ff-el-input--name .ff-t-cell { padding: 0 0.4rem; }
.bm-form-wrap .ff-el-form-control-wrapper.ff-el-input--name .ff-t-cell:first-child { padding-left: 0; }
.bm-form-wrap .ff-el-form-control-wrapper.ff-el-input--name .ff-t-cell:last-child { padding-right: 0; }
/* spacing tra gruppi più compatto */
.bm-form-wrap .ff-el-group { margin-bottom: 0.85rem !important; }
.bm-form-wrap .ff-el-group:last-of-type { margin-bottom: 0; }
/* checkbox DSGVO */
.bm-form-wrap .ff-el-form-check { display: flex; align-items: flex-start; gap: 0.5rem; }
.bm-form-wrap .ff-el-form-check input[type="checkbox"] { width: 18px !important; height: 18px !important; margin-top: 2px; accent-color: #E6A817; }
.bm-form-wrap .ff-el-form-check label {
	color: #5A5A5A !important;
	font-size: 0.8125rem !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	font-weight: 400 !important;
	line-height: 1.5;
}
.bm-form-wrap .ff-el-form-check label a { color: #1A2750; text-decoration: underline; }
.bm-form-wrap .ff-el-form-check label a:hover { color: #E6A817; }
/* submit centrato a tutta larghezza per impatto */
.bm-form-wrap .ff_submit_btn_wrapper,
.bm-form-wrap .ff-el-group.ff-btn-submit-container { margin-top: 1.25rem !important; text-align: center; }
.bm-form-wrap .ff-btn-submit,
.bm-form-wrap button[type="submit"] {
	background-color: #E6A817 !important;
	color: #ffffff !important;
	border: 0 !important;
	border-radius: 2px !important;
	padding: 0.95rem 2.25rem !important;
	font-family: var(--wp--preset--font-family--primary) !important;
	font-size: 0.9375rem !important;
	font-weight: 600 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.04em !important;
	cursor: pointer !important;
	transition: background-color 0.2s ease, transform 0.15s ease !important;
	width: 100% !important;
	max-width: 320px;
}
.bm-form-wrap .ff-btn-submit:hover,
.bm-form-wrap button[type="submit"]:hover {
	background-color: #C68F0F !important;
	transform: translateY(-1px);
}
/* asterischi rossi → ocra */
.bm-form-wrap .ff-el-is-required.asterisk-right label:after,
.bm-form-wrap .ff-el-is-required label .ff_required { color: #E6A817 !important; }
/* success message */
.bm-form-wrap .ff-message-success {
	background: #F6F2EA !important;
	border: 1px solid #E6A817 !important;
	border-left-width: 4px !important;
	padding: 1.25rem !important;
	border-radius: 3px !important;
	color: #1C1C1C !important;
}

/* Scroll fade-in animations (rispetta prefers-reduced-motion) */
@media (prefers-reduced-motion: no-preference) {
	.bm-fade-in {
		opacity: 0;
		transform: translateY(24px);
		transition: opacity 0.7s ease-out, transform 0.7s ease-out;
		will-change: opacity, transform;
	}
	.bm-fade-in.bm-in-view {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Real Cookie Banner — override brand BodenManufaktur */
.rcb-banner-body,
.rcb-banner-body *,
[class*="real-cookie-banner"],
[id*="real-cookie-banner"] {
	font-family: var(--wp--preset--font-family--body, Inter, system-ui, sans-serif) !important;
}
.rcb-banner-body h2,
.rcb-banner-body h3,
[class*="rcb-banner"] h2,
[class*="rcb-banner"] h3,
.rcb-headline {
	font-family: var(--wp--preset--font-family--primary, Barlow, system-ui, sans-serif) !important;
	color: #161B36 !important;
	font-weight: 700 !important;
}
.rcb-banner-body,
[class*="real-cookie-banner"][class*="banner"] {
	color: #1C1C1C !important;
	background-color: #FFFFFF !important;
	border-radius: 6px !important;
	box-shadow: 0 18px 50px rgba(22, 27, 54, 0.25) !important;
}
.rcb-banner-body a,
[class*="rcb-banner"] a {
	color: #1A2750 !important;
	text-decoration: underline !important;
}
/* Bottoni accetta tutti — ocra */
.rcb-button-link[class*="acceptAll"],
button[class*="acceptAll"],
[class*="rcb"] button[class*="accept-all"],
.rcb-banner-body button.rcb-button-link.rcb-button-acceptAll,
.rcb-button-acceptAll {
	background-color: #E6A817 !important;
	color: #FFFFFF !important;
	border: 0 !important;
	border-radius: 2px !important;
	font-family: var(--wp--preset--font-family--primary, Barlow, sans-serif) !important;
	font-weight: 600 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.04em !important;
	padding: 0.75rem 1.25rem !important;
}
.rcb-button-acceptAll:hover,
button[class*="acceptAll"]:hover {
	background-color: #C68F0F !important;
}
/* Bottoni accetta essenziali / rifiuta — outline navy */
.rcb-button-acceptEssentials,
button[class*="acceptEssentials"],
button[class*="deny"] {
	background-color: #FFFFFF !important;
	color: #161B36 !important;
	border: 1px solid #D9D4CB !important;
	border-radius: 2px !important;
	font-family: var(--wp--preset--font-family--primary, Barlow, sans-serif) !important;
	font-weight: 600 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.04em !important;
	padding: 0.75rem 1.25rem !important;
}
.rcb-button-acceptEssentials:hover {
	background-color: #F6F2EA !important;
}
/* Bottone settings / individuell */
.rcb-button-individual,
button[class*="individual"],
button[class*="settings"] {
	background: transparent !important;
	color: #1A2750 !important;
	border: 1px solid #D9D4CB !important;
	border-radius: 2px !important;
	font-family: var(--wp--preset--font-family--primary, Barlow, sans-serif) !important;
	font-weight: 600 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.04em !important;
}
/* Overlay backdrop quando banner type=dialog */
.rcb-banner-overlay,
[class*="rcb-overlay"] {
	background-color: rgba(22, 27, 54, 0.55) !important;
}
/* Toggle category switches → ocra quando on */
.rcb-switch input:checked + .rcb-switch-slider,
.rcb-banner-body input[type="checkbox"]:checked + [class*="slider"] {
	background-color: #E6A817 !important;
}

/* Focus visibile per accessibilità WCAG */
a:focus-visible,
button:focus-visible,
.wp-element-button:focus-visible,
.wp-block-button__link:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline: 2px solid #E6A817;
	outline-offset: 2px;
}
