/* site/css/style.css - Playbusid Farm Foundation CSS */

/* 1. CSS Custom Properties (Variables) */
:root {
  /* Colors - Earthy greens, warm browns, sky blues, sunny yellow */
  --primary-green: #4A7C59; /* Earthy green for growth and nature */
  --secondary-green: #6B8E23; /* Lighter green for accents */
  --warm-brown: #8B4513; /* Saddle brown for authenticity */
  --light-brown: #D2B48C; /* Tan for warmth */
  --sky-blue: #87CEEB; /* Sky blue for openness */
  --sunny-yellow: #FFD700; /* Gold yellow for joy */
  --neutral-white: #FFFFFF;
  --neutral-light: #F8F9FA;
  --neutral-gray: #6C757D;
  --neutral-dark: #343A40;
  --text-primary: #2C3E50; /* Dark gray for readability */
  --text-secondary: #7F8C8D;
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-medium: rgba(0, 0, 0, 0.15);
  --shadow-dark: rgba(0, 0, 0, 0.25);

  /* Typography */
  --font-heading: 'Playfair Display', serif; /* Rustic, hand-crafted for headings */
  --font-body: 'Open Sans', sans-serif; /* Clean, legible sans-serif */
  --font-size-xl: 3.5rem; /* h1 */
  --font-size-lg: 2.5rem; /* h2 */
  --font-size-md: 2rem; /* h3 */
  --font-size-base: 1.125rem; /* h4, body */
  --font-size-sm: 1rem; /* small text */
  --font-size-xs: 0.875rem;
  --line-height-base: 1.6;
  --line-height-heading: 1.2;

  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --container-padding: 2rem;
  --container-max-width: 1200px;

  /* Borders and Shadows */
  --border-radius-sm: 0.25rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-width: 1px;
  --border-color: #DEE2E6;

  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;

  /* Z-index */
  --z-modal: 1050;
  --z-dropdown: 1000;
  --z-navbar: 1030;
}


/* 2. CSS Reset/Normalize */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background-color: var(--neutral-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: var(--space-md);
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--line-height-heading);
  color: var(--text-primary);
}

h1 { font-size: var(--font-size-xl); }
h2 { font-size: var(--font-size-lg); }
h3 { font-size: var(--font-size-md); }
h4 { font-size: var(--font-size-base); }
h5 { font-size: var(--font-size-sm); }
h6 { font-size: var(--font-size-xs); }

p {
  margin-top: 0;
  margin-bottom: var(--space-md);
}

a {
  color: var(--primary-green);
  text-decoration: none;
  transition: color var(--transition-normal);
}

a:hover,
a:focus {
  color: var(--secondary-green);
  text-decoration: underline;
}

a:focus {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

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

ul, ol {
  margin-top: 0;
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

li {
  margin-bottom: var(--space-xs);
}

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  margin: 0;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/* 3. Typography System */
.text-center { text-align: center; }
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-green { color: var(--primary-green) !important; }
.text-yellow { color: var(--sunny-yellow) !important; }

.lead {
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1.4;
}

/* 4. Layout Utilities - Complement Bootstrap */
.container-custom {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section-padding {
  padding: var(--space-2xl) 0;
}

.section-padding-sm {
  padding: var(--space-lg) 0;
}

.d-flex-center {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.full-bleed {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* Parallax background for hero sections */
.hero-bg {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3); /* Overlay for readability */
}

/* 5. Reusable Components */

/* Buttons */
.btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--border-radius-md);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: all var(--transition-normal);
  border: var(--border-width) solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn:focus {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--primary-green);
  color: var(--neutral-white);
  border-color: var(--primary-green);
}

.btn-primary:hover {
  background-color: var(--secondary-green);
  border-color: var(--secondary-green);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-medium);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-green);
  border-color: var(--primary-green);
}

.btn-secondary:hover {
  background-color: var(--primary-green);
  color: var(--neutral-white);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  color: var(--warm-brown);
  border-color: var(--warm-brown);
}

.btn-outline:hover {
  background-color: var(--warm-brown);
  color: var(--neutral-white);
  transform: translateY(-2px);
}

.btn-yellow {
  background-color: var(--sunny-yellow);
  color: var(--text-primary);
  border-color: var(--sunny-yellow);
}

.btn-yellow:hover {
  background-color: #FFA500;
  border-color: #FFA500;
  transform: translateY(-2px);
}

/* Cards - Compatible with Bootstrap */
.card {
  background: var(--neutral-white);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 2px 8px var(--shadow-light);
  transition: all var(--transition-normal);
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px var(--shadow-medium);
}

.card-img-top {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
}

.card-title {
  font-size: var(--font-size-md);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.card-text {
  flex-grow: 1;
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

.card-footer {
  border-top: var(--border-width) solid var(--border-color);
  background: transparent;
  padding: var(--space-md) var(--space-lg) var(--space-lg);
}

/* REQUIRED: Prevent card squishing in Bootstrap grid */
.row[class*='g-'] > [class*='col-']:has([class*='card']) {
  display: flex !important;
  flex-direction: column !important;
}

[class*='card'] {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-sm);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
  background-color: var(--neutral-white);
  color: var(--text-primary);
}

.form-control:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 0.2rem rgba(74, 124, 89, 0.25);
  outline: none;
}

