/**
 * EcoGlow: rules theme.json cannot express.
 * Tokens come from theme.json custom properties (--wp--preset--*, --wp--custom--*).
 */

/* ---------- Type details ---------- */

h1, h2, h3, h4, h5, h6,
.wp-block-site-title {
	font-stretch: 88%;
	text-wrap: balance;
}

h1 {
	font-stretch: 82%;
}

p {
	text-wrap: pretty;
}

::selection {
	background: var(--wp--preset--color--pollen);
	color: var(--wp--preset--color--fern);
}

/* ---------- Focus & accessibility ---------- */

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--pollen);
	outline-offset: 3px;
	border-radius: 4px;
}

.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--pollen);
	color: var(--wp--preset--color--fern);
	font-weight: 600;
}

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

/* ---------- Buttons ---------- */

.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--fern);
	border-color: var(--wp--preset--color--fern);
}

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

.wp-element-button,
.wp-block-button__link {
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* ---------- Header ---------- */

.eg-notice p {
	margin: 0;
}

.eg-brand__icon {
	margin: 0;
	flex-shrink: 0;
}

.eg-primary-nav .wp-block-navigation-item.current-menu-item > a {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--pollen);
	text-decoration-thickness: 4px;
	text-underline-offset: 8px;
}

.eg-primary-nav .wp-block-navigation-item > a:hover {
	text-decoration-color: var(--wp--preset--color--moss);
	text-decoration-thickness: 2px;
	text-underline-offset: 8px;
}

/* Mobile overlay menu: large, easy tap targets. */
.eg-primary-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--daylight);
	padding: var(--wp--preset--spacing--50) var(--wp--custom--gutter);
}

.eg-primary-nav .is-menu-open .wp-block-navigation__responsive-container-content,
.eg-primary-nav .is-menu-open .wp-block-navigation__container {
	align-items: flex-start !important;
	gap: 1.1rem;
}

.eg-primary-nav .is-menu-open .wp-block-navigation-item > a {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	font-stretch: 88%;
}

/* Below the overlay breakpoint, push the menu button to the far right, after the account and basket icons. */
@media (max-width: 599px) {
	.eg-header .alignwide {
		gap: 0.25rem;
	}

	.eg-brand {
		margin-right: auto;
	}

	.eg-primary-nav {
		order: 3;
	}
}

/* Tablet: brand and icons on the first row, the menu on its own row below. */
@media (min-width: 600px) and (max-width: 1023px) {
	.eg-header .alignwide {
		flex-wrap: wrap !important;
		row-gap: 0.75rem;
	}

	.eg-brand {
		margin-right: auto;
	}

	.eg-primary-nav {
		order: 3;
		flex-basis: 100%;
	}

	.eg-primary-nav .wp-block-navigation__container {
		justify-content: flex-start;
		gap: 1.5rem;
	}
}

.wc-block-mini-cart__badge {
	background: var(--wp--preset--color--pollen) !important;
	color: var(--wp--preset--color--fern) !important;
	font-weight: 700;
}

/* ---------- Footer ---------- */

.eg-footer .wp-block-site-title a {
	color: var(--wp--preset--color--daylight);
}

.eg-footer__tagline {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 650;
	font-stretch: 88%;
	color: var(--wp--preset--color--daylight);
}

.eg-footer__heading {
	font-family: var(--wp--preset--font-family--body);
	font-stretch: 100%;
	font-weight: 700;
	margin-bottom: 0.9rem;
}

@media (max-width: 781px) {
	.eg-footer .wp-block-columns {
		row-gap: var(--wp--preset--spacing--50);
	}
}

.eg-footer__links {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 0.55rem;
}

.eg-footer a {
	text-decoration: none;
}

.eg-footer a:hover {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--pollen);
	text-underline-offset: 4px;
}

.eg-footer__rule {
	border-color: rgba(231, 238, 233, 0.25) !important;
	opacity: 1;
}

