/**
 * AgriBio visual polish — phong cách thư viện khoa học / wiki học thuật.
 * Chỉ tinh chỉnh CSS, không đổi cấu trúc HTML.
 */

:root {
	--font-sans: "Source Sans 3", "Noto Sans", ui-sans-serif, system-ui, sans-serif;
	--font-serif: "Source Serif 4", "Noto Serif", Georgia, serif;
	--ink-soft: #334155;
	--plant: #4b6f1c;
	--plant-soft: #f3f6eb;
	--disease: #ae4d12;
	--disease-soft: #fff4eb;
	--nutrition: #1d6473;
	--nutrition-soft: #edf8fa;
	--process: #276e68;
	--process-soft: #eaf7f5;
}

/* Nền lưới nhẹ — gợi giấy kỹ thuật / sổ ghi chép */
body {
	background-color: var(--bg);
	background-image:
		linear-gradient(rgba(31, 94, 59, 0.022) 1px, transparent 1px),
		linear-gradient(90deg, rgba(31, 94, 59, 0.022) 1px, transparent 1px);
	background-size: 40px 40px;
	background-position: center -1px;
}

::selection {
	background: rgba(31, 94, 59, 0.14);
	color: var(--ink);
}

/* Tiêu đề chính dùng serif — cảm giác bách khoa / tạp chí khoa học */
.hero h1,
.section-heading h2,
.page-hero h1,
.article-header h1,
.record-header h1 {
	font-family: var(--font-serif) !important;
	font-weight: 700 !important;
	letter-spacing: -0.025em !important;
}

p,
.hero-description,
.section-heading > p {
	color: var(--ink-soft);
}

/* Header — kính mờ tinh tế */
.site-header {
	background: rgba(255, 255, 255, 0.88) !important;
	backdrop-filter: blur(14px) saturate(1.2);
	-webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.site-header.is-scrolled {
	box-shadow: 0 4px 24px rgba(31, 94, 59, 0.06) !important;
}

.main-navigation a::after {
	height: 2px !important;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--green), var(--green-2)) !important;
}

/* Hero — gradient khoa học, viền dưới mảnh */
.hero {
	position: relative;
	background:
		radial-gradient(ellipse 80% 60% at 92% 20%, rgba(46, 125, 50, 0.07) 0%, transparent 55%),
		radial-gradient(ellipse 50% 40% at 8% 80%, rgba(31, 94, 59, 0.05) 0%, transparent 50%),
		linear-gradient(135deg, #f0f7f3 0%, #ffffff 55%, #f7faf8 100%) !important;
	border-bottom: 1px solid rgba(31, 94, 59, 0.08) !important;
}

.hero h1 em {
	font-family: var(--font-serif) !important;
	font-style: italic !important;
	color: var(--green) !important;
}

.section-kicker,
.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	padding: 5px 12px;
	border: 1px solid rgba(46, 125, 50, 0.18);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.72);
	letter-spacing: 0.1em !important;
}

/* Tiêu đề section — gạch trang trí kiểu học thuật */
.section-heading {
	align-items: flex-end !important;
	padding-bottom: 4px;
	border-bottom: 1px solid rgba(31, 94, 59, 0.07);
	margin-bottom: 8px;
}

.section-heading h2 {
	position: relative;
	padding-bottom: 10px;
}

.section-heading h2::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 48px;
	height: 3px;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--green), var(--green-2));
}

.text-link {
	font-weight: 700;
	transition: gap 0.2s ease, color 0.2s ease;
}

.text-link:hover {
	color: var(--green-2) !important;
}

/* Ô tìm kiếm — viền sắc nét hơn */
.search-form-large {
	border-color: #b8d4c4 !important;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.9) inset,
		0 10px 28px rgba(31, 94, 59, 0.06) !important;
}

.search-form-large:focus-within {
	box-shadow:
		0 0 0 3px rgba(46, 125, 50, 0.12),
		0 10px 28px rgba(31, 94, 59, 0.08) !important;
}

