/*
Theme Name: Lutefo Coffee Farm
Theme URI: https://lutefocoffee.com
Author: LUTEFO Coffee Farm Company Ltd.
Description: A single-page theme for LUTEFO Coffee Farm Company Ltd., an Arabica coffee farm in Mbozi District, Tanzania. Content is edited under Appearance → Customize → Lutefo Coffee Farm.
Version: 1.0.0
Requires at least: 6.0
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: lutefo
*/

/* ---------- Tokens ---------- */
:root {
	--mist: #e6eae1;
	--mist-deep: #d6dccf;
	--canopy: #1e3529;
	--canopy-soft: #2c4a3a;
	--cherry: #a3262a;
	--cherry-dark: #841c20;
	--honey: #c79a3e;
	--soil: #4a3324;
	--ink: #17201b;
	--paper: #f7f8f4;
	--line: rgba(23, 32, 27, 0.16);

	--font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
	--font-body: "Literata", Georgia, "Times New Roman", serif;

	--step--1: 0.875rem;
	--step-0: 1.0625rem;
	--step-1: 1.3125rem;
	--step-2: 1.75rem;
	--step-3: clamp(2rem, 3.4vw, 2.75rem);
	--step-4: clamp(2.6rem, 5.6vw, 4.5rem);
	--step-5: clamp(3rem, 8.4vw, 7rem);

	--gutter: clamp(1rem, 4vw, 3rem);
	--max: 1240px;
	--radius-sm: 4px;
	--radius-lg: 18px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 100px; }

body {
	margin: 0;
	background: var(--mist);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: var(--step-0);
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.02em;
	margin: 0 0 0.5em;
}
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); line-height: 1.15; }
p { margin: 0 0 1.1em; max-width: 64ch; }

a { color: var(--cherry); text-underline-offset: 0.2em; }
a:hover { color: var(--cherry-dark); }

