/* AgTech Intelligence: section page and edition pages on enterpriseagmag.com.
   Builds on the enterprise-ag theme (its --eag-* colors, .eag-page-hero, .eag-shell, .eag-eyebrow,
   .eag-button, .eag-breadcrumb) and follows its dark mode through the same variables. */

.eagi {
	--eagi-card: var(--eag-white);
	--eagi-tag-bg: #eef4ec;
	--eagi-rule: var(--eag-ink);
	background: var(--eag-cream);
	color: var(--eag-ink);
}
html[data-eag-theme="dark"] .eagi {
	--eagi-card: #101d2e;
	--eagi-tag-bg: rgba(118, 184, 42, 0.14);
	--eagi-rule: rgba(226, 234, 243, 0.4);
}

.eagi h1,
.eagi h2,
.eagi h3 {
	font-family: "Playfair Display", Georgia, serif;
	font-weight: 800;
	line-height: 1.12;
	letter-spacing: -0.01em;
}

/* --- shared pieces ----------------------------------------------------------------------- */

.eagi-text-link {
	display: inline-block;
	color: var(--eag-green-deep);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-decoration: none;
	text-transform: uppercase;
}
.eagi-text-link:hover { color: var(--eag-green); text-decoration: underline; }
.eagi-text-link--light { color: var(--eag-lime); }
html[data-eag-theme="dark"] .eagi-text-link { color: var(--eag-lime); }

.eagi-button--gold {
	background: var(--eag-gold-bright);
	color: var(--eag-navy);
}
.eagi-button--gold:hover { background: var(--eag-gold); }

.eagi-tag {
	display: inline-block;
	padding: 1px 8px;
	border: 1px solid var(--eag-green);
	border-radius: 3px;
	background: var(--eagi-tag-bg);
	color: var(--eag-green-deep);
	font-family: "Inter", system-ui, sans-serif;
	font-size: 10px;
	font-weight: 800;
	font-style: normal;
	letter-spacing: 0.12em;
	line-height: 18px;
	text-transform: uppercase;
	white-space: nowrap;
}
html[data-eag-theme="dark"] .eagi-tag { color: var(--eag-lime); }

/* --- headers ------------------------------------------------------------------------------
   Both pages use the theme's own headers: .eag-page-hero (as on /articles/) on the section page and
   .eag-single__hero (as on every article) on an edition. Only the photo credit is added here. */

.eagi-hero-credit {
	position: absolute;
	right: 20px;
	bottom: 14px;
	z-index: 1;
	color: rgba(255, 255, 255, 0.7);
	font-size: 11px;
	letter-spacing: 0.02em;
}
/* Report headlines run longer than article titles; one step down keeps them to about two lines. */
.eagi-edition .eag-single__hero h1 { max-width: 1050px; font-size: clamp(38px, 5vw, 64px); }
.eagi-has-hero-photo .eag-single__hero-image img { object-position: center 65%; filter: brightness(1.2) saturate(1.08); }
/* Lighter than the theme's article shade (Dave, Oct 29): enough on the left and bottom for the
   white headline, the photo left clear on the right. */
.eagi-has-hero-photo .eag-single__hero-overlay {
	background:
		linear-gradient(90deg, rgba(5, 9, 18, 0.72), rgba(5, 9, 18, 0.3) 58%, rgba(5, 9, 18, 0.08)),
		linear-gradient(0deg, rgba(5, 9, 18, 0.6), transparent 45%);
}

/* The hero photo fills the header, so its copy at the top of the report is not shown twice. */
.eagi-has-hero-photo .eagi-lead-photo { display: none; }

/* --- section page ------------------------------------------------------------------------ */

.eagi-band { padding-block: 72px; }
.eagi-band h2 { margin: 0 0 16px; font-size: clamp(32px, 3.6vw, 46px); }
.eagi-band__head { margin-bottom: 34px; }
.eagi-band__head .eag-eyebrow,
.eagi-explainer .eag-eyebrow,
.eagi-more .eag-eyebrow { color: var(--eag-green); }

.eagi-latest { padding-top: 0; }
.eagi-latest .eagi-card--featured { position: relative; z-index: 2; margin-top: -40px; }

.eagi-explainer { background: var(--eag-sand); }
.eagi-explainer__grid {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	gap: 56px;
	align-items: start;
}
.eagi-explainer p { max-width: 640px; font-size: 17px; }
.eagi-taglist {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 6px 0 14px;
	padding: 0;
	list-style: none;
}
.eagi-taglist li { display: flex; align-items: center; gap: 10px; }
.eagi-taglist li + li::before { content: "→"; color: var(--eag-muted); font-size: 13px; }
.eagi-taglist .eagi-tag { font-size: 11px; line-height: 22px; padding: 2px 10px; }
.eagi-small { color: var(--eag-muted); font-size: 14px !important; font-style: italic; }

