/* Land4Lions — clean white space framed with green edges; National-Geographic-grade boldness. */
:root {
  --green-900: #0e4229;
  --green-800: #14532f;
  --green-700: #1f6d43;
  --green-600: #2d8659;
  --green-100: #e6f2ea;
  --gold: #d9a441;
  --gold-dark: #b6822a;
  --ivory: #f5f1e6;
  --paper: #ffffff;
  --ink: #14201a;
  --ink-soft: #445a4e;
  --border: #cfe3d6;
  --danger: #b3402d;
  --shadow: 0 10px 30px rgba(14, 66, 41, 0.12);
  --radius: 14px;
  --maxw: 1180px;
  color-scheme: light;
}
[data-theme="dark"] {
  --green-100: #12291d;
  --ivory: #0f1a14;
  --paper: #16261d;
  --ink: #eaf3ec;
  --ink-soft: #b7cabf;
  --border: #234634;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  /* Dark-mode-only accent for text that sits on --paper/--green-100 (both dark surfaces in this
     theme) — --green-800/--green-900 stay unchanged elsewhere (they're also used as always-dark
     backgrounds, e.g. the footer and admin sidebar, so they can't be globally repointed to a light
     colour without breaking those). This is the WCAG color-contrast fix: dark green text on a dark
     surface was unreadable (fails AA). */
  --accent-on-dark: #8fe6b8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--ivory);
  color: var(--ink);
  line-height: 1.55;
  transition: background 0.2s ease, color 0.2s ease;
  min-height: 100vh;
}
h1, h2, h3, h4 { font-family: Georgia, 'Times New Roman', serif; color: var(--ink); line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
a { color: var(--green-700); }
[data-theme="dark"] a { color: #7fd6a5; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }

.price, .money { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ── Top nav ─────────────────────────────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 40;
  background: var(--paper);
  border-bottom: 3px solid var(--green-700);
  box-shadow: var(--shadow);
}
.topnav .bar { display: flex; align-items: center; gap: 18px; padding: 10px 20px; max-width: var(--maxw); margin: 0 auto; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand img { height: 34px; width: auto; }
.navlinks { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.navlinks a, .navlinks button.navlink {
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.94rem;
  padding: 10px 12px; border-radius: 8px; min-height: 44px; display: flex; align-items: center;
  background: none; border: none; cursor: pointer;
}
.navlinks a:hover, .navlinks a.active, .navlink:hover { background: var(--green-100); color: var(--green-800); }
[data-theme="dark"] .navlinks a:hover, [data-theme="dark"] .navlinks a.active, [data-theme="dark"] .navlink:hover { color: var(--accent-on-dark); }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.theme-toggle, .btn-icon {
  border: 2px solid var(--border); background: var(--paper); color: var(--ink);
  border-radius: 999px; min-width: 44px; min-height: 44px; cursor: pointer; font-size: 1.1rem;
}
.admin-flag { background: var(--gold); color: #241a05; font-weight: 800; font-size: 0.72rem; padding: 3px 8px; border-radius: 999px; letter-spacing: 0.04em; }
.nav-hamburger { display: none; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; font-weight: 700; cursor: pointer; text-decoration: none;
  border: 2px solid transparent; min-height: 44px; transition: transform 0.05s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-800); }
.btn-gold { background: var(--gold); color: #241a05; }
.btn-gold:hover { background: var(--gold-dark); }
.btn-outline { background: transparent; border-color: var(--green-700); color: var(--green-700); }
.btn-outline:hover { background: var(--green-100); }
[data-theme="dark"] .btn-outline { border-color: var(--accent-on-dark); color: var(--accent-on-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 0.88rem; min-height: 38px; }
.btn:disabled { opacity: 0.7; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  position: relative; min-height: 78vh; display: flex; align-items: flex-end;
  background-image: linear-gradient(180deg, rgba(8,18,13,0.55) 0%, rgba(6,14,10,0.92) 88%), url('/assets/stock-1.jpg');
  background-size: cover; background-position: center 30%;
  border-bottom: 6px solid var(--gold);
}
.hero .wrap { padding-bottom: 56px; padding-top: 90px; }
.hero .eyebrow { color: var(--gold); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.85rem; }
.hero h1 { color: #fff; max-width: 820px; }
.hero p.lead { color: #fdfdfa; max-width: 620px; font-size: 1.15rem; }
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 22px; }

/* ── Sections / cards ────────────────────────────────────────────────────── */
section.block { padding: 56px 0; }
.section-head { margin-bottom: 32px; max-width: 720px; }
.section-head .kicker { color: var(--green-700); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }
[data-theme="dark"] .section-head .kicker { color: var(--accent-on-dark); }

.grid { display: grid; gap: 22px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: var(--paper); border: 1px solid var(--border); border-left: 5px solid var(--green-700);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; height: 100%;
}
.card.project { padding: 0; overflow: hidden; }
.card.project .cover { height: 180px; background-size: cover; background-position: center; }
.card.project .body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tag { display: inline-block; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--green-800); background: var(--green-100); padding: 3px 10px; border-radius: 999px; align-self: flex-start; }
[data-theme="dark"] .tag { color: var(--accent-on-dark); }

.tier-card {
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 12px; height: 100%; box-shadow: var(--shadow);
}
.tier-card .tier-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tier-card .tier-head h3 { margin: 0; flex: 1; min-width: 0; }
.tier-card .price-line { text-align: right; flex-shrink: 0; }
.tier-card .price-line .amount { font-size: 1.4rem; color: var(--green-800); }
[data-theme="dark"] .tier-card .price-line .amount { color: var(--accent-on-dark); }
.tier-card .price-line .period { display: block; font-size: 0.75rem; color: var(--ink-soft); font-weight: 500; }
.tier-card ul { margin: 0; padding-left: 18px; color: var(--ink-soft); flex: 1; }
.tier-card ul li { margin-bottom: 4px; }

.stat-card { text-align: center; }
.stat-card .num { font-size: 2rem; font-weight: 800; color: var(--green-800); font-variant-numeric: tabular-nums; }
[data-theme="dark"] .stat-card .num { color: var(--accent-on-dark); }
.stat-card .label { color: var(--ink-soft); font-weight: 600; font-size: 0.9rem; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: 0.9rem; }
.field input, .field select, .field textarea {
  border: 2px solid var(--border); border-radius: 8px; padding: 11px 12px; background: var(--paper); color: var(--ink);
  min-height: 44px;
}
.field textarea { min-height: 90px; resize: vertical; }
.field .error { color: var(--danger); font-size: 0.82rem; }
.form-card { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); border-top: 5px solid var(--gold); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 620px) { .two-col { grid-template-columns: 1fr; } }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { background: var(--green-100); color: var(--green-900); font-weight: 700; }
[data-theme="dark"] th { color: var(--accent-on-dark); }
tr:last-child td { border-bottom: none; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.badge.ok { background: #dff5e6; color: #0f3d22; }
.badge.warn { background: #fdf1d8; color: #6e4406; }
.badge.err { background: #fbe1dc; color: #6e2415; }
.badge.info { background: var(--green-100); color: var(--green-800); }
[data-theme="dark"] .badge.info { color: var(--accent-on-dark); }
[data-theme="dark"] .badge.ok { background: #143d26; color: #b7f0cf; }
[data-theme="dark"] .badge.warn { background: #4a3306; color: #ffdf9b; }
[data-theme="dark"] .badge.err { background: #4a2015; color: #ffc2b0; }

/* ── Layout shells ───────────────────────────────────────────────────────── */
#app { min-height: calc(100vh - 60px); }
.page { padding-bottom: 40px; }
.two-pane { display: grid; grid-template-columns: 1.3fr 0.9fr; gap: 26px; align-items: start; }
@media (max-width: 860px) { .two-pane { grid-template-columns: 1fr; } }

.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 60px); }
.admin-sidebar { background: var(--green-900); color: #eaf3ec; padding: 22px 14px; border-right: 6px solid var(--gold); }
.admin-sidebar a, .admin-sidebar button.navlink { color: #d9ebe0; display: block; width: 100%; text-align: left; }
.admin-sidebar a.active, .admin-sidebar a:hover { background: rgba(217,164,65,0.18); color: #fff; }
.admin-sidebar .adm-title { color: var(--gold); font-weight: 800; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.08em; margin: 18px 0 8px; padding: 0 12px; }
.admin-main { padding: 28px 24px; }
@media (max-width: 760px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { border-right: none; border-bottom: 6px solid var(--gold); display: flex; overflow-x: auto; gap: 4px; padding: 10px; }
  .admin-sidebar .adm-title { display: none; }
}

/* ── GIS map (SVG) ───────────────────────────────────────────────────────── */
.gis-map { width: 100%; height: auto; background: var(--green-100); border-radius: var(--radius); border: 1px solid var(--border); }
.gis-map .parcel { fill: rgba(217,164,65,0.35); stroke: var(--gold-dark); stroke-width: 1.4; cursor: pointer; }
.gis-map .parcel:hover { fill: rgba(217,164,65,0.6); }
.gis-map .pin { fill: var(--green-700); stroke: #fff; stroke-width: 1.5; }
.gis-map text.map-label { font-size: 3px; fill: var(--ink); font-weight: 700; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 20, 15, 0.55); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-panel {
  background: var(--paper); border-radius: var(--radius); border-top: 6px solid var(--gold);
  max-width: 520px; width: 100%; max-height: 88vh; overflow-y: auto; padding: 26px; box-shadow: var(--shadow);
}
.modal-panel .modal-close { float: right; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--ink-soft); min-height: 44px; min-width: 44px; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer.site-footer { background: var(--green-900); color: #d9ebe0; border-top: 6px solid var(--gold); padding: 40px 0 24px; }
footer.site-footer h4 { color: #fff; }
footer.site-footer a { color: #d9ebe0; }
footer.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 24px; margin-bottom: 24px; }
footer.site-footer .trust-row { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.82rem; color: #cfe3d6; border-top: 1px solid rgba(255,255,255,0.12); padding-top: 18px; }
footer.site-footer .credits { font-size: 0.74rem; color: #b7cabf; margin-top: 10px; }

/* ── Misc ────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 20px; right: 20px; background: var(--green-800); color: #fff; padding: 14px 18px;
  border-radius: 10px; box-shadow: var(--shadow); z-index: 100; max-width: 320px; font-weight: 600;
}
.toast.err { background: var(--danger); }
.muted { color: var(--ink-soft); font-size: 0.88rem; }
.center { text-align: center; }
.spacer-lg { height: 40px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { border: 2px solid var(--border); background: var(--paper); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; min-height: 40px; color: var(--ink); }
.chip.active { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.empty-state { text-align: center; padding: 50px 20px; color: var(--ink-soft); }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

@media (max-width: 720px) {
  .nav-hamburger { display: inline-flex; align-items: center; justify-content: center; }
  .navlinks { display: none; width: 100%; order: 3; }
  .navlinks.open { display: flex; flex-direction: column; }
}
