/* ============================================
   SimpleLandTools — Design System
   Inspired by land surveys, plat maps, and deed
   records: contour lines, brass compass tones,
   ruled paper. Not a generic SaaS template.
   ============================================ */

:root {
  /* Color */
  --paper:      #F3EFE4;   /* soft survey-paper background */
  --paper-line: #DAD3BF;   /* faint ruled-paper lines */
  --ink:        #23301F;   /* deep forest ink for text */
  --ink-soft:   #4B5A44;   /* softer body text */
  --moss:       #4B6B3E;   /* primary accent — moss green */
  --moss-dark:  #34492B;
  --brass:      #B98A2E;   /* surveyor's brass / compass accent */
  --brass-soft: #E4C77C;
  --clay:       #A85B3B;   /* stake/clay red-brown, used sparingly */
  --white:      #FCFAF3;
  --line:       #C7BFA6;

  /* Type */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius: 3px;
}

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600&display=swap');

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  background-image:
    linear-gradient(var(--paper-line) 1px, transparent 1px);
  background-size: 100% 2.1em;
  background-attachment: local;
}

a { color: var(--moss-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 600;
}

h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.3rem; }

p { max-width: 68ch; color: var(--ink-soft); }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--white);
  border-bottom: 2px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header::after {
  content: "";
  display: block;
  height: 6px;
  background-image: repeating-linear-gradient(
    90deg, var(--moss) 0 18px, transparent 18px 26px
  );
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  max-width: 1120px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
}

.logo img { width: 300px; height: 60px; object-fit: contain; flex-shrink: 0; }

.main-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--moss-dark);
  border-bottom-color: var(--brass);
  text-decoration: none;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--moss);
  border-color: var(--moss-dark);
  color: var(--white);
}
.btn-primary:hover { background: var(--moss-dark); }

.btn-outline {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn-outline:hover { background: var(--ink); color: var(--white); }

.btn-small { padding: 7px 14px; font-size: 0.85rem; }

/* ---------- Hero ---------- */

.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-eyebrow {
  color: var(--brass);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.hero h1 { max-width: 14ch; }

.hero-sub {
  font-size: 1.15rem;
  max-width: 46ch;
  margin-bottom: 28px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* Plat-map illustration block */
.plat-illustration {
  border: 2px solid var(--ink);
  background: var(--white);
  aspect-ratio: 1 / 1;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}

.plat-illustration svg { width: 100%; height: 100%; display: block; }

/* ---------- Section blocks ---------- */

.section { padding: 64px 0; }
.section-alt { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { max-width: 62ch; margin-bottom: 40px; }
.section-head p { margin-top: 8px; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

.card-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--moss);
  border-radius: 50%;
  color: var(--moss-dark);
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-weight: 700;
}

.card h3 { margin-bottom: 8px; }
.card p { margin-bottom: 0; font-size: 0.95rem; }

/* ---------- Network site cards (Our Sites page) ---------- */

.network-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent, var(--moss));
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(35,48,31,0.06);
}

.network-card img {
  width: 100%;
  max-width: 240px;
  height: auto;
  margin-bottom: 16px;
}

.network-card-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 4px 0 16px;
}

.network-card p {
  flex-grow: 1;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: 0;
}

.network-card-link {
  margin-top: 18px;
  font-weight: 600;
  color: var(--accent, var(--moss-dark)) !important;
}
.network-card-you-are-here {
  color: var(--brass);
  font-size: 0.8rem;
  margin-left: 6px;
}

/* ---------- Guide / long-form content ---------- */

.guide-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
}

.guide-toc {
  position: sticky;
  top: 24px;
  border-left: 2px solid var(--line);
  padding-left: 18px;
}

.guide-toc a {
  display: block;
  padding: 6px 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.guide-toc a:hover { color: var(--moss-dark); text-decoration: none; }

.guide-step {
  display: flex;
  gap: 20px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.guide-step:last-child { border-bottom: none; }

.guide-step-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--brass);
  min-width: 44px;
}