.eg-footer__legal {
	color: var(--wp--preset--color--fern-light);
	opacity: 0.85;
}

/* ---------- Journal cards & prose ---------- */

.eg-post-card .wp-block-post-featured-image img {
	border-radius: var(--wp--custom--radius--medium);
}

.eg-post-card .wp-block-post-title a:hover {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--pollen);
	text-decoration-thickness: 3px;
	text-underline-offset: 5px;
}

.eg-post-card .wp-block-post-excerpt__excerpt {
	margin: 0;
}

.eg-prose > * + h2,
.eg-prose > * + h3,
.eg-prose > * + h4 {
	margin-top: var(--wp--preset--spacing--50);
}

.eg-prose {
	font-size: 1.125rem;
	line-height: 1.7;
}

/* ---------- Search ---------- */

.eg-search .wp-block-search__input {
	border: 2px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--pill);
	padding: 0.75rem 1.25rem;
	font: inherit;
}

.eg-search .wp-block-search__button {
	margin-left: 0.5rem;
}

/* ---------- Full-width sections sit flush against each other and the footer ---------- */

.wp-block-post-content > .alignfull + .alignfull,
.wp-site-blocks > footer {
	margin-block-start: 0;
}

/* ---------- Home: hero (the one bold moment: the sun behind the photo) ---------- */

.eg-lead-line {
	font-weight: 600;
	margin-bottom: 0;
}

.eg-hero__title {
	font-stretch: 80%;
	line-height: 0.92;
	letter-spacing: -0.025em;
}

.eg-hero__lede {
	max-width: 44ch;
	color: #2e4a3b;
}

.eg-hero__media {
	position: relative;
	isolation: isolate;
}

.eg-sun {
	position: relative;
	margin: 0;
}

.eg-sun::before {
	content: "";
	position: absolute;
	z-index: -1;
	width: 62%;
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--wp--preset--color--pollen);
	top: -9%;
	right: -5%;
}

.eg-sun img {
	border-radius: 28px;
	width: 100%;
}

@media (max-width: 781px) {
	.eg-sun::before {
		right: -3%;
		width: 55%;
	}
}

/* ---------- Home: categories & reasons ---------- */

.eg-cat-card {
	position: relative;
}

.eg-cat-card .wp-block-image {
	margin: 0;
	width: 100%;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--medium);
}

.eg-cat-card .wp-block-image img {
	width: 100%;
	transition: transform 0.4s ease;
}

.eg-cat-card__title a {
	color: var(--wp--preset--color--fern);
	text-decoration: none;
}

/* The whole card is clickable through the heading link. */
.eg-cat-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.eg-cat-card:hover .wp-block-image img {
	transform: scale(1.03);
}

.eg-cat-card:hover .eg-cat-card__title a,
.eg-cat-card__title a:focus-visible {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--pollen);
	text-decoration-thickness: 3px;
	text-underline-offset: 5px;
}

.eg-cat-card p,
.eg-reason p {
	margin: 0;
}

.eg-reason .wp-block-image {
	margin: 0;
}

@media (max-width: 599px) {
	.eg-cat-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 1.25rem 0.9rem !important;
	}

	.eg-cat-card .eg-cat-card__title {
		font-size: 1.05rem;
	}

	.eg-cat-card p {
		font-size: var(--wp--preset--font-size--small);
	}
}

/* ---------- About ---------- */

.eg-statement {
	border-top: 3px solid var(--wp--preset--color--fern);
	padding-top: var(--wp--preset--spacing--40);
}

.eg-statement p {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 500;
	font-stretch: 92%;
	line-height: 1.3;
}

.eg-value {
	border-top: 1px solid var(--wp--preset--color--line);
	padding-top: var(--wp--preset--spacing--30);
}

.eg-value p {
	margin: 0;
	color: var(--wp--preset--color--muted);
}

