/*
Theme Name: Ralph Agro
Theme URI: https://ralphagro.com/
Author: Ralph Agro Rasayan Pvt. Ltd.
Description: Lightweight custom theme for Ralph Agro Rasayan Pvt. Ltd., manufacturer and supplier of agrochemicals. No page builder, no framework.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ralph-agro
*/

/* ---------- Tokens ---------- */

:root {
	--green-900: #10331c;
	--green-800: #17492a;
	--green-700: #1d6136;
	--green-600: #2a7d45;
	--green-500: #3d9a58;
	--green-100: #e8f3ec;
	--green-50:  #f4f9f6;

	--ink:       #16241b;
	--body:      #46564c;
	--muted:     #6d7c73;
	--line:      #dce6df;
	--surface:   #ffffff;
	--canvas:    #fbfcfb;

	--sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--serif: "Source Serif 4", Georgia, "Times New Roman", serif;

	--wrap: 1140px;
	--gap: 1.5rem;
	--radius: 10px;
	--shadow: 0 1px 2px rgba(16, 51, 28, .06), 0 8px 24px rgba(16, 51, 28, .07);
}

/* ---------- Base ---------- */

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

body {
	margin: 0;
	font-family: var(--sans);
	font-size: 1rem;
	line-height: 1.65;
	color: var(--body);
	background: var(--surface);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
	font-family: var(--serif);
	color: var(--ink);
	line-height: 1.2;
	margin: 0 0 .6em;
	font-weight: 600;
	letter-spacing: -.01em;
}

h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 1.25rem + 1.5vw, 2.25rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--green-700); }
a:hover { color: var(--green-600); }

