/*
Theme Name:        Octagon Farms
Theme URI:         https://octagonfarms.com
Author:            Octagon Farms Ltd
Author URI:        https://octagonfarms.com
Description:       A premium wholesale farming theme for Octagon Farms Ltd. Fully compatible with Elementor page builder. Features a deep forest green palette, Playfair Display headings, and a clean modern layout optimised for B2B wholesale businesses.
Version:           1.0.0
Requires at least: 6.0
Tested up to:      6.5
Requires PHP:      8.0
License:           GNU General Public License v2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       octagon-farms
Tags:              elementor, full-width-template, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ============================================================
   GLOBAL CSS VARIABLES — Octagon Farms Brand Colours
   ============================================================ */
:root {
  --of-green:        #22C55E;
  --of-green-dark:   #16A34A;
  --of-forest:       #1A3D2B;
  --of-forest-deep:  #112A1D;
  --of-forest-mid:   #2D5A40;
  --of-sage:         #4A7C5F;
  --of-sage-light:   #6BA882;
  --of-cream:        #F4FAF6;
  --of-warm-white:   #EBF5EF;
  --of-text:         #1A3D2B;

  /* Elementor Global Colour overrides (these match the palette above) */
  --e-global-color-primary:    #22C55E;
  --e-global-color-secondary:  #1A3D2B;
  --e-global-color-text:       #1A3D2B;
  --e-global-color-accent:     #16A34A;

  /* Elementor Global Font overrides */
  --e-global-typography-primary-font-family:   'Playfair Display';
  --e-global-typography-primary-font-weight:   700;
  --e-global-typography-secondary-font-family: 'DM Sans';
  --e-global-typography-secondary-font-weight: 400;
  --e-global-typography-text-font-family:      'DM Sans';
  --e-global-typography-text-font-weight:      300;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--of-cream);
  color: var(--of-text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--of-green); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--of-green-dark); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  color: var(--of-forest);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 5rem);  font-weight: 900; }
h2 { font-size: clamp(2rem,   4vw, 3.5rem); font-weight: 700; }
h3 { font-size: clamp(1.4rem, 2vw, 2rem);   font-weight: 700; }
h4 { font-size: 1.2rem; font-weight: 700; }
h5 { font-size: 1rem;   font-weight: 600; }
h6 { font-size: 0.9rem; font-weight: 600; }

p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--of-sage);
  font-weight: 300;
  margin-bottom: 1.25rem;
}

p:last-child { margin-bottom: 0; }

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-pad {
  padding: 7rem 5rem;
}

.section-pad-sm {
  padding: 4rem 5rem;
}

/* ============================================================
   BUTTONS — base styles Elementor inherits
   ============================================================ */
.btn, .wp-block-button__link,
.elementor-button {
  display: inline-block;
  padding: 0.9rem 2rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, color 0.2s;
  border: none;
  text-decoration: none;
  line-height: 1;
}

.btn-primary,
.elementor-button.elementor-button-primary,
.wp-block-button:not(.is-style-outline) .wp-block-button__link {
  background: var(--of-green);
  color: #fff !important;
}

.btn-primary:hover,
.elementor-button.elementor-button-primary:hover {
  background: var(--of-green-dark);
  transform: translateY(-2px);
  color: #fff !important;
}

.btn-outline,
.elementor-button.elementor-button-ghost,
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--of-forest) !important;
  border: 1.5px solid var(--of-forest);
}

.btn-outline:hover,
.elementor-button.elementor-button-ghost:hover {
  background: var(--of-forest);
  color: #fff !important;
}

/* Elementor default button override */
.elementor-widget-button .elementor-button {
  border-radius: 2px;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.04em;
}

/* ============================================================
   HEADER / SITE NAVIGATION
   ============================================================ */
#masthead,
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: rgba(244, 250, 246, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(26, 61, 43, 0.10);
  transition: box-shadow 0.3s;
}

