/* J99 Farms — site styles */
:root {
  --bg: #f8f1e7;
  --surface: #ffffff;
  --ink: #241c16;
  --muted: #6b5f55;
  --line: #e4dccf;
  --brand: #8e4d2a;       /* logo brown */
  --brand-dark: #6a361b;
  --accent: #c4472c;      /* logo star red */
  --brand-tint: #f2d9c0;   /* logo cream */
  --ok: #2f6b3a;   --ok-bg: #e3f0e4;
  --warn: #8a5a00; --warn-bg: #fbefd2;
  --info: #2b5677; --info-bg: #e2edf5;
  --sold: #6e6e6e; --sold-bg: #ececec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(36,28,22,.06), 0 4px 14px rgba(36,28,22,.06);
  --head: "Rockwell", "Roboto Slab", "Zilla Slab", "Georgia", serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max: 1160px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--body);
  padding-bottom: 76px; /* room for mobile action bar */
}
@media (min-width: 860px) { body { padding-bottom: 0; } }
img { max-width: 100%; display: block; }
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); }
h3 { font-size: 1.15rem; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 18px; }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246,242,234,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { height: 44px; width: auto; }
.brand-mark {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: #fff; font: 700 15px/1 var(--head); letter-spacing: .02em;
}
.brand-name { font: 700 1.25rem/1 var(--head); white-space: nowrap; }
.nav { display: none; gap: 4px; }
.nav a {
  text-decoration: none; color: var(--ink); padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: .95rem;
}
.nav a:hover { background: var(--brand-tint); }
.nav a.active { background: var(--brand); color: #fff; }
.site-header .header-call { display: none; }
.menu-btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  width: 44px; height: 44px; font-size: 20px; cursor: pointer; color: var(--ink);
}
.mobile-nav { display: none; border-top: 1px solid var(--line); padding: 8px 18px 14px; }
.mobile-nav.open { display: grid; }
.mobile-nav a {
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: 1.1rem;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
}
.mobile-nav a:last-child { border-bottom: 0; }
.mobile-nav a.active { color: var(--brand); }
@media (min-width: 860px) {
  .nav { display: flex; }
  .menu-btn, .mobile-nav, .mobile-nav.open { display: none; }
  .site-header .header-call { display: inline-flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font: 600 1rem/1 var(--body); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: .92rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Hero ---------- */
.hero { padding: 44px 0 30px; }
.hero .wrap { display: grid; gap: 26px; align-items: center; }
.hero-logo { max-width: 220px; }
.hero-logo .brand-mark { width: 96px; height: 96px; font-size: 32px; box-shadow: 0 0 0 6px var(--bg), 0 0 0 8px var(--brand); }
.hero p.lead { font-size: 1.12rem; color: var(--muted); max-width: 60ch; margin: 0 0 22px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--accent); margin: 0 0 8px; }
@media (min-width: 760px) { .hero .wrap { grid-template-columns: auto 1fr; gap: 44px; } .hero { padding: 64px 0 44px; } }

/* ---------- Section tiles ---------- */
.tiles { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile {
  display: block; text-decoration: none; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s;
}
.tile:hover { transform: translateY(-2px); border-color: var(--brand); }
.tile .ico { font-size: 34px; line-height: 1; margin-bottom: 12px; }
.tile p { margin: 0; color: var(--muted); font-size: .95rem; }
.tile .go { display: inline-block; margin-top: 12px; color: var(--brand); font-weight: 700; }

/* ---------- Generic blocks ---------- */
.section { padding: 34px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { margin: 0; }
.page-head { padding: 34px 0 10px; }
.page-head p { color: var(--muted); max-width: 65ch; margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 9px 15px; font: 600 .93rem/1 var(--body); cursor: pointer; text-decoration: none;
}
.chip .n { color: var(--muted); font-weight: 500; margin-left: 4px; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.active .n { color: #d9cfc4; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0 18px; }
.search {
  flex: 1 1 220px; min-height: 44px; border: 1px solid var(--line); border-radius: 999px; padding: 0 16px;
  font: inherit; background: var(--surface);
}
.search:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.count { color: var(--muted); font-size: .92rem; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-2px); border-color: #cdbfae; }
.card.is-sold { opacity: .62; }
.thumb { position: relative; aspect-ratio: 4 / 3; background: var(--brand-tint); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 54px; filter: saturate(.75); }
.ph small { display: block; font: 600 .78rem/1 var(--body); color: var(--muted); text-align: center; margin-top: 6px; letter-spacing: .04em; text-transform: uppercase; }
.thumb .badge { position: absolute; top: 10px; left: 10px; }
.thumb .count-tag {
  position: absolute; bottom: 10px; right: 10px; background: rgba(36,28,22,.78); color: #fff;
  font-size: .78rem; font-weight: 600; padding: 4px 9px; border-radius: 999px;
}
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-kicker { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.card h3 { margin: 0; font-size: 1.1rem; }
.card .summary { color: var(--muted); font-size: .92rem; }
.price { font: 700 1.15rem/1.2 var(--head); margin-top: auto; padding-top: 8px; color: var(--brand-dark); }
.price small { font: 500 .85rem var(--body); color: var(--muted); }

.badge { display: inline-block; font-size: .76rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; letter-spacing: .02em; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.sold { background: var(--sold-bg); color: var(--sold); }
.badge.neutral { background: #f1ece5; color: var(--muted); }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .btn-row { justify-content: center; margin-top: 14px; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }

/* ---------- Detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; margin: 22px 0 14px; }
.detail { display: grid; gap: 24px; padding-bottom: 40px; }
@media (min-width: 860px) { .detail { grid-template-columns: 1.15fr 1fr; gap: 36px; align-items: start; } }
.gallery .main { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--brand-tint); border: 1px solid var(--line); }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.gallery .main .ph { font-size: 90px; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.thumbs button { flex: none; width: 74px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; }
.thumbs button.active { border-color: var(--brand); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); margin-top: 8px; }
.detail .price { font-size: 1.6rem; padding: 0; margin: 4px 0 16px; }
.specs { width: 100%; border-collapse: collapse; margin: 6px 0 18px; }
.specs th, .specs td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.specs th { color: var(--muted); font-weight: 600; width: 42%; padding-right: 12px; }
.desc { white-space: pre-line; margin: 0 0 20px; }
.contact-box { background: var(--brand-tint); border-radius: var(--radius); padding: 16px; }
.contact-box p { margin: 0 0 10px; font-weight: 600; }
.contact-box .btn { flex: 1 1 140px; }
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 999px; font-size: .92rem; z-index: 50; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* ---------- About / contact ---------- */
.prose { max-width: 68ch; font-size: 1.06rem; }
.prose p { margin: 0 0 1em; }
.contact-grid { display: grid; gap: 14px; }
@media (min-width: 700px) { .contact-grid { grid-template-columns: repeat(2, 1fr); } }
.contact-card h3 { margin-bottom: 2px; }
.contact-card .big { font: 700 1.4rem/1.3 var(--head); margin: 2px 0 12px; display: block; color: var(--ink); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #d9cfc4; margin-top: 30px; padding: 34px 0 30px; font-size: .95rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.foot-grid { display: grid; gap: 22px; }
@media (min-width: 700px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h4 { color: #fff; font: 700 1rem var(--head); margin: 0 0 8px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.copy { border-top: 1px solid #3b3029; margin-top: 24px; padding-top: 16px; font-size: .85rem; color: #a39586; }

/* ---------- Mobile action bar ---------- */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(0,0,0,.06);
}
.action-bar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 50px; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: .85rem; color: var(--ink); background: #f3eee7;
}
.action-bar a.primary { background: var(--brand); color: #fff; }
.action-bar span { font-size: 1.15rem; line-height: 1; }
@media (min-width: 860px) { .action-bar { display: none; } }

.notice { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px 14px; font-size: .9rem; margin: 14px 0 0; }
.hero-logo img { max-width: 140px; }
@media (min-width: 760px) { .hero-logo .brand-mark { width: 150px; height: 150px; font-size: 48px; } .hero-logo img { max-width: 220px; } }
.brand img { height: 46px; width: 46px; }
.hero-logo img { width: 100%; height: auto; filter: drop-shadow(0 6px 14px rgba(60,30,10,.18)); }
.site-notice { background: var(--warn-bg); color: var(--warn); text-align: center; font-size: .88rem; font-weight: 600; padding: 8px 16px; border-bottom: 1px solid #efd9a6; }