img { max-width: 100%; height: auto; display: block; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.2em; }
li { margin-bottom: .35em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.section { padding: clamp(3.5rem, 2rem + 6vw, 6rem) 0; }
.section--tint { background: var(--green-50); }
.section--dark { background: var(--green-900); color: #cfdfd5; }
.section--dark h2, .section--dark h3 { color: #fff; }

.eyebrow {
	font-family: var(--sans);
	font-size: .78rem;
	font-weight: 600;
	letter-spacing: .13em;
	text-transform: uppercase;
	color: var(--green-600);
	margin: 0 0 .75rem;
}

.section-head { max-width: 46rem; margin-bottom: 3rem; }
.section-head p { font-size: 1.075rem; color: var(--body); }

.lead { font-size: 1.1rem; }

/* Skip link */
.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--green-800);
	color: #fff;
	padding: .7rem 1.1rem;
	z-index: 200;
}
.skip-link:focus { left: 1rem; top: 1rem; color: #fff; }

:focus-visible { outline: 2px solid var(--green-600); outline-offset: 3px; }

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

.btn {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	font-family: var(--sans);
	font-size: .93rem;
	font-weight: 600;
	padding: .8rem 1.5rem;
	border-radius: 6px;
	border: 1px solid transparent;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--green-700); color: #fff; }
.btn--primary:hover { background: var(--green-800); color: #fff; }
.btn--ghost { border-color: rgba(255,255,255,.5); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn--outline { border-color: var(--line); color: var(--green-800); background: #fff; }
.btn--outline:hover { border-color: var(--green-600); color: var(--green-700); }

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

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(255,255,255,.96);
	backdrop-filter: saturate(180%) blur(8px);
	border-bottom: 1px solid var(--line);
}

.topbar {
	background: var(--green-900);
	color: #b9cec1;
	font-size: .82rem;
}
.topbar .wrap {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem 1.75rem;
	justify-content: flex-end;
	padding-block: .55rem;
}
.topbar a { color: #dff0e6; text-decoration: none; }
.topbar a:hover { color: #fff; text-decoration: underline; }

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	padding-block: .85rem;
}

.brand, .custom-logo-link {
	display: flex;
	align-items: center;
	gap: .8rem;
	text-decoration: none;
	color: var(--ink);
}
.brand img, .custom-logo { width: 52px; height: auto; }
.brand__text {
	font-family: var(--serif);
	font-size: 1.06rem;
	font-weight: 700;
	line-height: 1.15;
	max-width: 11rem;
	color: var(--green-900);
}

.nav__list {
	display: flex;
	align-items: center;
	gap: 2rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.nav__list li { margin: 0; }
.nav__list a {
	font-size: .93rem;
	font-weight: 500;
	color: var(--body);
	text-decoration: none;
	padding-block: .4rem;
	border-bottom: 2px solid transparent;
	white-space: nowrap;
}
.nav__list a:hover { color: var(--green-700); }
.nav__list .current-menu-item > a,
.nav__list .current_page_item > a {
	color: var(--green-800);
	border-bottom-color: var(--green-600);
}

.nav-toggle {
	display: none;
	background: none;
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: .55rem .7rem;
	cursor: pointer;
	color: var(--ink);
}
.nav-toggle svg { display: block; }

/* ---------- Hero ---------- */

.hero {
	position: relative;
	color: #fff;
	background: var(--green-900) center/cover no-repeat;
	isolation: isolate;
}
.hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, rgba(10,38,21,.92) 0%, rgba(10,38,21,.72) 45%, rgba(10,38,21,.42) 100%);
	z-index: -1;
}
.hero .wrap { padding-block: clamp(5rem, 3rem + 11vw, 9.5rem); }
.hero__inner { max-width: 44rem; }
.hero h1 { color: #fff; margin-bottom: .5rem; }
.hero .eyebrow { color: #8fd0a5; }
.hero p {
	font-size: clamp(1.05rem, .98rem + .35vw, 1.25rem);
	color: #d5e7dc;
	max-width: 36rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2rem; }

/* Compact hero for interior pages */
.page-hero {
	background: var(--green-900) center/cover no-repeat;
	color: #fff;
	position: relative;
	isolation: isolate;
}
.page-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, rgba(10,38,21,.93), rgba(10,38,21,.7));
	z-index: -1;
}
.page-hero .wrap { padding-block: clamp(3rem, 2rem + 5vw, 5rem); }
.page-hero h1 { color: #fff; margin-bottom: .35rem; }
.page-hero p { color: #cfe3d7; max-width: 40rem; margin: 0; }

/* ---------- Generic grid ---------- */

.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.split {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(2rem, 1rem + 4vw, 4rem);
	align-items: center;
}

.media { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.media img { width: 100%; }

/* ---------- Cards ---------- */

.card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1.75rem;
}
.card h3 { margin-bottom: .4rem; }
.card p:last-child { margin-bottom: 0; }

.stat { text-align: left; }
.stat__num {
	font-family: var(--serif);
	font-size: 2.5rem;
	font-weight: 700;
	color: var(--green-700);
	line-height: 1;
	display: block;
	margin-bottom: .35rem;
}
.stat__label { font-size: .93rem; color: var(--muted); }

.section--dark .stat__num { color: #7cc696; }
.section--dark .stat__label { color: #a9c2b4; }

/* Numbered list of principles */
.principles { display: grid; gap: 1.25rem; counter-reset: p; list-style: none; padding: 0; margin: 0; }
.principles li {
	counter-increment: p;
	display: grid;
	grid-template-columns: 2.5rem 1fr;
	gap: 1.1rem;
	align-items: start;
	margin: 0;
}
.principles li::before {
	content: counter(p, decimal-leading-zero);
	font-family: var(--serif);
	font-size: 1rem;
	font-weight: 700;
	color: var(--green-600);
	background: var(--green-100);
	border-radius: 50%;
	width: 2.5rem;
	height: 2.5rem;
	display: grid;
	place-items: center;
}
.principles h3 { font-size: 1.08rem; margin-bottom: .2rem; }
.principles p { margin: 0; font-size: .97rem; }

/* ---------- Gallery ---------- */

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.gallery figure { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--green-100); }
.gallery img { width: 100%; aspect-ratio: 4 / 3.4; object-fit: cover; transition: transform .4s ease; }
.gallery figure:hover img { transform: scale(1.04); }

/* ---------- Products ---------- */

.product-nav {
	display: flex;
	flex-wrap: wrap;
	gap: .6rem;
	margin-bottom: 3rem;
	padding: 0;
	list-style: none;
}
.product-nav li { margin: 0; }
.product-nav a {
	display: inline-block;
	font-size: .88rem;
	font-weight: 500;
	padding: .5rem 1rem;
	border: 1px solid var(--line);
	border-radius: 100px;
	background: #fff;
	text-decoration: none;
	color: var(--green-800);
}
.product-nav a:hover { border-color: var(--green-600); background: var(--green-50); }

.product-group { margin-bottom: 3.25rem; scroll-margin-top: 7rem; }
.product-group:last-child { margin-bottom: 0; }
.product-group__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding-bottom: .75rem;
	margin-bottom: 1.5rem;
	border-bottom: 2px solid var(--green-100);
}
.product-group__head h2 { margin: 0; font-size: 1.5rem; }
.product-group__count { font-size: .85rem; color: var(--muted); white-space: nowrap; }

.product-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
	gap: .5rem 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.product-list li {
	margin: 0;
	padding: .55rem 0 .55rem 1.4rem;
	font-size: .95rem;
	color: var(--ink);
	border-bottom: 1px solid var(--line);
	position: relative;
}
.product-list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 1.15rem;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--green-500);
}

/* ---------- Plant sections ---------- */

.plant {
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1.9rem;
	background: #fff;
	display: flex;
	flex-direction: column;
}
.plant h3 {
	font-size: 1.15rem;
	padding-bottom: .8rem;
	margin-bottom: 1rem;
	border-bottom: 1px solid var(--line);
}
.plant ul { list-style: none; padding: 0; margin: 0 0 1.4rem; flex: 1; }
.plant li {
	position: relative;
	padding-left: 1.3rem;
	font-size: .94rem;
	margin-bottom: .5rem;
}
.plant li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .62rem;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--green-500);
}
.plant__capacity {
	background: var(--green-50);
	border-left: 3px solid var(--green-600);
	border-radius: 0 6px 6px 0;
	padding: .85rem 1rem;
	font-size: .92rem;
	color: var(--green-900);
	margin: 0;
}
.plant__capacity strong { display: block; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--green-600); margin-bottom: .15rem; }

/* ---------- Contact ---------- */

.contact-grid {
	display: grid;
	grid-template-columns: 1fr 1.15fr;
	gap: clamp(2rem, 1rem + 4vw, 4rem);
	align-items: start;
}

.address-block { margin-bottom: 2rem; }
.address-block:last-child { margin-bottom: 0; }
.address-block h3 { font-size: 1.05rem; margin-bottom: .5rem; }
.address-block address { font-style: normal; font-size: .97rem; line-height: 1.7; }
.address-block a { text-decoration: none; }
.address-block a:hover { text-decoration: underline; }

.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .4rem; }
.field label { font-size: .88rem; font-weight: 600; color: var(--ink); }
.field input, .field textarea {
	font: inherit;
	font-size: .96rem;
	padding: .75rem .9rem;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: #fff;
	color: var(--ink);
	width: 100%;
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input:focus, .field textarea:focus { border-color: var(--green-600); outline: none; box-shadow: 0 0 0 3px rgba(61,154,88,.15); }
.field--hp { position: absolute; left: -9999px; }

.notice { padding: .9rem 1.1rem; border-radius: 6px; font-size: .93rem; margin-bottom: 1.5rem; }
.notice--ok { background: var(--green-100); color: var(--green-900); border: 1px solid #b9dcc6; }
.notice--bad { background: #fdecea; color: #7a231b; border: 1px solid #f3c6c1; }

/* ---------- Contact strip ---------- */

.cta-strip { background: var(--green-800); color: #d6e8dd; }
.cta-strip .wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	padding-block: 3rem;
}
.cta-strip h2 { color: #fff; margin-bottom: .3rem; }
.cta-strip p { margin: 0; }

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

.site-footer {
	background: var(--green-900);
	color: #a8c1b2;
	font-size: .92rem;
	padding-top: 3.5rem;
}
.site-footer h3 {
	color: #fff;
	font-family: var(--sans);
	font-size: .8rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	margin-bottom: 1rem;
}
.site-footer a { color: #cfe3d7; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer address { font-style: normal; line-height: 1.75; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .5rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 2.5rem; padding-bottom: 3rem; }
.footer-brand img { width: 58px; margin-bottom: 1rem; background: #fff; border-radius: 8px; padding: .4rem; }
.footer-bottom {
	border-top: 1px solid rgba(255,255,255,.12);
	padding-block: 1.4rem;
	display: flex;
	flex-wrap: wrap;
	gap: .5rem 1.5rem;
	justify-content: space-between;
	font-size: .85rem;
	color: #8ba99a;
}

/* ---------- Editor content (page.php fallback) ---------- */

.entry-content { max-width: 44rem; }
.entry-content img { border-radius: var(--radius); }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
	.grid--4 { grid-template-columns: repeat(2, 1fr); }
	.grid--3 { grid-template-columns: repeat(2, 1fr); }
	.gallery { grid-template-columns: repeat(2, 1fr); }
	.footer-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
}

@media (max-width: 800px) {
	.nav-toggle { display: block; }

	.site-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: #fff;
		border-bottom: 1px solid var(--line);
		box-shadow: var(--shadow);
		display: none;
	}
	.site-nav.is-open { display: block; }
	.nav__list {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: .5rem 1.25rem 1.25rem;
	}
	.nav__list a {
		display: block;
		padding: .8rem 0;
		border-bottom: 1px solid var(--line);
	}
	.nav__list li:last-child a { border-bottom: none; }
	.nav__list .current-menu-item > a,
	.nav__list .current_page_item > a { border-bottom-color: var(--line); }

	.split, .contact-grid, .grid--2 { grid-template-columns: 1fr; }
	.topbar .wrap { justify-content: flex-start; }
	.brand__text { font-size: .95rem; max-width: 9rem; }
}

@media (max-width: 560px) {
	.grid--3, .grid--4 { grid-template-columns: 1fr; }
	.gallery { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
	.footer-grid { grid-template-columns: 1fr; }
	.product-list { grid-template-columns: 1fr; }
	.card, .plant { padding: 1.4rem; }
	.topbar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