.eagi-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 26px;
}
.eagi-empty { font-size: 18px; }

.eagi-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--eag-border);
	border-radius: var(--eag-radius);
	background: var(--eagi-card);
	box-shadow: 0 10px 30px rgba(5, 9, 18, 0.06);
}
.eagi-card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--eag-navy); }
.eagi-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.eagi-card:hover .eagi-card__media img { transform: scale(1.03); }
.eagi-card__body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 24px 26px 26px; }
.eagi-card__date {
	margin: 0 0 10px;
	color: var(--eag-green);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}
.eagi-card__title { margin: 0 0 12px; font-size: 24px; }
.eagi-card__title a { color: inherit; text-decoration: none; }
.eagi-card__title a:hover { color: var(--eag-green-deep); }
.eagi-card__dek { margin: 0 0 12px; color: var(--eag-muted); font-size: 15px; line-height: 1.6; }
.eagi-card__meta { margin: 0 0 18px; color: var(--eag-muted); font-size: 12px; font-weight: 600; }
.eagi-card .eagi-text-link { margin-top: auto; }

.eagi-card--featured {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 6fr);
	box-shadow: var(--eag-shadow);
}
.eagi-card--featured .eagi-card__media { aspect-ratio: auto; min-height: 380px; }
.eagi-card--featured .eagi-card__body { justify-content: center; padding: clamp(30px, 4vw, 56px); }
.eagi-card--featured .eagi-card__title { font-size: clamp(28px, 2.8vw, 38px); }
.eagi-card--featured .eagi-card__dek { font-size: 17px; }
.eagi-card--featured .eag-button { width: auto; margin-top: 6px; }

.eagi-more { padding-top: 0; }
.eagi-more__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.eagi-more__card {
	padding: 36px 38px;
	border: 1px solid var(--eag-border);
	border-top: 4px solid var(--eag-green);
	border-radius: var(--eag-radius);
	background: var(--eagi-card);
}
.eagi-more__card h2 { font-size: 30px; }
.eagi-more__card p { color: var(--eag-muted); }

.eagi-subscribe {
	background:
		radial-gradient(circle at 12% 0%, rgba(118, 184, 42, 0.16), transparent 40%),
		linear-gradient(135deg, var(--eag-navy-deep), var(--eag-navy));
	color: var(--eag-white);
	text-align: center;
}
.eagi-subscribe p { max-width: 620px; margin: 0 auto 26px; color: #c8d0db; font-size: 18px; }
.eagi-subscribe .eag-button { width: auto; }

/* --- edition page ------------------------------------------------------------------------ */

.eagi-layout {
	display: grid;
	grid-template-columns: minmax(0, 780px) minmax(240px, 300px);
	justify-content: space-between;
	gap: 64px;
	padding-block: 44px 96px;
}
.eagi-breadcrumb { margin-bottom: 18px; }
.eagi-breadcrumb a { text-decoration: none; }
.eagi-notice {
	margin: 0 0 34px;
	padding: 12px 16px;
	border-left: 3px solid var(--eag-gold);
	background: var(--eagi-card);
	color: var(--eag-muted);
	font-size: 13px;
}

.eagi-sidebar {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + 100px);
	align-self: start;
	max-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px) - 120px);
	overflow-y: auto;
	scrollbar-width: thin;
}
.eagi-side {
	margin-bottom: 22px;
	padding: 24px;
	border: 1px solid var(--eag-border);
	background: var(--eagi-card);
}
.eagi-side .eag-eyebrow { margin-bottom: 12px; color: var(--eag-green); }
.eagi-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: eagi-toc; }
.eagi-toc li { padding: 7px 0; border-top: 1px solid var(--eag-border); font-size: 14px; line-height: 1.4; }
.eagi-toc li:first-child { border-top: 0; }
.eagi-toc a { color: inherit; text-decoration: none; }
.eagi-toc a:hover { color: var(--eag-green-deep); text-decoration: underline; }
.eagi-tools button {
	display: block;
	width: 100%;
	margin-top: 8px;
	padding: 9px 12px;
	border: 1px solid var(--eag-border);
	border-radius: 6px;
	background: transparent;
	color: inherit;
	font: 600 13px/1.3 "Inter", system-ui, sans-serif;
	text-align: left;
	cursor: pointer;
}
.eagi-tools button:hover,
.eagi-tools button[aria-pressed="true"] { border-color: var(--eag-green); color: var(--eag-green-deep); }
.eagi-side--dark { border-top: 4px solid var(--eag-lime); background: var(--eag-navy); color: var(--eag-white); }
.eagi-side--dark .eag-eyebrow { color: var(--eag-gold-bright); }
.eagi-side--dark h2 { margin: 0 0 18px; font-size: 26px; }
.eagi-side--dark .eag-button { width: 100%; margin-bottom: 14px; }

