/**
 * Header Blocksy — allineato a bb-demo.local
 */

:root {
	--bb-cream: #f7f3ec;
	--bb-sand: #d8b77a;
	--bb-sage: #78866b;
	--bb-olive-dark: #465044;
	--bb-charcoal: #252725;
	--bb-white: #fffef9;
	--bb-header-h: 85px;
}

/* Nasconde header scorrendo verso il basso — solo #header (evita doppio transform sul sticky interno) */
#header.ct-header {
	transition:
		transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
		opacity 0.25s ease,
		visibility 0.25s ease,
		background-color 0.35s ease,
		box-shadow 0.35s ease;
}

body.bb-header-auto-hidden #header.ct-header {
	transform: translate3d(0, calc(-1 * (var(--bb-header-h) + 12px)), 0);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

html.admin-bar body.bb-header-auto-hidden #header.ct-header {
	transform: translate3d(0, calc(-1 * (var(--bb-header-h) + 44px)), 0);
}

/* Logo solo immagine */
.ct-header [data-id="logo"] .site-title,
.ct-header [data-id="logo"] .site-description,
.ct-header [data-id="logo"] .site-tagline {
	display: none !important;
}

.ct-header [data-id="logo"] .site-logo-container {
	display: flex;
	align-items: center;
	line-height: 0;
}

/* Blocksy imposta height:inherit sul logo: con SVG può collassare a 0×0 */
.ct-header [data-id="logo"] .site-logo-container img,
.ct-header [data-id="offcanvas-logo"] img {
	width: auto !important;
	height: 52px !important;
	max-height: 52px !important;
	max-width: 190px !important;
}

@media (max-width: 767px) {
	.ct-header [data-id="logo"] img {
		max-height: 48px !important;
		max-width: 160px !important;
	}
}

/* Header compatto — solo middle row */
.ct-header [data-row="top"],
.ct-header [data-row="bottom"] {
	display: none !important;
	min-height: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
}

/*
 * Blocksy global.css: middle row --height:120px + background bianco (palette-8).
 * Resta visibile anche in sticky/scroll → fascia sotto il menu.
 */
#header.ct-header [data-row="middle"] {
	--height: var(--bb-header-h) !important;
	height: var(--bb-header-h) !important;
	min-height: var(--bb-header-h) !important;
	max-height: var(--bb-header-h) !important;
	background-color: transparent !important;
	background-image: none !important;
}

#header.ct-header .ct-sticky-container {
	height: var(--bb-header-h) !important;
	min-height: var(--bb-header-h) !important;
	max-height: var(--bb-header-h) !important;
}

.ct-header [data-device="desktop"] [data-row="middle"] {
	min-height: var(--bb-header-h) !important;
}

.ct-header [data-device="desktop"] [data-row="middle"] > .ct-container {
	max-width: min(1300px, calc(100% - 2.5rem));
	margin-inline: auto;
	min-height: var(--bb-header-h) !important;
	padding-block: 0 !important;
	align-items: center;
}

.ct-header [data-column="end"] > [data-items] {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: nowrap;
	margin-inline-start: auto;
	width: 100%;
	gap: 0;
}

.ct-header [data-id="menu"] {
	flex: 0 1 auto;
	margin-inline-start: auto;
}

.ct-header [data-id="menu"] .menu {
	gap: 32px;
}

/* —— Selettore lingua (Polylang) —— */
.bb-lang-switcher {
	display: inline-flex;
	align-items: center;
	margin-inline-start: 0.15rem;
}