:focus-visible { outline: 3px solid var(--honey); outline-offset: 3px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto;
	top: 1rem; left: 1rem; z-index: 100;
	background: var(--paper); padding: 0.75rem 1rem;
}

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.section { padding-block: clamp(4.5rem, 10vw, 8.5rem); }
.section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head .lede { font-size: var(--step-1); line-height: 1.55; color: var(--canopy-soft); }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
	padding: 0.95rem 1.6rem;
	border: 2px solid transparent;
	border-radius: 999px;
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 1rem;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primary { background: var(--cherry); color: #fff; }
.btn-primary:hover { background: var(--cherry-dark); color: #fff; }
.btn-ghost { border-color: currentColor; color: inherit; background: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: inherit; }

/* ---------- Header ---------- */
.site-header {
	position: fixed; inset: 0 0 auto 0; z-index: 50;
	color: #fff;
	transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.site-header.is-solid {
	background: var(--paper);
	color: var(--ink);
	box-shadow: 0 1px 0 var(--line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 92px; }

.brand { display: flex; align-items: center; gap: 0.7rem; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; line-height: 1; letter-spacing: -0.01em; }
.brand-name small { display: block; font-weight: 400; font-size: 0.72rem; letter-spacing: 0.02em; opacity: 0.8; margin-top: 0.25rem; }
.logo { height: 64px; width: auto; }
.site-footer .logo { height: 110px; }
@media (max-width: 960px) { .site-header .logo { height: 54px; } }
.site-header .logo--on-light,
.site-header.is-solid .logo--on-dark { display: none; }
.site-header.is-solid .logo--on-light { display: block; }

.main-nav ul { list-style: none; display: flex; gap: 1.75rem; margin: 0; padding: 0; }
.main-nav a { color: inherit; text-decoration: none; font-family: var(--font-display); font-weight: 500; font-size: 0.98rem; }
.main-nav a:hover { color: var(--honey); }
.site-header.is-solid .main-nav a:hover { color: var(--cherry); }

.header-cta { padding: 0.7rem 1.2rem; }

.nav-toggle {
	display: none;
	background: none; border: 0; color: inherit; padding: 0.5rem; cursor: pointer;
}
.nav-toggle span { display: block; width: 26px; height: 2px; background: currentColor; margin: 6px 0; transition: transform 0.25s, opacity 0.25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 960px) {
	.nav-toggle { display: block; }
	.header-cta { display: none; }
	.main-nav {
		position: absolute; top: 100%; left: 0; right: 0;
		max-height: calc(100vh - 92px); overflow-y: auto;
		background: var(--paper); color: var(--ink);
		padding: 1.5rem var(--gutter) 2rem;
		box-shadow: 0 12px 24px rgba(23, 32, 27, 0.12);
		display: none;
	}
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; gap: 0; }
	.main-nav a { display: block; padding: 0.85rem 0; border-bottom: 1px solid var(--line); font-size: 1.15rem; }
	.main-nav .mobile-cta { display: block; margin-top: 1.25rem; }
	.main-nav .mobile-cta a { border: 0; color: #fff; text-align: center; }
}
@media (min-width: 961px) { .main-nav .mobile-cta { display: none; } }

/* ---------- Hero ---------- */
.hero {
	position: relative;
	min-height: 100svh;
	display: flex; align-items: flex-end;
	color: #fff;
	background-color: var(--canopy);
	background-size: cover;
	background-position: center 65%;
	overflow: hidden;
}
.hero::before {
	content: ""; position: absolute; inset: 0;
	background:
		linear-gradient(90deg, rgba(14, 26, 20, 0.55) 0%, rgba(14, 26, 20, 0) 75%),
		linear-gradient(180deg, rgba(14, 26, 20, 0.6) 0%, rgba(14, 26, 20, 0.35) 35%, rgba(14, 26, 20, 0.55) 60%, rgba(14, 26, 20, 0.88) 100%);
}
.hero:not(.no-image) .hero-contours { display: none; }
.hero.no-image {
	background-image:
		radial-gradient(ellipse at 75% 20%, rgba(199, 154, 62, 0.28), transparent 55%),
		radial-gradient(ellipse at 10% 90%, rgba(163, 38, 42, 0.25), transparent 50%);
}
.hero-contours { position: absolute; inset: auto 0 0 0; width: 100%; height: 72%; opacity: 0.5; pointer-events: none; }
.hero-contours path { fill: none; stroke: rgba(230, 234, 225, 0.35); stroke-width: 1.2; }
.hero-contours .ridge { stroke: var(--honey); stroke-width: 2; }
.hero-contours .farm-dot { fill: var(--honey); }
.hero-contours .farm-ring { fill: none; stroke: var(--honey); stroke-width: 1.5; }

.hero-inner { position: relative; padding-top: 150px; padding-bottom: clamp(3rem, 8vw, 6rem); width: 100%; }
.hero-location { font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; color: var(--mist); margin-bottom: 1.25rem; display: flex; align-items: flex-start; gap: 0.6rem; line-height: 1.4; }
.hero-location svg { width: 18px; height: 18px; flex: none; margin-top: 0.1em; }
.hero h1 { font-size: var(--step-5); max-width: 13ch; margin-bottom: 0.35em; font-weight: 800; letter-spacing: -0.035em; line-height: 0.95; }
.hero-text { font-size: var(--step-1); line-height: 1.55; max-width: 44ch; color: rgba(255, 255, 255, 0.9); margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }

.hero-altitude { color: var(--honey); }

/* ---------- Facts strip ---------- */
.facts { background: var(--canopy); color: var(--mist); }
.facts-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.fact { padding: 2rem 1.5rem 2.2rem; border-left: 1px solid rgba(230, 234, 225, 0.18); }
.fact:first-child { border-left: 0; padding-left: 0; }
.fact dt { font-size: var(--step--1); color: rgba(230, 234, 225, 0.7); margin-bottom: 0.35rem; }
.fact dd { margin: 0; font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; line-height: 1.25; color: #fff; }
@media (max-width: 860px) {
	.facts-grid { grid-template-columns: 1fr 1fr; }
	.fact { border-left: 0; padding-left: 0; border-top: 1px solid rgba(230, 234, 225, 0.18); }
	.fact:nth-child(-n+2) { border-top: 0; }
}

/* ---------- Image placeholders ---------- */
.photo {
	position: relative;
	border-radius: var(--radius-lg);
	overflow: hidden;
	background: var(--canopy-soft);
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder {
	position: absolute; inset: 0;
	display: flex; align-items: flex-end; padding: 1.25rem;
	color: rgba(230, 234, 225, 0.75);
	font-family: var(--font-display); font-size: var(--step--1);
	background:
		repeating-radial-gradient(circle at 30% 110%, transparent 0 22px, rgba(230, 234, 225, 0.08) 22px 23px),
		linear-gradient(160deg, var(--canopy-soft), var(--canopy));
}

/* ---------- Story ---------- */
.story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
.story-media { position: relative; }
.story-media .photo { aspect-ratio: 4 / 5; }
.story-media .photo-secondary {
	position: absolute; width: 46%; aspect-ratio: 1; right: -6%; bottom: -8%;
	border: 8px solid var(--mist);
}
.story-copy h2 { max-width: 14ch; }
.story-copy p { font-size: 1.08rem; }
.signature { margin-top: 2rem; font-family: var(--font-display); }
.signature strong { display: block; font-size: 1.1rem; }
.signature span { color: var(--canopy-soft); font-size: var(--step--1); }
@media (max-width: 860px) {
	.story-grid { grid-template-columns: 1fr; }
	.story-media { margin-right: 6%; margin-bottom: 2rem; }
}

/* ---------- What we offer ---------- */
.offer { background: var(--canopy); color: var(--mist); }
.offer h2, .offer h3 { color: #fff; }
.offer .lede { color: rgba(230, 234, 225, 0.82); }
.offer-stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 3vw, 3rem); }
.offer-stages li { border-top: 3px solid var(--honey); padding-top: 1.5rem; }
.offer-stages h3 { font-size: var(--step-2); }
.offer-stages p { margin: 0; color: rgba(230, 234, 225, 0.85); }
.purpose { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 4rem); margin-top: clamp(3.5rem, 7vw, 5.5rem); padding: clamp(1.75rem, 4vw, 3rem); background: var(--canopy-soft); border-radius: var(--radius-lg); }
.purpose h3 { font-size: 1.1rem; color: var(--honey); margin-bottom: 0.6rem; }
.purpose p { margin: 0; font-size: var(--step-1); line-height: 1.5; color: #fff; }
@media (max-width: 860px) {
	.offer-stages, .purpose { grid-template-columns: 1fr; }
}

/* ---------- Process ---------- */
.process { background: var(--paper); }
.process-steps {
	list-style: none; margin: 0; padding: 0;
	display: grid; grid-template-columns: repeat(6, 1fr); gap: 0;
	counter-reset: step;
	position: relative;
}
.process-steps::before {
	content: ""; position: absolute; left: 0; right: 0; top: 23px;
	border-top: 2px dashed var(--mist-deep);
}
.process-step { position: relative; padding-right: 1.5rem; counter-increment: step; }
.process-step::before {
	content: counter(step);
	position: relative;
	display: grid; place-items: center;
	width: 48px; height: 48px; border-radius: 50%;
	background: var(--cherry); color: #fff;
	font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
	margin-bottom: 1.25rem;
	box-shadow: 0 0 0 8px var(--paper);
}
.process-step:nth-child(n+4)::before { background: var(--honey); color: var(--ink); }
.process-step:last-child::before { background: var(--canopy); color: #fff; }
.process-step h3 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.process-step p { font-size: 0.97rem; line-height: 1.6; color: #3b463f; }
@media (max-width: 1020px) {
	.process-steps { grid-template-columns: 1fr; gap: 0.5rem; }
	.process-steps::before { left: 23px; right: auto; top: 0; bottom: 0; border-top: 0; border-left: 2px dashed var(--mist-deep); }
	.process-step { display: grid; grid-template-columns: 48px 1fr; column-gap: 1.25rem; padding: 0 0 1.25rem; }
	.process-step::before { grid-row: span 2; margin: 0; }
}

/* ---------- Community ---------- */
.community-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
.community-list { list-style: none; margin: 0; padding: 0; }
.community-list li { padding: 1.75rem 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 56px 1fr; gap: 1.25rem; }
.community-list li:last-child { border-bottom: 1px solid var(--line); }
.community-list svg { width: 44px; height: 44px; color: var(--canopy); }
.community-list h3 { font-size: 1.3rem; margin-bottom: 0.35rem; }
.community-list p { margin: 0; color: #3b463f; }
.community-intro .photo { aspect-ratio: 1; margin-top: 2rem; }
@media (max-width: 860px) { .community-grid { grid-template-columns: 1fr; } }

/* ---------- Visit ---------- */
.visit {
	position: relative; color: #fff;
	background-color: var(--soil);
	background-size: cover; background-position: center;
}
.visit::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(40, 26, 17, 0.92) 0%, rgba(40, 26, 17, 0.6) 60%, rgba(40, 26, 17, 0.35) 100%); }
.visit .wrap { position: relative; }
.visit h2 { max-width: 15ch; }
.visit p { font-size: var(--step-1); line-height: 1.55; max-width: 46ch; color: rgba(255, 255, 255, 0.9); }
.visit-list { list-style: none; padding: 0; margin: 1.5rem 0 2.25rem; display: grid; gap: 0.6rem; }
.visit-list li { display: flex; gap: 0.75rem; align-items: baseline; font-size: 1.05rem; }
.visit-list li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--honey); flex: none; transform: translateY(-2px); }

/* ---------- Contact ---------- */
.contact { background: var(--paper); }
.contact-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(2.5rem, 6vw, 6rem); }
.contact-details { font-style: normal; margin-top: 2rem; }
.contact-details dl { margin: 0; }
.contact-details dt { font-family: var(--font-display); font-weight: 600; margin-top: 1.25rem; }
.contact-details dd { margin: 0.15rem 0 0; }
.contact-details a { color: var(--ink); }

.enquiry-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field--full { grid-column: 1 / -1; }
.field label { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }
.field input, .field select, .field textarea {
	font: inherit; font-size: 1rem;
	padding: 0.85rem 1rem;
	border: 1.5px solid #b8c0b3; border-radius: var(--radius-sm);
	background: #fff; color: var(--ink);
	width: 100%;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--canopy); box-shadow: 0 0 0 3px rgba(199, 154, 62, 0.45); }
.hp-field { position: absolute; left: -9999px; }
.form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.form-actions small { color: #55615a; font-size: 0.88rem; }
.notice { grid-column: 1 / -1; padding: 1rem 1.25rem; border-radius: var(--radius-sm); font-family: var(--font-display); }
.notice--success { background: #dfeadf; color: var(--canopy); border-left: 4px solid var(--canopy); }
.notice--error { background: #f6dede; color: var(--cherry-dark); border-left: 4px solid var(--cherry); }
@media (max-width: 860px) {
	.contact-grid { grid-template-columns: 1fr; }
	.enquiry-form { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(230, 234, 225, 0.75); padding-block: 3.5rem 2rem; font-size: 0.95rem; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; padding-bottom: 2.5rem; border-bottom: 1px solid rgba(230, 234, 225, 0.14); }
.site-footer .brand { color: #fff; }
.footer-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding: 0; margin: 0; }
.site-footer a { color: rgba(230, 234, 225, 0.85); text-decoration: none; }
.site-footer a:hover { color: var(--honey); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-top: 1.75rem; }
.footer-bottom p { margin: 0; }
.social { display: flex; gap: 1rem; }
.social svg { width: 22px; height: 22px; }

/* ---------- Generic page fallback ---------- */
.page-content { padding-top: 150px; padding-bottom: 5rem; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
	.hero-contours .ridge { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: draw-ridge 2.6s 0.3s ease-out forwards; }
	.hero-contours .farm-ring { transform-origin: center; transform-box: fill-box; animation: pulse 2.8s 2.6s ease-out infinite; }
	@keyframes draw-ridge { to { stroke-dashoffset: 0; } }
	@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(3); opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}