[id] {
	scroll-margin-top: 2rem;
}

/* ---------- FAQ ---------- */

.eg-faq summary {
	cursor: pointer;
	list-style: none;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 650;
	font-stretch: 92%;
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.25rem 0;
}

.eg-faq summary::-webkit-details-marker {
	display: none;
}

.eg-faq summary::after {
	content: "+";
	font-family: var(--wp--preset--font-family--body);
	font-weight: 400;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--wp--preset--color--moss);
	flex-shrink: 0;
}

.eg-faq[open] summary::after {
	content: "\2212";
}

.eg-faq[open] summary {
	margin-bottom: 0.5rem;
}

.eg-faq p {
	margin: 0;
	max-width: 65ch;
}

/* ---------- Contact & newsletter ---------- */

.eg-contact-card p {
	margin: 0;
}

.eg-newsletter p {
	color: var(--wp--preset--color--fern-light);
}

/* ---------- Forms (Fluent Forms inside [ecoglow_form]) ---------- */

.eg-form .ff-el-input--label label {
	font-weight: 600;
	font-size: 0.95rem;
}

.eg-form .ff-el-form-control {
	font: inherit;
	font-size: 1rem;
	color: var(--wp--preset--color--fern);
	background: var(--wp--preset--color--daylight);
	border: 1.5px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--small);
	padding: 0.8rem 1rem;
	min-height: 3rem;
}

.eg-form .ff-el-form-control::placeholder {
	color: #66736a; /* 4.97:1 on white */
}

.eg-form .ff-el-form-control:focus {
	border-color: var(--wp--preset--color--fern);
	outline: 3px solid var(--wp--preset--color--pollen);
	outline-offset: 1px;
	box-shadow: none;
}

.eg-form .ff-el-is-error .ff-el-form-control {
	border-color: #b3261e;
}

.eg-form .error.text-danger {
	color: #b3261e;
	font-size: 0.875rem;
	margin-top: 0.35rem;
}

.eg-form input[type="checkbox"] {
	accent-color: var(--wp--preset--color--fern);
	width: 1.1rem;
	height: 1.1rem;
}

.eg-form .ff-btn-submit {
	font: inherit;
	font-weight: 600 !important;
	font-size: 1rem !important;
	border-radius: var(--wp--custom--radius--pill) !important;
	padding: 0.85rem 1.75rem !important;
	background-color: var(--wp--preset--color--fern) !important;
	color: var(--wp--preset--color--daylight) !important;
	border: 2px solid var(--wp--preset--color--fern) !important;
}

.eg-form .ff-btn-submit:hover {
	background-color: var(--wp--preset--color--moss) !important;
	border-color: var(--wp--preset--color--moss) !important;
	opacity: 1;
}

.eg-form .ff-message-success {
	border: 2px solid var(--wp--preset--color--fern);
	border-radius: var(--wp--custom--radius--medium);
	background: var(--wp--preset--color--mist);
	color: var(--wp--preset--color--fern);
	box-shadow: none;
	padding: 1.25rem 1.5rem;
}

/* Newsletter sits on dark green: light labels, sun-yellow button. */
.eg-form--newsletter .ff-el-input--label label,
.eg-form--newsletter .ff_t_c,
.eg-form--newsletter .ff-el-tc label {
	color: var(--wp--preset--color--fern-light);
}

.eg-form--newsletter .ff_t_c a,
.eg-form--newsletter .ff-el-tc a {
	color: var(--wp--preset--color--daylight);
}

.eg-form--newsletter input[type="checkbox"] {
	accent-color: var(--wp--preset--color--pollen);
}

.eg-form--newsletter .ff-btn-submit {
	background-color: var(--wp--preset--color--pollen) !important;
	border-color: var(--wp--preset--color--pollen) !important;
	color: var(--wp--preset--color--fern) !important;
}

