@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg:        #0d1117;
  --bg2:       #161b22;
  --bg3:       #21262d;
  --border:    #30363d;
  --border2:   #21262d;
  --text:      #e6edf3;
  --muted:     #8b949e;
  --blue:      #58a6ff;
  --blue-bg:   #1a3a5c;
  --green:     #3fb950;
  --green-bg:  #1a4a2e;
  --red:       #f85149;
  --red-bg:    #4a1a1a;
  --orange:    #f0883e;
  --orange-bg: #2d1f0e;
  --yellow:    #d29922;
  --yellow-bg: #2d2a1a;
  --purple:    #bc8cff;
  --purple-bg: #2d1f4a;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
  --max: 1200px;
  --hh: 54px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; background: none; border: none; }
img, video { max-width: 100%; height: auto; display: block; }

/* ── Layout ── */
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.page { padding: 36px 0 60px; }

/* ── Header ── */
.site-header { background: var(--bg2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; height: var(--hh); }
.header-inner { display: flex; align-items: center; height: 100%; gap: 16px; }
.site-logo { font-family: var(--mono); font-size: 14px; font-weight: 600; border: 1px solid var(--border); padding: 3px 9px; border-radius: 4px; color: var(--text); flex-shrink: 0; }
.site-logo em { color: var(--blue); font-style: normal; }
.main-nav { display: flex; align-items: center; flex: 1; height: 100%; }
.main-nav ul { display: flex; list-style: none; height: 100%; }
.main-nav li { position: relative; height: 100%; display: flex; align-items: center; }
.main-nav a { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 0 14px; height: 100%; display: flex; align-items: center; border-bottom: 2px solid transparent; transition: color .15s; }
.main-nav a:hover { color: var(--text); }
.main-nav .active > a { color: var(--blue); border-bottom-color: var(--blue); }
.main-nav .has-dropdown > ul { display: none; position: absolute; top: 100%; left: 0; background: var(--bg2); border: 1px solid var(--border); border-radius: 4px; min-width: 200px; z-index: 200; flex-direction: column; }
.main-nav .has-dropdown:hover > ul { display: flex; }
.main-nav .has-dropdown > ul li { height: auto; }
.main-nav .has-dropdown > ul a { height: auto; padding: 8px 16px; border-bottom: none; border-top: 1px solid var(--border2); }
.main-nav .has-dropdown > ul li:first-child a { border-top: none; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-login { font-family: var(--mono); font-size: 11px; padding: 5px 14px; border-radius: 4px; border: 1px solid var(--border); color: var(--muted); transition: color .15s, border-color .15s; }
.btn-login:hover { color: var(--text); border-color: var(--muted); }
.btn-join { font-family: var(--mono); font-size: 11px; padding: 5px 14px; border-radius: 4px; border: 1px solid var(--blue); background: var(--blue-bg); color: var(--blue); transition: background .15s; }
.btn-join:hover { background: var(--blue); color: #0d1117; }

/* ── Buttons ── */
.btn { font-family: var(--mono); font-size: 12px; padding: 9px 20px; border-radius: 4px; border: 1px solid var(--border); color: var(--muted); cursor: pointer; transition: all .15s; display: inline-block; }
.btn-primary { border-color: var(--blue); background: var(--blue-bg); color: var(--blue); }
.btn-primary:hover { background: var(--blue); color: #0d1117; }
.btn-green { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.btn-green:hover { background: var(--green); color: #0d1117; }
.btn-red { border-color: var(--red); background: var(--red-bg); color: var(--red); }
.btn-sm { padding: 4px 12px; font-size: 11px; }
.btn-full { width: 100%; text-align: center; display: block; }

/* ── Section ── */
.sec { font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.section { padding: 32px 0; border-bottom: 1px solid var(--border); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-link { font-family: var(--mono); font-size: 11px; color: var(--blue); }

/* ── Cards ── */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; }
.card-body { padding: 16px 20px; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: 6px; }
.form-input, .form-select, .form-textarea { background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-family: var(--mono); font-size: 13px; padding: 9px 12px; width: 100%; outline: none; transition: border-color .15s; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--blue); }
.form-select { appearance: none; cursor: pointer; }
.form-textarea { resize: vertical; min-height: 100px; }
.form-error { font-family: var(--mono); font-size: 11px; color: var(--red); margin-top: 4px; }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Tables ── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
thead th { background: var(--bg3); color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border2); }
tbody tr:hover { background: var(--bg3); }
td { padding: 8px 12px; }

/* ── Badges ── */
.badge { font-family: var(--mono); font-size: 10px; padding: 2px 8px; border-radius: 10px; border: 1px solid; display: inline-block; }
.badge-active  { color: var(--green);  border-color: var(--green);  background: var(--green-bg); }
.badge-inactive{ color: var(--red);    border-color: var(--red);    background: var(--red-bg); }
.badge-trial   { color: var(--yellow); border-color: var(--yellow); background: var(--yellow-bg); }
.badge-manual  { color: var(--blue);   border-color: var(--blue);   background: var(--blue-bg); }
.badge-comp    { color: var(--purple); border-color: var(--purple); background: var(--purple-bg); }
.badge-stripe  { color: var(--green);  border-color: var(--green);  background: var(--green-bg); }

/* ── Post Cards ── */
.posts-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.post-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; transition: border-color .15s; }
.post-card:hover { border-color: var(--muted); }
.post-thumb { height: 120px; background: var(--bg3); overflow: hidden; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.post-card:hover .post-thumb img { transform: scale(1.03); }
.post-thumb-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.post-thumb-icon { font-family: var(--mono); font-size: 10px; color: var(--blue); padding: 5px 9px; border: 1px solid var(--border); border-radius: 3px; }
.post-body { padding: 12px 14px; }
.post-cat { font-family: var(--mono); font-size: 10px; color: var(--blue); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px; }
.post-title { font-size: 13px; font-weight: 500; line-height: 1.4; margin-bottom: 8px; }
.post-meta { display: flex; align-items: center; justify-content: space-between; }
.post-date { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.post-lock { font-family: var(--mono); font-size: 9px; color: var(--muted); padding: 2px 7px; border: 1px solid var(--border); border-radius: 10px; }

/* ── Dashboard Cards ── */
.dash-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
.dash-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; padding: 18px 20px; position: relative; overflow: hidden; transition: border-color .15s; }
.dash-card:hover { border-color: var(--muted); }
.dash-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.dash-card.c-blue::before   { background: var(--blue); }
.dash-card.c-green::before  { background: var(--green); }
.dash-card.c-orange::before { background: var(--orange); }
.dash-card.c-purple::before { background: var(--purple); }
.dash-card-name { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.dash-card-sub  { font-size: 12px; color: var(--muted); margin-top: 3px; }
.dash-stat-lbl  { font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 12px 0 4px; }
.dash-stat-val  { font-family: var(--mono); font-size: 24px; font-weight: 600; }
.dash-card-footer { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border2); display: flex; align-items: center; justify-content: space-between; }
.dash-card-date { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.dash-card-link { font-family: var(--mono); font-size: 10px; color: var(--blue); }
.member-only-badge { font-family: var(--mono); font-size: 9px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--blue); color: var(--blue); background: var(--blue-bg); }

/* ── Hero ── */
.hero { padding: 56px 0 48px; border-bottom: 1px solid var(--border); }
.hero-eyebrow { font-family: var(--mono); font-size: 11px; color: var(--blue); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.hero-title { font-size: 36px; font-weight: 700; line-height: 1.2; margin-bottom: 16px; max-width: 640px; }
.hero-title span { color: var(--blue); }
.hero-sub { font-size: 14px; color: var(--muted); line-height: 1.8; max-width: 540px; margin-bottom: 28px; }
.hero-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 40px; }
.hero-stats { display: flex; gap: 40px; padding-top: 28px; border-top: 1px solid var(--border2); flex-wrap: wrap; }
.hero-stat-val { font-family: var(--mono); font-size: 22px; font-weight: 600; }
.hero-stat-lbl { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── Auth pages ── */
.auth-page { min-height: calc(100vh - var(--hh)); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 36px 40px; width: 100%; max-width: 420px; }
.auth-title { font-family: var(--mono); font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.auth-sub { font-size: 12px; color: var(--muted); margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 16px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.auth-footer a { color: var(--blue); }
.auth-error { background: var(--red-bg); border: 1px solid var(--red); border-radius: 4px; padding: 10px 14px; font-family: var(--mono); font-size: 12px; color: var(--red); margin-bottom: 16px; display: none; }
.auth-error.show { display: block; }

/* ── Calendar ── */
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.cal-header { background: var(--bg3); padding: 8px; text-align: center; font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cal-day { background: var(--bg2); padding: 8px; min-height: 80px; }
.cal-day.other-month { background: var(--bg); }
.cal-day.today { background: var(--bg3); }
.cal-day-num { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.cal-day.today .cal-day-num { color: var(--blue); font-weight: 600; }
.cal-event { font-size: 10px; padding: 2px 5px; border-radius: 2px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-event.usda    { background: var(--blue-bg);   color: var(--blue); }
.cal-event.cftc    { background: var(--purple-bg);  color: var(--purple); }
.cal-event.holiday { background: var(--red-bg);     color: var(--red); }
.cal-event.planting{ background: var(--green-bg);   color: var(--green); }
.cal-event.harvest { background: var(--orange-bg);  color: var(--orange); }
.cal-event.other   { background: var(--yellow-bg);  color: var(--yellow); }

/* ── Pricing ── */
.pricing-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; max-width: 680px; }
.price-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; padding: 24px; }
.price-card.featured { border-color: var(--blue); }
.price-name { font-family: var(--mono); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.price-amount { font-family: var(--mono); font-size: 32px; font-weight: 700; margin: 12px 0 6px; }
.price-amount span { font-size: 13px; color: var(--muted); font-weight: 400; }
.price-desc { font-size: 12px; color: var(--muted); margin-bottom: 16px; line-height: 1.6; }
.price-features { list-style: none; }
.price-feature { font-size: 12px; color: var(--muted); padding: 5px 0; border-bottom: 1px solid var(--border2); display: flex; align-items: center; gap: 8px; }
.price-check { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; }

/* ── Member gate ── */
.member-gate { background: var(--bg2); border: 1px solid var(--border); border-left: 3px solid var(--blue); border-radius: 4px; padding: 28px 32px; text-align: center; margin: 32px 0; }
.member-gate h3 { font-family: var(--mono); font-size: 14px; margin-bottom: 8px; }
.member-gate p { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

/* ── Footer ── */
.site-footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 20px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-logo { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.footer-nav { display: flex; gap: 16px; list-style: none; }
.footer-nav a { font-family: var(--mono); font-size: 11px; color: var(--muted); transition: color .15s; }
.footer-nav a:hover { color: var(--text); }

/* ── Search ── */
.search-result { background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; padding: 16px 20px; margin-bottom: 10px; }
.search-result-title { font-size: 14px; font-weight: 500; color: var(--blue); margin-bottom: 6px; }
.search-result-highlight { font-size: 12px; color: var(--muted); line-height: 1.6; }
.search-result-highlight mark { background: var(--yellow-bg); color: var(--yellow); padding: 1px 2px; border-radius: 2px; }
.search-result-meta { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 8px; }

/* ── Admin ── */
.admin-sidebar { width: 220px; flex-shrink: 0; }
.admin-layout { display: flex; gap: 24px; padding: 24px 0; }
.admin-content { flex: 1; min-width: 0; }
.admin-nav { background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.admin-nav a { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 10px 16px; display: block; border-bottom: 1px solid var(--border2); transition: color .15s, background .15s; }
.admin-nav a:last-child { border-bottom: none; }
.admin-nav a:hover, .admin-nav a.active { background: var(--bg3); color: var(--text); }
.admin-nav a.active { color: var(--blue); }
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; padding: 16px; }
.stat-card-lbl { font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.stat-card-val { font-family: var(--mono); font-size: 24px; font-weight: 600; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .posts-grid { grid-template-columns: repeat(2,1fr); }
  .dash-grid  { grid-template-columns: 1fr; }
  .stat-grid  { grid-template-columns: repeat(2,1fr); }
  .hero-title { font-size: 26px; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; }
}
@media (max-width: 640px) {
  .posts-grid  { grid-template-columns: 1fr; }
  .pricing-grid{ grid-template-columns: 1fr; }
  .main-nav    { display: none; }
  .hero-stats  { gap: 20px; }
  .auth-box    { padding: 24px 20px; }
}

/* ── Nav dropdown fixes ── */
.main-nav .has-dropdown > ul {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  padding: 4px 0;
  min-width: 220px;
}
.main-nav .has-dropdown > ul a {
  padding: 9px 16px;
  border-top: none;
  border-bottom: 1px solid var(--border2);
  font-size: 12px;
  color: var(--muted);
}
.main-nav .has-dropdown > ul li:last-child a { border-bottom: none; }
.main-nav .has-dropdown > ul a:hover { color: var(--text); background: var(--bg3); }

/* ── Page top padding ── */
.hero { padding-top: 72px; }
.page { padding-top: 48px; }

/* ── Reduce mono font usage — use sans for body text ── */
.post-title { font-family: var(--sans); font-size: 14px; }
.dash-card-name { font-family: var(--sans); }
.dash-card-sub { font-family: var(--sans); }
.price-desc { font-family: var(--sans); }
.hero-sub { font-family: var(--sans); }
.hero-stat-lbl { font-family: var(--sans); }
p { font-family: var(--sans); }
