/* --- CONFIG & RESET --- */
@font-face {
  font-family: 'CQ Mono';
  src: url('../public/fonts/CQ Mono.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

:root {
  --primary-green: #46673D; /* Updated closely to prototype */
  --primary-hover: #3a5732;
  --bg-color: #fafaf7;
  --bg-box: rgba(236, 243, 233, 0.95);
  --text-dark: #1A1A1A;
  --text-light: #fefefe;
  --accent-sage: #A1C679;
  
  --font-serif: 'Merriweather', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'CQ Mono', 'Courier New', monospace; /* The requested font */

  --border-radius-lg: 40px;
  --border-radius-md: 20px;
  --border-radius-sm: 8px;
  --nav-height: 90px;
  
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text-dark);
  background-color: var(--bg-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--primary-green);
  line-height: 1.2;
}

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

a {
  text-decoration: none;
  color: inherit;
}

/* --- NAVBAR --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: var(--bg-color);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  transition: var(--transition);
}

.nav-container {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 60px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-link {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary-green);
}

.nav-btn {
  background-color: var(--primary-green);
  color: var(--text-light);
  padding: 12px 28px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.nav-btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

.nav-btn .arrow {
  transition: transform 0.3s ease;
}

.nav-btn:hover .arrow {
  transform: translateX(4px);
}

/* Mobile Nav */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 20px;
  position: relative;
  z-index: 1001;
}

.mobile-menu-btn span {
  display: block;
  position: absolute;
  height: 2px;
  width: 100%;
  background: var(--primary-green);
  border-radius: 2px;
  transition: .25s ease-in-out;
}

.mobile-menu-btn span:nth-child(1) { top: 0px; }
.mobile-menu-btn span:nth-child(2) { top: 9px; }
.mobile-menu-btn span:nth-child(3) { top: 18px; }

.mobile-nav-links {
  display: none;
  flex-direction: column;
  background: var(--bg-color);
  position: absolute;
  top: var(--nav-height);
  left: 0;
  width: 100%;
  padding: 20px 40px;
  box-shadow: 0 10px 15px rgba(0,0,0,0.05);
}

.mobile-nav-links.active {
  display: flex;
}

.mobile-nav-links .nav-link {
  padding: 15px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* --- MAIN APP CONTAINER --- */
#app {
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height) - 100px); /* 100px footer */
  display: flex;
  flex-direction: column;
}

/* --- FOOTER --- */
.footer {
  background-color: #222222; /* Dark Grey as per feedback */
  color: var(--text-light);
  padding: 40px;
  text-align: center;
  font-size: 0.9rem;
}

.footer a {
  text-decoration: underline;
  font-weight: 600;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
/* --- GENERAL LAYOUT --- */
.section-container {
  max-width: 1680px;
  margin: 0 auto;
  padding: 80px 40px;
}

.section-header {
  margin-bottom: 40px;
  position: relative;
}

.section-header h2 {
  font-size: 2.5rem;
  background-color: var(--primary-green);
  color: var(--text-light);
  display: inline-block;
  padding: 10px 30px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 10px;
}

.hens-header h2 {
  font-size: 3.125rem; /* 25% larger than 2.5rem */
  padding: 12.5px 37.5px; /* 25% larger box model */
}

.text-center { text-align: center; }
.text-center h2 { margin: 0 auto 20px auto; }
.intro-text { max-width: 800px; margin: 0 auto; font-size: 1.1rem; color: #555; }

.hen-category-section {
  display: flex;
  flex-direction: column;
}

.category-heading {
  font-size: 2rem;
  color: var(--primary-green);
  margin-bottom: 20px;
  border-bottom: 2px solid var(--accent-sage);
  display: inline-block;
  padding-bottom: 5px;
  align-self: flex-start;
}

/* --- HOME HERO --- */
.hero-section {
  min-height: 80vh;
  background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('../assets/home.webp') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.hero-content {
  background: rgba(255, 255, 255, 0.75);
  padding: 60px;
  border-radius: var(--border-radius-lg);
  text-align: center;
  max-width: 800px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  
  /* Animation */
  opacity: 0;
  animation: fadeInBox 2s 0.5s ease-out forwards;
}

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

.hero-content h1 {
  font-size: 3.5rem;
  color: var(--text-dark);
  margin-bottom: 20px;
}

.hero-content .tagline {
  font-size: 1.25rem;
  color: #555;
  margin-bottom: 40px;
}

.cta-button {
  background-color: var(--primary-green);
  color: var(--text-light);
  padding: 16px 40px;
  border-radius: var(--border-radius-sm);
  font-size: 1.1rem;
  font-weight: 600;
  display: inline-block;
  transition: var(--transition);
}

.cta-button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(70, 103, 61, 0.2);
}

/* About Section */
.about-text .section-header {
  text-align: left;
  margin-bottom: 30px;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: stretch;
}

.about-text {
  font-size: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.about-text p { margin-bottom: 20px; }
.about-text p:last-child { margin-bottom: 0; }

.about-map {
  width: 100%;
  height: 100%;
  min-height: 400px; /* Base height for mobile */
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08); /* Match card shadow */
}

.map-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block; /* Removes bottom space under inline iframe */
}

/* --- HEN CARDS GRID (OUR HENS) --- */
.hens-section {
  position: relative;
  /* Add green side-walls using pseudo elements on very wide screens */
}

@media (min-width: 1760px) {
  .hens-section::before,
  .hens-section::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    /* (100% - 1680px inner size) / 2 = gutter width. Subtract 40px for the white gap */
    width: calc((100% - 1680px) / 2 - 40px);
    background-color: var(--primary-green);
    z-index: -1;
  }

  .hens-section::before {
    left: 0;
  }
  
  .hens-section::after {
    right: 0;
  }
}

