/* Empire Homeowner Guides — front end.
 *
 * Layout rules are scoped to #ewg-primary and use !important only on the layout
 * primitives (width, centering, display) so Elementor/theme containers can't push
 * the guide to the left or squeeze it. Fonts are inherited from the theme.
 */

.ewg,
.ewg-cta,
.ewg-library,
.ewg-hub-index {
	--ewg-accent: #0b3c74;
	--ewg-text: #1f2933;
	--ewg-muted: #5b6875;
	--ewg-border: #dfe4ea;
	--ewg-soft: #f4f7fa;
	--ewg-radius: 10px;
}

/* ------------------------------------------------------------------ */
/* Layout shell                                                        */
/* ------------------------------------------------------------------ */

#ewg-primary {
	display: block !important;
	float: none !important;
	clear: both;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 0 72px !important;
	box-sizing: border-box;
	color: var(--ewg-text);
	font-size: 17px;
	line-height: 1.7;
	text-align: left;
	overflow-wrap: break-word;
}

/* Every wrapper the theme puts around the guide must span the page. Elementor/theme
   wrappers that are flex items with align-items:flex-start shrink to their content,
   which is what pushed guides to the left. */
body.ewg-guide-page :has(> #ewg-primary),
body.ewg-guide-page :has(#ewg-primary) {
	align-self: stretch !important;
	justify-self: stretch !important;
	min-width: 0;
}

#ewg-primary *,
#ewg-primary *::before,
#ewg-primary *::after {
	box-sizing: border-box;
}

#ewg-primary .ewg-container {
	display: block;
	float: none !important;
	width: 100% !important;
	max-width: 1200px !important;
	margin-left: auto !important;
	margin-right: auto !important;
	padding-left: 24px;
	padding-right: 24px;
}

#ewg-primary .ewg-container--narrow {
	max-width: 880px !important;
}

@media (max-width: 600px) {
	#ewg-primary .ewg-container {
		padding-left: 16px;
		padding-right: 16px;
	}
}

/* Title band */
#ewg-primary .ewg-hero {
	width: 100%;
	margin: 0 0 40px;
	padding: 28px 0 32px;
	background: var(--ewg-soft);
	border-top: 1px solid var(--ewg-border);
	border-bottom: 1px solid var(--ewg-border);
}

#ewg-primary.ewg-single .ewg-hero .ewg-container {
	/* Line the title up with the article column below it. */
	max-width: 1200px !important;
}

#ewg-primary .ewg-hero .ewg-title {
	max-width: 860px;
}

/* Article + sidebar */
#ewg-primary .ewg-layout {
	display: block;
}

#ewg-primary .ewg-article {
	min-width: 0;
	max-width: 780px;
	margin: 0;
	padding: 0;
}

#ewg-primary .ewg-container--narrow .ewg-article {
	max-width: none;
}

#ewg-primary .ewg-sidebar {
	display: none;
}

@media (min-width: 1080px) {
	#ewg-primary .ewg-layout--sidebar {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) 300px;
		gap: 56px;
		align-items: start;
	}

	#ewg-primary .ewg-layout--sidebar .ewg-sidebar {
		display: block;
		align-self: stretch; /* full column height, so the inner box can stick */
	}

	#ewg-primary .ewg-layout--sidebar .ewg-toc--inline {
		display: none;
	}
}

@media (max-width: 1079px) {
	#ewg-primary .ewg-article {
		max-width: 780px;
		margin: 0 auto;
	}
}

#ewg-primary .ewg-sidebar__inner {
	position: sticky;
	top: 32px;
}

body.admin-bar #ewg-primary .ewg-sidebar__inner {
	top: 64px;
}

/* ------------------------------------------------------------------ */
/* Typography                                                          */
/* ------------------------------------------------------------------ */

#ewg-primary p,
#ewg-primary li,
#ewg-primary td,
#ewg-primary th,
#ewg-primary dd {
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}

