/* =============================================
   Barn Analytics — main.css
   Matches chickensense.us design exactly
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;600;700&display=swap');

/* --- Design Tokens ---------------------------------------- */
:root {
  --color-primary:   #556b2f;
  --color-btn:       #32373c;
  --color-btn-text:  #ffffff;
  --color-text:      #1a1a1a;
  --color-border:    #e5e7eb;
  --color-hover-bg:  #f9fafb;
  --color-white:     #ffffff;
  --font:            'Hanken Grotesk', sans-serif;
  --max-w:           1200px;
  --content-w:       800px;
  --gap:             24px;
  --radius:          10px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: #fff;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul { list-style: none; }

/* --- Container -------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
.container--narrow {
  max-width: var(--content-w);
}

/* --- Buttons ---------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.667em 1.333em;
  background: var(--color-btn);
  color: var(--color-btn-text);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.btn:hover { opacity: 0.85; }
.btn--outline {
  background: transparent;
  border: 2px solid var(--color-btn-text);
  color: var(--color-btn-text);
}
.btn--outline:hover { background: rgba(255,255,255,0.1); opacity: 1; }

/* --- Header ----------------------------------------------- */
.site-header {
  background: var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
.site-logo img {
  height: 44px;
  width: auto;
}
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a {
  color: var(--color-white);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: opacity 0.15s;
}
.site-nav a:hover { opacity: 0.8; }
.site-nav .nav-cart { font-size: 1.25rem; }

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  transition: all 0.2s;
}

/* --- Footer ----------------------------------------------- */
.site-footer {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 48px 0 32px;
}
.site-footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}
.footer-social { display: flex; gap: 20px; }
.footer-social a {
  color: var(--color-white);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.footer-social a:hover { opacity: 1; }
.footer-legal {
  font-size: 0.82rem;
  opacity: 0.75;
}
.footer-top-link {
  font-size: 0.85rem;
  color: var(--color-white);
  text-decoration: underline;
  opacity: 0.8;
}
.footer-top-link:hover { opacity: 1; }

/* --- Hero Section ----------------------------------------- */
.hero {
  background: #fff;
  padding: 80px 24px 80px;
  text-align: center;
}
.hero__centered {
  max-width: 820px;
  margin: 0 auto;
}
.hero__tagline-large {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.15;
  margin-bottom: 24px;
}
.hero__subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 700;
  line-height: 1.4;
  color: #222;
  margin-bottom: 24px;
}
.hero__body {
  font-size: 1rem;
  line-height: 1.75;
  color: #444;
  margin-bottom: 16px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.hero__body:last-of-type { margin-bottom: 40px; }

/* Outlined button variant */
.btn--outline {
  background: transparent;
  color: var(--color-btn);
  border: 2px solid var(--color-btn);
  padding: 13px 36px;
}
.btn--outline:hover {
  background: var(--color-btn);
  color: #fff;
}

/* --- Sections --------------------------------------------- */
.section {
  padding: 72px 24px;
}
.section--alt { background: var(--color-hover-bg); }
.section--dark {
  background: var(--color-primary);
  color: var(--color-white);
}

.section__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.section__label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: 12px;
}
.section--dark .section__label { color: rgba(255,255,255,0.65); }
.section__title {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 16px;
}
.section__body {
  font-size: 1rem;
  line-height: 1.7;
  max-width: 640px;
  color: #444;
  margin-bottom: 28px;
}
.section--dark .section__body { color: rgba(255,255,255,0.85); }

/* Two-column content+image layout */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.split--reverse .split__image { order: -1; }
.split__image img { border-radius: var(--radius); }

/* --- Team Section ----------------------------------------- */
.team-section {
  display: block;
}
.team-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  width: 100%;
}
.team-photo {
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.team-copy {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 64px 24px;
}
.team-copy__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.team-copy__heading {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-white);
  margin-bottom: 28px;
}
.team-copy p {
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.9);
  margin-bottom: 14px;
  max-width: 760px;
}
.team-copy p:last-child { margin-bottom: 0; }
.team-copy strong { color: var(--color-white); }

@media (max-width: 600px) {
  .team-photos { grid-template-columns: 1fr; }
}

/* --- Product Cards (Shop) --------------------------------- */
.shop-header {
  padding: 56px 24px 32px;
  background: #fff;
}
.shop-header__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.shop-header__title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 8px;
}
.shop-header__sub {
  font-size: 1rem;
  color: #555;
}

.shop-embeds {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px 72px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  padding: 32px 24px 72px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.product-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.product-card__image {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--color-hover-bg);
}
.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-card__body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-card__name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.product-card__desc {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
}
.product-card__price {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.product-card__buy {
  margin-top: auto;
}

/* Shopify Buy Button override: make it match our btn style */
.shopify-buy__btn {
  background: var(--color-btn) !important;
  color: var(--color-btn-text) !important;
  font-family: var(--font) !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  border-radius: 0 !important;
  padding: 0.667em 1.333em !important;
}

/* --- ChickenSense Product Page ---------------------------- */
.product-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 72px 24px;
  align-items: start;
}
.product-hero__meta { padding-top: 8px; }
.product-hero__title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
}
.product-hero__desc {
  font-size: 1rem;
  line-height: 1.7;
  color: #444;
  margin-bottom: 24px;
}
.product-hero__price {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-top: 40px;
}
.feature-item__icon {
  font-size: 2rem;
  margin-bottom: 12px;
}
.feature-item__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.feature-item__body {
  font-size: 0.92rem;
  color: #555;
  line-height: 1.6;
}