/* ---------- Tables (state funding) ---------- */

table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

.data-table th, .data-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.94rem;
}

.data-table th { color: var(--ink); font-family: var(--font-display); }

/* ---------- State grid (funding page) ---------- */

.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.state-chip {
  display: block;
  text-align: center;
  padding: 12px 6px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--radius);
  font-weight: 600;
  color: var(--ink);
}
.state-chip:hover { border-color: var(--moss); color: var(--moss-dark); text-decoration: none; }

/* ---------- Clickable US map (funding page) ---------- */

.us-map-wrap {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px 20px 8px;
}

.us-map { width: 100%; height: auto; display: block; }

.us-map-state path {
  fill: var(--moss);
  stroke: var(--paper);
  stroke-width: 1.2;
  transition: fill 0.12s ease;
  cursor: pointer;
}

.us-map-state:hover path,
.us-map-state:focus path {
  fill: var(--brass);
}

.us-map-dc circle {
  fill: var(--clay);
  stroke: var(--paper);
  stroke-width: 1;
  cursor: pointer;
  transition: fill 0.12s ease;
}

.us-map-dc:hover circle,
.us-map-dc:focus circle {
  fill: var(--brass);
}

.us-map-attribution {
  font-size: 0.75rem;
  color: var(--ink-soft);
  text-align: right;
  margin: 6px 0 0;
}

/* ---------- State page with sidebars ---------- */

.state-page-layout {
  display: grid;
  grid-template-columns: 200px 1fr 200px;
  gap: 28px;
  align-items: start;
}

.state-sidebar {
  position: sticky;
  top: 88px; /* clears the sticky header */
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.sidebar-box h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--ink);
}

.sidebar-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-box ul a {
  font-size: 0.88rem;
  color: var(--moss-dark);
}

.sidebar-ad-box {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 8px;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.sidebar-account-box p { font-size: 0.88rem; margin-bottom: 10px; }
.sidebar-account-box .btn { width: 100%; text-align: center; box-sizing: border-box; margin-bottom: 8px; }

@media (max-width: 980px) {
  .state-page-layout { grid-template-columns: 1fr; }
  .state-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .state-sidebar > * { flex: 1 1 260px; }
}

/* ---------- Listings ---------- */

.listing-filters {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: var(--radius);
  margin-bottom: 32px;
}

.listing-filters select,
.listing-filters input {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  background: var(--paper);
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.listing-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.listing-thumb {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #E8E2CE, #D7CDA9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.listing-body { padding: 16px; }
.listing-price { font-family: var(--font-display); font-size: 1.3rem; color: var(--moss-dark); margin-bottom: 2px; }
.listing-meta { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 10px; }
.listing-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag {
  font-size: 0.75rem;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink-soft);
}
.tag-source { border-color: var(--brass); color: var(--brass); }

/* ---------- Forms ---------- */

.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 560px;
}

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--paper);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 0.92rem;
}
.alert-error { background: #F6E2DC; border: 1px solid var(--clay); color: #6B2E1B; }
.alert-success { background: #E4EDDD; border: 1px solid var(--moss); color: var(--moss-dark); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: #D8D9C9;
  padding: 48px 0 28px;
  margin-top: 64px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

.site-footer h4 { color: var(--white); font-size: 0.95rem; margin-bottom: 12px; }
.site-footer a { color: #B7BBA4; font-size: 0.9rem; }
.site-footer a:hover { color: var(--brass-soft); }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }

.footer-bottom {
  border-top: 1px solid #3A4634;
  padding-top: 20px;
  font-size: 0.82rem;
  color: #8C9179;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero-grid, .grid-3, .grid-2, .guide-layout, .footer-grid, .listing-grid { grid-template-columns: 1fr; }
  .guide-toc { position: static; border-left: none; padding-left: 0; }
  .main-nav { display: none; } /* consider adding a mobile menu toggle */
  .form-row { grid-template-columns: 1fr; }
}