.bb-lang-switcher__select {
	appearance: none;
	-webkit-appearance: none;
	min-width: 3.1rem;
	padding: 0.38rem 1.55rem 0.38rem 0.65rem;
	border: 1px solid rgba(37, 39, 37, 0.2);
	border-radius: 6px;
	background-color: rgba(255, 254, 249, 0.95);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23252725' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.45rem center;
	background-size: 0.55rem auto;
	color: var(--bb-charcoal, #252725);
	cursor: pointer;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.07em;
	line-height: 1.2;
	text-transform: uppercase;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.bb-lang-switcher__select:hover,
.bb-lang-switcher__select:focus-visible {
	border-color: rgba(37, 39, 37, 0.38);
	outline: none;
}

body.bb-transparent-header:not(.bb-header-past-hero) .bb-lang-switcher__select {
	border-color: rgba(255, 254, 249, 0.55);
	background-color: rgba(0, 0, 0, 0.22);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23fffef9' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
	color: var(--bb-white, #fffef9);
}

body.bb-inner-header-solid .bb-lang-switcher__select {
	background-color: var(--bb-white, #fffef9);
}

.ct-header .menu > li.bb-lang-switcher-item {
	display: flex;
	align-items: center;
	margin-inline-start: 0.5rem;
	list-style: none;
}

.ct-header [data-id="button"] {
	flex: 0 0 auto;
	margin-inline-start: 24px;
}

@media (max-width: 999px) {
	:root {
		--bb-header-h: 64px;
	}

	.ct-header [data-id="logo"] img {
		max-height: 44px !important;
	}
}

/* Menu bianco su hero (home) — finché la hero è visibile */
body.bb-transparent-header:not(.bb-header-past-hero) .ct-header [data-id="menu"] .menu > li > a,
body.bb-transparent-header:not(.bb-header-past-hero) .ct-header [data-id="menu"] .ct-menu-link {
	color: var(--bb-white) !important;
}

body.bb-transparent-header:not(.bb-header-past-hero) #header.ct-header {
	position: absolute;
	left: 0;
	right: 0;
	z-index: 100;
	background: linear-gradient(
		180deg,
		rgba(44, 47, 46, 0.62) 0%,
		rgba(44, 47, 46, 0.22) 65%,
		rgba(44, 47, 46, 0) 100%
	) !important;
	box-shadow: none !important;
}

body.bb-transparent-header:not(.bb-header-past-hero) #header.ct-header [data-row="middle"],
body.bb-transparent-header:not(.bb-header-past-hero) #header.ct-header .ct-container,
body.bb-transparent-header:not(.bb-header-past-hero) #header.ct-header .ct-sticky-container {
	background: transparent !important;
	box-shadow: none !important;
}

body.bb-transparent-header {
	--has-transparent-header: 1;
}

body.bb-transparent-header #main-container {
	margin-top: 0 !important;
}

/*
 * Blocksy: .ct-container-full ha padding-top ~60px sotto l’header.
 * Con hero full-bleed / header assoluto resta una fascia chiara (panna).
 */
body.bb-transparent-header #main-container .site-main > .ct-container-full,
#main-container .site-main > .ct-container-full:has(
		> article > .entry-content > .alignfull:first-child
	) {
	padding-top: 0 !important;
}

/* Hero sotto header assoluto: niente fascia bianca (prima: margin-top -90px + padding-top 90px) */
body.bb-transparent-header .entry-content > .bb-home-hero-cover:first-child {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Fallback se il titolo Blocksy è ancora in output (cache / anteprima). */
body.bb-transparent-header article > .hero-section,
article:has(.entry-content > .alignfull.bb-home-hero-cover:first-child) > .hero-section,
article:has(.entry-content > .alignfull.bb-page-hero:first-child) > .hero-section,
article:has(.entry-content > .alignfull.wp-block-cover:first-child) > .hero-section {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
	min-height: 0 !important;
}

body.bb-transparent-header .bb-home-hero-cover .wp-block-cover__inner-container {
	padding-top: calc(var(--bb-header-h) + 0.75rem);
}

/* Barra scura solo dopo la hero (non a 40px di scroll) + sticky Blocksy */
body.bb-transparent-header.bb-header-past-hero #header.ct-header,
body.bb-transparent-header.bb-header-past-hero #header.ct-header.is-sticky,
body.bb-transparent-header.bb-header-past-hero #header.ct-header .ct-sticky-container[data-sticky*="yes"] {
	background: rgba(37, 39, 37, 0.94) !important;
	box-shadow: 0 6px 24px rgba(33, 46, 45, 0.12);
	backdrop-filter: blur(10px);
}

body.bb-transparent-header:not(.bb-header-past-hero) #header.ct-header.is-sticky,
body.bb-transparent-header:not(.bb-header-past-hero) #header.ct-header .ct-sticky-container[data-sticky*="yes"] {
	background: linear-gradient(
		180deg,
		rgba(44, 47, 46, 0.62) 0%,
		rgba(44, 47, 46, 0.22) 65%,
		rgba(44, 47, 46, 0) 100%
	) !important;
	box-shadow: none !important;
	backdrop-filter: none;
}

body.bb-transparent-header.bb-header-past-hero #header.ct-header [data-row="middle"],
body.bb-transparent-header #header.ct-header.is-sticky [data-row="middle"],
body.bb-transparent-header #header.ct-header .ct-sticky-container[data-sticky*="yes"] [data-row="middle"] {
	background: transparent !important;
}

body.bb-transparent-header.bb-header-past-hero .ct-header [data-id="menu"] .menu > li > a,
body.bb-transparent-header.bb-header-past-hero .ct-header [data-id="menu"] .ct-menu-link,
body.bb-transparent-header #header.ct-header.is-sticky .ct-header [data-id="menu"] .menu > li > a,
body.bb-transparent-header #header.ct-header.is-sticky .ct-header [data-id="menu"] .ct-menu-link {
	color: var(--bb-white) !important;
}

