/**
 * Farm Homepage Styles
 * Modern scroll-snap parallax design for farm landing page
 */

/* Reset and base styles */
.farm-homepage {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* Scroll snap container */
.farm-homepage {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-padding-top: 0;
}

/* Section base styles */
.hero-section,
.enterprise-section,
.contact-section,
.no-enterprises-section {
  min-height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-attachment: fixed; /* Parallax effect */
}

/* ============================================================================
   Hero Section
   ============================================================================ */

.hero-section {
  background: linear-gradient(135deg, var(--primary-deep, #2e7d32) 0%, var(--primary-dark, #3d8b40) 100%);
  color: white;
  text-align: center;
}

.hero-section.has-hero-image {
  background-blend-mode: overlay;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #0b1f14; /* overridden inline by farm.heroOverlayColor */
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 800px;
  padding: 40px 20px;
  animation: fadeInUp 1s ease-out;
}

/* Hero content alignment */
.hero-content.hero-align-center {
  text-align: center;
}

.hero-content.hero-align-left {
  text-align: left;
  max-width: 1400px;
  padding-left: clamp(20px, 8vw, 120px);
  padding-right: clamp(20px, 8vw, 120px);
}

.hero-content.hero-align-left .farm-logo {
  margin-left: 0;
}

/* Hero call-to-action button */
.hero-cta {
  display: inline-block;
  margin-top: 32px;
  padding: 15px 40px;
  background: var(--primary-color, #4CAF50);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(46, 125, 50, 0.45);
}

.hero-cta:hover {
  background: var(--primary-dark, #3d8b40);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 125, 50, 0.6);
  text-decoration: none;
  color: white;
}

.farm-logo {
  max-width: 200px;
  max-height: 200px;
  margin-bottom: 30px;
  border-radius: 50%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: fadeIn 1.5s ease-out;
}

.farm-name {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  margin: 0 0 20px 0;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: -1px;
}

.farm-tagline {
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 300;
  margin: 0;
  opacity: 0.95;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
}

/* Scroll indicator */
.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  cursor: pointer;
  color: white;
  text-align: center;
  animation: bounce 2s infinite;
  transition: opacity 0.3s;
}

.hero-scroll-indicator:hover {
  opacity: 0.7;
}

.hero-scroll-indicator span {
  display: block;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.scroll-arrow {
  font-size: 24px;
  animation: arrowBounce 2s infinite;
}

/* ============================================================================
   Enterprise Sections
   ============================================================================ */

.enterprises-container {
  width: 100%;
}

.enterprise-section {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.enterprise-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Icon Mode - Clean brand-tinted background with large emoji or framed image */
.enterprise-section.enterprise-icon {
  background: linear-gradient(160deg, var(--surface, #ffffff) 0%, var(--surface-muted, #f6f8f5) 100%);
  color: var(--ink, #1f2a24);
}

.enterprise-section.enterprise-icon .enterprise-content {
  text-align: center;
}

.enterprise-section.enterprise-icon .enterprise-name {
  color: var(--ink, #1f2a24);
}

.enterprise-section.enterprise-icon .enterprise-description {
  color: var(--ink-soft, #5b6b61);
}

/* Framed card image (icon-mode enterprise that has a thumbnail) */
.enterprise-thumb {
  margin: 0 auto 28px;
  max-width: 560px;
}

.enterprise-thumb img {
  width: 100%;
  height: auto;
  max-height: 42vh;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(31, 42, 36, 0.18);
}

/* Hero Mode - Full background image with overlay */
.enterprise-section.enterprise-hero {
  color: white;
  background-blend-mode: overlay;
}

.enterprise-section.enterprise-hero .enterprise-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(11, 31, 20, 0.30), rgba(11, 31, 20, 0.70));
  z-index: 1;
}

.enterprise-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 40px;
  text-align: center;
}

.enterprise-icon {
  font-size: clamp(3rem, 10vw, 6rem);
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.enterprise-name {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 700;
  margin: 0 0 20px 0;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.enterprise-description {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  line-height: 1.6;
  margin: 0 0 30px 0;
  opacity: 0.95;
}

.enterprise-link {
  display: inline-block;
  padding: 15px 40px;
  background: var(--primary-color, #4CAF50);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(46, 125, 50, 0.4);
}

.enterprise-link:hover {
  background: var(--primary-dark, #3d8b40);
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 125, 50, 0.55);
}

.link-arrow {
  margin-left: 8px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.enterprise-link:hover .link-arrow {
  transform: translateX(5px);
}

/* ============================================================================
   No Enterprises Section
   ============================================================================ */

.no-enterprises-section {
  background: linear-gradient(135deg, #f5f7fa 0%, #e8eef3 100%);
}

.no-enterprises-content {
  text-align: center;
  max-width: 600px;
  padding: 40px 20px;
}

.no-enterprises-content h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: #666;
  margin: 0 0 20px 0;
}

.no-enterprises-content p {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: #888;
}

/* ============================================================================
   Contact Section
   ============================================================================ */

.contact-section {
  /* Lighter, on-brand footer that melds with the rest of the page.
     Not a full-height panel — sized to its content. */
  min-height: auto;
  background: var(--surface-muted, #f6f8f5);
  border-top: 1px solid var(--hairline, rgba(31, 42, 36, 0.1));
  color: var(--ink, #1f2a24);
  scroll-snap-align: end;
}

.contact-content {
  max-width: 800px;
  padding: 64px 20px 40px;
  text-align: center;
}

.contact-content h2 {
  color: var(--ink, #1f2a24);
}

.contact-content h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 40px 0;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  font-size: 18px;
}

.contact-icon {
  font-size: 24px;
}

.contact-item a {
  color: var(--primary-dark, #3d8b40);
  text-decoration: none;
  transition: color 0.3s;
}

.contact-item a:hover {
  color: var(--primary-deep, #2e7d32);
  text-decoration: underline;
}

.contact-item p {
  margin: 0;
}

.social-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.social-link {
  padding: 12px 24px;
  background: var(--surface, #ffffff);
  color: var(--ink, #1f2a24);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s;
  border: 1px solid var(--hairline, rgba(31, 42, 36, 0.1));
}

.social-link:hover {
  background: #ffffff;
  border-color: rgba(31, 42, 36, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(31, 42, 36, 0.08);
}

.farm-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline, rgba(31, 42, 36, 0.1));
  font-size: 14px;
  color: var(--ink-soft, #5b6b61);
}

.admin-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 16px;
}

.admin-links a {
  color: var(--primary-dark, #3d8b40);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
}

.admin-links a:hover {
  color: var(--primary-deep, #2e7d32);
  text-decoration: underline;
}

/* ============================================================================
   Animations
   ============================================================================ */

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

@keyframes arrowBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
  .hero-section,
  .enterprise-section,
  .contact-section,
  .no-enterprises-section {
    scroll-snap-align: start;
    background-attachment: scroll; /* Disable parallax on mobile for performance */
  }

  .enterprise-content,
  .contact-content {
    padding: 20px;
  }

  .contact-info {
    gap: 15px;
  }

  .social-links {
    flex-direction: column;
    gap: 10px;
  }

  .admin-links {
    flex-direction: column;
    gap: 10px;
  }
}

/* Accessibility: Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  .farm-homepage {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-section,
  .enterprise-section,
  .contact-section,
  .no-enterprises-section {
    background-attachment: scroll;
  }
}
