/**
 * Native shell chrome.
 * Footer matches production Elementor template 280 (rootshki.fi):
 * #E5D1C3, centered newsletter, logo + contact, three studio columns, Visma.
 * Desktop submenus open on hover. Superfish is not loaded without Genesis.
 */

/*
 * Overrides the listing block's html { overflow-x: hidden } rules, including
 * the high-specificity :has() variant. They make body a scroll container and
 * break the sticky header. The body overflow-x rule still prevents horizontal
 * scrolling.
 */
html:root {
	overflow-x: visible !important;
}

.hoyry-shell-header {
	position: sticky;
	top: 0;
	z-index: 9999;
	overflow: visible;
	background-color: #faf2eb;
	border-bottom: 1px solid #ded8d2;
	transition: transform 0.3s ease, visibility 0s linear 0s;
}

/*
 * Sticky header. rootsInitStickyHeader() in assets/js/front.js sets
 * body.sticky-header-hidden-on-scroll while scrolling down. The shell keeps
 * its space and only moves with a transform, so nothing below it jumps.
 * Visible state has no transform: a transform would make the fixed mobile
 * menu relative to the shell.
 */
body.admin-bar .hoyry-shell-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .hoyry-shell-header {
		top: 46px;
	}
}

/* The admin bar scrolls away below 601px. */
@media screen and (max-width: 600px) {
	body.admin-bar .hoyry-shell-header {
		top: 0;
	}
}

body.sticky-header-hidden-on-scroll:not(.menu-open) .hoyry-shell-header {
	transform: translateY(-100%);
	visibility: hidden;
	transition: transform 0.3s ease, visibility 0s linear 0.3s;
}

/* The mobile menu measures the header when it opens: no slide in between. */
body.menu-open .hoyry-shell-header {
	transition: none;
}

body.woocommerce-checkout .hoyry-shell-header {
	position: relative;
	transform: none;
	visibility: visible;
}

/* The class modal overlay is z-index 9998; keep the header below it. */
body:has(.micromodal-slide.is-open) .hoyry-shell-header {
	z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
	.hoyry-shell-header,
	body.sticky-header-hidden-on-scroll:not(.menu-open) .hoyry-shell-header {
		transition: none;
	}
}

#header {
	overflow: visible;
}

#header .menu-wrapper .main-menu-container > ul > li.menu-item-has-children {
	position: relative;
}

#header .menu-wrapper .main-menu-container > ul > li.menu-item-has-children:hover > .sub-menu,
#header .menu-wrapper .main-menu-container > ul > li.menu-item-has-children:focus-within > .sub-menu {
	display: block;
	z-index: 10001;
}

/*
 * Hover bridge. The panel is wider than its label and sits at top: 100%,
 * after the item padding. align_desktop_submenu() sets left in pixels.
 * A leftover translateX(-50%) shoved that panel ~100px off the trigger, so
 * the pointer left the item in the gap and Superfish closed and reopened it.
 * This strip is a child of the panel, so the path from the label into the
 * overhang stays inside :hover. Desktop .menu-wrapper only; the mobile
 * drawer uses .mobile-menu-wrapper and its own .open toggle.
 */
#header .menu-wrapper .main-menu-container > ul > li.menu-item-has-children > .sub-menu::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	height: 24px;
}

#header .mobile-menu-wrapper .main-menu-container > ul > li.menu-item-has-children {
	position: relative;
}

/*
 * Shop subnav vs hero.
 *
 * Desktop band is position:absolute; top:100%; height:68px, so it overlays
 * the first 68px of the hero. Mobile sage bar is absolute as well, 30px
 * below the header. Do not add a block-gap above header covers: that gap
 * is what pushed the subnav off the photo. The zero-margin rule lives with
 * the subnav styles in front.scss.
 */

/*
 * Open hamburger menu. The shell's scroll transform makes position:fixed
 * children relative to the shell, and the menu used to start below the whole
 * shell — including the shop subnav — so the subnav and hero stayed visible.
 * While the menu is open, drop the transform and keep the shell above page
 * content. The menu top is the #header bar, so the subnav is covered.
 * Desktop mega-menus are not in this breakpoint.
 */