.hen-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-top: 40px;
}

/* Flip Card Base */
.flip-card {
  background-color: transparent;
  width: 100%;
  aspect-ratio: 1/1; /* Square cards to match square images */
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1); /* Slower transition when flipping BACK (mouse leave) */
  transform-style: preserve-3d;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  border-radius: var(--border-radius-md);
}

/* Hover effect for desktop */
@media (hover: hover) and (pointer: fine) {
  .flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); /* Normal speed when hovering */
  }
}

/* Touch active state for mobile */
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); /* Normal speed when tapping */
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--border-radius-md);
  overflow: hidden;
}

.flip-card-front {
  background-color: var(--bg-box);
  overflow: hidden;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.flip-card-front img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Ensure the entire image and baked-in text is visible */
  transition: transform 0.3s ease;
}

.flip-card:hover .flip-card-front img {
  transform: scale(1.03); /* Subtle hover to prevent clipping text */
}

.flip-card-back {
  background-color: var(--bg-box);
  color: var(--text-dark);
  transform: rotateY(180deg);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flip-card-back .back-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1; /* Fully opaque as it is the background art */
}

.back-content {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 40px 30px;
  background: transparent; /* No overlay required based on user request */
  color: white;
  text-align: center;
}

.back-content h3 {
  color: white;
  margin-bottom: 20px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5); /* Good contrast */
}

.back-content p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: white;
  margin-bottom: 25px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  display: -webkit-box;
  -webkit-line-clamp: 10; /* Increased from 7 for more space */
  line-clamp: 10;
  -webkit-box-orient: vertical;  
  overflow: hidden;
}

/* --- CONTACT SECTION --- */
.contact-section {
  padding: 60px 20px;
}
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: stretch;
  max-width: 1200px;
  margin: 0 auto;
}
.contact-card {
  background: var(--bg-box);
  padding: 60px;
  border-radius: var(--border-radius-md);
  width: 100%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.contact-card h2 { margin-bottom: 20px; }
.contact-info { margin: 30px 0; text-align: left; background: white; padding: 30px; border-radius: 8px;}
.contact-info p { margin-bottom: 10px; font-size: 1.1rem; }
.contact-info a { color: var(--primary-green); font-weight: 600;}

.social-links { display: flex; justify-content: center; gap: 20px; }
.social-btn {
  background: var(--primary-green);
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: 600;
}

#fb-icon-wrapper {
  display: inline-block;
  position: relative;
  width: 60px;
  height: 60px;
}

.fb-icon {
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.fb-anim {
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fb-anim:hover {
  transform: scale(1.15) translateY(-5px);
}

/* --- 404 ERROR PAGE --- */
.error-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  background-color: #FFFFFF;
  text-align: center;
  padding: 80px 20px;
}

.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

.error-img {
  width: 250px;
  height: auto;
  margin-bottom: 30px;
}

.error-container h1 {
  font-family: var(--font-sans);
  font-size: 3.5rem;
  color: #333333;
  margin-bottom: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 800;
}

.error-container h2 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  color: #333333;
  margin-bottom: 10px;
  font-weight: 700;
}

.error-container p {
  font-size: 1.1rem;
  color: #555555;
}

/* RESPONSIVE ADDITIONS */
@media (max-width: 1200px) {
  .hen-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .hen-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-content h1 { font-size: 2.5rem; }
  .hero-content { padding: 40px 20px; }
  .about-content, .contact-content { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hen-grid { grid-template-columns: 1fr; gap: 40px; }
  .section-container { padding: 40px 20px; }
  .flip-card { aspect-ratio: 1/1; }
}
