/*
Theme Name: CAG Theme
Theme URI: https://agribusinessghana.com
Author: Chamber of Agribusiness Ghana
Description: Custom WordPress theme for the Chamber of Agribusiness Ghana
Version: 1.0.0
Text Domain: cag-theme
*/

/* ===================================
   AGRIBUSINESS GHANA - CUSTOM STYLES
   Tailwind CSS extensions, animations,
   agricultural patterns & parallax
   =================================== */

/* ===================================
   1. NAVIGATION COMPONENT CLASSES
   =================================== */
.nav-link {
  position: relative;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  border-radius: 0.375rem;
  transition: color 0.2s ease;
}
.nav-link:hover {
  color: #2E7D32;
}
.nav-link--active {
  color: #2E7D32;
  font-weight: 600;
}
.nav-link--active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background: #D4AF37;
  border-radius: 1px;
}

/* WordPress nav active state */
.current-menu-item > a,
.current-menu-ancestor > a {
    color: #2E7D32;
    font-weight: 600;
}

.dropdown-link {
  display: block;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: #374151;
  transition: all 0.2s ease;
}
.dropdown-link:hover {
  background: #E8F5E9;
  color: #2E7D32;
}

.mobile-nav-link {
  display: block;
  color: rgba(255,255,255,0.8);
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: color 0.2s ease;
  font-size: 1.125rem;
}
.mobile-nav-link:hover {
  color: #D4AF37;
}

/* Sticky header shadow */
.header-scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ===================================
   2. CARD & COMPONENT EFFECTS
   =================================== */
.card-hover {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.gold-underline::after {
  content: '';
  display: block;
  width: 4rem;
  height: 3px;
  background: #D4AF37;
  margin-top: 0.75rem;
  border-radius: 2px;
}

.section-divider {
  width: 5rem;
  height: 3px;
  background: #D4AF37;
  margin: 1rem auto 1.5rem;
  border-radius: 2px;
}

/* ===================================
   3. AGRICULTURAL PATTERN BACKGROUNDS
   =================================== */

/* Leaf/seed repeating pattern */
.agri-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5 Q35 15 30 25 Q25 15 30 5Z' fill='%23ffffff' opacity='0.5'/%3E%3Cpath d='M15 35 Q20 45 15 55 Q10 45 15 35Z' fill='%23ffffff' opacity='0.3'/%3E%3Cpath d='M45 35 Q50 45 45 55 Q40 45 45 35Z' fill='%23ffffff' opacity='0.3'/%3E%3C/svg%3E");
  background-size: 60px 60px;
}

/* Topographical contour lines */
.topo-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 50 Q25 30 50 50 Q75 70 100 50' fill='none' stroke='%232E7D32' stroke-width='0.5' opacity='0.08'/%3E%3Cpath d='M0 70 Q25 50 50 70 Q75 90 100 70' fill='none' stroke='%232E7D32' stroke-width='0.5' opacity='0.05'/%3E%3Cpath d='M0 30 Q25 10 50 30 Q75 50 100 30' fill='none' stroke='%232E7D32' stroke-width='0.5' opacity='0.05'/%3E%3C/svg%3E");
  background-size: 100px 100px;
}

/* Dot grid pattern */
.dot-pattern {
  background-image: radial-gradient(circle, #2E7D32 0.8px, transparent 0.8px);
  background-size: 24px 24px;
}

/* ===================================
   4. HERO & PARALLAX ANIMATIONS
   =================================== */

/* Parallax performance */
[data-speed] {
  will-change: transform;
}

/* Floating leaf keyframes */
@keyframes floatLeaf1 {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.12; }
  25% { transform: translateY(-25px) rotate(8deg); opacity: 0.22; }
  50% { transform: translateY(-12px) rotate(-5deg); opacity: 0.18; }
  75% { transform: translateY(-30px) rotate(10deg); opacity: 0.14; }
}
@keyframes floatLeaf2 {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); opacity: 0.1; }
  33% { transform: translateY(-18px) rotate(-8deg) scale(1.05); opacity: 0.2; }
  66% { transform: translateY(-28px) rotate(6deg) scale(0.95); opacity: 0.15; }
}
@keyframes floatLeaf3 {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.08; }
  50% { transform: translateY(-20px) rotate(15deg); opacity: 0.18; }
}

.floating-leaf-1 { animation: floatLeaf1 8s ease-in-out infinite; }
.floating-leaf-2 { animation: floatLeaf2 10s ease-in-out infinite; }
.floating-leaf-3 { animation: floatLeaf3 12s ease-in-out infinite; }

/* Gradient shift for hero overlay */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.animate-gradient-shift {
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
}

/* Scroll indicator bounce */
@keyframes scrollIndicator {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(6px); opacity: 0.3; }
}
.animate-scroll-indicator {
  animation: scrollIndicator 1.5s ease-in-out infinite;
}

/* Hero content entrance */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}
.animate-fade-in {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}
.animate-slide-up {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}
.animate-fade-right {
  opacity: 0;
  animation: fadeInRight 0.8s ease-out forwards;
}

/* Pulse glow on gold CTAs */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3); }
  50% { box-shadow: 0 4px 30px rgba(212, 175, 55, 0.5); }
}
.pulse-glow {
  animation: pulseGlow 3s ease-in-out infinite;
}

/* ===================================
   5. INTERACTIVE COMPONENT ANIMATIONS
   =================================== */

/* Hamburger morph */
#hamburger span {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.hamburger-open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger-open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Accordion smooth expand */
.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.accordion-panel.open {
  max-height: 2000px;
}
.accordion-trigger[aria-expanded="true"] .fa-plus {
  transform: rotate(45deg);
}
.accordion-trigger .fa-plus {
  transition: transform 0.3s ease;
}

/* Logo scroll strip */
@keyframes scrollLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.logo-scroll {
  animation: scrollLeft 25s linear infinite;
}
.logo-scroll:hover {
  animation-play-state: paused;
}

/* Partner logos grayscale-to-color */
.partner-logo {
  filter: grayscale(100%);
  opacity: 0.5;
  transition: all 0.4s ease;
}
.partner-logo:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.08);
}

/* Typewriter cursor blink */
.typewriter-cursor::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: #D4AF37;
  font-weight: 300;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* Staggered card entrance delays */
.stagger-children > *:nth-child(1) { animation-delay: 0s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }

/* ===================================
   6. TESTIMONIAL CAROUSEL
   =================================== */
.carousel-slide {
  transition: opacity 0.5s ease-in-out;
}

/* ===================================
   7. GLOBAL & RESPONSIVE
   =================================== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

*:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #D4AF37;
  border-radius: 4px;
}

/* Disable parallax and heavy animations on mobile */
@media (max-width: 768px) {
  [data-speed] {
    transform: none !important;
  }
  .floating-leaf-1, .floating-leaf-2, .floating-leaf-3 {
    display: none !important;
  }
}

/* Reduce motion for accessibility */
@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;
  }
  [data-speed] {
    transform: none !important;
  }
  .floating-leaf-1, .floating-leaf-2, .floating-leaf-3 {
    display: none !important;
  }
}

/* ===================================
   8. UTILITY HELPERS
   =================================== */

/* Text gradient */
.text-gradient {
  background: linear-gradient(135deg, #D4AF37, #FFD54F);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Image placeholder style */
.placeholder-img {
  background: linear-gradient(135deg, #A5D6A7, #2E7D32);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  font-weight: 500;
}