#ewg-primary p {
	margin: 0 0 1.15em;
}

#ewg-primary h1,
#ewg-primary h2,
#ewg-primary h3,
#ewg-primary h4 {
	color: var(--ewg-text);
	text-align: left;
	letter-spacing: normal;
	text-transform: none;
}

#ewg-primary .ewg-title {
	margin: 10px 0 10px;
	font-size: clamp(30px, 22px + 2vw, 46px);
	line-height: 1.15;
}

#ewg-primary .ewg-content h2 {
	margin: 1.9em 0 0.6em;
	font-size: clamp(24px, 20px + 0.8vw, 30px);
	line-height: 1.25;
	scroll-margin-top: 24px;
}

#ewg-primary .ewg-content h3 {
	margin: 1.6em 0 0.5em;
	font-size: 21px;
	font-weight: 700;
	line-height: 1.3;
	scroll-margin-top: 24px;
}

#ewg-primary .ewg-content > :first-child {
	margin-top: 0;
}

#ewg-primary .ewg-content ul,
#ewg-primary .ewg-content ol {
	margin: 0 0 1.25em;
	padding-left: 1.4em;
}

#ewg-primary .ewg-content li {
	margin: 0.35em 0;
}

#ewg-primary .ewg-content a,
#ewg-primary .ewg-faq a {
	color: var(--ewg-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

#ewg-primary .ewg-content a:hover,
#ewg-primary .ewg-faq a:hover {
	text-decoration-thickness: 2px;
}

#ewg-primary .ewg-meta {
	margin: 0;
	font-size: 14px;
	color: var(--ewg-muted);
}

#ewg-primary .ewg-eyebrow,
.ewg-eyebrow {
	display: inline-block;
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ewg-accent);
}

#ewg-primary .ewg-intro {
	max-width: 760px;
	margin-top: 8px;
	font-size: 18px;
	color: var(--ewg-muted);
}

#ewg-primary .ewg-intro p:last-child {
	margin-bottom: 0;
}

/* Breadcrumbs */
#ewg-primary .ewg-breadcrumbs ol {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	margin: 0 0 18px;
	padding: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--ewg-muted);
}

#ewg-primary .ewg-breadcrumbs li {
	margin: 0;
	padding: 0;
}

#ewg-primary .ewg-breadcrumbs li + li::before {
	content: "/";
	margin: 0 8px;
	opacity: 0.5;
}

#ewg-primary .ewg-breadcrumbs a {
	color: inherit;
	text-decoration: none;
}

#ewg-primary .ewg-breadcrumbs a:hover {
	color: var(--ewg-accent);
	text-decoration: underline;
}

/* Badges */
.ewg-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	background: #fff;
	color: var(--ewg-accent);
	border: 1px solid var(--ewg-border);
}

.ewg-badge--problem { background: #fff4e5; color: #8a4b00; border-color: #f6d7a8; }
.ewg-badge--comparison { background: #eaf3ff; color: #0b4a8f; border-color: #c4dbf7; }
.ewg-badge--data { background: #ecf8f1; color: #17633b; border-color: #bfe5cf; }
.ewg-badge--guide { background: #f3effc; color: #563a9c; border-color: #d9cdf3; }

/* ------------------------------------------------------------------ */
/* Components                                                          */
/* ------------------------------------------------------------------ */

/* Quick answer */
#ewg-primary .ewg-quick-answer {
	margin: 0 0 32px;
	padding: 20px 24px;
	background: #fff;
	border: 1px solid var(--ewg-border);
	border-left: 5px solid var(--ewg-accent);
	border-radius: 0 var(--ewg-radius) var(--ewg-radius) 0;
	box-shadow: 0 2px 10px rgba(15, 35, 60, 0.05);
}

#ewg-primary .ewg-quick-answer__label {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ewg-accent);
}

#ewg-primary .ewg-quick-answer__text {
	margin: 0;
	font-size: 18px;
	line-height: 1.65;
}

/* TOC */
#ewg-primary .ewg-toc {
	margin: 0 0 32px;
	padding: 14px 18px;
	background: #fff;
	border: 1px solid var(--ewg-border);
	border-radius: var(--ewg-radius);
	font-size: 15px;
	line-height: 1.5;
}