.eagi-pager {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin-top: 56px;
	padding-top: 28px;
	border-top: 1px solid var(--eag-border);
}
.eagi-pager__link {
	flex: 1 1 180px;
	padding: 16px 18px;
	border: 1px solid var(--eag-border);
	border-radius: 8px;
	background: var(--eagi-card);
	color: inherit;
	font-weight: 700;
	text-decoration: none;
}
.eagi-pager__link span {
	display: block;
	margin-bottom: 4px;
	color: var(--eag-green);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}
.eagi-pager__link:hover { border-color: var(--eag-green); }
.eagi-pager__next { text-align: right; }

/* --- the report body (built from the email) ---------------------------------------------- */

.eagi-body { font-size: 17px; line-height: 1.75; }
.eagi-body.eagi-body--large { font-size: 20px; }
.eagi-body > :first-child { margin-top: 0; }
.eagi-body p { margin: 0 0 1.1em; }
.eagi-body a { color: var(--eag-green-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
html[data-eag-theme="dark"] .eagi-body a { color: var(--eag-lime); }
.eagi-body sup { color: var(--eag-green); font-size: 0.62em; font-weight: 700; line-height: 0; }

.eagi-body h2 {
	margin: 64px 0 22px;
	padding-top: 20px;
	border-top: 1px solid var(--eagi-rule);
	font-size: 34px;
	scroll-margin-top: 110px;
}
.eagi-body h3 { margin: 48px 0 12px; font-size: 26px; scroll-margin-top: 110px; }

.eagi-intro-line { color: var(--eag-muted); font-size: 15px; }
.eagi-body .eagi-intro-line a { color: inherit; }

.eagi-kicker {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	margin: 0 0 16px !important;
	color: var(--eag-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.12em;
	line-height: 1.6;
	text-transform: uppercase;
}
.eagi-kicker em { font-style: normal; }
.eagi-kicker + h3,
.eagi-kicker:has(+ h3) { margin-top: 0; }
.eagi-body h3:has(+ .eagi-kicker) { margin-bottom: 8px; }

.eagi-body figure { margin: 26px 0 28px; }
.eagi-body figure img { display: block; width: 100%; height: auto; border-radius: 6px; }
.eagi-body figure.wp-block-image > a { display: block; }
.eagi-body figcaption { margin-top: 10px; color: var(--eag-muted); font-size: 13px; line-height: 1.5; }
.eagi-credit { color: var(--eag-muted); opacity: 0.8; white-space: nowrap; }
.eagi-credit::before { content: "  "; white-space: pre; }

.eagi-callout {
	margin: 22px 0 !important;
	padding: 16px 20px;
	border-left: 3px solid var(--eag-green);
	background: var(--eagi-card);
	font-size: 0.94em;
}
.eagi-callout strong:first-child {
	display: block;
	margin-bottom: 4px;
	color: var(--eag-green);
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}
.eagi-item-sources { font-size: 14px; }

.eagi-cost { padding: 12px 16px; border: 1px solid var(--eag-border); border-radius: 6px; background: var(--eagi-card); font-size: 0.94em; }
.eagi-cost em { font-style: normal; }
.eagi-cost strong:first-child {
	margin-right: 6px;
	color: var(--eag-green-deep);
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}
html[data-eag-theme="dark"] .eagi-cost strong:first-child { color: var(--eag-lime); }

/* Robot of the Week: the navy box, as in the email. */
.eagi-robot {
	padding: clamp(24px, 4vw, 40px);
	border-top: 4px solid var(--eag-lime);
	border-radius: var(--eag-radius);
	background: var(--eag-navy);
	color: #e6ebf1;
}
.eagi-body .eagi-robot h3 { margin: 0 0 10px; color: var(--eag-white); font-size: 30px; }
.eagi-robot figcaption,
.eagi-robot .eagi-credit { color: #aab6c5; }
.eagi-body .eagi-robot a { color: var(--eag-lime); }
.eagi-body .eagi-robot sup { color: var(--eag-lime); }
.eagi-body table.eagi-facts { margin: 6px 0 0; font-size: 15px; }
.eagi-facts th {
	width: 28%;
	padding: 14px 16px 14px 0;
	border-top: 1px solid rgba(255, 255, 255, 0.16);
	color: var(--eag-gold-bright);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-align: left;
	text-transform: uppercase;
	vertical-align: top;
}
.eagi-body .eagi-facts td,
.eagi-body .eagi-facts td:first-child {
	width: auto;
	padding: 12px 0;
	border-top: 1px solid rgba(255, 255, 255, 0.16);
	border-bottom: 0;
	color: #e6ebf1;
	font-size: 15px;
}

.eagi-quote {
	margin: 0 0 24px;
	padding: 6px 0 6px 26px;
	border-left: 4px solid var(--eag-gold);
}
.eagi-quote p:first-child {
	margin-bottom: 12px;
	font-family: "Playfair Display", Georgia, serif;
	font-size: 26px;
	font-style: italic;
	font-weight: 700;
	line-height: 1.35;
}
.eagi-quote__by { color: var(--eag-muted); font-size: 14px; }

.eagi-numbers {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
}
.eagi-numbers li {
	padding: 20px 20px 18px;
	border-top: 3px solid var(--eag-green);
	background: var(--eagi-card);
	font-size: 14px;
	line-height: 1.5;
}
.eagi-numbers strong {
	display: block;
	margin-bottom: 8px;
	color: var(--eag-green-deep);
	font-family: "Playfair Display", Georgia, serif;
	font-size: 34px;
	font-weight: 800;
	line-height: 1;
}
html[data-eag-theme="dark"] .eagi-numbers strong { color: var(--eag-lime); }
.eagi-num-sep { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.eagi-legend { color: var(--eag-muted); font-size: 14px; font-style: italic; }

.eagi-body ul:not(.eagi-numbers),
.eagi-body ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.eagi-body li { margin-bottom: 0.5em; }

.eagi-body table { width: 100%; border-collapse: collapse; font-size: 15px; }
.eagi-body figure.wp-block-table { margin: 16px 0 22px; overflow-x: auto; }
.eagi-body td { padding: 12px 10px; border-bottom: 1px solid var(--eag-border); vertical-align: top; }
.eagi-body td:first-child { width: 30%; color: var(--eag-muted); font-size: 13px; }
.eagi-body td:first-child strong { color: var(--eag-ink); font-size: 16px; line-height: 1.9; }

/* The magazine pick's headline. */
.eagi-body #from-enterprise-ag-magazine + p {
	margin-bottom: 6px;
	font-family: "Playfair Display", Georgia, serif;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.25;
}
.eagi-body #from-enterprise-ag-magazine + p a { color: inherit; text-decoration: none; }
.eagi-body #from-enterprise-ag-magazine + p a:hover { color: var(--eag-green-deep); text-decoration: underline; }
.eagi-body #from-enterprise-ag-magazine + p + p { color: var(--eag-muted); font-size: 14px; }

.eagi-body h2 + p em:only-child { color: var(--eag-muted); }
.eagi-editorial { margin-top: 36px !important; padding-top: 18px; border-top: 1px solid var(--eag-border); color: var(--eag-muted); font-size: 13px; }
.eagi-sources-list { font-size: 14px; line-height: 1.6; }
.eagi-sources-list li { margin-bottom: 0.7em; }

/* --- responsive -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
	.eagi-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 40px; }
	.eagi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
	.eagi-layout { grid-template-columns: 1fr; padding-block: 30px 70px; }
	.eagi-sidebar { position: static; max-height: none; overflow: visible; }
	.eagi-toc { display: none; }
	.eagi-explainer__grid,
	.eagi-more__grid,
	.eagi-card--featured { grid-template-columns: 1fr; gap: 28px; }
	.eagi-card--featured .eagi-card__media { min-height: 0; aspect-ratio: 16 / 10; }
}

@media (max-width: 640px) {
	.eagi-band { padding-block: 52px; }
	.eagi-grid,
	.eagi-numbers { grid-template-columns: 1fr; }
	.eagi-body { font-size: 16.5px; }
	.eagi-body h2 { font-size: 28px; }
	.eagi-body h3 { font-size: 22px; }
	.eagi-latest .eagi-card--featured { margin-top: -24px; }
}

/* --- print -------------------------------------------------------------------------------- */

@media print {
	.eag-site-header,
	.eag-footer,
	.eagi-sidebar,
	.eagi-pager,
	.eagi-breadcrumb { display: none !important; }
	.eag-single__hero { min-height: 0 !important; padding-block: 0 20px !important; background: none !important; color: #000 !important; }
	.eag-single__hero-image,
	.eag-single__hero-overlay,
	.eagi-hero-credit { display: none !important; }
	.eagi-has-hero-photo .eagi-lead-photo { display: block !important; }
	.eagi-layout { display: block; padding: 0; }
	.eagi-body { font-size: 12pt; }
	.eagi-body a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; word-break: break-all; }
	.eagi-body figure a::after { content: ""; }
}
