/* ── The Homestead Calculator — shared styles ── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Courier+Prime:wght@400;700&family=Lato:wght@300;400;700&display=swap');

:root {
  --cream: #f5f0e8;
  --parchment: #ede4d0;
  --bark: #3d2b1f;
  --moss: #4a6741;
  --sage: #7a9970;
  --clay: #b5601e;
  --rust: #8b3a1a;
  --wheat: #c9a84c;
  --soil: #2c1a0e;
  --fog: #d4cfc7;
}

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

body {
  background-color: var(--cream);
  color: var(--bark);
  font-family: 'Lato', sans-serif;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(74,103,65,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(181,96,30,0.05) 0%, transparent 50%);
}

/* ── HEADER ── */
header {
  background-color: var(--bark);
  color: var(--cream);
  padding: 24px 40px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 4px solid var(--wheat);
  position: relative;
}
header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.015) 10px, rgba(255,255,255,0.015) 11px);
  pointer-events: none;
}
header a { text-decoration: none; color: inherit; display: flex; align-items: center; gap: 18px; min-width: 0; }
header a .logo-icon { flex-shrink: 0; }
header a > div { min-width: 0; overflow: hidden; }
header h1 { font-family: 'Playfair Display', serif; font-size: 1.8rem; letter-spacing: 0.02em; }
header .tagline {
  font-family: 'Courier Prime', monospace;
  font-size: 0.72rem;
  color: var(--fog);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 3px;
}

/* ── NAV ── */
nav {
  background-color: var(--soil);
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}
nav::-webkit-scrollbar { display: none; }
nav a {
  font-family: 'Courier Prime', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fog);
  text-decoration: none;
  padding: 13px 22px;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 7px;
}
nav a:hover { color: var(--cream); background: rgba(255,255,255,0.05); }
nav a.active { color: var(--wheat); border-bottom-color: var(--wheat); background: rgba(201,168,76,0.08); }

/* ── PAGE WRAPPER ── */
.page-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}
.page-layout.no-sidebar {
  grid-template-columns: 1fr;
  max-width: 860px;
}
@media (max-width: 860px) {
  .page-layout { grid-template-columns: 1fr; }
  header { padding: 20px 20px; }
  header h1 { font-size: 1.4rem; }
  .sidebar { display: none; }
}

@media (max-width: 600px) {
  header {
    padding: 14px 16px;
    flex-wrap: nowrap;
    min-height: 64px;
    gap: 10px;
  }
  header h1 {
    font-size: 1.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .logo-icon {
    font-size: 1.6rem !important;
    flex-shrink: 0;
  }
}

/* ── MAIN CONTENT ── */
.tool-header { margin-bottom: 32px; }
.tool-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--bark);
  line-height: 1.2;
}
.tool-header h2 em { color: var(--moss); font-style: italic; }
.tool-header p {
  font-size: 0.95rem;
  color: #6b5b4e;
  margin-top: 8px;
  line-height: 1.6;
  max-width: 560px;
}

/* ── CARDS ── */
.card {
  background: #fff;
  border: 1px solid var(--fog);
  border-radius: 4px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(61,43,31,0.06);
  position: relative;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--moss);
  border-radius: 4px 0 0 4px;
}
.card.rust-accent::before { background: var(--clay); }
.card.wheat-accent::before { background: var(--wheat); }
.card.bark-accent::before { background: var(--bark); }

/* ── FORM ELEMENTS ── */
label {
  display: block;
  font-family: 'Courier Prime', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a6b5e;
  margin-bottom: 8px;
  margin-top: 20px;
}
label:first-of-type { margin-top: 0; }

