/* Force light page chrome — do NOT paint header/footer groups white. */
:root {
	color-scheme: light only;
}

html {
	color-scheme: light only;
	background-color: #ffffff;
}

html,
body {
	background-color: #ffffff;
	color: #111111;
}

/* Keep dark green header/footer surfaces intact (no white boxes inside). */
header.wp-block-template-part .wp-block-group,
header.wp-block-template-part .wp-block-group.has-background,
header.wp-block-template-part .has-base-background-color,
header.wp-block-template-part .has-base-2-background-color,
footer.wp-block-template-part .wp-block-group,
footer.wp-block-template-part .wp-block-group.has-background,
footer.wp-block-template-part .has-base-background-color,
footer.wp-block-template-part .has-base-2-background-color,
footer.wp-block-template-part .ri-site-logo-wrap,
footer.wp-block-template-part .ri-site-logo-wrap--footer {
	background: transparent !important;
	background-color: transparent !important;
}

@media (prefers-color-scheme: dark) {
	:root {
		color-scheme: light only;
	}
	html,
	body {
		background-color: #ffffff;
		color: #111111;
	}
}

.ri-reg-topnav {
	position: absolute;
	top: 12px;
	right: 8px;
	z-index: 99990;
	font-family: inherit;
	display: flex;
	align-items: center;
	gap: 0.55rem;
}

/* Keep WP admin bar above site tools. */
#wpadminbar {
	z-index: 100001 !important;
}

.ri-buyers-info-link {
	display: inline-flex;
	align-items: center;
	margin-right: 0.85rem;
	padding: 0.35rem 0.15rem;
	color: #fff !important;
	text-decoration: none !important;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.15;
	white-space: nowrap;
}

/* Desktop / tablet only — do not change mobile (≤781px) sizes. */
@media (min-width: 782px) {
	.ri-buyers-info-link {
		font-size: 1.05rem;
		padding: 0.4rem 0.2rem;
	}

	.ri-commerce-icons {
		gap: 0.3rem;
	}

	.ri-commerce-icons .wc-block-customer-account__link,
	.ri-commerce-icons .ri-icon-link {
		padding: 0.3rem;
	}

	.ri-commerce-icons .wc-block-customer-account__account-icon,
	.ri-commerce-icons .ri-icon-link svg,
	.ri-commerce-icons svg {
		width: 1.6rem;
		height: 1.6rem;
	}

	.ri-cart-icon__count {
		min-width: 1rem;
		height: 1rem;
		font-size: 0.68rem;
		line-height: 1rem;
	}

	.ri-reg-dropdown__toggle,
	.ri-reg-logout {
		font-size: 1.05rem;
		padding: 0.45rem 0.8rem;
	}
}

.ri-buyers-info-link:hover,
.ri-buyers-info-link:focus {
	color: #f3f3f3 !important;
	text-decoration: underline !important;
	text-underline-offset: 0.18em;
}

/*
 * Footer: brand left, links to the right — inside a content width (not viewport edge).
 */
footer.wp-block-template-part .wp-block-group.alignwide {
	max-width: min(100%, 64rem) !important;
	width: 100% !important;
	margin-left: auto !important;
	margin-right: auto !important;
	box-sizing: border-box !important;
	padding-left: 1.5rem !important;
	padding-right: 1.5rem !important;
}

footer.wp-block-template-part .wp-block-group.alignfull.is-content-justification-space-between.is-layout-flex {
	flex-wrap: nowrap !important;
	justify-content: space-between !important;
	align-items: center !important;
	gap: 1.25rem 2rem !important;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box !important;
}

footer.wp-block-template-part .wp-block-group.alignfull.is-content-justification-space-between > .wp-block-columns {
	flex: 0 0 auto !important;
	min-width: 0 !important;
	order: 1 !important;
	align-self: center !important;
}

footer.wp-block-template-part .wp-block-group.alignfull.is-content-justification-space-between > .ri-site-logo-wrap--footer {
	flex: 1 1 auto !important;
	order: 2 !important;
	align-self: center !important;
}