/* --- FAQ -------------------------------------------------- */
.faq-page {
  padding: 0 0 80px;
}
.faq-page__header {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 64px 24px 56px;
  text-align: center;
}
.faq-page__header h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 12px;
}
.faq-page__header p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.85);
  max-width: 580px;
  margin: 0 auto;
}
.cs-faq { max-width: 900px; margin: 0 auto; padding: 48px 24px 0; }
.cs-faq-section { margin: 32px 0 16px; }
.cs-faq-section h2 { margin: 0 0 16px; font-size: 1.3rem; }
.cs-faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  background: #fff;
}
.cs-faq-question {
  width: 100%;
  background: #fff;
  border: 0;
  padding: 18px 20px;
  text-align: left;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s;
}
.cs-faq-question:hover { background: var(--color-hover-bg) !important; color: inherit !important; }
.cs-faq-icon {
  margin-left: 16px;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.cs-faq-answer {
  display: none;
  padding: 16px 20px 20px;
}
.cs-faq-item.active .cs-faq-answer { display: block; }
.cs-faq-item.active .cs-faq-icon { transform: rotate(45deg); }
.cs-faq-answer p, .cs-faq-answer ul, .cs-faq-answer ol { margin: 0 0 12px; }
.cs-faq-answer p:last-child, .cs-faq-answer ul:last-child, .cs-faq-answer ol:last-child { margin-bottom: 0; }
.cs-faq-answer ul, .cs-faq-answer ol { padding-left: 24px; list-style: disc; }

/* --- Subscribe Form --------------------------------------- */
.subscribe-form { margin-top: 24px; }
.subscribe-form__row {
  display: flex;
  gap: 12px;
  max-width: 480px;
}
.subscribe-form__input {
  flex: 1;
  padding: 13px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
}
.subscribe-form__input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
@media (max-width: 480px) {
  .subscribe-form__row { flex-direction: column; }
}

/* --- Contact Form ----------------------------------------- */
.contact-page {
  padding: 56px 24px 80px;
  max-width: 680px;
  margin: 0 auto;
}
.contact-page h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 12px;
}
.contact-page .lead {
  font-size: 1rem;
  color: #555;
  margin-bottom: 40px;
}
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
}
.form-group input,
.form-group textarea,
.form-group select {
  font-family: var(--font);
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  width: 100%;
  background: #fff;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: var(--color-primary); }
.form-group textarea { resize: vertical; min-height: 120px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-status {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  display: none;
}
.form-status.success { background: #d1fae5; color: #065f46; display: block; }
.form-status.error   { background: #fee2e2; color: #991b1b; display: block; }

/* --- Homepage contact section ----------------------------- */
.section-contact .contact-form { max-width: 600px; }
.section-contact .section__title { color: var(--color-white); }

/* --- Video Embed (constrained, used on other pages) ------- */
.section--video { padding: 0 24px 72px; }
.video-embed {
  position: relative;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* --- Hero Video (full-bleed autoplay, homepage only) ------ */
.video-hero-section {
  width: 100%;
  background: #000;
  display: block;
  padding: 0;
  margin: 0;
}
.video-hero-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
  overflow: hidden;
}
.video-hero-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}

/* --- Blog ------------------------------------------------- */
.posts-list {
  padding: 56px 24px 80px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.posts-list h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 40px;
}
.post-item {
  border-bottom: 1px solid var(--color-border);
  padding: 24px 0;
}
.post-item:last-child { border-bottom: none; }
.post-item__title { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.post-item__title a { text-decoration: none; color: var(--color-text); }
.post-item__title a:hover { color: var(--color-primary); }
.post-item__date { font-size: 0.85rem; color: #888; margin-bottom: 8px; }
.post-item__excerpt { font-size: 0.95rem; color: #555; }

.post-single {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 56px 24px 80px;
}
.post-single h1 { font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.post-single .post-date { color: #888; font-size: 0.85rem; margin-bottom: 32px; }
.post-single .post-content h2 { font-size: 1.4rem; margin: 32px 0 12px; }
.post-single .post-content p { margin-bottom: 16px; line-height: 1.7; }
.post-single .post-content ul,
.post-single .post-content ol { padding-left: 24px; margin-bottom: 16px; list-style: disc; }

/* --- Responsive ------------------------------------------- */
@media (max-width: 1024px) {
  .split, .hero__inner, .product-hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .split--reverse .split__image { order: 0; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .site-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--color-primary);
    padding: 16px 24px 24px;
    gap: 16px;
    align-items: flex-start;
  }
  .site-nav.open { display: flex; }
  .nav-toggle { display: flex; }
  .site-header { position: relative; }

  .hero { padding: 48px 24px 40px; }
  .section { padding: 48px 24px; }
  .feature-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .team-photos { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr; }
  .hero__title { font-size: 1.75rem; }
}
