/* ============================================================
   Kettle Hills Farm — styles.css
   Pastoral warmth with honest rusticity
   ============================================================ */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Source+Sans+3:wght@400;600&display=swap');

/* --- Custom Properties --- */
:root {
  --bg: #FAF7F0;
  --bg-alt: #F0EBE0;
  --bg-card: #FFFFFF;
  --bg-dark: #2A3A20;
  --text: #2A2520;
  --text-muted: #5A5448;
  --text-faint: #8A8478;
  --primary: #4A7A38;
  --primary-rgb: 74, 122, 56;
  --primary-light: #E8F2E4;
  --accent: #C4883A;
  --accent-light: #F5ECD5;
  --border: #DDD5C5;
  --border-light: #F0EBE0;

  --font-heading: 'DM Serif Display', serif;
  --font-body: 'Source Sans 3', sans-serif;

  --h1: clamp(2.25rem, 4vw, 3.5rem);
  --h2: clamp(1.5rem, 2.5vw, 2.25rem);
  --body: 1.0625rem;

  --nav-height: 4rem;
  --max-w: 72rem;
  --radius: 0.5rem;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.08);
  --transition: 0.25s ease;
}

html.dark {
  --bg: #1A1D18;
  --bg-alt: #222520;
  --bg-card: #2A2D28;
  --bg-dark: #0F1210;
  --text: #E8E4D8;
  --text-muted: #A8A098;
  --text-faint: #686058;
  --primary: #6AA058;
  --primary-rgb: 106, 160, 88;
  --primary-light: #1A2A18;
  --accent: #D4A050;
  --accent-light: #2A2218;
  --border: #353228;
  --border-light: #222520;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-height) + 1rem);
}

body {
  font-family: var(--font-body);
  font-size: var(--body);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 2.25rem;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: clamp(1.125rem, 1.5vw, 1.375rem); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Section Spacing --- */
.section { padding: 5rem 0; }
.section--sm { padding: 3.5rem 0; }

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--nav-height);
  background: rgba(250, 247, 240, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition), box-shadow var(--transition);
}

html.dark .nav {
  background: rgba(26, 29, 24, 0.92);
}

.nav.scrolled {
  box-shadow: var(--shadow);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav__brand {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text);
  white-space: nowrap;
}

.nav__brand:hover { color: var(--primary); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav__links a {
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: color var(--transition);
}

.nav__links a:hover,
.nav__links a[aria-current="page"] {
  color: var(--primary);
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1.25rem;
  background: var(--primary);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius);
  transition: background var(--transition), transform var(--transition);
}

.nav__cta:hover {
  background: var(--accent);
  color: #fff !important;
  transform: translateY(-1px);
}

.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
}

.nav__toggle svg { width: 1.5rem; height: 1.5rem; }

.nav__theme-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color var(--transition), border-color var(--transition);
}

.nav__theme-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.nav__theme-btn svg { width: 1rem; height: 1rem; }
.nav__theme-btn .icon-sun { display: none; }
html.dark .nav__theme-btn .icon-moon { display: none; }
html.dark .nav__theme-btn .icon-sun { display: block; }

/* --- Mobile Nav --- */
@media (max-width: 767px) {
  .nav__toggle { display: flex; }

  .nav__menu {
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 1.25rem;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: var(--shadow-lg);
  }

  .nav__menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav__links {
    flex-direction: column;
    gap: 1.25rem;
    align-items: flex-start;
  }

  .nav__links a { font-size: 1.0625rem; }

  .nav__cta { width: 100%; justify-content: center; margin-top: 0.5rem; }
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-top: var(--nav-height);
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(42, 58, 32, 0.78) 0%,
    rgba(42, 37, 32, 0.55) 100%
  );
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 38rem;
  padding: 3rem 0;
}

.hero__content h1 {
  color: #fff;
  margin-bottom: 1.25rem;
}

.hero__content p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.125rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: var(--accent);
  color: #fff !important;
  font-weight: 600;
  border-radius: var(--radius);
  font-size: 1rem;
  transition: background var(--transition), transform var(--transition);
}

.hero__cta:hover {
  background: var(--primary);
  color: #fff !important;
  transform: translateY(-2px);
}

/* --- Section Headers --- */
.section-header {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 3rem;
}