#masthead.scrolled {
  box-shadow: 0 4px 30px rgba(17, 42, 29, 0.10);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 4rem;
  max-width: 1440px;
  margin: 0 auto;
}

/* Logo */
.site-branding {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-branding .custom-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
  /* Tint black-bg logo to brand forest green */
  filter: brightness(0) saturate(100%)
          invert(20%) sepia(50%) saturate(600%)
          hue-rotate(110deg) brightness(75%);
  transition: opacity 0.2s;
}

.site-branding .custom-logo:hover { opacity: 0.8; }

.site-title {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 1.4rem;
  color: var(--of-forest);
  letter-spacing: -0.03em;
  text-decoration: none;
}

.site-title:hover { color: var(--of-green); }

.site-title span { color: var(--of-green); }

/* Primary nav */
#primary-navigation ul {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}

#primary-navigation ul li a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--of-forest);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}

#primary-navigation ul li a:hover,
#primary-navigation ul li.current-menu-item > a {
  color: var(--of-green);
}

/* CTA button in nav */
#primary-navigation ul li.menu-item-cta > a {
  background: var(--of-green);
  color: #fff !important;
  padding: 0.55rem 1.3rem;
  border-radius: 2px;
  transition: background 0.2s;
}

#primary-navigation ul li.menu-item-cta > a:hover {
  background: var(--of-green-dark);
}

/* Mobile hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--of-forest);
  border-radius: 2px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  color: var(--of-forest);
  font-size: 1.2rem;
  line-height: 1;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-top: 80px;
  overflow: hidden;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 3rem 6rem 5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--of-forest);
  color: var(--of-green);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  width: fit-content;
  margin-bottom: 2rem;
  animation: fadeUp 0.6s ease both;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(3rem, 5vw, 5.5rem);
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--of-forest);
  margin-bottom: 1.5rem;
  animation: fadeUp 0.6s 0.1s ease both;
}

.hero-title em {
  font-style: italic;
  color: var(--of-green);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--of-sage);
  line-height: 1.7;
  max-width: 420px;
  margin-bottom: 2.5rem;
  font-weight: 300;
  animation: fadeUp 0.6s 0.2s ease both;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeUp 0.6s 0.3s ease both;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(26, 61, 43, 0.12);
  animation: fadeUp 0.6s 0.4s ease both;
}

.hero-stat-number {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--of-green);
  line-height: 1;
}

.hero-stat-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--of-sage);
  margin-top: 0.3rem;
  font-weight: 500;
}

.hero-visual {
  position: relative;
  overflow: hidden;
}

.hero-visual-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 60% 40%, rgba(34,197,94,0.22) 0%, transparent 65%),
    radial-gradient(ellipse at 80% 70%, rgba(26,61,43,0.3) 0%, transparent 50%),
    linear-gradient(135deg, #112A1D 0%, #1A3D2B 45%, #2D5A40 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-visual-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--of-cream) 0%, transparent 30%);
  z-index: 1;
}

/* ============================================================
   SECTION LABELS / EYEBROWS
   ============================================================ */
.section-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--of-sage-light);
  font-weight: 500;
  margin-bottom: 0.75rem;
  display: block;
}

.section-label--green { color: var(--of-green); }
.section-label--light { color: rgba(212, 240, 220, 0.75); }

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about-section {
  background: var(--of-forest);
  padding: 5rem;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: center;
}

.about-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 3vw, 2.8rem);
  color: var(--of-cream);
  line-height: 1.1;
}

.about-section h2 em {
  font-style: italic;
  color: var(--of-green);
}

.about-section p {
  color: rgba(212, 240, 220, 0.78);
}