input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--fog);
  border-radius: 3px;
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  color: var(--bark);
  background: var(--cream);
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
input:focus, select:focus { outline: none; border-color: var(--moss); background: #fff; }

.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .input-row { grid-template-columns: 1fr; } }
.btn {
  display: inline-block;
  margin-top: 24px;
  padding: 13px 32px;
  background-color: var(--moss);
  color: #fff;
  border: none;
  border-radius: 3px;
  font-family: 'Courier Prime', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn:hover { background-color: #3d5736; }
.btn:active { transform: scale(0.98); }
.btn.clay { background-color: var(--clay); }
.btn.clay:hover { background-color: var(--rust); }
.btn.bark { background-color: var(--bark); }
.btn.bark:hover { background-color: var(--soil); }
.btn.wheat-btn { background-color: var(--wheat); color: var(--bark); }
.btn.wheat-btn:hover { background-color: #b8923e; }

/* ── RESULTS ── */
.result-box {
  display: none;
  margin-top: 28px;
  background: var(--parchment);
  border: 1px solid #c9b99a;
  border-radius: 4px;
  padding: 28px;
}
.result-box.show { display: block; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.result-item {
  background: #fff;
  border-radius: 3px;
  padding: 14px;
  border: 1px solid #d9cbb5;
}
.result-item .label {
  font-family: 'Courier Prime', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a7060;
  margin-bottom: 5px;
}
.result-item .value {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--bark);
  line-height: 1.1;
}
.result-item .unit { font-size: 0.78rem; color: #8a7060; margin-top: 2px; }

.result-note {
  font-size: 0.88rem;
  color: #6b5b4e;
  line-height: 1.65;
  border-top: 1px solid #c9b99a;
  padding-top: 16px;
  margin-top: 4px;
}
.result-note strong { color: var(--bark); }

.zone-badge {
  display: inline-block;
  background: var(--moss);
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  padding: 10px 18px;
  border-radius: 4px;
  margin-bottom: 14px;
}

.error-msg {
  color: var(--rust);
  font-size: 0.88rem;
  margin-top: 10px;
  font-style: italic;
  display: none;
}

.tip {
  background: rgba(74,103,65,0.08);
  border-left: 3px solid var(--sage);
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #4a5e47;
  border-radius: 0 3px 3px 0;
  margin-top: 16px;
  line-height: 1.6;
}

.section-divider { border: none; border-top: 1px dashed #c9b99a; margin: 24px 0; }

/* ── SEED TABLE ── */
.schedule-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin-top: 8px; }
.schedule-table th {
  font-family: 'Courier Prime', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a6b5e;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid #c9b99a;
}
.schedule-table td { padding: 9px 10px; border-bottom: 1px solid #e0d5c4; color: var(--bark); vertical-align: top; }
.schedule-table tr:last-child td { border-bottom: none; }
.schedule-table tr:nth-child(even) td { background: rgba(255,255,255,0.5); }
.schedule-table .start-date { font-weight: 700; color: var(--moss); }
.schedule-table .outdoor-date { color: var(--clay); font-weight: 700; }

/* ── FOOD STORAGE ── */
.food-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin-bottom: 12px; align-items: end; }
.food-category {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: var(--bark);
  font-size: 1rem;
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--fog);
}
.food-total-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
  padding: 12px;
  background: var(--bark);
  color: var(--cream);
  border-radius: 3px;
  margin-top: 8px;
  font-weight: 700;
  font-size: 0.9rem;
}
.food-total-row span:first-child {
  font-family: 'Courier Prime', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

/* ── SIDEBAR ── */
.sidebar { display: flex; flex-direction: column; gap: 20px; }

/* AD SLOT */
.ad-slot {
  /* TEMPORARY — hide placeholders until AdSense approved.
     When approved: delete the line below, change display:none to display:flex */
  display: none !important;
  background: #fff;
  border: 2px dashed #c9b99a;
  border-radius: 4px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #a89880;
  font-family: 'Courier Prime', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  gap: 6px;
  text-align: center;
  padding: 12px;
}
.ad-slot.leaderboard { height: 100px; width: 100%; } /* 728×90 or 320×50 mobile */
.ad-slot.rectangle  { height: 280px; width: 100%; } /* 300×250 */
.ad-slot.inline     { height: 120px; width: 100%; margin: 24px 0; } /* between input/result */
.ad-slot span { font-size: 1.4rem; }

/* ── HOMEPAGE CARDS ── */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 32px;
}
.calc-card {
  background: #fff;
  border: 1px solid var(--fog);
  border-radius: 4px;
  padding: 24px;
  text-decoration: none;
  color: var(--bark);
  transition: all 0.2s;
  border-bottom: 3px solid var(--fog);
  display: block;
}
.calc-card:hover { border-bottom-color: var(--moss); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(61,43,31,0.1); }
.calc-card .icon { font-size: 2rem; margin-bottom: 12px; }
.calc-card h3 { font-family: 'Playfair Display', serif; font-size: 1.1rem; margin-bottom: 6px; }
.calc-card p { font-size: 0.82rem; color: #7a6b5e; line-height: 1.5; }

.home-intro {
  max-width: 600px;
}
.home-intro h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  line-height: 1.2;
  margin-bottom: 14px;
}
.home-intro h2 em { color: var(--moss); font-style: italic; }
.home-intro p { font-size: 1rem; color: #6b5b4e; line-height: 1.7; }

/* ── METRIC TOGGLE ── */
#hc-metric-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding-right: 8px;
  font-family: 'Courier Prime', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fog);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
@media (max-width: 400px) {
  #hc-metric-toggle span#hc-unit-label { display: none; }
}