@media screen and (max-width: 1024px) {
	body.menu-open .hoyry-shell-header {
		z-index: 100000;
		transform: none !important;
		-webkit-transform: none !important;
		opacity: 1 !important;
		visibility: visible !important;
	}

	body.menu-open #header .mobile-menu-wrapper {
		z-index: 100000;
	}

	body.menu-open .shop-navigation-wrapper {
		z-index: 1;
	}
}

.roots-shell-footer {
	background-color: #e5d1c3;
	color: #303030;
	padding: 3em 2em;
	font-family: Fugue, var(--wp--preset--font-family--toissijainen, sans-serif);
	font-size: 1rem;
	line-height: 1.45;
}

.roots-shell-footer__newsletter {
	max-width: 920px;
	margin: 0 auto;
	text-align: center;
}

.roots-shell-footer__newsletter h2 {
	margin: 0 0 0.75rem;
	font-family: Monumentextended, var(--wp--preset--font-family--ensisijainen, sans-serif);
	font-size: 0.9rem;
	font-weight: 500;
	letter-spacing: 0.5px;
	color: #303030;
}

.roots-shell-footer__newsletter > p {
	margin: 0 auto 1.25rem;
	max-width: 36rem;
	padding: 0;
}

.roots-shell-footer__form,
.roots-shell-footer__newsletter .frm-fluent-form,
.roots-shell-footer__newsletter form {
	display: flex;
	justify-content: center;
	align-items: flex-end;
	gap: 1.25rem;
	width: 100%;
	max-width: 820px;
	margin: 0 auto;
	padding: 0;
}

.roots-shell-footer__newsletter .ff-el-group,
.roots-shell-footer__newsletter .ff-el-input--content {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
}