.form-control::placeholder {
  color: var(--neutral-gray);
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

.btn-submit {
  width: 100%;
  padding: var(--space-md);
  background-color: var(--primary-green);
  color: var(--neutral-white);
  border: none;
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  transition: all var(--transition-normal);
}

.btn-submit:hover {
  background-color: var(--secondary-green);
  transform: translateY(-2px);
}

/* Navigation */
.navbar-custom {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: var(--border-width) solid var(--border-color);
  padding: var(--space-sm) 0;
  transition: all var(--transition-normal);
}

.navbar-brand {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--primary-green) !important;
}

.navbar-nav .nav-link {
  color: var(--text-primary);
  font-weight: 500;
  padding: var(--space-sm) var(--space-md) !important;
  transition: color var(--transition-normal);
  border-radius: var(--border-radius-sm);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link.active {
  color: var(--primary-green) !important;
  background-color: rgba(74, 124, 89, 0.1);
}

.navbar-toggler {
  border: var(--border-width) solid var(--primary-green);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2874, 124, 89, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile nav toggle */
.nav-menu {
  transition: all var(--transition-normal);
}

.nav-menu.active {
  transform: translateX(0);
}

/* Footer */
.footer {
  background-color: var(--warm-brown);
  color: var(--neutral-white);
  padding: var(--space-xl) 0;
  margin-top: var(--space-3xl);
}

.footer a {
  color: var(--light-brown);
}

.footer a:hover {
  color: var(--neutral-white);
}

.footer h5 {
  color: var(--neutral-white);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-sm);
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  color: var(--neutral-white);
  text-align: center;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, var(--font-size-xl));
  margin-bottom: var(--space-lg);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-xl);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Testimonials Carousel */
.testimonial-card {
  text-align: center;
  padding: var(--space-lg);
}

.testimonial-text {
  font-style: italic;
  margin-bottom: var(--space-md);
  font-size: var(--font-size-base);
}

.testimonial-author {
  font-weight: 600;
  color: var(--primary-green);
}

/* Interactive Map */
.farm-map {
  max-width: 100%;
  height: 400px;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 12px var(--shadow-medium);
}

.map-area {
  cursor: pointer;
  transition: all var(--transition-normal);
  fill: var(--light-brown);
}

.map-area:hover {
  fill: var(--primary-green);
  transform: scale(1.05);
}

/* Harvest Calendar */
.harvest-item {
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  transition: all var(--transition-normal);
  background: var(--neutral-light);
}

.harvest-item.available {
  border-color: var(--primary-green);
  background: rgba(74, 124, 89, 0.05);
}

.harvest-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px var(--shadow-light);
}

/* Sustaina-meter */
.sustaina-meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.meter-bar {
  width: 100%;
  height: 20px;
  background: var(--neutral-light);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-green), var(--secondary-green));
  transition: width var(--transition-slow);
  border-radius: var(--border-radius-sm);
}

/* Newsletter Signup */
.newsletter-form {
  max-width: 500px;
  margin: 0 auto;
}

.newsletter-input {
  padding: var(--space-md);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-md) 0 0 var(--border-radius-md);
  border-right: none;
}

.newsletter-btn {
  padding: var(--space-md) var(--space-xl);
  background: var(--primary-green);
  color: var(--neutral-white);
  border: var(--border-width) solid var(--primary-green);
  border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
  transition: all var(--transition-normal);
}

.newsletter-btn:hover {
  background: var(--secondary-green);
  border-color: var(--secondary-green);
}

/* 6. Responsive Breakpoints - Mobile-first */
@media (min-width: 576px) {
  :root {
    --container-padding: 1.5rem;
  }
}

@media (min-width: 768px) {
  html {
    font-size: 18px;
  }

  .navbar-custom {
    padding: var(--space-md) 0;
  }

  .hero {
    min-height: 80vh;
  }
}

@media (min-width: 992px) {
  .container-custom {
    padding: 0 var(--space-xl);
  }

  .section-padding {
    padding: var(--space-3xl) 0;
  }
}

@media (min-width: 1200px) {
  .hero h1 {
    font-size: var(--font-size-xl);
  }
}

/* Mobile adjustments */
@media (max-width: 767.98px) {
  .hero-content {
    padding: 0 var(--space-md);
  }

  .btn {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
  }

  .card-body {
    padding: var(--space-md);
  }

  .farm-map {
    height: 300px;
  }
}

/* 7. Micro-interactions */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.pulse {
  animation: pulse 2s infinite;
}

.scale-hover:hover {
  transform: scale(1.02);
}

/* Smooth transitions for all interactive elements */
* {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

/* 8. Accessibility - WCAG AA */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-bg {
    background-attachment: scroll !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-width: 2px;
    --shadow-light: rgba(0, 0, 0, 0.5);
  }

  .btn:focus,
  .form-control:focus,
  a:focus {
    outline: 3px solid var(--primary-green);
  }
}

/* Print styles */
@media print {
  .navbar, .footer, .btn {
    display: none;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }
}

/* Utility Classes */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* End of style.css */
