/* HayWise — Small Farm Hay Management Hub */
/* Aesthetic: Warm agrarian editorial — earthy, honest, practical */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;1,8..60,300;1,8..60,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --hay:        #C8A84B;
  --hay-light:  #E8D48A;
  --hay-dark:   #8B6914;
  --soil:       #3D2B1F;
  --soil-mid:   #6B4C38;
  --soil-light: #A07050;
  --cream:      #FAF5E9;
  --cream-mid:  #F0E6CC;
  --green:      #4A6741;
  --green-light:#7A9E70;
  --rust:       #B84A2E;
  --sky:        #6B9BB8;
  --white:      #FDFAF3;
  --text:       #2C1A0E;
  --text-mid:   #5C3D28;
  --text-light: #8B6B50;
  --border:     #D4C4A0;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Serif 4', Georgia, serif;
  --font-mono:    'JetBrains Mono', monospace;

  --max-w: 780px;
  --max-w-wide: 1100px;
  --radius: 4px;
  --shadow: 0 2px 12px rgba(61,43,31,0.10);
  --shadow-lg: 0 8px 32px rgba(61,43,31,0.15);
}

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

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

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--cream);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--soil);
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 900; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); font-weight: 700; margin-top: 2.5rem; margin-bottom: 1rem; }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); font-weight: 700; margin-top: 2rem; margin-bottom: 0.6rem; }
h4 { font-size: 1.05rem; font-weight: 700; margin-top: 1.5rem; margin-bottom: 0.4rem; }

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

a { color: var(--hay-dark); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--rust); }

strong { font-weight: 600; color: var(--soil); }
em { font-style: italic; }

ul, ol { padding-left: 1.6rem; margin-bottom: 1.2rem; }
li { margin-bottom: 0.4rem; }

blockquote {
  border-left: 4px solid var(--hay);
  padding: 0.8rem 1.4rem;
  margin: 1.8rem 0;
  background: var(--cream-mid);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-mid);
}

/* ── LAYOUT ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.2rem;
}
.container-wide {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 1.2rem;
}

/* ── HEADER / NAV ── */
.site-header {
  background: var(--soil);
  border-bottom: 3px solid var(--hay);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0.8rem 1.2rem;
  gap: 1rem;
}
.site-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--hay);
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.site-logo span { color: var(--cream); }
.site-logo:hover { color: var(--hay-light); }

.main-nav { display: flex; gap: 0.2rem; flex-wrap: wrap; align-items: center; }
.main-nav a {
  color: var(--cream-mid);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}
.main-nav a:hover { background: var(--soil-mid); color: var(--hay); }

/* ── HERO ── */
.hero {
  background: var(--soil);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(200,168,75,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(74,103,65,0.2) 0%, transparent 50%);
  padding: 4rem 1.2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  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%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C8A84B' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}
.hero-content { position: relative; max-width: 680px; margin: 0 auto; }
.hero h1 { color: var(--cream); margin-bottom: 1rem; }
.hero h1 em { color: var(--hay); font-style: italic; }
.hero p { color: var(--cream-mid); font-size: 1.1rem; margin-bottom: 1.8rem; max-width: 520px; margin-left: auto; margin-right: auto; }
.hero-cta { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

/* ── BUTTONS ── */
.btn {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
}
.btn-primary { background: var(--hay); color: var(--soil); border-color: var(--hay); }
.btn-primary:hover { background: var(--hay-light); color: var(--soil); border-color: var(--hay-light); }
.btn-outline { background: transparent; color: var(--cream); border-color: var(--cream-mid); }
.btn-outline:hover { background: rgba(255,255,255,0.1); color: var(--cream); }
.btn-green { background: var(--green); color: var(--white); border-color: var(--green); }
.btn-green:hover { background: var(--green-light); color: var(--white); border-color: var(--green-light); }

/* ── CARDS / GRID ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
  margin: 2rem 0;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card h3 { margin-top: 0; font-size: 1.1rem; }
.card p { font-size: 0.92rem; color: var(--text-mid); margin-bottom: 1rem; }
.card a.card-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--hay-dark);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.card a.card-link::after { content: '→'; }
.card a.card-link:hover { color: var(--rust); }

.card-icon {
  font-size: 1.8rem;
  margin-bottom: 0.8rem;
  display: block;
}

/* ── ARTICLE LAYOUT ── */
.article-header {
  background: var(--soil);
  padding: 3rem 1.2rem 2.5rem;
  text-align: center;
}
.article-header h1 { color: var(--cream); margin-bottom: 0.8rem; }
.article-header .subtitle {
  color: var(--hay-light);
  font-size: 1.05rem;
  font-style: italic;
  max-width: 600px;
  margin: 0 auto;
}
.article-header .meta {
  color: var(--soil-light);
  font-size: 0.82rem;
  margin-top: 1rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-body {
  padding: 2.5rem 1.2rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ── TABLE ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8rem 0;
  font-size: 0.92rem;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table th {
  background: var(--soil);
  color: var(--hay);
  font-family: var(--font-display);
  font-weight: 700;
  padding: 0.7rem 1rem;
  text-align: left;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}
.data-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) td { background: var(--cream-mid); }

/* ── CALLOUT BOXES ── */
.callout {
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius);
  margin: 1.8rem 0;
  border-left: 4px solid;
}
.callout-tip { background: #EFF7EC; border-color: var(--green); }
.callout-tip strong { color: var(--green); }
.callout-warn { background: #FFF4E0; border-color: var(--hay-dark); }
.callout-warn strong { color: var(--hay-dark); }
.callout-alert { background: #FDECEA; border-color: var(--rust); }
.callout-alert strong { color: var(--rust); }
.callout p:last-child { margin-bottom: 0; }

/* ── FAQ ── */
.faq-section { margin: 2.5rem 0; }
.faq-section h2 { margin-bottom: 1.2rem; }
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--soil);
  margin-bottom: 0.5rem;
}
.faq-a { color: var(--text-mid); font-size: 0.95rem; }

/* ── CALCULATOR ── */
.calc-box {
  background: var(--white);
  border: 2px solid var(--hay);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-lg);
}
.calc-box h3 { margin-top: 0; color: var(--hay-dark); }
.calc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 500px) { .calc-row { grid-template-columns: 1fr; } }
.calc-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 0.3rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.calc-field input, .calc-field select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--cream);
  color: var(--text);
  transition: border-color 0.15s;
}
.calc-field input:focus, .calc-field select:focus {
  outline: none;
  border-color: var(--hay);
}
.calc-result {
  background: var(--soil);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-top: 1rem;
  display: none;
}
.calc-result.visible { display: block; }
.calc-result .result-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--hay);
  display: block;
}
.calc-result .result-label { font-size: 0.88rem; color: var(--cream-mid); }