.eg-form--newsletter .ff-btn-submit:hover {
	background-color: var(--wp--preset--color--daylight) !important;
	border-color: var(--wp--preset--color--daylight) !important;
}

.eg-form--newsletter .error.text-danger {
	color: #ffd2cc;
}

/* ---------- Shop: category pills, sort row ---------- */

.eg-chips {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.eg-chips a {
	display: inline-block;
	padding: 0.5rem 1rem;
	border: 1.5px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--pill);
	color: var(--wp--preset--color--fern);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-decoration: none;
}

.eg-chips a:hover {
	border-color: var(--wp--preset--color--fern);
}

.eg-chips a[aria-current="page"] {
	background: var(--wp--preset--color--fern);
	border-color: var(--wp--preset--color--fern);
	color: var(--wp--preset--color--daylight);
}

.eg-delivery-note {
	margin: 0;
	color: var(--wp--preset--color--muted);
}

.eg-sort-row {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}

.eg-sort-row select {
	font: inherit;
	padding: 0.45rem 2rem 0.45rem 0.75rem;
	border: 1.5px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--small);
	background-color: var(--wp--preset--color--daylight);
	color: var(--wp--preset--color--fern);
}

.wc-block-breadcrumbs,
.woocommerce-breadcrumb {
	color: var(--wp--preset--color--muted);
}

/* ---------- Product cards ---------- */

.eg-product-card {
	height: 100%;
	background: var(--wp--preset--color--daylight);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--large);
	padding: 0.75rem 0.75rem 1.1rem;
}

.eg-product-card > * {
	width: 100%;
	margin: 0;
}

.eg-product-card .wc-block-components-product-image {
	margin: 0 !important;
}

.eg-product-card .wc-block-components-product-image img {
	border-radius: var(--wp--custom--radius--medium);
	aspect-ratio: 1;
	object-fit: cover;
}

.eg-product-card .wp-block-post-title {
	padding: 0 0.35rem;
	margin-top: 0.4rem !important;
}

.eg-product-card .wp-block-post-title a {
	color: var(--wp--preset--color--fern);
	text-decoration: none;
}

.eg-product-card .wp-block-post-title a:hover {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--pollen);
	text-decoration-thickness: 3px;
	text-underline-offset: 4px;
}

.eg-product-card .wp-block-woocommerce-product-summary {
	padding: 0 0.35rem;
	line-height: 1.45;
}

.eg-product-card .wc-block-components-product-summary {
	padding: 0;
}

.eg-product-card .wc-block-components-product-summary p {
	margin: 0;
}

.eg-product-card__buy {
	margin-top: auto !important;
	padding: 0.5rem 0.35rem 0;
	align-items: center;
}

.eg-price .wc-block-components-product-price,
.eg-product-card .wc-block-components-product-price {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 750;
	font-stretch: 88%;
	font-size: 1.3rem;
	color: var(--wp--preset--color--fern);
	margin: 0 !important;
}

.eg-product-card .wc-block-components-product-button {
	margin: 0 !important;
	align-items: flex-end;
}

.eg-product-card .wp-block-button__link,
.eg-product-card .wc-block-components-product-button__button {
	font-size: 0.9rem !important;
	padding: 0.65rem 1rem !important;
	margin: 0 !important;
	white-space: nowrap;
	border-radius: var(--wp--custom--radius--pill) !important;
}

.eg-product-card .added_to_cart {
	font-size: var(--wp--preset--font-size--small);
	margin-top: 0.35rem;
}

/* ---------- Single product ---------- */

.eg-product__summary .wp-block-post-terms a {
	text-decoration: none;
	font-weight: 600;
}

.eg-product__summary .wp-block-post-excerpt__excerpt {
	margin: 0;
}

.eg-product__summary .quantity .qty {
	border: 1.5px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--small);
	padding: 0.7rem 0.5rem;
	font: inherit;
	width: 4.5rem;
}

