/*
Theme Name: Balchik Summer
Description: A custom block theme scaffolded by Studio Code.
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.2
Version: 0.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: balchik-summer
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready, style-variations
*/

/* WordPress inserts a margin-block-start equal to the block gap (24px unless
   theme.json sets styles.spacing.blockGap) between the template's top-level
   sections (header part, main, footer part) — a gap that exists even when no
   markup asks for it. Zero it so sections butt edge-to-edge and own their
   vertical rhythm via padding; this does not affect block gaps inside nested
   layouts. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* With that gap gone, main carries its own vertical padding so templates this
   theme does not author (WooCommerce shop, product, cart…) still clear the
   header and footer. A descendant selector, not a child one: WooCommerce wraps
   the single-product main in an extra group. Templates built from full-bleed
   sections opt out with is-flush and let the sections own the rhythm. */
.wp-site-blocks main {
	padding-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--70);
}
.wp-site-blocks main.is-flush {
	padding-block: 0;
}

/* === root === */
:root {
	--rule: rgb(26 25 23 / 0.18);
	--header-h: 72px;
}

/* === typography === */
body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.site-brand a {
	color: var(--wp--preset--color--text);
	text-decoration: none;
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: 1.5rem;
	font-weight: 400;
	letter-spacing: -0.01em;
}

/* === header === */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgb(244 239 230 / 0.9);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--rule);
}

.site-header-inner {
	width: 100%;
}

.site-nav {
	margin-left: auto;
}

.header-gt {
	display: inline-flex;
	align-items: center;
}

/* GTranslate's own widget is hidden — it only powers the translation engine. */
.header-gt .gt_switcher_wrapper,
.header-gt .gt_switcher {
	position: static !important;
	top: auto !important;
	bottom: auto !important;
	left: auto !important;
	right: auto !important;
	z-index: auto !important;
	display: none !important;
}

/* Custom header language dropdown: a flag + country-code button with the caret
   placed beside the text, and an absolutely-positioned menu that drops below
   the header (never expanding the header itself). */
.header-lang {
	position: relative;
	margin-left: 6px;
}

.header-lang__button {
	display: flex;
	align-items: center;
	background: transparent;
	border: 1px solid var(--rule);
	border-radius: 2px;
	padding: 5px 9px;
	cursor: pointer;
	color: var(--wp--preset--color--text);
	font-family: inherit;
}

.header-lang__button:hover {
	border-color: var(--wp--preset--color--text);
}

.header-lang__flag {
	display: flex;
	align-items: center;
	margin-right: 7px;
	line-height: 0;
}

