/*
Theme Name:   McNab Ridge Blocks
Theme URI:    https://mcnabridge.com
Description:  Block-based child theme for McNab Ridge Winery. No page builders.
Author:       McNab Ridge Winery
Template:     twentytwentyfive
Version:      1.1.5
Requires at least: 6.5
Requires PHP: 7.4
Text Domain:  mcnabridge-blocks
*/

/* ─── Sticky header ──────────────────────────────────── */
.wp-site-blocks {
	row-gap: 0 !important;
	overflow: visible !important;
}
.site-header {
	position: sticky !important;
	top: 0;
	z-index: 1000;
	box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
	transition: box-shadow 0.3s ease;
}
/* Kill the block-gap white bar between utility bar and nav bar */
.site-header .wp-block-group + .wp-block-group {
	margin-top: 0 !important;
}
/* Kill gap between header and main (white bar fix) */
main.wp-block-group {
	padding-top: 0 !important;
	margin-top: 0 !important;
}

/* ─── Navigation ─────────────────────────────────────── */
.wp-block-navigation .wp-block-navigation-item__content,
.wp-block-navigation a.wp-block-navigation-item__content {
	padding: 1.25rem 0.75rem;
	font-size: 1rem;
	color: #ffffff !important;
	text-decoration: none !important;
	transition: color 0.2s ease;
	position: relative;
}
/* Cream underline follower */
.wp-block-navigation .wp-block-navigation-item__content::after,
.wp-block-navigation a.wp-block-navigation-item__content::after {
	content: '';
	position: absolute;
	bottom: 0.6rem;
	left: 0.75rem;
	right: 0.75rem;
	height: 1px;
	background-color: #f0eeda;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.25s ease;
}
.wp-block-navigation .wp-block-navigation-item__content:hover,
.wp-block-navigation a.wp-block-navigation-item__content:hover {
	color: #ffffff !important;
}
.wp-block-navigation .wp-block-navigation-item__content:hover::after,
.wp-block-navigation a.wp-block-navigation-item__content:hover::after {
	transform: scaleX(1);
}
/* Nav toggle / hamburger icon on sage background */
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	color: #ffffff !important;
}
.wp-block-navigation .has-child .wp-block-navigation__submenu-container {
	background-color: #121516;
	box-shadow: 0 20px 80px rgba(0, 0, 0, 0.4);
	min-width: 260px;
}
.wp-block-navigation .has-child .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	color: #ffffff;
	padding: 0.875rem 1.25rem;
	font-size: 0.9rem;
	line-height: 1.3;
}
.wp-block-navigation .has-child .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	background-color: rgba(240, 238, 218, 0.08);
	border-left: 2px solid #f0eeda;
	padding-left: calc(1.25rem - 2px);
	color: #ffffff;
}

/* ─── Mobile navigation ──────────────────────────────── */
@media (max-width: 781px) {
	.wp-block-navigation__responsive-container.is-menu-open {
		background-color: rgba(0, 0, 0, 0.92);
	}
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
		color: #ffffff;
		font-size: 1.5rem;
		font-weight: 700;
		letter-spacing: 0.15em;
		text-transform: uppercase;
		padding: 0.9375rem 5%;
	}
	.wp-block-navigation__responsive-container.is-menu-open .has-child .wp-block-navigation-item__content {
		font-size: 1.125rem;
		padding: 0.375rem 5%;
	}
	.wp-block-navigation__responsive-container-open svg {
		color: #ffffff;
	}
}

/* ─── Footer nav lists ───────────────────────────────── */
.footer-nav-list {
	list-style: none;
	padding-left: 0;
	margin: 0;
}
.footer-nav-list li {
	margin-bottom: 0.625rem;
}

