/*
 * Articles: listing page (sfop-articles-template.php) and single articles (single.php).
 * Loaded only on those pages by sfop-articles.php. Colors match the SFOP ab-* design system.
 *
 * !important is used only on the Avada layout overrides and on Avada-styled elements (headings,
 * links): Avada's compiled CSS sets those with high specificity and we can't edit the parent theme.
 */

:root {
	--sfop-green-dark: #1a3a28;
	--sfop-green: #245c3a;
	--sfop-green-ink: #1a2e15;
	--sfop-gold: #c9963a;
	--sfop-cream: #f5f0e8;
	--sfop-body-ink: #3a4a30;
	--sfop-muted: #5a6a50;
	--sfop-muted-light: #8a9a80;
	--sfop-line: rgba(0, 0, 0, 0.07);
	--sfop-card-radius: 12px;
	--sfop-content-width: 760px;
	--sfop-page-width: 1100px;
}

/* ===== Avada layout overrides: full-width canvas on both page types ===== */
.page-template-sfop-articles-template #main,
.page-template-sfop-articles-template .fusion-row,
.page-template-sfop-articles-template #wrapper .fusion-row,
.page-template-sfop-articles-template .post-content,
.page-template-sfop-articles-template .entry-content,
.page-template-sfop-articles-template #content,
.page-template-sfop-articles-template #wrapper,
.sfop-article-page #main,
.sfop-article-page #main > .fusion-row,
.sfop-article-page #content {
	max-width: 100% !important;
	padding: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	width: 100% !important;
	float: none !important;
}
.page-template-sfop-articles-template .fusion-page-title-bar,
.page-template-sfop-articles-template #sliders-container,
.sfop-article-page .fusion-page-title-bar,
.sfop-article-page #sliders-container {
	display: none !important;
}
.page-template-sfop-articles-template .fusion-column-wrapper {
	padding: 0 !important;
}
.page-template-sfop-articles-template .post,
.page-template-sfop-articles-template article {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* ===== Shared: hero band ===== */
.sfop-hero,
.sfop-article-hero {
	background: var(--sfop-green-dark);
	position: relative;
	overflow: hidden;
	margin: 0;
}
.sfop-hero { padding: 52px 60px 48px; }
.sfop-hero::before,
.sfop-article-hero::before {
	content: '';
	position: absolute;
	right: -30px;
	top: -30px;
	width: 220px;
	height: 220px;
	border-radius: 50%;
	background: rgba(201, 150, 58, 0.07);
	pointer-events: none;
}
.sfop-hero::after {
	content: '';
	position: absolute;
	right: 90px;
	bottom: -50px;
	width: 140px;
	height: 140px;
	border-radius: 50%;
	background: rgba(201, 150, 58, 0.04);
	pointer-events: none;
}
.sfop-hero-inner {
	max-width: var(--sfop-page-width);
	margin: 0 auto;
	position: relative;
	z-index: 1;
}
.sfop-hero-eyebrow {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--sfop-gold);
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: sans-serif;
}
.sfop-hero-eyebrow::after {
	content: '';
	display: block;
	width: 50px;
	height: 1px;
	background: rgba(201, 150, 58, 0.3);
}
.sfop-hero h1 {
	font-size: 36px !important;
	font-weight: 700 !important;
	color: #ffffff !important;
	margin: 0 0 12px 0 !important;
	line-height: 1.2 !important;
	padding: 0 !important;
}
.sfop-hero p {
	font-size: 14px !important;
	color: rgba(255, 255, 255, 0.55) !important;
	line-height: 1.7 !important;
	max-width: 540px !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* ===== Shared: category label ===== */
.sfop-cat {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.7px;
	text-transform: uppercase;
	padding: 3px 10px;
	border-radius: 20px;
	width: fit-content;
	text-decoration: none !important;
	font-family: sans-serif;
}
.sfop-cat-newsblast    { background: #e6f4eb; color: #245c3a; }
.sfop-cat-news-release { background: #fbeaf0; color: #72243e; }
.sfop-cat-events       { background: #e8f0fb; color: #185fa5; }
.sfop-cat-reports      { background: #faeeda; color: #854f0b; }
.sfop-cat-usda         { background: #eeedfe; color: #3c3489; }
.sfop-cat-farmers      { background: #e1f5ee; color: #085041; }
.sfop-cat-workshop     { background: #fff8e1; color: #7a5200; }
.sfop-cat-default      { background: #eeece8; color: #4a4a4a; }

/* ===== Listing page ===== */
.sfop-main {
	background: var(--sfop-cream);
	padding: 40px 60px 70px;
}
.sfop-main-inner {
	max-width: var(--sfop-page-width);
	margin: 0 auto;
}
.sfop-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 22px;
	margin-bottom: 48px;
}
@media (max-width: 1024px) { .sfop-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .sfop-grid { grid-template-columns: 1fr; } }

.sfop-card {
	background: #ffffff;
	border-radius: var(--sfop-card-radius);
	border: 1px solid var(--sfop-line);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	text-decoration: none !important;
}
.sfop-card:hover {
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}
.sfop-card-img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	display: block;
}
.sfop-card-img-placeholder {
	width: 100%;
	height: 200px;
	background: #e2ebe5;
	display: flex;
	align-items: center;
	justify-content: center;
}
.sfop-card-img-placeholder svg {
	width: 42px;
	height: 42px;
	opacity: 0.3;
	stroke: var(--sfop-green-dark);
}
.sfop-card-body {
	padding: 18px 20px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.sfop-card-title {
	font-size: 15px !important;
	font-weight: 700 !important;
	color: var(--sfop-green-ink) !important;
	line-height: 1.4 !important;
	margin: 0 !important;
	text-decoration: none !important;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.sfop-card-title:hover { color: var(--sfop-green) !important; }
.sfop-card-excerpt {
	font-size: 12.5px;
	color: var(--sfop-muted);
	line-height: 1.6;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0;
	font-family: sans-serif;
}
.sfop-card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 11px 20px 13px;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	background: #fafaf8;
	margin-top: auto;
}
.sfop-card-date {
	font-size: 11px;
	color: var(--sfop-muted-light);
	font-family: sans-serif;
}
.sfop-card-readmore {
	font-size: 11px;
	font-weight: 700;
	color: var(--sfop-green) !important;
	text-decoration: none !important;
	display: flex;
	align-items: center;
	gap: 5px;
	font-family: sans-serif;
}
.sfop-card-readmore:hover { color: var(--sfop-green-dark) !important; }
.sfop-card-readmore svg { width: 12px; height: 12px; }

.sfop-no-posts {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
	color: #7a8a70;
	font-family: sans-serif;
}
.sfop-no-posts-title {
	font-size: 16px;
	font-weight: 700;
	color: #4a5a40;
	margin-bottom: 8px;
}

.sfop-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex-wrap: wrap;
}
.sfop-pg {
	min-width: 36px;
	height: 36px;
	padding: 0 12px;
	border-radius: 8px;
	border: 1.5px solid rgba(0, 0, 0, 0.12);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none !important;
	color: #4a5a40 !important;
	background: #ffffff;
	transition: all 0.15s;
	font-family: sans-serif;
}
.sfop-pg:hover { border-color: var(--sfop-green-dark); color: var(--sfop-green-dark) !important; }
.sfop-pg-active { background: var(--sfop-green-dark) !important; color: #ffffff !important; border-color: var(--sfop-green-dark) !important; }
.sfop-pg-gap,
.sfop-pg-gap:hover { border: none; background: none; cursor: default; }

/* ===== Single article ===== */
.sfop-article-inner {
	max-width: var(--sfop-content-width);
	margin: 0 auto;
	position: relative;
	z-index: 1;
}
.sfop-article-hero { padding: 44px 24px 40px; }
.sfop-article-back {
	display: inline-block;
	font-size: 13px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.75) !important;
	text-decoration: none !important;
	margin-bottom: 18px;
	font-family: inherit;
}
.sfop-article-back:hover { color: #ffffff !important; }
.sfop-article-hero .sfop-cat { display: table; margin-bottom: 14px; }
.sfop-article-title {
	font-size: 34px !important;
	font-weight: 700 !important;
	color: #ffffff !important;
	line-height: 1.22 !important;
	margin: 0 0 14px !important;
	padding: 0 !important;
	letter-spacing: -0.2px;
}
.sfop-article-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin: 0 !important;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.72);
	font-family: inherit;
}
.sfop-article-meta-source::before {
	content: '\00b7';
	margin-right: 14px;
}

.sfop-article-main {
	background: var(--sfop-cream);
	padding: 32px 24px 64px;
}
.sfop-article-sheet {
	background: #ffffff;
	border: 1px solid var(--sfop-line);
	border-radius: var(--sfop-card-radius);
	padding: 40px 48px;
}
.sfop-article-image {
	margin: -40px -48px 32px;
}
.sfop-article-image img {
	display: block;
	width: 100%;
	max-height: 420px;
	object-fit: cover;
	border-radius: var(--sfop-card-radius) var(--sfop-card-radius) 0 0;
}

/* Body copy: every article's HTML is plain semantic tags after clean_articles.py, styled only here. */
.sfop-article-content {
	font-size: 17px;
	line-height: 1.75;
	color: var(--sfop-body-ink);
}
.sfop-article-content > :first-child { margin-top: 0 !important; }
.sfop-article-content p { margin: 0 0 1.15em; }
.sfop-article-content h2,
.sfop-article-content h3,
.sfop-article-content h4 {
	color: var(--sfop-green-ink) !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	margin: 1.6em 0 0.6em !important;
}
.sfop-article-content h2 { font-size: 24px !important; }
.sfop-article-content h3 { font-size: 20px !important; }
.sfop-article-content h4 { font-size: 17px !important; }
.sfop-article-content a {
	color: var(--sfop-green) !important;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.sfop-article-content a:hover { color: var(--sfop-green-dark) !important; }
.sfop-article-content ul,
.sfop-article-content ol { margin: 0 0 1.15em; padding-left: 1.4em; }
.sfop-article-content li { margin-bottom: 0.4em; }
.sfop-article-content img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}
.sfop-article-content figure { margin: 1.5em 0; }
.sfop-article-content figcaption {
	font-size: 13px;
	color: var(--sfop-muted);
	margin-top: 6px;
}
.sfop-article-content blockquote {
	margin: 1.5em 0;
	padding: 4px 0 4px 20px;
	border-left: 1px solid #dde8dd; /* plain rule: Ty doesn't want thick colored side borders */
	color: var(--sfop-green-ink);
	font-style: italic;
}
.sfop-article-content hr {
	border: 0;
	border-top: 1px solid #dde8dd;
	margin: 2em 0;
}
/* Tables from source sites can be wide: scroll sideways on phones instead of breaking the page. */
.sfop-article-content table {
	display: block;
	overflow-x: auto;
	width: 100%;
	border-collapse: collapse;
	margin: 1.5em 0;
	font-size: 15px;
}
.sfop-article-content th,
.sfop-article-content td {
	border: 1px solid #dde8dd;
	padding: 8px 12px;
	text-align: left;
	vertical-align: top;
}
.sfop-article-content th { background: #f3f7f3; color: var(--sfop-green-ink); }

.sfop-article-source {
	margin-top: 36px;
	padding: 18px 22px;
	background: var(--sfop-cream);
	border: 1px solid #e6dcc8;
	border-radius: 10px;
	font-family: inherit;
}
.sfop-article-source-label {
	font-size: 12px !important;
	font-weight: 700;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	color: #7a5a1e;
	margin: 0 0 6px !important;
}
.sfop-article-source a {
	font-size: 15px;
	font-weight: 600;
	color: var(--sfop-green) !important;
}
.sfop-article-footer {
	margin-top: 32px;
	padding-top: 20px;
	border-top: 1px solid #e8e2d6;
}
.sfop-article-back-bottom {
	font-size: 14px;
	font-weight: 600;
	color: var(--sfop-green) !important;
	text-decoration: none !important;
	font-family: inherit;
}

@media (max-width: 640px) {
	.sfop-hero { padding: 40px 20px 36px; }
	.sfop-main { padding: 28px 16px 56px; }
	.sfop-article-hero { padding: 32px 16px 30px; }
	.sfop-article-title { font-size: 26px !important; }
	.sfop-article-main { padding: 16px 0 48px; }
	.sfop-article-sheet { padding: 28px 18px; border-radius: 0; border-left: 0; border-right: 0; }
	.sfop-article-image { margin: -28px -18px 24px; }
	.sfop-article-image img { border-radius: 0; }
	.sfop-article-content { font-size: 16px; }
}