#ewg-primary .ewg-toc summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--ewg-text);
}

#ewg-primary .ewg-toc ol {
	margin: 10px 0 0;
	padding-left: 20px;
}

#ewg-primary .ewg-toc li {
	margin: 6px 0;
}

#ewg-primary .ewg-toc a {
	color: var(--ewg-accent);
	text-decoration: none;
}

#ewg-primary .ewg-toc a:hover {
	text-decoration: underline;
}

#ewg-primary .ewg-toc--side {
	margin-bottom: 20px;
	max-height: calc(100vh - 320px);
	overflow-y: auto;
}

#ewg-primary .ewg-toc--side summary {
	list-style: none;
	cursor: default;
	font-size: 13px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ewg-muted);
}

#ewg-primary .ewg-toc--side summary::-webkit-details-marker {
	display: none;
}

/* Sidebar CTA */
#ewg-primary .ewg-side-cta {
	padding: 20px;
	background: var(--ewg-accent);
	color: #fff;
	border-radius: var(--ewg-radius);
	font-size: 15px;
	line-height: 1.5;
}

#ewg-primary .ewg-side-cta__heading {
	margin: 0 0 4px;
	font-size: 18px;
	font-weight: 700;
	color: #fff;
}

#ewg-primary .ewg-side-cta__text {
	margin: 0 0 14px;
	color: #fff;
	opacity: 0.9;
}

#ewg-primary .ewg-side-cta .ewg-btn {
	display: block;
	text-align: center;
}

#ewg-primary .ewg-side-cta__phone {
	display: block;
	margin-top: 10px;
	text-align: center;
	font-weight: 700;
	color: #fff !important;
	text-decoration: none;
}

/* Tables */
/* Wrapper: horizontal scroll as a last resort for any table that is still too wide. */
#ewg-primary .ewg-table-wrap {
	margin: 1.25em 0 1.75em;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

#ewg-primary .ewg-content table {
	display: table;
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	border-spacing: 0;
	font-size: 15px;
	line-height: 1.5;
}

#ewg-primary .ewg-content th,
#ewg-primary .ewg-content td {
	padding: 11px 14px;
	border: 1px solid var(--ewg-border);
	text-align: left;
	vertical-align: top;
	background: #fff;
}

#ewg-primary .ewg-content thead th {
	background: var(--ewg-accent);
	color: #fff;
	font-weight: 700;
	border-color: var(--ewg-accent);
}

#ewg-primary .ewg-content tbody tr:nth-child(even) td {
	background: var(--ewg-soft);
}

#ewg-primary .ewg-content td a {
	font-weight: 600;
}

/* Phones: tables with 3+ columns become one card per row. The first cell is the
   card title; every other cell shows its column header as a label (data-label). */