/* ─── Buttons ────────────────────────────────────────── */
.wp-block-button__link {
	border-radius: 0 !important;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Gold outlined variant */
.wp-block-button.is-style-outline .wp-block-button__link {
	border-color: #bf9e77;
	color: #bf9e77;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background-color: #f0eeda;
	border-color: #bf9e77;
	color: #121516;
}

/* ─── Hero / cover blocks (non-slider pages) ─────────── */
.wp-block-cover {
	min-height: 75vh;
}
.wp-block-cover .wp-block-cover__inner-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 1.5rem;
}

/* ─── Hero Swiper Slider ─────────────────────────────── */
.mnr-hero-swiper {
	width: 100%;
	height: 83vh;
	min-height: 500px;
}
.mnr-hero-swiper .swiper-wrapper {
	height: 100%;
}
.mnr-hero-slide {
	width: 100%;
	height: 83vh !important;
	min-height: 500px;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	position: relative;
	display: flex !important;
	align-items: center;
	justify-content: center;
}
.mnr-hero-slide__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		rgba(18, 21, 22, 0.25) 0%,
		rgba(18, 21, 22, 0.48) 100%
	);
	z-index: 1;
}
.mnr-hero-slide__content {
	position: relative;
	z-index: 2;
	text-align: center;
	width: 100%;
	max-width: 680px;
	padding: 0 2rem;
}
.mnr-hero-slide__title {
	font-family: var(--wp--preset--font-family--display);
	font-size: 3rem;
	font-weight: 400;
	color: #f0eeda;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	line-height: 1.1;
	margin: 0 0 1rem;
	text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5), 0 1px 5px rgba(0, 0, 0, 0.6);
}
.mnr-hero-slide__subtitle {
	font-size: 1.5rem;
	line-height: 1.55;
	color: #f0eeda;
	margin: 0 0 2rem;
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}
.mnr-hero-slide__buttons {
	display: flex;
	gap: 1rem;
	justify-content: center;
	flex-wrap: wrap;
}

/* ─── Hero CTA buttons ───────────────────────────────── */
.mnr-btn {
	display: inline-block;
	font-family: var(--wp--preset--font-family--display);
	font-size: 1rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-decoration: none;
	padding: 0.75em 2.5em;
	border: 2px solid transparent;
	border-radius: 0;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	cursor: pointer;
}
.mnr-btn--cream {
	background-color: #f0eeda;
	color: #404c32 !important;
	border-color: #f0eeda;
}
.mnr-btn--cream:hover {
	background-color: transparent;
	color: #f0eeda !important;
}
.mnr-btn--outline {
	background-color: transparent;
	color: #ffffff !important;
	border-color: #ffffff !important;
}
.mnr-btn--outline:hover {
	background-color: #ffffff !important;
	color: #404c32 !important;
}

/* ─── Swiper navigation & pagination ─────────────────── */
.mnr-hero-swiper .swiper-button-prev,
.mnr-hero-swiper .swiper-button-next {
	color: rgba(240, 238, 218, 0.7);
	transition: color 0.2s ease;
}
.mnr-hero-swiper .swiper-button-prev:hover,
.mnr-hero-swiper .swiper-button-next:hover {
	color: #f0eeda;
}
.mnr-hero-swiper .swiper-button-prev::after,
.mnr-hero-swiper .swiper-button-next::after {
	font-size: 1.5rem;
}
.mnr-hero-swiper .swiper-pagination-bullet {
	background: #f0eeda;
	opacity: 0.5;
}
.mnr-hero-swiper .swiper-pagination-bullet-active {
	opacity: 1;
	background: #bf9e77;
}

/* ─── Body typography ────────────────────────────────── */
body {
	font-family: var(--wp--preset--font-family--body);
	font-size: 1.125rem;
	font-weight: 500;
}
p {
	font-family: var(--wp--preset--font-family--body);
	font-size: 1.125rem;
	font-weight: 500;
}
/* Gravity Forms labels and inputs stay normal weight */
.gform_wrapper.gravity-theme input,
.gform_wrapper.gravity-theme textarea,
.gform_wrapper.gravity-theme select {
	font-weight: 400;
}