.roots-shell-footer__newsletter .ff-el-input--label {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

.roots-shell-footer__newsletter .ff_submit_btn_wrapper {
	flex: 0 0 auto;
	margin: 0;
	width: auto;
}

.roots-shell-footer__newsletter .ff-el-input--content,
.roots-shell-footer__newsletter .ff-el-group {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
}

.roots-shell-footer__form input[type="email"],
.roots-shell-footer__newsletter .ff-el-form-control,
.roots-shell-footer__newsletter input[type="email"],
.roots-shell-footer__newsletter input[type="text"] {
	width: 100%;
	min-height: 42px;
	border: 0 !important;
	border-bottom: 1px solid rgba(48, 48, 48, 0.55) !important;
	border-radius: 0 !important;
	padding: 8px 0 10px !important;
	background: transparent !important;
	color: #303030 !important;
	box-shadow: none !important;
	font: inherit;
}

.roots-shell-footer__form button,
.roots-shell-footer__newsletter .ff-btn-submit,
.roots-shell-footer__newsletter .ff-btn-submit.wp-element-button,
.roots-shell-footer__newsletter .ff-btn-submit.wp-block-button__link,
.roots-shell-footer__newsletter button[type="submit"] {
	flex: 0 0 auto;
	min-width: 8.5rem;
	min-height: 46px;
	border: 0 !important;
	border-radius: 6px !important;
	padding: 12px 36px !important;
	background: #3a3a3a !important;
	color: #fff !important;
	font-family: Fugue, var(--wp--preset--font-family--toissijainen, sans-serif) !important;
	font-size: 1rem !important;
	line-height: 1.2 !important;
	box-shadow: none !important;
	cursor: pointer;
}

.roots-shell-footer__main {
	display: grid;
	grid-template-columns: minmax(16rem, 0.9fr) minmax(0, 1.6fr);
	align-items: start;
	gap: 2rem 6vw;
	max-width: 1680px;
	margin: 8em auto 0;
	padding: 0 2vw;
}

.roots-shell-footer__brand {
	max-width: 26rem;
	text-align: left;
}

.roots-shell-footer__brand img {
	display: block;
	width: 120px;
	max-width: 100%;
	height: auto;
	margin: 0 auto 1.5rem;
}

.roots-shell-footer__contact {
	text-align: center;
}

.roots-shell-footer__contact p {
	margin: 0 0 1.15rem;
}

.roots-shell-footer__contact p:has(strong) {
	margin-top: 1.35rem;
}

.roots-shell-footer__contact p:first-of-type {
	margin-top: 0;
}

.roots-shell-footer__legal {
	font-size: 0.85rem;
}

.roots-shell-footer a {
	color: inherit;
}

.roots-shell-footer__studios {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	justify-content: stretch;
	gap: 2.75rem 3rem;
	padding-left: 6%;
	text-align: left;
}

.roots-shell-footer__studio h3 {
	margin: 0 0 0.4rem;
	font-family: Monumentextended, var(--wp--preset--font-family--ensisijainen, sans-serif);
	font-size: 0.8rem;
	font-weight: 600;
}

.roots-shell-footer__studio {
	max-width: none;
}

.roots-shell-footer__studio p {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.4;
}

.roots-shell-footer__hours {
	margin-top: 0.35rem !important;
	font-size: 0.8rem !important;
}

.roots-shell-footer__visma {
	text-align: center;
}

.roots-shell-footer__visma--desktop {
	max-width: 1680px;
	margin: 3.5rem auto 0;
	padding: 0 2vw;
	text-align: center;
}

.roots-shell-footer__visma--desktop img {
	width: min(100%, 980px);
	height: auto;
}

.roots-shell-footer__visma--mobile {
	display: none;
}

.roots-shell-footer__visma--mobile img {
	max-width: 130px;
	height: auto;
}

/*
 * Tampere. Centered single column on the same beige as the Helsinki footer.
 * Authored in this file, same as the rules above: shell chrome has no SCSS entry.
 */
.roots-shell-footer.roots-shell-footer--tampere {
	padding: 5.75rem 1.5rem 4.75rem;
	text-align: center;
	color: #1a1a1a;
}

.roots-shell-footer__tampere {
	max-width: 36rem;
	margin: 0 auto;
}

.roots-shell-footer.roots-shell-footer--tampere .roots-shell-footer__newsletter {
	margin-bottom: 4.5rem;
}

.roots-shell-footer__wordmark {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.45rem;
	margin: 0 0 3.1rem;
}

.roots-shell-footer__wordmark-name {
	font-family: Monumentextended, var(--wp--preset--font-family--ensisijainen, sans-serif);
	font-size: 2.35rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	line-height: 0.9;
	color: #111;
}

.roots-shell-footer__wordmark-city {
	font-family: Fugue, var(--wp--preset--font-family--toissijainen, sans-serif);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.42em;
	line-height: 1;
	text-indent: 0.42em;
	text-transform: uppercase;
}

.roots-shell-footer__address {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	margin: 0 0 2.35rem;
	font-style: normal;
	font-size: 1.05rem;
	line-height: 1.45;
}

.roots-shell-footer__service {
	margin: 0 0 2.5rem;
}

.roots-shell-footer.roots-shell-footer--tampere .roots-shell-footer__service p,
.roots-shell-footer.roots-shell-footer--tampere .roots-shell-footer__legal {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.55;
}

.roots-shell-footer__service-label {
	font-weight: 700;
}

.roots-shell-footer.roots-shell-footer--tampere .roots-shell-footer__legal {
	font-size: 1rem;
	line-height: 1.7;
}

.roots-shell-footer.roots-shell-footer--tampere a {
	color: inherit;
	text-decoration: none;
}

.roots-shell-footer.roots-shell-footer--tampere a:hover,
.roots-shell-footer.roots-shell-footer--tampere a:focus {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.12em;
}

@media screen and (max-width: 768px) {
	.roots-shell-footer.roots-shell-footer--tampere {
		padding: 3.5rem 1.25rem 3.25rem;
	}

	.roots-shell-footer.roots-shell-footer--tampere .roots-shell-footer__newsletter {
		margin-bottom: 3rem;
	}

	.roots-shell-footer__wordmark {
		margin-bottom: 2.4rem;
	}

	.roots-shell-footer__wordmark-name {
		font-size: 1.9rem;
	}

	.roots-shell-footer__whatsapp {
		padding: 0 0.5rem;
	}
}

.roots-shell-footer .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media screen and (max-width: 767px) {
	.roots-shell-footer__visma--desktop {
		display: none;
	}

	.roots-shell-footer__visma--mobile {
		display: block;
		margin-top: 2rem;
	}
}

@media screen and (max-width: 768px) {
	.roots-shell-footer {
		padding-right: 1.25rem;
		padding-left: 1.25rem;
	}

	.roots-shell-footer__newsletter > p,
	.roots-shell-footer__form {
		padding-left: 0;
		padding-right: 0;
	}

	.roots-shell-footer__form,
	.roots-shell-footer__newsletter .frm-fluent-form,
	.roots-shell-footer__newsletter form {
		flex-direction: column;
		align-items: center;
		max-width: 22rem;
		gap: 1rem;
	}

	.roots-shell-footer__newsletter .ff-el-group,
	.roots-shell-footer__newsletter .ff-el-input--content,
	.roots-shell-footer__form input[type="email"],
	.roots-shell-footer__newsletter .ff-el-form-control,
	.roots-shell-footer__newsletter input[type="email"],
	.roots-shell-footer__newsletter input[type="text"] {
		width: 100%;
		max-width: 22rem;
	}

	.roots-shell-footer__newsletter .ff_submit_btn_wrapper,
	.roots-shell-footer__form button,
	.roots-shell-footer__newsletter .ff-btn-submit,
	.roots-shell-footer__newsletter .ff-btn-submit.wp-element-button,
	.roots-shell-footer__newsletter button[type="submit"] {
		width: auto;
		min-width: 8.5rem;
		max-width: 16rem;
	}

	.roots-shell-footer__main {
		display: grid;
		grid-template-columns: 1fr;
		justify-items: center;
		gap: 2.5rem;
		margin-top: 3em;
		padding: 0;
	}

	.roots-shell-footer__brand {
		max-width: 22rem;
		width: 100%;
	}

	.roots-shell-footer__brand,
	.roots-shell-footer__studios,
	.roots-shell-footer__contact {
		text-align: center;
	}

	.roots-shell-footer__studios {
		grid-template-columns: 1fr;
		justify-content: center;
		justify-items: center;
		width: 100%;
		padding-left: 0;
		gap: 2rem;
	}

	.roots-shell-footer__visma--desktop img,
	.roots-shell-footer__visma--mobile img {
		width: 100%;
		max-width: 9rem;
		height: auto;
	}
}

footer.wp-block-template-part > .wp-block-group.alignfull ~ .wp-block-group.alignfull {
	display: none;
}

/*
 * Live caps content at 1640px via #genesis-content > #modal-ready.
 * The Höyry shell has no #modal-ready, so the checkout block, title and
 * notices sit on the main itself and run full width. Account and
 * order-received keep their own max-width: none override.
 *
 * Groups stay in the width rule so a top-level group matches the editor.
 * Side padding is a separate rule that skips groups, so Block Styles
 * Manager padding is not reset to 0.
 */
body:not(.woocommerce-account):not(.woocommerce-order-received) :is(#genesis-content, .content-sidebar-wrap) > :is(
	.entry-title,
	.woocommerce-message,
	.wp-block-post-title,
	[class*="wp-block-"]:not(.wp-block-woocommerce-checkout):not(.alignfull)
),
body:not(.woocommerce-account):not(.woocommerce-order-received) :is(#genesis-content, .content-sidebar-wrap) :is(
	.entry-title,
	.woocommerce-message
) {
	max-width: 1640px;
	margin-left: auto;
	margin-right: auto;
}

body:not(.woocommerce-account):not(.woocommerce-order-received) :is(#genesis-content, .content-sidebar-wrap) > :is(
	.entry-title,
	.woocommerce-message,
	.wp-block-post-title,
	[class*="wp-block-"]:not(.wp-block-woocommerce-checkout):not(.wp-block-group):not(.alignfull)
),
body:not(.woocommerce-account):not(.woocommerce-order-received) :is(#genesis-content, .content-sidebar-wrap) :is(
	.entry-title,
	.woocommerce-message
) {
	padding-left: 0;
	padding-right: 0;
}

body:not(.woocommerce-account):not(.woocommerce-order-received) :is(#genesis-content, .content-sidebar-wrap) .wp-block-woocommerce-checkout,
body:not(.woocommerce-account):not(.woocommerce-order-received) :is(#genesis-content, .content-sidebar-wrap) .wp-block-woocommerce-checkout.alignwide,
body:not(.woocommerce-account):not(.woocommerce-order-received) :is(#genesis-content, .content-sidebar-wrap) .wp-block-woocommerce-checkout.alignfull {
	max-width: 1640px;
	margin-left: auto;
	margin-right: auto;
	padding-top: 0;
}

@media screen and (max-width: 1680px) {
	body:not(.woocommerce-account):not(.woocommerce-order-received) :is(#genesis-content, .content-sidebar-wrap) .wp-block-woocommerce-checkout {
		max-width: 92%;
	}
}

@media screen and (max-width: 1660px) {
	body:not(.woocommerce-account):not(.woocommerce-order-received) :is(#genesis-content, .content-sidebar-wrap) > :is(
		.entry-title,
		.woocommerce-message,
		.wp-block-post-title,
		[class*="wp-block-"]:not(.wp-block-woocommerce-checkout):not(.wp-block-group):not(.alignfull)
	) {
		padding-left: 4%;
		padding-right: 4%;
	}
}

@media screen and (max-width: 1280px) {
	body:not(.woocommerce-account):not(.woocommerce-order-received) :is(#genesis-content, .content-sidebar-wrap) > :is(
		.entry-title,
		.woocommerce-message,
		.wp-block-post-title,
		[class*="wp-block-"]:not(.wp-block-woocommerce-checkout):not(.wp-block-group):not(.alignfull)
	) {
		padding-left: 5%;
		padding-right: 5%;
	}
}

@media screen and (max-width: 1024px) {
	body:not(.woocommerce-account):not(.woocommerce-order-received) :is(#genesis-content, .content-sidebar-wrap) .wp-block-woocommerce-checkout {
		max-width: calc(100% - 40px);
		padding-right: 20px;
		padding-left: 20px;
	}
}

/*
 * Kassan otsikko seuraa .wp-block-woocommerce-checkout-laatikon reunoja.
 * Otsikko on .content-containerin sisällä eikä mainin suora lapsi, joten
 * yllä olevat reunuspaddingit eivät osu siihen.
 */
body.woocommerce-checkout:not(.woocommerce-account):not(.woocommerce-order-received) :is(#genesis-content, .content-sidebar-wrap) .entry-title {
	max-width: 1640px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 0;
	padding-right: 0;
}

@media screen and (max-width: 1680px) {
	body.woocommerce-checkout:not(.woocommerce-account):not(.woocommerce-order-received) :is(#genesis-content, .content-sidebar-wrap) .entry-title {
		max-width: 92%;
	}
}

@media screen and (max-width: 1024px) {
	body.woocommerce-checkout:not(.woocommerce-account):not(.woocommerce-order-received) :is(#genesis-content, .content-sidebar-wrap) .entry-title {
		max-width: calc(100% - 40px);
		padding-right: 20px;
		padding-left: 20px;
	}
}

/*
 * Ostoskorin otsikko samoihin reunoihin kuin mainin suorat lohkot
 * (.wp-block-woocommerce-cart).
 */
body.woocommerce-cart:not(.woocommerce-account):not(.woocommerce-order-received) :is(#genesis-content, .content-sidebar-wrap) .entry-title {
	max-width: 1640px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 0;
	padding-right: 0;
}

@media screen and (max-width: 1660px) {
	body.woocommerce-cart:not(.woocommerce-account):not(.woocommerce-order-received) :is(#genesis-content, .content-sidebar-wrap) .entry-title {
		padding-left: 4%;
		padding-right: 4%;
	}
}

@media screen and (max-width: 1280px) {
	body.woocommerce-cart:not(.woocommerce-account):not(.woocommerce-order-received) :is(#genesis-content, .content-sidebar-wrap) .entry-title {
		padding-left: 5%;
		padding-right: 5%;
	}
}

/*
 * SEO: a repeated header H1 is demoted to H2 in the mobile cover and in
 * .tilat-intro. Keep the desktop H1 metrics so the type does not shrink.
 */
#genesis-content h2.wp-block-heading.rootshki-seo-demoted-h1,
.entry-content h2.wp-block-heading.rootshki-seo-demoted-h1 {
	font-size: var(--wp--preset--font-size--xxl);
	line-height: 44px;
}

.elementor-widget.tilat-intro h2.elementor-heading-title {
	color: inherit;
	font-size: var(--wp--preset--font-size--xl);
	line-height: 44px;
	font-weight: 700;
	margin-top: 20px;
	margin-bottom: 40px;
}