.header-lang__code {
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.header-lang__caret {
	margin-left: 7px;
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid var(--wp--preset--color--text);
}

.header-lang__menu {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	min-width: 200px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: var(--wp--preset--color--cream);
	border: 1px solid var(--rule);
	border-radius: 2px;
	box-shadow: 0 14px 34px rgb(26 25 23 / 0.14);
	display: none;
	z-index: 9999;
}

.header-lang.is-open .header-lang__menu {
	display: block;
}

.header-lang__option {
	display: flex;
	align-items: center;
	gap: 9px;
	width: 100%;
	text-align: left;
	background: transparent;
	border: 0;
	border-radius: 2px;
	padding: 7px 10px;
	cursor: pointer;
	font-size: 0.86rem;
	font-family: inherit;
	color: var(--wp--preset--color--text);
}

.header-lang__option:hover {
	background: rgb(91 107 79 / 0.1);
}

.header-lang__option img {
	width: 16px;
	height: 16px;
}

.header-lang__option.is-current {
	font-weight: 600;
}

.site-header-inner {
	flex-wrap: nowrap;
	column-gap: 20px;
}

@media (max-width: 782px) {
	.site-header-inner {
		flex-wrap: wrap;
	}

	.header-lang {
		margin-left: auto;
	}

	/* Give the full-bleed home sections breathing room so content never sits
	   against the viewport edge on small screens. */
	.ss-step-inner {
		padding-left: 20px;
		padding-right: 20px;
	}

	/* Interior-page heroes are full-bleed but their text escapes the content
	   wrapper's padding — re-add it so headlines don't hug the left edge. */
	.entry-content > .alignfull.page-hero,
	.page-hero {
		padding-left: 20px;
		padding-right: 20px;
	}

	/* Footer: brand column full width, Stay and Guide side by side. */
	.site-footer .wp-block-columns {
		gap: 12px;
	}
	.site-footer .wp-block-column {
		flex: 0 0 100% !important;
	}
	.site-footer .wp-block-column:not(:first-child) {
		flex: 0 0 calc(50% - 6px) !important;
		max-width: calc(50% - 6px) !important;
	}

	/* Clean up the responsive (hamburger) nav when it opens on mobile: a
	   full-screen cream panel with a left-aligned vertical list of links. */
	.wp-block-navigation__responsive-container.is-menu-open {
		position: fixed !important;
		top: 0 !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		width: 100vw !important;
		height: 100vh !important;
		min-height: 100vh !important;
		max-width: none !important;
		max-height: none !important;
		margin: 0 !important;
		border: 0 !important;
		border-radius: 0 !important;
		box-shadow: none !important;
		background: #f4efe6 !important;
		padding: 60px 24px 24px;
		overflow-y: auto;
		z-index: 10000;
	}

	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		gap: 0;
		width: 100%;
	}

	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
		width: 100%;
		text-align: left;
	}

	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
		display: block;
		width: 100%;
		font-size: 1.02rem;
		line-height: 1.25;
		padding: 6px 0;
		text-transform: none;
		letter-spacing: 0;
	}

	/* Submenu ("The Town") items render inline in the open overlay — convert the
	   nested container from an absolute-positioned white dropdown into a plain
	   left-aligned flow of links, kept nearly flush with the top-level options. */
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
		position: static !important;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		width: 100%;
		height: auto;
		margin: 0;
		padding-left: 12px;
		gap: 0;
		background: transparent !important;
		border: 0 !important;
		box-shadow: none !important;
		opacity: 1 !important;
	}
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
		font-size: 0.92rem;
		opacity: 0.75;
	}

	.wp-block-navigation__responsive-container-close {
		position: absolute;
		top: 20px;
		right: 20px;
	}
}

.site-nav .wp-block-navigation-item > a {
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-size: 0.72rem;
	font-weight: 600;
	text-decoration: none;
}

.site-nav .wp-block-navigation-item > a:hover {
	text-decoration: underline;
	text-underline-offset: 4px;
}

.site-nav .wp-block-navigation-submenu .wp-block-navigation-item a {
	text-transform: none;
	letter-spacing: 0;
	font-weight: 500;
	font-size: 0.95rem;
}

/* language switcher — compact flags / names */
.wp-block-polylang-language-switcher {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 0.4rem;
	flex-wrap: wrap;
}

.wp-block-polylang-language-switcher li {
	margin: 0;
}

.wp-block-polylang-language-switcher a {
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.66rem;
	text-decoration: none;
	color: var(--wp--preset--color--text);
	opacity: 0.7;
}

.wp-block-polylang-language-switcher a:hover {
	opacity: 1;
	text-decoration: underline;
}

/* === hero eyebrow + headings === */
.eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.18em;
	font-size: 0.8rem;
	color: var(--wp--preset--color--primary);
	margin: 0 0 1rem;
}

/* === buttons === */
.wp-block-button__link {
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 0.75rem;
	font-weight: 600;
	border-radius: 2px;
}

.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--text);
	border: 1px solid var(--wp--preset--color--text);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--text);
	color: var(--wp--preset--color--background);
}

/* === sticky split (home) === */
.ss-split .wp-block-columns {
	gap: 0;
}

.ss-pane-left {
	position: sticky;
	top: var(--header-h);
	height: calc(100dvh - var(--header-h));
	overflow: hidden;
	padding: 0 !important;
}

.ss-pane-left .ss-pane-image {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.6s ease;
}

.ss-pane-left .ss-pane-image.is-active {
	opacity: 1;
}

.ss-pane-left .ss-pane-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ss-step {
	min-height: 100dvh;
	display: flex;
	align-items: center;
	padding: var(--wp--preset--spacing--60) 0;
	border-bottom: 1px solid var(--rule);
}

.ss-step:last-child {
	border-bottom: 0;
}

.ss-step-inner {
	max-width: 30rem;
}

.ss-step .ss-mobile-img {
	display: none;
}

/* === interior page hero === */
.page-hero {
	padding: var(--wp--preset--spacing--70) 0 var(--wp--preset--spacing--40);
}

.page-hero .eyebrow {
	font-size: 0.75rem;
}

/* === apartment pages === */
.apt-section {
	padding-block: var(--wp--preset--spacing--60);
}