/* ─── Typography tweaks ──────────────────────────────── */
.entry-content a,
.wp-block-post-content a {
	color: #58595b;
	text-decoration: underline;
}
.entry-content a:hover,
.wp-block-post-content a:hover {
	color: #404c32;
}

/* ─── Gravity Forms — brand styling ─────────────────── */
.gform_wrapper.gravity-theme .gform_fields {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}
.gform_wrapper.gravity-theme .gfield_label {
	font-family: var(--wp--preset--font-family--display);
	font-size: 0.8125rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin-bottom: 0.375rem;
	color: #404c32;
}
.gform_wrapper.gravity-theme input[type="text"],
.gform_wrapper.gravity-theme input[type="email"],
.gform_wrapper.gravity-theme input[type="tel"],
.gform_wrapper.gravity-theme textarea,
.gform_wrapper.gravity-theme select {
	border: 1px solid #bbc4bc;
	border-radius: 0;
	padding: 0.625rem 0.875rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	color: #404c32;
	background-color: #ffffff;
	width: 100%;
	transition: border-color 0.2s ease;
}
.gform_wrapper.gravity-theme input:focus,
.gform_wrapper.gravity-theme textarea:focus {
	border-color: #bf9e77;
	outline: none;
	box-shadow: 0 0 0 2px rgba(191, 158, 119, 0.2);
}
.gform_wrapper.gravity-theme .gform_footer input[type="submit"],
.gform_wrapper.gravity-theme .gform_page_footer input[type="submit"] {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	background-color: #404c32;
	color: #ffffff;
	border: 2px solid #404c32;
	border-radius: 0;
	padding: 0.6em 2.25em;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}
.gform_wrapper.gravity-theme .gform_footer input[type="submit"]:hover {
	background-color: transparent;
	color: #404c32;
}
/* Newsletter form: cream background context */
.mnr-newsletter-form .gfield_label {
	color: #404c32;
}
.gform_confirmation_message {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.125rem;
	color: #404c32;
	padding: 1rem 0;
}

/* ─── Commerce7 widget — brand colours ──────────────── */
.c7-btn--primary,
a.c7-btn--primary {
	background-color: #404c32 !important;
	border-color: #404c32 !important;
	color: #ffffff !important;
}
.c7-btn--primary:hover,
a.c7-btn--primary:hover {
	background-color: transparent !important;
	border-color: #404c32 !important;
	color: #404c32 !important;
}
.c7-btn--secondary,
a.c7-btn--secondary {
	background-color: transparent !important;
	border-color: #bf9e77 !important;
	color: #bf9e77 !important;
}
.c7-btn--secondary:hover,
a.c7-btn--secondary:hover {
	background-color: #bf9e77 !important;
	color: #ffffff !important;
}

/* ─── Admin bar compensation ─────────────────────────── */
.admin-bar .site-header {
	top: 32px;
}
@media (max-width: 782px) {
	.admin-bar .site-header {
		top: 46px;
	}
}

/* ─── Heading sizes — hard fallback (theme.json vars can fail to resolve) */
h2, h2.wp-block-heading {
	font-size: clamp(1.75rem, 3.5vw, 3.5rem);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	line-height: 1.15;
}
h3, h3.wp-block-heading {
	font-size: clamp(1.25rem, 2vw, 2rem);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	line-height: 1.2;
}

/* ─── Remove block-gap white bars between full-width sections ── */
.wp-block-post-content > .alignfull,
.entry-content > .alignfull,
.wp-block-post-content > .wp-block-html {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

/* ─── Hero: mobile height ────────────────────────────── */
@media (max-width: 781px) {
	.mnr-hero-swiper,
	.mnr-hero-slide {
		height: 60vh !important;
		min-height: 400px;
	}
}

/* ─── Hero pause button ──────────────────────────────── */
.mnr-hero-pause {
	position: absolute;
	bottom: 1.25rem;
	right: 1.25rem;
	z-index: 10;
	background: rgba(0, 0, 0, 0.45);
	border: 1px solid rgba(240, 238, 218, 0.5);
	border-radius: 50%;
	width: 2.25rem;
	height: 2.25rem;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #f0eeda;
	font-size: 0.75rem;
	transition: background 0.2s ease;
	padding: 0;
}
.mnr-hero-pause:hover {
	background: rgba(0, 0, 0, 0.7);
}
.mnr-hero-pause:focus-visible {
	outline: 2px solid #f0eeda;
	outline-offset: 2px;
}

/* ─── Featured wines: normalize image aspect ratio ───── */
.wp-block-columns.alignwide .wp-block-image img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
	width: 100%;
}
.wp-block-columns.alignwide .wp-block-image.mnr-image--contain img {
	object-fit: contain;
	background-color: #ffffff;
}