.suggestions span {
	font-size: 12px;
	font-weight: 600;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.suggestions a {
	font-size: 13px !important;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Thẻ chủ đề — viền trên màu phân loại, nền sáng hơn */
.topic-card {
	position: relative;
	overflow: hidden;
	border-radius: 14px !important;
	background: #fff !important;
	box-shadow: 0 2px 8px rgba(15, 42, 26, 0.04);
}

.topic-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	border-radius: 14px 14px 0 0;
}

.topic-plant::before { background: linear-gradient(90deg, var(--plant), #3d9a6a); }
.topic-disease::before { background: linear-gradient(90deg, var(--disease), #d4783a); }
.topic-soil::before { background: linear-gradient(90deg, var(--nutrition), #3a8fa0); }
.topic-microbe::before { background: linear-gradient(90deg, var(--process), #3d9e96); }

.topic-plant { border-color: #cfe7d5 !important; background: linear-gradient(180deg, var(--plant-soft) 0%, #fff 42%) !important; }
.topic-disease { border-color: #f2d4bc !important; background: linear-gradient(180deg, var(--disease-soft) 0%, #fff 42%) !important; }
.topic-soil { border-color: #c5e3ea !important; background: linear-gradient(180deg, var(--nutrition-soft) 0%, #fff 42%) !important; }
.topic-microbe { border-color: #c2e5e1 !important; background: linear-gradient(180deg, var(--process-soft) 0%, #fff 42%) !important; }

.topic-card:hover {
	box-shadow: 0 16px 40px rgba(15, 42, 26, 0.09) !important;
	border-color: rgba(31, 94, 59, 0.18) !important;
}

.topic-icon {
	border: 1px solid rgba(255, 255, 255, 0.9);
	box-shadow: 0 4px 12px rgba(15, 42, 26, 0.06) !important;
}

.topic-card > a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	transition: gap 0.2s ease;
}

.topic-card:hover > a {
	gap: 8px;
}

/* Nội dung nổi bật */
.featured-section {
	background: linear-gradient(180deg, #fff 0%, #f9fbf9 100%) !important;
	border-color: rgba(31, 94, 59, 0.07) !important;
}

.filter-tabs button {
	font-size: 13px !important;
	letter-spacing: 0.01em;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.filter-tabs .is-active {
	box-shadow: 0 4px 12px rgba(31, 94, 59, 0.18);
}

.featured-grid .content-card {
	background: #fff !important;
	border-color: rgba(31, 94, 59, 0.1) !important;
	box-shadow: 0 2px 10px rgba(15, 42, 26, 0.04) !important;
}

.featured-grid .content-card:hover {
	border-color: rgba(31, 94, 59, 0.16) !important;
	box-shadow: 0 14px 32px rgba(15, 42, 26, 0.09) !important;
}

.featured-grid .card-image {
	background: linear-gradient(145deg, #eef6f1 0%, #f8fbf9 55%, #f2f8f4 100%) !important;
}

.featured-grid .card-image img {
	object-fit: contain !important;
	padding: 18px !important;
	mix-blend-mode: multiply;
	opacity: 0.92;
}

.featured-grid .card-body h3 a {
	transition: color 0.2s ease;
}

/* Tra cứu nhanh — 3 panel theo hub */
.quick-lookup-section .section-heading {
	margin-bottom: 28px;
}

.quick-lookup-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	align-items: stretch;
}

.quick-panel {
	display: flex;
	flex-direction: column;
	border-radius: 16px;
	border: 1px solid var(--line);
	background: #fff;
	box-shadow: 0 4px 20px rgba(15, 42, 26, 0.04);
	overflow: hidden;
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.quick-panel:hover {
	box-shadow: 0 12px 32px rgba(15, 42, 26, 0.08);
	transform: translateY(-2px);
}

.quick-panel::before {
	content: "";
	display: block;
	height: 4px;
	background: var(--quick-accent, var(--green));
}

.quick-panel-plants {
	--quick-accent: #1b5e35;
	--quick-soft: #eaf5ed;
	--quick-border: #cfe7d5;
}

.quick-panel-diseases {
	--quick-accent: #c2410c;
	--quick-soft: #fff7ed;
	--quick-border: #fed7aa;
}

.quick-panel-terms {
	--quick-accent: #1d4ed8;
	--quick-soft: #eff6ff;
	--quick-border: #bfdbfe;
}

.quick-panel-header {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 20px 20px 16px;
	background: linear-gradient(180deg, var(--quick-soft) 0%, #fff 85%);
	border-bottom: 1px solid var(--quick-border);
}

.quick-panel-icon {
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: #fff;
	color: var(--quick-accent);
	border: 1px solid var(--quick-border);
	box-shadow: 0 2px 8px rgba(15, 42, 26, 0.04);
}

.quick-panel-icon svg {
	width: 22px;
	height: 22px;
}

.quick-panel-titles {
	flex: 1;
	min-width: 0;
}

.quick-panel-titles h3 {
	margin: 0 0 4px;
	font-family: var(--font-serif);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--ink);
}

.quick-panel-desc {
	margin: 0;
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--muted);
}

.quick-panel-count {
	flex-shrink: 0;
	display: grid;
	place-items: center;
	min-width: 30px;
	height: 30px;
	padding: 0 8px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 800;
	color: var(--quick-accent);
	background: #fff;
	border: 1px solid var(--quick-border);
}

.quick-panel-list {
	list-style: none;
	margin: 0;
	padding: 8px 12px;
	flex: 1;
}

.quick-panel-list li {
	margin: 0;
	border-bottom: 1px solid rgba(15, 42, 26, 0.06);
}

.quick-panel-list li:last-child {
	border-bottom: 0;
}

.quick-panel-link {
	display: block;
	padding: 12px 10px;
	border-radius: 10px;
	text-decoration: none;
	transition: background 0.2s ease, padding-left 0.2s ease;
}

.quick-panel-link:hover {
	background: var(--quick-soft);
	padding-left: 14px;
}

.quick-link-badge {
	display: inline-block;
	margin-bottom: 4px;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--quick-accent);
	background: var(--quick-soft);
	border: 1px solid var(--quick-border);
}

.quick-link-title {
	display: block;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--ink);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.quick-panel-link:hover .quick-link-title {
	color: var(--quick-accent);
}

.quick-link-meta {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	line-height: 1.45;
	color: var(--muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.quick-panel-diseases .quick-link-meta {
	font-style: italic;
}

.quick-panel-terms .quick-link-title {
	font-family: var(--font-serif);
}

.quick-panel-footer {
	padding: 14px 20px 18px;
	border-top: 1px solid rgba(15, 42, 26, 0.06);
	margin-top: auto;
}

.quick-panel-footer a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--quick-accent);
	text-decoration: none;
	transition: gap 0.2s ease;
}

.quick-panel-footer a:hover {
	gap: 10px;
}

@media (max-width: 960px) {
	.quick-lookup-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}
}

@media (max-width: 600px) {
	.quick-panel-header {
		padding: 16px 16px 14px;
	}

	.quick-panel-list {
		padding: 6px 8px;
	}

	.quick-panel-footer {
		padding: 12px 16px 16px;
	}
}

/* Footer */
.site-footer {
	background:
		linear-gradient(180deg, #3d5a18 0%, #2a3d10 100%) !important;
	border-top: none !important;
	padding-top: 52px !important;
	color: #eef4e4 !important;
}

.site-footer::before {
	content: "";
	display: block;
	height: 3px;
	background: linear-gradient(90deg, #4b6f1c, #a2b02a, #6b8f28);
	opacity: 1;
}

.footer-inner {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.85fr);
	gap: 48px;
	padding-bottom: 36px;
	align-items: start;
}

.footer-brand-link {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	margin-bottom: 14px;
}

.footer-brand-icon {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: linear-gradient(135deg, #1b5e35, #43a047);
	color: #fff;
	box-shadow: 0 4px 14px rgba(27, 94, 53, 0.2);
	flex-shrink: 0;
}

.footer-brand-icon svg {
	width: 22px;
	height: 22px;
}

.footer-brand-name {
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -0.5px;
	color: var(--green);
	line-height: 1.1;
}

.footer-brand-name span {
	color: var(--green-2);
}

.footer-brand-desc {
	margin: 0;
	max-width: 340px;
	font-size: 13.5px;
	line-height: 1.65;
	color: #dce8cc;
}

.footer-columns {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px;
}

.footer-col-title {
	margin: 0 0 14px;
	padding-left: 12px;
	border-left: 3px solid #a2b02a;
	border-bottom: none !important;
	display: block !important;
	padding-bottom: 0 !important;
	font-size: 14px;
	font-weight: 700;
	color: #f2f8e6;
	line-height: 1.3;
}

.footer-links,
.footer-contact-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer-links li,
.footer-contact-list li {
	margin: 0;
}

.footer-links a {
	display: inline-block;
	padding: 5px 0;
	font-size: 13.5px;
	font-weight: 500;
	color: #e8f2d8;
	text-decoration: none;
	transition: color 0.2s ease, transform 0.2s ease;
}

.footer-links a:hover {
	color: #f4fadc;
	transform: translateX(3px);
}

.footer-contact-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.footer-contact-list li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 13.5px;
	color: #e8f2d8;
	line-height: 1.45;
}

.footer-contact-icon {
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.22);
	color: #f0f7c8;
}

.footer-contact-icon svg {
	width: 15px;
	height: 15px;
}

.footer-contact-list a {
	color: #e8f2d8;
	text-decoration: none;
	word-break: break-word;
}

.footer-contact-list a:hover {
	color: #f4fadc;
}

.footer-socials {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
}

.footer-socials a {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 10px !important;
	border: 1px solid rgba(255, 255, 255, 0.25) !important;
	background: rgba(255, 255, 255, 0.1) !important;
	color: #f0f7c8;
	transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.footer-socials a:hover {
	border-color: #a2b02a !important;
	color: #2a3d10 !important;
	background: #a2b02a !important;
	transform: translateY(-2px);
}

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	margin-top: 0 !important;
	padding: 18px 0 22px !important;
	border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.footer-copy {
	margin: 0;
	font-size: 12.5px;
	color: #c8d8b4;
}

.footer-legal {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
}

.footer-legal a {
	font-size: 12.5px;
	font-weight: 600;
	color: #dce8cc;
	text-decoration: none;
}

.footer-legal a:hover {
	color: #f4fadc;
}

@media (max-width: 960px) {
	.site-footer {
		padding-top: 28px !important;
	}

	.footer-inner {
		grid-template-columns: 1fr;
		gap: 24px;
		padding-bottom: 32px;
	}

	.footer-columns {
		grid-template-columns: repeat(2, 1fr);
		gap: 24px 20px;
	}

	.footer-col-contact {
		grid-column: 1 / -1;
	}

	.footer-brand-desc {
		max-width: none;
	}
}

@media (max-width: 640px) {
	.site-footer {
		padding-top: 20px !important;
	}

	.footer-inner {
		gap: 22px;
		padding-bottom: 32px;
	}

	.footer-brand-link {
		margin-bottom: 10px;
	}

	.footer-socials {
		margin-top: 14px;
	}

	.footer-brand-desc {
		max-width: 100%;
	}

	.footer-columns {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 22px 18px;
	}

	.footer-col-contact {
		grid-column: 1 / -1;
		padding-top: 6px;
		margin-top: 2px;
		border-top: 1px dashed rgba(255, 255, 255, 0.18);
	}

	.footer-col-title {
		margin-bottom: 12px;
	}

	.footer-links a {
		padding: 5px 0;
	}

	.footer-contact-list {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px 18px;
	}

	.footer-contact-list li:last-child {
		grid-column: 1 / -1;
	}

	.footer-bottom {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
		padding: 22px 0 24px !important;
	}

	.footer-legal {
		gap: 8px 16px;
	}
}

@media (max-width: 400px) {
	.footer-columns {
		gap: 20px 14px;
	}

	.footer-contact-list {
		grid-template-columns: 1fr;
	}

	.footer-contact-list li:last-child {
		grid-column: auto;
	}
}

/* Chuyển động nhẹ — tôn trọng prefers-reduced-motion */
@media (prefers-reduced-motion: no-preference) {
	.topic-card,
	.content-card,
	.quick-panel,
	.quick-panel-link,
	.suggestions a {
		transition:
			transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1),
			box-shadow 0.25s ease,
			border-color 0.25s ease,
			background 0.25s ease;
	}

	.hero-art-img {
		animation: agri-float 5.5s ease-in-out infinite;
	}

	@keyframes agri-float {
		0%, 100% { transform: translateY(0); }
		50% { transform: translateY(-7px); }
	}
}

@media (max-width: 767px) {
	.section-heading {
		flex-direction: column;
		align-items: flex-start !important;
		gap: 8px;
	}

	.section-kicker {
		font-size: 10px !important;
	}
}

/* Header search: keep the field and action visually separate. */
.header-search {
	padding: 12px;
	border-radius: 14px;
	box-shadow: 0 14px 34px rgba(31, 94, 59, 0.13);
}

.header-search .search-form {
	display: flex;
	align-items: stretch;
	gap: 9px;
}

.header-search label {
	min-width: 0;
}

.header-search .search-field {
	height: 46px;
	padding: 0 14px;
	border: 1px solid #cbd8d0;
	border-radius: 9px;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search .search-field:focus {
	border-color: var(--green-2);
	box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.header-search .search-submit {
	min-width: 90px;
	min-height: 46px;
	padding: 0 16px;
	border: 1px solid var(--green);
	border-radius: 9px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.header-search .search-submit:hover {
	background: #16452c;
	box-shadow: 0 5px 12px rgba(31, 94, 59, 0.18);
	transform: translateY(-1px);
}

@media (max-width: 420px) {
	.header-search .search-form {
		gap: 7px;
	}

	.header-search .search-submit {
		min-width: 82px;
		padding-inline: 12px;
	}
}