.section-header__tag {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.section-header p {
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* --- Product Cards --- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.75rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-card__icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1.25rem;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.product-card__icon svg { width: 1.5rem; height: 1.5rem; }

.product-card h3 { margin-bottom: 0.5rem; }

.product-card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* --- Farm Story (Split) --- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.split__img {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.split__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.split__text h2 { margin-bottom: 1rem; }
.split__text p { color: var(--text-muted); margin-bottom: 1rem; }

.split__text p:last-child { margin-bottom: 0; }

@media (max-width: 767px) {
  .split {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* --- Visit Section (Green BG) --- */
.visit {
  background: var(--bg-dark);
  color: #fff;
  padding: 4rem 0;
}

.visit h2 { color: #fff; margin-bottom: 2rem; text-align: center; }

.visit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2rem;
  text-align: center;
}

.visit-item__icon {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 1rem;
  color: var(--accent);
}

.visit-item__icon svg { width: 100%; height: 100%; }

.visit-item h3 { color: #fff; margin-bottom: 0.5rem; font-size: 1.125rem; }

.visit-item p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.visit-item a {
  color: var(--accent);
  font-weight: 600;
}

.visit-item a:hover { color: #fff; }

/* --- About Page — Values --- */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2rem;
}

.value-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

.value-card__icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  color: var(--primary);
}

.value-card__icon svg { width: 100%; height: 100%; }

.value-card h3 { margin-bottom: 0.5rem; }
.value-card p { color: var(--text-muted); font-size: 0.9375rem; }

/* --- Contact Form --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 767px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-info { list-style: none; }

.contact-info li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

.contact-info__icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary);
  margin-top: 0.2rem;
}

.contact-info__icon svg { width: 100%; height: 100%; }

.contact-info a { color: var(--primary); font-weight: 600; }
.contact-info a:hover { color: var(--accent); }

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.form-group textarea { resize: vertical; min-height: 7rem; }

.form-group select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%235A5448' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.form-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.form-submit:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-feedback {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  display: none;
}

.form-feedback--success {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.form-feedback--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

html.dark .form-feedback--error {
  background: #2a1818;
  color: #fca5a5;
  border-color: #7f1d1d;
}

.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; }

/* --- Footer --- */
.footer {
  background: var(--bg-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 3rem 0 1.5rem;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer__brand h3 {
  font-family: var(--font-heading);
  color: #fff;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.footer__brand p {
  font-size: 0.875rem;
  max-width: 18rem;
  line-height: 1.6;
}

.footer__nav { list-style: none; }
.footer__nav li { margin-bottom: 0.5rem; }

.footer__nav a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  transition: color var(--transition);
}

.footer__nav a:hover { color: #fff; }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.8125rem;
}

.footer__bottom a { color: var(--accent); }
.footer__bottom a:hover { color: #fff; }

/* --- Disclaimer Bar (z-101) --- */
.disclaimer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 101;
  background: var(--bg-dark);
  color: rgba(255,255,255,0.65);
  text-align: center;
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.disclaimer-bar a { color: var(--accent); }
.disclaimer-bar a:hover { color: #fff; }

/* --- 404 --- */
.fourohfour {
  min-height: calc(100vh - var(--nav-height) - 3rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-top: var(--nav-height);
  padding: 3rem 1.25rem;
}

.fourohfour h1 {
  font-size: clamp(4rem, 10vw, 8rem);
  color: var(--primary);
  line-height: 1;
  margin-bottom: 1rem;
}

.fourohfour h2 {
  margin-bottom: 1rem;
}

.fourohfour p {
  color: var(--text-muted);
  max-width: 28rem;
  margin-bottom: 2rem;
}

.fourohfour__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  background: var(--primary);
  color: #fff !important;
  font-weight: 600;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.fourohfour__link:hover { background: var(--accent); color: #fff !important; }

/* --- Breadcrumb --- */
.breadcrumb {
  padding: 1.5rem 0 0;
  margin-top: var(--nav-height);
  font-size: 0.8125rem;
  color: var(--text-faint);
}

.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 0.375rem; }

/* --- About Hero --- */
.page-hero {
  padding: 3rem 0 2rem;
  background: var(--bg-alt);
}

.page-hero h1 { margin-bottom: 0.75rem; }
.page-hero p { color: var(--text-muted); max-width: 36rem; font-size: 1.0625rem; }

/* --- Utility --- */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }

/* --- Animations --- */
@media (prefers-reduced-motion: no-preference) {
  .fade-up {
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .fade-up.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-up { opacity: 1; transform: none; }
}

/* --- Print --- */
@media print {
  .nav, .disclaimer-bar, .nav__toggle { display: none !important; }
  body { padding-bottom: 0; }
  .hero { min-height: auto; }
}