/* ─── Events band: use display font for heading ─────── */
.mnr-section--events h2 {
	font-family: var(--wp--preset--font-family--display) !important;
	font-weight: 400 !important;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/* ─── Utility bar: readable contrast on sage ─────────── */
.site-header > .wp-block-group:first-child {
	background-color: #404c32 !important;
}

/* ─── Shop Wines: mobile column order ────────────────── */
@media (max-width: 781px) {
	.mnr-shop-wines > .wp-block-column:first-child {
		order: 2;
	}
	.mnr-shop-wines > .wp-block-column:last-child {
		order: 1;
	}
}

/* ─── Newsletter: reduce vertical height ────────────── */
.mnr-newsletter .wp-block-cover {
	min-height: 260px !important;
}
.mnr-newsletter .wp-block-column:last-child {
	padding-top: 2.5rem !important;
	padding-bottom: 2.5rem !important;
}

/* ─── Newsletter: hide decorative image on mobile ────── */
@media (max-width: 781px) {
	.mnr-newsletter > .wp-block-column:first-child {
		display: none;
	}
}

/* ─── Coming soon banner (homepage only) ────────────────────────── */
.mnr-coming-soon-banner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 60px;
	background: #f0eeda;
	padding: 0 1.5rem;
	box-sizing: border-box;
	gap: 1rem;
}
/* Kill the is-layout-flow block gap between banner and slider */
.home .wp-block-post-content .mnr-coming-soon-banner + * {
	margin-block-start: 0 !important;
}
.mnr-csb-thumb {
	height: 40px;
	width: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	display: block;
	flex-shrink: 0;
}
.mnr-csb-text {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	margin: 0;
	color: #404c32;
	font-size: 1rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	white-space: nowrap;
	pointer-events: none;
	text-align: center;
}
.mnr-csb-text strong {
	color: #404c32;
	font-weight: 700;
}
.mnr-csb-btn {
	flex-shrink: 0;
	background: #bbc4bc;
	color: #404c32 !important;
	padding: 0 1.1rem;
	height: 34px;
	display: inline-flex;
	align-items: center;
	text-decoration: none !important;
	font-size: 0.6875rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	font-weight: 600;
	line-height: 1;
}
.mnr-csb-btn:hover {
	background: #a8b4aa;
}
@media (max-width: 640px) {
	/* ── Banner: drop thumb + button, centre text inline ── */
	.mnr-csb-thumb,
	.mnr-csb-btn {
		display: none;
	}
	.mnr-coming-soon-banner {
		justify-content: center;
		overflow: hidden;
	}
	.mnr-csb-text {
		position: static;
		transform: none;
		font-size: 0.8rem;
		letter-spacing: 0.04em;
		pointer-events: auto;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		text-align: center;
		max-width: 100%;
	}
}

/* ─── Events: enforce 4:3 crop from top (archive + /events page) ─── */
.category-events .wp-block-post-featured-image,
.page-id-101369 .wp-block-image {
	aspect-ratio: 4 / 3;
	overflow: hidden;
}
.category-events .wp-block-post-featured-image a,
.page-id-101369 .wp-block-image a {
	display: block;
	height: 100%;
}
.category-events .wp-block-post-featured-image img,
.page-id-101369 .wp-block-image img {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover !important;
	object-position: top center !important;
}