/* Sticky attivo sulla hero: niente fascia grigia/chiara da Blocksy */
body.bb-transparent-header #header.ct-header .ct-sticky-container[data-sticky*="yes"] [data-row="middle"] {
	background-color: transparent !important;
}

/* Nessun CTA «Prenota» in header: prenotazione da home / pagina Prenota. */
.ct-header [data-id="button"] {
	display: none !important;
}

/* Nascondi search default Travel */
.ct-header [data-id="search"] {
	display: none !important;
}

/* Pagine interne chiare: header panna, menu scuro, logo leggibile */
body.bb-inner-header-solid #header.ct-header,
body.bb-inner-header-solid #header.ct-header.is-sticky,
body.bb-inner-header-solid #header.ct-header .ct-sticky-container[data-sticky*="yes"] {
	background: rgba(247, 243, 236, 0.98) !important;
	box-shadow: 0 1px 0 rgba(37, 39, 37, 0.07);
	backdrop-filter: none;
}

body.bb-inner-header-solid .ct-header [data-id="menu"] .menu > li > a,
body.bb-inner-header-solid .ct-header [data-id="menu"] .ct-menu-link {
	color: var(--bb-charcoal, #252725) !important;
}

body.bb-inner-header-solid .ct-header .menu .current-menu-item > a,
body.bb-inner-header-solid .ct-header .menu .current_page_item > a,
body.bb-inner-header-solid .ct-header .menu .current-menu-ancestor > a {
	color: var(--bb-sand, #d8b77a) !important;
}

/* Logo chiaro su hero home → versione scura su fondo panna */
body.bb-inner-header-solid .ct-header [data-id="logo"] img,
body.bb-inner-header-solid .ct-header [data-id="offcanvas-logo"] img {
	filter: brightness(0) saturate(100%);
	opacity: 0.88;
}

body.bb-inner-header-solid #main-container {
	margin-top: 0 !important;
}

body.bb-inner-header-solid #main-container .site-main > .ct-container-full {
	padding-top: 1.5rem !important;
}

/* CTA Spectra + footer: continuità (no gap prima del footer) */
.home .entry-content > .bb-home-final-cta {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

.home .bb-reviews-section + .bb-home-final-cta {
	margin-top: 0 !important;
}

/* Footer Blocksy globale */
#footer.ct-footer {
	background: var(--bb-charcoal) !important;
	color: rgba(255, 254, 249, 0.92);
}

#footer.ct-footer [data-row="middle"] > .ct-container-fluid,
#footer.ct-footer [data-row="bottom"] > .ct-container-fluid {
	max-width: min(1320px, calc(100% - 3rem));
	margin-left: auto;
	margin-right: auto;
}

/* Blocksy: griglia 4 col solo se --grid-template-columns è valorizzata (manca nel CSS globale type-2). */
@media (min-width: 1000px) {
	#footer.ct-footer [data-row="middle"] > .ct-container-fluid {
		--grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

#footer.ct-footer [data-row="middle"] {
	padding-top: clamp(4rem, 5vw, 5.5rem);
	padding-bottom: clamp(3rem, 4vw, 4.5rem);
}

#footer.ct-footer a {
	color: var(--bb-sand);
	text-decoration: none;
}

#footer.ct-footer a:hover {
	color: var(--bb-white);
}

#footer .bb-footer-logo {
	max-width: 180px;
	width: 100%;
	height: auto;
	margin-bottom: 1rem;
	display: block;
}

#footer .bb-footer-brand-name {
	margin: 0 0 0.5rem;
	color: var(--bb-white);
	font-weight: 700;
}

#footer .bb-footer-brand-desc {
	margin: 0;
	color: rgba(255, 255, 255, 0.75);
	line-height: 1.6;
}

#footer .bb-footer-contact {
	color: rgba(255, 255, 255, 0.78);
}

#footer .bb-footer-widget-title {
	font-size: 0.75rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--bb-sand);
	margin: 0 0 1rem;
	font-weight: 600;
}

#footer .bb-footer-widget-title--serif {
	font-family: var(--wp--preset--font-family--heading-serif, "Source Serif 4", serif);
	text-transform: none;
	letter-spacing: 0.02em;
	font-size: 1.35rem;
	line-height: 1.25;
}

#footer .bb-footer-links {
	list-style: none;
	margin: 0;
	padding: 0;
}

#footer .bb-footer-links li {
	margin: 0.5rem 0;
}