/* ============================================================
   PRODUCT CARDS
   ============================================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.product-card {
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(26, 61, 43, 0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(26, 61, 43, 0.13);
}

.product-card__thumb {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: linear-gradient(135deg, #E8F5E8, #B8E8C8);
}

.product-card__body {
  padding: 1.4rem;
}

.product-card__title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--of-forest);
  margin-bottom: 0.4rem;
}

.product-card__desc {
  font-size: 0.82rem;
  color: var(--of-sage);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.product-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(26, 61, 43, 0.07);
}

.min-order {
  font-size: 0.72rem;
  color: var(--of-sage-light);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.heat-dots { display: flex; gap: 3px; }
.heat-dot  { width: 8px; height: 8px; border-radius: 50%; background: #ddd; }
.heat-dot--hot { background: var(--of-green); }

/* ============================================================
   PROCESS / STEPS
   ============================================================ */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  position: relative;
}

.steps-grid::before {
  content: '';
  position: absolute;
  top: 2.2rem;
  left: 5%;
  right: 5%;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    var(--of-green) 0, var(--of-green) 8px,
    transparent 8px, transparent 18px
  );
  z-index: 0;
}

.step-item {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 1rem;
}

.step-number {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--of-forest);
  color: var(--of-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 auto 1.5rem;
  border: 3px solid var(--of-cream);
  box-shadow: 0 0 0 2px var(--of-forest);
}

.step-item h4 {
  color: var(--of-forest);
  margin-bottom: 0.6rem;
}

/* ============================================================
   WHOLESALE / PERKS
   ============================================================ */
.wholesale-section {
  background: linear-gradient(135deg, var(--of-forest-mid) 0%, var(--of-forest-deep) 100%);
  padding: 7rem 5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.wholesale-section h2,
.wholesale-section h3 {
  color: #fff;
}

.perks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.perk-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 4px;
  padding: 1.2rem;
  transition: background 0.2s;
}

.perk-card:hover { background: rgba(34, 197, 94, 0.1); }

.perk-card__icon { font-size: 1.5rem; margin-bottom: 0.5rem; display: block; }

.perk-card h5 {
  color: #fff;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.perk-card p {
  font-size: 0.8rem;
  color: rgba(212, 240, 220, 0.65);
  line-height: 1.4;
  margin: 0;
}

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.testimonial-card {
  background: #fff;
  border: 1px solid rgba(26, 61, 43, 0.07);
  border-radius: 4px;
  padding: 2rem;
  position: relative;
}

.testimonial-card::before {
  content: '\201C';
  font-family: 'Playfair Display', serif;
  font-size: 5rem;
  color: var(--of-green);
  opacity: 0.22;
  position: absolute;
  top: 0.5rem;
  left: 1.5rem;
  line-height: 1;
  pointer-events: none;
}

.testimonial-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--of-sage);
  font-weight: 300;
  margin-bottom: 1.5rem;
  padding-top: 1.5rem;
}

.testimonial-author { display: flex; align-items: center; gap: 0.8rem; }

.testimonial-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--of-forest);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--of-green);
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.testimonial-avatar img { width: 100%; height: 100%; object-fit: cover; }

.testimonial-name { font-weight: 600; font-size: 0.88rem; color: var(--of-forest); }
.testimonial-role { font-size: 0.76rem; color: var(--of-sage-light); }
.stars-rating { color: var(--of-green); font-size: 0.8rem; letter-spacing: 2px; }

/* ============================================================
   CTA / CONTACT SECTION
   ============================================================ */
.cta-section {
  background: var(--of-forest);
  padding: 7rem 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section h2 {
  color: var(--of-cream);
}

.cta-section h2 em {
  font-style: italic;
  color: var(--of-green);
}

.cta-form {
  display: flex;
  gap: 1rem;
  max-width: 520px;
  margin: 0 auto 1.5rem;
}

.cta-form input[type="email"] {
  flex: 1;
  padding: 0.9rem 1.2rem;
  border: 1.5px solid rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.07);
  border-radius: 2px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
}