.eg-product__summary .single_add_to_cart_button {
	background: var(--wp--preset--color--fern) !important;
	color: var(--wp--preset--color--daylight) !important;
	border: 2px solid var(--wp--preset--color--fern) !important;
	border-radius: var(--wp--custom--radius--pill) !important;
	font-weight: 600;
	padding: 0.85rem 1.75rem !important;
}

.eg-product__summary .single_add_to_cart_button:hover {
	background: var(--wp--preset--color--moss) !important;
	border-color: var(--wp--preset--color--moss) !important;
}

.eg-product__gallery .wp-block-woocommerce-product-image-gallery {
	max-width: none;
}

.eg-product__gallery .woocommerce-product-gallery {
	width: 100% !important;
	float: none !important;
}

.eg-product__summary > * + * {
	margin-block-start: 1.1rem;
}

.eg-product__gallery .woocommerce-product-gallery__image img,
.eg-product__gallery .flex-viewport {
	border-radius: var(--wp--custom--radius--large);
}

.eg-product__gallery .flex-control-thumbs {
	display: flex;
	gap: 0.75rem;
	margin-top: 0.75rem !important;
}

.eg-product__gallery .flex-control-thumbs li img {
	border-radius: var(--wp--custom--radius--small);
}

/* Refill-shop specification label. */
.eg-refill {
	position: relative;
	border: 2px solid var(--wp--preset--color--fern);
	border-radius: var(--wp--custom--radius--small);
	padding: 1rem 1.15rem 0.9rem;
	max-width: 26rem;
	background: var(--wp--preset--color--daylight);
}

.eg-refill::before {
	content: "";
	position: absolute;
	top: 0.9rem;
	right: 0.9rem;
	width: 0.65rem;
	height: 0.65rem;
	border-radius: 50%;
	border: 2px solid var(--wp--preset--color--fern);
}

.eg-refill__name {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-stretch: 90%;
	font-size: 1.15rem;
	margin: 0 1.5rem 0.6rem 0;
}

.eg-refill dl {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.3rem 1rem;
	margin: 0;
	font-size: 0.92rem;
}

.eg-refill dt {
	color: var(--wp--preset--color--muted);
}

.eg-refill dd {
	margin: 0;
	font-weight: 600;
}

.eg-refill__big {
	font-family: var(--wp--preset--font-family--display);
	font-size: 2rem;
	font-weight: 780;
	font-stretch: 82%;
	line-height: 1;
	border-top: 2px dashed var(--wp--preset--color--fern);
	margin: 0.75rem 0 0;
	padding-top: 0.55rem;
}

.eg-refill__note {
	margin: 0.6rem 0 0;
	font-size: 0.8rem;
	color: var(--wp--preset--color--muted);
}

/* Description tab. */
.eg-product-details {
	margin-top: var(--wp--preset--spacing--60) !important;
}

.eg-product-details .wc-tabs li a {
	font-weight: 600;
	text-decoration: none;
	color: var(--wp--preset--color--fern);
}

.eg-product-details .wc-tabs li.active a {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--pollen);
	text-decoration-thickness: 4px;
	text-underline-offset: 10px;
}

.eg-product-details .woocommerce-Tabs-panel {
	max-width: 720px;
	font-size: 1.0625rem;
	line-height: 1.7;
}

.eg-product-details .woocommerce-Tabs-panel > h2:first-child {
	display: none;
}

.eg-product-details .woocommerce-Tabs-panel h2 {
	font-size: var(--wp--preset--font-size--large);
	margin-top: var(--wp--preset--spacing--40);
}

/* ---------- Basket & checkout ---------- */

.wc-block-cart .wc-block-components-button:not(.is-link),
.wc-block-checkout .wc-block-components-checkout-place-order-button,
.wc-block-mini-cart__footer .wc-block-components-button {
	border-radius: var(--wp--custom--radius--pill);
	font-weight: 600;
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
.wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 750;
	font-stretch: 88%;
}