#footer .bb-footer-cta {
	display: inline-block;
	background: var(--bb-sand);
	color: var(--bb-charcoal) !important;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-size: 0.78rem;
	padding: 0.7em 1.25em;
	border-radius: 6px;
}

#footer.ct-footer [data-row="bottom"] {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding: 1.25rem 0 2rem;
}

#footer.ct-footer [data-row="bottom"] > .ct-container-fluid {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 2rem;
}

#footer .ct-footer-copyright {
	color: rgba(255, 254, 249, 0.85);
	font-size: 0.85rem;
	text-align: left;
	flex: 1 1 auto;
}

#footer [data-column="socials"] {
	flex: 0 0 auto;
}

#footer [data-id="socials"] a {
	color: var(--bb-sand);
}

@media (max-width: 767px) {
	#footer.ct-footer [data-column] {
		text-align: center;
	}

	#footer .bb-footer-logo {
		margin-left: auto;
		margin-right: auto;
	}
}

/* Intro tagline home — senza !important così padding/margini da editor Gutenberg funzionano */
.bb-intro-tagline {
	padding-left: 1.5rem;
	padding-right: 1.5rem;
}

.bb-intro-tagline :is(h5, h6) {
	font-family: var(--wp--preset--font-family--heading-serif, "Source Serif 4", serif);
	font-size: clamp(1.35rem, 2.2vw, 1.85rem) !important;
	line-height: 1.45;
	font-weight: 500;
	color: var(--bb-olive-dark);
}

/* Hero Blocksy + cover */
.home .bb-home-hero-cover {
	margin-top: 0 !important;
}

.home .bb-home-hero-cover .wp-block-cover__inner-container {
	max-width: 42rem;
	text-align: center;
}

/* Solo dentro la cover hero: non applicare a titoli in altre sezioni (es. perks). */
.home .bb-home-hero-cover .bb-home-hero-eyebrow {
	color: #fffef9 !important;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.home .bb-home-hero-cover .bb-home-hero-h1 {
	color: #fffef9 !important;
	font-family: var(--wp--preset--font-family--heading-serif, serif);
	font-size: clamp(2rem, 4.2vw, 3.35rem) !important;
	line-height: 1.12 !important;
}

.home .bb-home-hero-cover .bb-home-hero-lead {
	color: #fffef9 !important;
	opacity: 0.96;
}

.home .bb-home-hero-cover .bb-home-hero-btns {
	justify-content: center;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-top: 1.75rem;
}

.home .bb-home-hero-cover .bb-home-hero-btns .wp-block-button__link {
	border-radius: 6px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-size: 0.78rem;
	padding: 0.85em 1.35em;
}

body.bb-transparent-header .bb-home-hero-cover .bb-home-hero-btns .wp-block-button:not(.is-style-outline) .wp-block-button__link,
.home .bb-home-hero-cover .bb-home-hero-btns .wp-block-button:not(.is-style-outline) .wp-block-button__link {
	background-color: var(--bb-sand) !important;
	background-image: none !important;
	color: var(--bb-charcoal) !important;
	border: 1px solid rgba(255, 253, 249, 0.25);
}

body.bb-transparent-header .bb-home-hero-cover .bb-home-hero-btns .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover,
.home .bb-home-hero-cover .bb-home-hero-btns .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover,
body.bb-transparent-header .bb-home-hero-cover .bb-home-hero-btns .wp-block-button:not(.is-style-outline) .wp-block-button__link:focus-visible,
.home .bb-home-hero-cover .bb-home-hero-btns .wp-block-button:not(.is-style-outline) .wp-block-button__link:focus-visible {
	background-color: var(--bb-sand) !important;
	background-image: none !important;
	color: var(--bb-charcoal) !important;
	filter: brightness(1.05);
}

/* Outline hero "SCOPRI LE CAMERE": override Blocksy .wp-block-button__link:hover (#1559ed) */
.home .bb-home-hero-btns .wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent !important;
	color: var(--bb-white) !important;
	border: 1px solid var(--bb-sand) !important;
	box-shadow: none;
	transition: all 0.25s ease;
}

.home .bb-home-hero-btns .wp-block-button.is-style-outline .wp-block-button__link:hover,
.home .bb-home-hero-btns .wp-block-button.is-style-outline .wp-block-button__link:focus-visible {
	background: var(--bb-sand) !important;
	color: var(--bb-charcoal) !important;
	border-color: var(--bb-sand) !important;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
	transform: translateY(-2px);
}

body.bb-transparent-header:not(.bb-header-past-hero) .ct-header [data-id="menu"] .current-menu-item > a,
body.bb-transparent-header:not(.bb-header-past-hero) .ct-header [data-id="menu"] .current_page_item > a {
	color: var(--bb-sand) !important;
}