.apt-section + .apt-section {
	padding-top: 0;
}

.apt-video .wp-block-embed {
	max-width: 820px;
	margin-inline: auto;
}

.apt-reviews {
	padding-block: var(--wp--preset--spacing--70);
}

.apt-reviews .wp-block-quote {
	margin: 0;
	border: none;
	background: var(--wp--preset--color--cream);
	border: 1px solid var(--rule);
	padding: 1.6rem;
	height: 100%;
}

.apt-reviews .wp-block-quote p {
	font-style: normal;
	font-size: 1.05rem;
	line-height: 1.55;
}

.apt-reviews .wp-block-quote cite {
	display: block;
	margin-top: 1.25rem;
	font-size: 0.72rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}

/* Lightbox: let the page show through behind an enlarged photo instead of
   a solid full-screen layer, so it never feels like leaving the site. The
   page-hiding layer is the .scrim inside the overlay, not the overlay itself. */
.wp-lightbox-overlay .scrim {
	opacity: 0.5 !important;
}

.wp-lightbox-overlay.zoom.active .scrim {
	animation: none !important;
}

/* === cookie banner === */
#bs-cookie-banner {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99999;
	background: var(--wp--preset--color--cream);
	border-top: 1px solid var(--rule);
	padding: 1rem clamp(1.25rem, 5vw, 3rem);
	box-shadow: 0 -6px 24px rgb(26 25 23 / 0.08);
}

.bs-cookie-content {
	max-width: 1180px;
	margin-inline: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.25rem;
	flex-wrap: wrap;
}

.bs-cookie-text {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--wp--preset--color--text);
	max-width: 62ch;
}

.bs-cookie-text a {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
}

.bs-cookie-actions {
	display: flex;
	gap: 0.6rem;
	flex-shrink: 0;
}

.bs-cookie-btn {
	font-family: inherit;
	font-size: 0.8rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	padding: 0.55rem 1.1rem;
	border: 1px solid var(--wp--preset--color--primary);
	background: transparent;
	color: var(--wp--preset--color--primary);
}

.bs-cookie-btn.bs-cookie-accept {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--cream);
	border-color: var(--wp--preset--color--primary);
}

@media (max-width: 600px) {
	.bs-cookie-content {
		flex-direction: column;
		align-items: flex-start;
	}
	.bs-cookie-actions {
		width: 100%;
	}
	.bs-cookie-btn {
		flex: 1;
		text-align: center;
	}
}

/* === footer === */
.site-footer {
	background: var(--wp--preset--color--background);
	padding: var(--wp--preset--spacing--50) clamp(1.25rem, 5vw, 3rem) var(--wp--preset--spacing--40);
	border-top: 1px solid var(--rule) !important;
}

.footer-nav.wp-block-navigation {
	gap: 0.55rem;
}

.site-footer h3 {
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 0.7rem;
	color: var(--wp--preset--color--primary);
}

.footer-nav .wp-block-navigation-item a {
	text-decoration: none;
	font-size: 0.95rem;
	color: var(--wp--preset--color--text);
}

.footer-nav .wp-block-navigation-item a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.site-footer .footer-bottom {
	font-size: 0.8rem;
	opacity: 0.6;
	margin-top: var(--wp--preset--spacing--40);
}

/* === forms === */
.wp-block-jetpack-contact-form input[type],
.wp-block-jetpack-contact-form textarea,
.wp-block-jetpack-contact-form select {
	border: 1px solid var(--rule);
	border-radius: 2px;
	background: #fff;
	padding: 0.7rem 0.85rem;
	font-family: var(--wp--preset--font-family--cormorant-garamond);
	font-size: 1.05rem;
}

.wp-block-jetpack-contact-form input[type]:focus,
.wp-block-jetpack-contact-form textarea:focus {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 0;
}

/* === responsive === */
@media (max-width: 781px) {
	.ss-split .wp-block-columns {
		display: block;
	}

	.ss-pane-left {
		display: none;
	}

	.ss-step {
		min-height: auto;
		display: block;
		padding: var(--wp--preset--spacing--50) 0;
	}

	.ss-step .ss-mobile-img {
		display: block;
		margin-bottom: var(--wp--preset--spacing--40);
		overflow: hidden;
		border-radius: 2px;
	}

	.ss-step .ss-mobile-img img {
		width: 100%;
		height: 240px;
		object-fit: cover;
		display: block;
	}
}

/* === reduced motion === */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}