@media (max-width: 699px) {
	#ewg-primary .ewg-table-wrap--stack {
		overflow: visible;
	}

	#ewg-primary .ewg-table--stack,
	#ewg-primary .ewg-table--stack tbody,
	#ewg-primary .ewg-table--stack tr,
	#ewg-primary .ewg-table--stack td {
		display: block;
		width: 100%;
	}

	#ewg-primary .ewg-table--stack thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	#ewg-primary .ewg-table--stack tr {
		margin: 0 0 12px;
		background: #fff;
		border: 1px solid var(--ewg-border);
		border-radius: var(--ewg-radius);
		overflow: hidden;
	}

	#ewg-primary .ewg-table--stack tr:last-child {
		margin-bottom: 0;
	}

	#ewg-primary .ewg-table--stack td,
	#ewg-primary .ewg-table--stack tbody tr:nth-child(even) td {
		display: grid;
		grid-template-columns: minmax(96px, 38%) minmax(0, 1fr);
		gap: 12px;
		padding: 10px 14px;
		border: 0;
		border-top: 1px solid var(--ewg-border);
		background: #fff;
	}

	#ewg-primary .ewg-table--stack td::before {
		content: attr(data-label);
		font-size: 13px;
		font-weight: 700;
		line-height: 1.45;
		color: var(--ewg-muted);
	}

	/* Empty header (e.g. comparison tables with a blank corner cell): no label column. */
	#ewg-primary .ewg-table--stack td[data-label=""] {
		display: block;
	}

	#ewg-primary .ewg-table--stack td[data-label=""]::before {
		content: none;
	}

	/* Row title. */
	#ewg-primary .ewg-table--stack td:first-child,
	#ewg-primary .ewg-table--stack tbody tr:nth-child(even) td:first-child {
		display: block;
		padding: 11px 14px;
		border-top: 0;
		background: var(--ewg-soft);
		color: var(--ewg-text);
		font-size: 16px;
		font-weight: 700;
	}

	#ewg-primary .ewg-table--stack td:first-child::before {
		content: none;
	}
}

.ewg-link-pending {
	text-decoration: underline dashed #c47f00;
	text-underline-offset: 3px;
	cursor: help;
}

/* Hub lists */
.ewg-hub-list {
	margin: 1em 0 1.5em;
	padding-left: 1.25em;
}

.ewg-hub-list li {
	margin: 0.6em 0;
}

#ewg-primary .ewg-hub-list a {
	font-weight: 700;
}

.ewg-blurb {
	color: var(--ewg-muted);
}

#ewg-primary .ewg-hub-index h3 {
	margin-top: 1.4em;
	font-size: 19px;
}

/* Cards */
.ewg-cards {
	display: grid;
	gap: 16px;
	grid-template-columns: 1fr;
	margin: 1em 0;
}

@media (min-width: 640px) {
	.ewg-cards {
		grid-template-columns: 1fr 1fr;
	}
}

@media (min-width: 1000px) {
	.ewg-more .ewg-cards {
		grid-template-columns: repeat(4, 1fr);
	}
}

#ewg-primary .ewg-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 18px 20px;
	background: #fff;
	border: 1px solid var(--ewg-border);
	border-radius: var(--ewg-radius);
	color: inherit;
	text-decoration: none;
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

#ewg-primary .ewg-card:hover,
#ewg-primary .ewg-card:focus {
	border-color: var(--ewg-accent);
	box-shadow: 0 6px 18px rgba(15, 35, 60, 0.08);
	transform: translateY(-1px);
}

.ewg-card .ewg-badge {
	align-self: flex-start;
}

.ewg-card__title {
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--ewg-accent);
}

.ewg-card__text {
	font-size: 15px;
	line-height: 1.5;
	color: var(--ewg-muted);
}

/* FAQ */
#ewg-primary .ewg-faq {
	margin: 56px 0 0;
	scroll-margin-top: 24px;
}

#ewg-primary .ewg-faq > h2 {
	margin: 0 0 8px;
	font-size: clamp(24px, 20px + 0.8vw, 30px);
	line-height: 1.25;
}

#ewg-primary .ewg-faq__item {
	padding: 18px 0;
	border-bottom: 1px solid var(--ewg-border);
}

#ewg-primary .ewg-faq__q {
	margin: 0 0 6px;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.35;
}

#ewg-primary .ewg-faq__a > :last-child {
	margin-bottom: 0;
}

/* Products */
#ewg-primary .ewg-section-title {
	margin: 0 0 16px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
}

#ewg-primary .ewg-products {
	margin: 56px 0 0;
}

.ewg-products__grid {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

#ewg-primary .ewg-product {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px;
	background: var(--ewg-soft);
	border: 1px solid var(--ewg-border);
	border-radius: var(--ewg-radius);
	text-decoration: none;
	color: inherit;
}

#ewg-primary .ewg-product:hover {
	border-color: var(--ewg-accent);
}