footer.wp-block-template-part .wp-block-group.alignfull.is-content-justification-space-between > .wp-block-group {
	flex: 0 0 auto !important;
	min-width: 0 !important;
	max-width: 100% !important;
	margin-left: 0 !important;
	order: 3 !important;
	align-self: center !important;
}

footer.wp-block-template-part .wp-block-navigation.is-vertical .wp-block-navigation-item {
	white-space: nowrap;
}

@media (max-width: 781px) {
	footer.wp-block-template-part .wp-block-group.alignfull.is-content-justification-space-between.is-layout-flex {
		flex-wrap: wrap !important;
		justify-content: center !important;
	}

	footer.wp-block-template-part .wp-block-group.alignfull.is-content-justification-space-between > .wp-block-columns,
	footer.wp-block-template-part .wp-block-group.alignfull.is-content-justification-space-between > .ri-site-logo-wrap--footer,
	footer.wp-block-template-part .wp-block-group.alignfull.is-content-justification-space-between > .wp-block-group {
		flex: 1 1 100% !important;
		order: 0 !important;
		margin-left: 0 !important;
		justify-content: center;
		text-align: center;
	}

	footer.wp-block-template-part .wp-block-group.alignfull.is-content-justification-space-between > .ri-site-logo-wrap--footer {
		order: -1 !important;
	}
}

/* Desktop: Buyers Info stays in the topbar (left of account). */
.wp-block-navigation-item.ri-nav-buyers-info {
	display: none !important;
}

/* Mobile / hamburger: hide topbar Buyers Info; keep it only in the menu. */
@media (max-width: 781px) {
	.ri-buyers-info-link {
		display: none !important;
	}

	.wp-block-navigation-item.ri-nav-buyers-info {
		display: flex !important;
	}
}

.ri-commerce-icons {
	display: inline-flex;
	align-items: center;
	gap: 0.2rem;
}

.ri-commerce-icons .wp-block-woocommerce-customer-account {
	display: inline-flex !important;
	align-items: center;
	line-height: 1;
}

.ri-commerce-icons .wc-block-customer-account__link,
.ri-commerce-icons .ri-icon-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	padding: 0.25rem;
	color: #fff;
	background: transparent;
	border: 0;
	text-decoration: none;
	cursor: pointer;
	line-height: 1;
}

.ri-commerce-icons .wc-block-customer-account__link:hover,
.ri-commerce-icons .wc-block-customer-account__link:focus,
.ri-commerce-icons .ri-icon-link:hover,
.ri-commerce-icons .ri-icon-link:focus {
	color: #f3f3f3;
}

.ri-commerce-icons .wc-block-customer-account__account-icon,
.ri-commerce-icons .ri-icon-link svg,
.ri-commerce-icons svg {
	width: 1.35rem;
	height: 1.35rem;
	display: block;
}

.ri-cart-icon__count {
	position: absolute;
	top: -2px;
	right: -4px;
	min-width: 0.9rem;
	height: 0.9rem;
	padding: 0 0.15rem;
	border-radius: 999px;
	background: #fff;
	color: #073507;
	font-size: 0.62rem;
	font-weight: 700;
	line-height: 0.9rem;
	text-align: center;
}