/* ── BREADCRUMB ── */
.breadcrumb {
  padding: 0.7rem 1.2rem;
  background: var(--cream-mid);
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-light);
}
.breadcrumb a { color: var(--text-light); text-decoration: none; }
.breadcrumb a:hover { color: var(--hay-dark); }
.breadcrumb span { margin: 0 0.4rem; }

/* ── INTERNAL LINKS SECTION ── */
.related-links {
  background: var(--cream-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  margin: 2rem 0;
}
.related-links h3 { margin-top: 0; font-size: 1.05rem; color: var(--soil); }
.related-links ul { margin-bottom: 0; }
.related-links li { margin-bottom: 0.3rem; }
.related-links a { font-size: 0.92rem; }

/* ── SECTION DIVIDER ── */
.section { padding: 3rem 1.2rem; }
.section-alt { background: var(--cream-mid); }
.section h2 { text-align: center; margin-bottom: 0.5rem; }
.section-sub { text-align: center; color: var(--text-mid); margin-bottom: 2rem; font-style: italic; }

/* ── FOOTER ── */
.site-footer {
  background: var(--soil);
  color: var(--cream-mid);
  padding: 2.5rem 1.2rem 1.5rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  max-width: var(--max-w-wide);
  margin: 0 auto 2rem;
}
.footer-col h4 {
  color: var(--hay);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.8rem;
  font-family: var(--font-mono);
}
.footer-col a {
  display: block;
  color: var(--cream-mid);
  text-decoration: none;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--hay); }
.footer-bottom {
  border-top: 1px solid var(--soil-mid);
  padding-top: 1.2rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--soil-light);
  max-width: var(--max-w-wide);
  margin: 0 auto;
}
.footer-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--hay);
  margin-bottom: 0.5rem;
}

/* ── DISCLAIMER ── */
.disclaimer {
  background: var(--cream-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  font-size: 0.82rem;
  color: var(--text-light);
  margin: 2rem 0;
  font-style: italic;
}

/* ── HIGHLIGHT BOX ── */
.highlight-box {
  background: var(--soil);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 1.8rem;
  margin: 2rem 0;
  text-align: center;
}
.highlight-box h3 { color: var(--hay); margin-top: 0; }
.highlight-box p { color: var(--cream-mid); margin-bottom: 0; }
.big-num {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  color: var(--hay);
  display: block;
  line-height: 1;
  margin-bottom: 0.3rem;
}

/* ── TOOL PAGE ── */
.tool-header {
  background: linear-gradient(135deg, var(--green) 0%, var(--soil) 100%);
  padding: 3rem 1.2rem;
  text-align: center;
}
.tool-header h1 { color: var(--cream); }
.tool-header p { color: var(--hay-light); max-width: 560px; margin: 0.8rem auto 0; }

/* ── PDF PROMO ── */
.pdf-promo {
  background: var(--hay);
  border-radius: var(--radius);
  padding: 1.6rem;
  margin: 2rem 0;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.pdf-promo .pdf-icon { font-size: 2.5rem; flex-shrink: 0; }
.pdf-promo h4 { color: var(--soil); margin-top: 0; margin-bottom: 0.3rem; }
.pdf-promo p { color: var(--soil); font-size: 0.9rem; margin-bottom: 0; }
.pdf-promo .btn { margin-top: 0.5rem; flex-shrink: 0; }

/* ── PROGRESS BAR (for calc results) ── */
.bar-wrap { background: rgba(255,255,255,0.1); border-radius: 99px; height: 8px; margin: 0.4rem 0; }
.bar-fill { height: 8px; border-radius: 99px; background: var(--hay); transition: width 0.4s; }

/* ── TABLE WRAP (scroll on mobile) ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .header-inner { flex-direction: column; gap: 0.5rem; }
  .main-nav { justify-content: center; }
  .hero { padding: 2.5rem 1rem; }
  .card-grid { grid-template-columns: 1fr; }
  .calc-row { grid-template-columns: 1fr; }
  .pdf-promo { flex-direction: column; text-align: center; }
}

/* ── ANALYTICS PLACEHOLDER ── */
/* Analytics: GA4 G-G9N88WVG8H | AdSense ca-pub-8027395044809342 | Clarity x2dwa9puaa — active in all page heads */