.cta-form input[type="email"]::placeholder { color: rgba(212, 240, 220, 0.4); }
.cta-form input[type="email"]:focus        { border-color: var(--of-green); }

/* ============================================================
   FOOTER
   ============================================================ */
#colophon,
.site-footer {
  background: var(--of-forest-deep);
  color: rgba(212, 240, 220, 0.55);
  padding: 2rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer .footer-logo img {
  height: 36px;
  width: auto;
  filter: brightness(0) saturate(100%)
          invert(65%) sepia(30%) saturate(400%)
          hue-rotate(100deg);
  opacity: 0.7;
}

.site-footer a {
  color: var(--of-sage-light);
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer a:hover { color: var(--of-green); }

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ============================================================
   ELEMENTOR OVERRIDES
   ============================================================ */

/* Make sections full-width inside Elementor */
.elementor-section.elementor-section-full_width,
.elementor-section.elementor-section-stretched {
  width: 100% !important;
  max-width: 100% !important;
}

/* Heading widget */
.elementor-widget-heading .elementor-heading-title {
  font-family: 'Playfair Display', serif;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* Text editor widget */
.elementor-widget-text-editor p {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.75;
  color: var(--of-sage);
}

/* Icon box widget */
.elementor-widget-icon-box .elementor-icon-box-title {
  font-family: 'Playfair Display', serif;
}

/* Divider */
.elementor-divider-separator { border-color: rgba(34, 197, 94, 0.3) !important; }

/* ============================================================
   SECTION BACKGROUNDS (utility classes for Elementor)
   ============================================================ */
.bg-forest      { background-color: var(--of-forest) !important; }
.bg-forest-deep { background-color: var(--of-forest-deep) !important; }
.bg-forest-mid  { background-color: var(--of-forest-mid) !important; }
.bg-cream       { background-color: var(--of-cream) !important; }
.bg-warm-white  { background-color: var(--of-warm-white) !important; }
.bg-green       { background-color: var(--of-green) !important; }

.text-white   { color: #fff !important; }
.text-cream   { color: var(--of-cream) !important; }
.text-green   { color: var(--of-green) !important; }
.text-forest  { color: var(--of-forest) !important; }
.text-sage    { color: var(--of-sage) !important; }
.text-muted   { color: rgba(212, 240, 220, 0.65) !important; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .header-inner { padding: 0.9rem 2rem; }
  .hero-section { grid-template-columns: 1fr; }
  .hero-visual  { display: none; }
  .hero-content { padding: 6rem 2rem 4rem; }
  .about-section { grid-template-columns: 1fr; padding: 4rem 2rem; gap: 2rem; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid    { grid-template-columns: repeat(2, 1fr); }
  .wholesale-section { grid-template-columns: 1fr; padding: 4rem 2rem; gap: 3rem; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .section-pad   { padding: 5rem 2rem; }
  .cta-section   { padding: 5rem 2rem; }
}

@media (max-width: 768px) {
  #primary-navigation { display: none; }
  #primary-navigation.is-open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(244, 250, 246, 0.98);
    border-bottom: 1px solid rgba(26, 61, 43, 0.1);
    padding: 1rem 2rem;
  }
  #primary-navigation.is-open ul {
    flex-direction: column;
    gap: 1rem;
  }
  .menu-toggle { display: block; }
  .products-grid { grid-template-columns: 1fr; }
  .steps-grid    { grid-template-columns: 1fr; }
  .steps-grid::before { display: none; }
  .perks-grid    { grid-template-columns: 1fr; }
  .cta-form { flex-direction: column; }
  #colophon { flex-direction: column; text-align: center; padding: 2rem; }
}

/* ============================================================
   WORDPRESS CORE ALIGNMENT CLASSES
   ============================================================ */
.alignleft  { float: left; margin-right: 1.5rem; }
.alignright { float: right; margin-left: 1.5rem; }
.aligncenter, .alignwide, .alignfull {
  clear: both;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Screen reader only */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}