/* Logged-in buyer: hover menu on account icon. */
.ri-buyer-menu {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.ri-buyer-menu__panel {
	position: absolute;
	top: calc(100% + 2px);
	right: 0;
	min-width: min(260px, 80vw);
	margin: 0;
	padding: 0.5rem 0;
	list-style: none;
	background: #fff;
	border: 1px solid #d5d5d5;
	border-radius: 6px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(4px);
	transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
	z-index: 100001;
	overflow: auto;
	max-height: 70vh;
}

/* Invisible bridge so the menu stays open while moving the cursor down. */
.ri-buyer-menu__panel::before {
	content: "";
	position: absolute;
	top: -16px;
	left: -12px;
	right: -12px;
	height: 18px;
}

.ri-buyer-menu:hover .ri-buyer-menu__panel,
.ri-buyer-menu:focus-within .ri-buyer-menu__panel,
.ri-buyer-menu.is-open .ri-buyer-menu__panel {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

.ri-buyer-menu__toggle {
	appearance: none;
	-webkit-appearance: none;
	font: inherit;
}

.ri-buyer-menu__label {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	padding: 0.7rem 0.9rem;
	color: #fff;
	font-size: 1.15rem;
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: 0;
	text-align: center;
	text-transform: none;
	background: #ff8c00;
	border-bottom: 1px solid #e67a00;
	margin-bottom: 0.15rem;
}

.ri-buyer-menu__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	background: #fff;
	color: #ff8c00;
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1;
	flex-shrink: 0;
}

.ri-buyer-menu__name {
	color: #fff;
	font-weight: 400;
}

.ri-buyer-menu__panel a {
	display: block;
	padding: 0.55rem 0.9rem;
	color: #111;
	background: transparent;
	text-decoration: none;
	font-size: 1rem;
	line-height: 1.35;
	border: 0;
	outline: none;
	box-shadow: none;
}

.ri-buyer-menu__panel a:focus,
.ri-buyer-menu__panel a:focus-visible {
	background: transparent;
	outline: none;
	box-shadow: none;
	text-decoration: none;
}

.ri-buyer-menu__panel a:hover,
.ri-buyer-menu__panel a:hover:focus,
.ri-buyer-menu__panel a:hover:focus-visible {
	background: var(--ri-btn-green, #82b541);
	color: #fff;
	text-decoration: none;
}

/* Hide WooCommerce icons beside the brand / main menu — tools bar has our cart. */
header .wp-block-woocommerce-customer-account,
header .wp-block-woocommerce-mini-cart,
header .wc-block-mini-cart,
header .wc-block-mini-cart__button,
header .wp-block-woocommerce-cart-link,
header .wc-block-cart-link,
.ri-header-left .wp-block-woocommerce-customer-account,
.ri-header-left .wp-block-woocommerce-mini-cart,
.ri-header-left .wc-block-mini-cart,
.ri-header-left .wp-block-woocommerce-cart-link,
.ri-header-left .wc-block-cart-link,
.ri-header-bar .wp-block-woocommerce-customer-account,
.ri-header-bar .wp-block-woocommerce-mini-cart,
.ri-header-bar .wc-block-mini-cart,
.ri-header-bar .wp-block-woocommerce-cart-link,
.ri-header-bar .wc-block-cart-link,
.wp-block-template-part[class*="header"] .wp-block-woocommerce-mini-cart,
.wp-block-template-part[class*="header"] .wc-block-mini-cart,
.wp-block-template-part[class*="header"] .wp-block-woocommerce-cart-link,
.wp-block-template-part[class*="header"] .wc-block-cart-link {
	display: none !important;
}

/* Language switcher lives in the footer (header stays free for tools). */
.ri-footer-lang {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 0.65rem 1rem 1rem;
	background: transparent;
}

.ri-lang-switch {
	display: flex;
	align-items: center;
	gap: 0.1rem;
	list-style: none;
	margin: 0;
	padding: 0.08rem;
	background: rgba(7, 53, 7, 0.06);
	border: 1px solid rgba(7, 53, 7, 0.22);
	border-radius: 3px;
}

.ri-lang-switch li {
	margin: 0;
	padding: 0;
}

.ri-lang-switch a {
	display: inline-flex;
	align-items: center;
	gap: 0.18rem;
	padding: 0.16rem 0.3rem;
	border-radius: 2px;
	color: #073507;
	text-decoration: none;
	font-size: 0.6rem;
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
}

.ri-lang-switch a:hover,
.ri-lang-switch a:focus {
	background: rgba(7, 53, 7, 0.1);
	color: #073507;
}

.ri-lang-switch li.is-current a {
	background: rgba(7, 53, 7, 0.16);
	color: #073507;
}

.ri-lang-switch__flag {
	display: inline-flex;
	width: 11px;
	height: 8px;
	overflow: hidden;
	line-height: 0;
}

.ri-lang-switch__flag img {
	display: block;
	width: 11px;
	height: 8px;
	object-fit: cover;
}

.ri-lang-switch__code {
	letter-spacing: 0.02em;
}

.ri-reg-dropdown {
	position: relative;
	/* Nudge Register toward the right edge without moving account/cart. */
	margin-right: -10px;
}

.ri-reg-logout {
	display: inline-flex;
	align-items: center;
	text-decoration: none !important;
	cursor: pointer;
	user-select: none;
	background: transparent !important;
	background-image: none !important;
	color: #fff !important;
	border: 0;
	border-radius: 3px;
	padding: 0.42rem 0.75rem;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.15;
	margin-right: -10px;
}

.ri-reg-logout:hover,
.ri-reg-logout:focus {
	background: rgba(255, 255, 255, 0.16) !important;
	color: #fff !important;
}

.ri-reg-dropdown__toggle {
	list-style: none;
	cursor: pointer;
	user-select: none;
	background: transparent !important;
	background-image: none !important;
	color: #fff !important;
	border: 0;
	border-radius: 3px;
	padding: 0.42rem 0.75rem;
	font-weight: 400;
	font-size: 0.9rem;
	line-height: 1.15;
}

.ri-reg-dropdown__label--short {
	display: none;
}

@media (max-width: 781px) {
	.ri-reg-dropdown__label--full {
		display: none;
	}

	.ri-reg-dropdown__label--short {
		display: inline;
	}
}

.ri-reg-dropdown__toggle::-webkit-details-marker {
	display: none;
}

.ri-reg-dropdown__toggle::after {
	content: " ▾";
	font-size: 0.8em;
}

.ri-reg-dropdown__toggle:hover,
.ri-reg-dropdown__toggle:focus,
.ri-reg-dropdown[open] .ri-reg-dropdown__toggle {
	background: rgba(255, 255, 255, 0.16) !important;
	background-image: none !important;
	color: #fff !important;
	filter: none;
}

.ri-reg-dropdown__menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	min-width: min(260px, 80vw);
	margin: 0;
	padding: 0.5rem 0;
	list-style: none;
	background: #fff;
	border: 1px solid #d5d5d5;
	border-radius: 6px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	overflow: auto;
	max-height: 70vh;
	z-index: 100001;
}

.ri-reg-dropdown__menu a {
	display: block;
	padding: 0.55rem 0.9rem;
	color: #111;
	background: transparent;
	text-decoration: none;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.35;
	border: 0;
	outline: none;
	box-shadow: none;
}

.ri-reg-dropdown__menu a:focus,
.ri-reg-dropdown__menu a:focus-visible {
	background: transparent;
	outline: none;
	box-shadow: none;
	text-decoration: none;
}

.ri-reg-dropdown__menu a:hover,
.ri-reg-dropdown__menu a:hover:focus,
.ri-reg-dropdown__menu a:hover:focus-visible {
	background: var(--ri-btn-green, #82b541);
	color: #fff;
	text-decoration: none;
}

/* Author centrum: horizontal category links. */
.ri-author-cats {
	display: flex !important;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.5rem;
	margin: 1.25rem 0 1.75rem !important;
	padding: 0.85rem 0;
	border-top: 1px solid #ddd;
	border-bottom: 1px solid #ddd;
}

.ri-author-cats__item {
	margin: 0 !important;
}

.ri-author-cats__item a {
	color: #073507;
	font-weight: 700;
	text-decoration: none;
}

.ri-author-cats__item a:hover,
.ri-author-cats__item a:focus {
	text-decoration: underline;
}

.ri-author-cats__item.is-active a {
	text-decoration: underline;
}

/* Keep clear of WP admin bar when logged in. */
body.admin-bar .ri-reg-topnav {
	top: 46px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .ri-reg-topnav {
		top: 60px;
	}

	.ri-reg-topnav {
		top: 8px;
		right: 4px;
		flex-direction: column;
		align-items: flex-end;
		gap: 0.15rem;
	}

	.ri-reg-topnav .ri-reg-dropdown,
	.ri-reg-topnav .ri-reg-logout {
		order: 1;
		margin-right: -12px;
	}

	.ri-reg-topnav .ri-commerce-icons {
		order: 2;
		gap: 0.35rem;
		margin-right: 0;
	}

	.ri-lang-switch a {
		padding: 0.14rem 0.26rem;
		font-size: 0.56rem;
	}
}