.ewg-product img {
	width: 100%;
	height: 120px;
	object-fit: cover;
	border-radius: 6px;
}

.ewg-product__title {
	font-weight: 700;
	line-height: 1.35;
	color: var(--ewg-text);
}

.ewg-product__more {
	font-size: 14px;
	color: var(--ewg-accent);
}

/* CTA */
.ewg-cta {
	margin: 56px 0 0;
	padding: 32px 28px;
	background: var(--ewg-accent);
	color: #fff;
	border-radius: var(--ewg-radius);
}

#ewg-primary .ewg-cta p {
	color: #fff;
}

.ewg-cta .ewg-cta__heading {
	margin: 0 0 8px;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
}

.ewg-cta .ewg-cta__text {
	margin: 0 0 20px;
	opacity: 0.92;
	color: #fff;
}

.ewg-cta .ewg-cta__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	margin: 0;
}

.ewg-btn {
	display: inline-block;
	padding: 13px 24px;
	background: #fff;
	color: var(--ewg-accent) !important;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	border-radius: 6px;
	text-decoration: none !important;
	transition: filter 0.15s;
}

.ewg-btn:hover {
	filter: brightness(0.94);
}

.ewg-cta__phone {
	color: #fff !important;
	font-weight: 700;
}

/* Sources */
#ewg-primary .ewg-sources {
	margin: 56px 0 0;
	padding-top: 20px;
	border-top: 1px solid var(--ewg-border);
	font-size: 14px;
	line-height: 1.55;
	color: var(--ewg-muted);
}

#ewg-primary .ewg-sources h2 {
	margin: 0 0 10px;
	font-size: 16px;
	font-weight: 700;
	color: var(--ewg-text);
}

#ewg-primary .ewg-sources ol {
	margin: 0;
	padding-left: 20px;
}

#ewg-primary .ewg-sources li {
	margin: 6px 0;
	overflow-wrap: anywhere;
}

#ewg-primary .ewg-sources a {
	color: var(--ewg-accent);
}

/* More from this hub */
#ewg-primary .ewg-more {
	margin: 72px 0 0;
	padding-top: 40px;
	border-top: 1px solid var(--ewg-border);
}

#ewg-primary .ewg-more__all a {
	font-weight: 700;
	color: var(--ewg-accent);
	text-decoration: none;
}

/* Library */
.ewg-library {
	display: grid;
	gap: 24px;
	grid-template-columns: 1fr;
	margin: 0;
}

@media (min-width: 760px) {
	.ewg-library {
		grid-template-columns: 1fr 1fr;
	}
}

#ewg-primary .ewg-hub-card {
	padding: 28px;
	background: #fff;
	border: 1px solid var(--ewg-border);
	border-radius: var(--ewg-radius);
	font-size: 16px;
}

#ewg-primary .ewg-hub-card__title {
	margin: 6px 0 10px;
	font-size: 24px;
	line-height: 1.25;
}

#ewg-primary .ewg-hub-card__title a {
	color: var(--ewg-text);
	text-decoration: none;
}

#ewg-primary .ewg-hub-card__title a:hover {
	color: var(--ewg-accent);
}

#ewg-primary .ewg-hub-card__text {
	margin: 0 0 8px;
	color: var(--ewg-muted);
}

#ewg-primary .ewg-hub-card__meta {
	margin: 0 0 8px;
	font-size: 13px;
	color: var(--ewg-muted);
}

#ewg-primary .ewg-hub-card .ewg-hub-list {
	font-size: 15px;
}

#ewg-primary .ewg-hub-card__more {
	margin: 14px 0 0;
}

#ewg-primary .ewg-hub-card__more a {
	font-weight: 700;
	color: var(--ewg-accent);
	text-decoration: none;
}

.ewg-empty {
	padding: 12px 16px;
	background: #fff8e1;
	border: 1px dashed #e0b44c;
	border-radius: 6px;
}
