/*
Theme Name: Land Registry Ghana
Theme URI: https://example.com/land-registry
Author: Your Name
Description: A purpose-built theme for the Land Plot Registry — a Ghanaian cadastral survey and flood-risk system. Designed to pair with the Land Plot Registry plugin: surfaces the interactive map, plot listings, GhanaPostGPS digital addresses and the Owner → Engineer → Supervisor workflow. Survey-drawing aesthetic: paper ground, deep survey green, ochre datum accent, monospace coordinates.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GPL-2.0+
Text Domain: land-registry-theme
*/

/* ============================================================
   Design tokens — cadastral survey palette
   ============================================================ */
:root {
  --paper:      #F7F4ED; /* surveyor's paper ground */
  --paper-2:    #EFEADD; /* panel / card ground */
  --ink:        #1A1712; /* near-black ink */
  --green:      #14342B; /* deep survey green */
  --green-soft: #2C5446;
  --ochre:      #B8752E; /* datum / altitude accent (laterite) */
  --ochre-soft: #D9A066;
  --contour:    #2E5E8C; /* low land / water */
  --line:       #D8CFBB; /* hairline ruling */
  --line-strong:#BEB196;

  --status-entered:  #B8752E;
  --status-verified: #2E5E8C;
  --status-approved: #14342B;

  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, monospace;

  --maxw: 1180px;
  --radius: 4px; /* survey drawings are crisp; minimal rounding */
}

/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ochre); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 560; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 5vw, 3.9rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ochre);
}

/* ============================================================
   Site header — thin survey-slip bar
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--green); }
.brand .mark {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border: 1.5px solid var(--green);
  border-radius: 50%;
  font-size: 15px; color: var(--green);
}
.brand b { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; letter-spacing: -.01em; }
.brand small { display: block; font-family: var(--font-mono); font-size: .6rem; letter-spacing: .14em; color: var(--ochre); text-transform: uppercase; }

.main-nav { display: flex; gap: 26px; align-items: center; }
.main-nav a { font-size: .93rem; text-decoration: none; color: var(--ink); }
.main-nav a:hover { color: var(--ochre); }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--green); }

/* ============================================================
   Hero — survey datum grid signature
   ============================================================ */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: .5;
  mask-image: radial-gradient(ellipse 80% 70% at 30% 30%, #000 40%, transparent 100%);
}
.hero-inner { position: relative; padding: 84px 0 92px; }
.hero h1 { max-width: 15ch; }
.hero h1 .datum { color: var(--ochre); }
.hero p.lead { max-width: 46ch; font-size: 1.15rem; color: var(--green-soft); margin: .2em 0 1.8em; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* benchmark triangle marker — the surveyor's fixed-elevation symbol */
.benchmark {
  position: absolute; right: 6%; top: 50%; transform: translateY(-50%);
  width: 210px; height: 210px; display: grid; place-items: center;
}
.benchmark svg { width: 100%; height: 100%; }
@media (max-width: 900px) { .benchmark { display: none; } }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: .95rem; font-weight: 500;
  padding: 12px 22px; border-radius: var(--radius);
  border: 1.5px solid var(--green); cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background .12s ease, color .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green); color: var(--paper); }
.btn-primary:hover { background: var(--green-soft); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--green); }
.btn-ghost:hover { background: var(--green); color: var(--paper); }

/* ============================================================
   Stat strip — real registry figures, not decoration
   ============================================================ */
.stat-strip { border-bottom: 1px solid var(--line); background: var(--paper-2); }
.stat-strip .container { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat {
  padding: 26px 20px; border-left: 1px solid var(--line);
}
.stat:first-child { border-left: 0; }
.stat .num { font-family: var(--font-display); font-size: 2.1rem; color: var(--green); line-height: 1; }
.stat .num.low { color: var(--contour); }
.stat .lbl { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ochre); margin-top: 8px; }
@media (max-width: 760px) { .stat-strip .container { grid-template-columns: repeat(2, 1fr); } .stat:nth-child(3){border-left:0;} }

/* ============================================================
   Section scaffolding
   ============================================================ */
.section { padding: 76px 0; }
.section-head { max-width: 60ch; margin-bottom: 40px; }
.section-head p { color: var(--green-soft); }

/* map block */
.map-frame {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 0 var(--paper-2), 0 24px 48px -32px rgba(20,52,43,.4);
}
#lpr-map { height: 560px; width: 100%; }
.map-legend {
  font-family: var(--font-mono); font-size: .78rem; color: var(--green-soft);
  padding: 12px 4px 0; display: flex; align-items: center; gap: 10px;
}
.map-legend .grad { display:inline-block; width: 130px; height: 9px; border-radius: 5px; }

/* workflow — the three roles as a real sequence */
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.flow-step {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 24px; position: relative;
}
.flow-step .step-no {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em;
  color: var(--ochre);
}
.flow-step h3 { margin: 12px 0 6px; }
.flow-step p { font-size: .95rem; color: var(--green-soft); margin: 0; }
.flow-step::after {
  content: "→"; position: absolute; right: -16px; top: 50%; transform: translateY(-50%);
  color: var(--line-strong); font-size: 1.3rem;
}
.flow-step:last-child::after { display: none; }
@media (max-width: 760px) {
  .flow { grid-template-columns: 1fr; }
  .flow-step::after { content: "↓"; right: 50%; top: auto; bottom: -18px; transform: translateX(50%); }
}

/* plot cards */
.plot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.plot-card {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--ink);
  transition: border-color .12s ease, transform .12s ease;
  display: block;
}
.plot-card:hover { border-color: var(--ochre); transform: translateY(-2px); }
.plot-card .row { display: flex; justify-content: space-between; align-items: baseline; }
.plot-card .owner { font-family: var(--font-display); font-size: 1.15rem; color: var(--green); }
.plot-card .gps { font-family: var(--font-mono); font-size: .8rem; color: var(--contour); margin: 6px 0; }
.plot-card .meta { font-family: var(--font-mono); font-size: .72rem; color: var(--green-soft); letter-spacing: .04em; }
.plot-card .alt-bar { height: 6px; border-radius: 3px; margin-top: 14px; background: var(--line); position: relative; overflow: hidden; }
.plot-card .alt-fill { position: absolute; inset: 0 auto 0 0; border-radius: 3px; }

.badge {
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px; border: 1px solid currentColor;
}
.badge.entered  { color: var(--status-entered); }
.badge.verified { color: var(--status-verified); }
.badge.approved { color: var(--status-approved); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--green); color: var(--paper);
  padding: 54px 0 40px; margin-top: 40px;
}
.site-footer a { color: var(--ochre-soft); }
.site-footer .container { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-footer h4 { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ochre-soft); }
.site-footer .brand b { color: var(--paper); }
.site-footer p { color: color-mix(in srgb, var(--paper) 80%, transparent); font-size: .92rem; }
.footer-bottom { border-top: 1px solid var(--green-soft); margin-top: 34px; padding-top: 18px; font-family: var(--font-mono); font-size: .72rem; color: color-mix(in srgb, var(--paper) 62%, transparent); }
@media (max-width: 760px) { .site-footer .container { grid-template-columns: 1fr; } }

/* ============================================================
   Generic content (pages/posts)
   ============================================================ */
.page-body { padding: 60px 0; }
.page-body .container { max-width: 760px; }
.entry-content { font-size: 1.06rem; }
.entry-content h2 { margin-top: 1.6em; }
.entry-content img { border-radius: var(--radius); border: 1px solid var(--line); }

/* mobile nav */
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .main-nav.open { max-height: 320px; }
  .main-nav a { padding: 15px 24px; width: 100%; border-top: 1px solid var(--line); }
}

/* ============================================================
   Flood analysis (front-page #flood section)
   ============================================================ */
.flood-controls { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin: 0 0 28px; }
.flood-controls label { display: flex; flex-direction: column; gap: 5px; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ochre-soft); }
.flood-controls input { width: 130px; padding: 9px 11px; border-radius: var(--radius); border: 1px solid var(--green-soft); background: color-mix(in srgb, var(--paper) 12%, transparent); color: var(--paper); font-family: var(--font-mono); font-size: .95rem; }
.flood-controls input:focus-visible { outline: 2px solid var(--ochre); }
.flood-summary { font-family: var(--font-mono); font-size: .78rem; color: var(--ochre-soft); }

.flood-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.flood-col { background: color-mix(in srgb, var(--paper) 8%, transparent); border: 1px solid var(--green-soft); border-radius: var(--radius); padding: 20px; }
.flood-col h3 { color: var(--paper); font-size: 1.1rem; display: flex; align-items: center; gap: 9px; margin: 0 0 3px; }
.flood-col .fsub { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; color: color-mix(in srgb, var(--paper) 62%, transparent); margin: 0 0 14px; }
.fdot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.fdot.risk { background: #E06B5A; }
.fdot.low { background: #7FB0DA; }
.fdot.high { background: var(--ochre-soft); }
.flood-list { list-style: none; margin: 0; padding: 0; }
.flood-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--green-soft); }
.flood-list li:first-child { border-top: 0; }
.flood-list .fname { font-family: var(--font-display); font-size: .98rem; color: var(--paper); line-height: 1.2; }
.flood-list .fname small { display: block; font-family: var(--font-mono); font-size: .68rem; color: var(--ochre-soft); margin-top: 2px; }
.flood-list .falt { font-family: var(--font-mono); font-size: .78rem; color: color-mix(in srgb, var(--paper) 80%, transparent); white-space: nowrap; text-align: right; }
.flood-list .falt.danger { color: #F0A090; }
.flood-list .empty { color: color-mix(in srgb, var(--paper) 50%, transparent); font-style: italic; }
@media (max-width: 820px) { .flood-grid { grid-template-columns: 1fr; } }

/* Parcels shortcode embedded in the dark flood section */
#flood .lpr-theme-parcels .lpr-parcels-tools #lpr-search{background:var(--paper);border-color:var(--green-soft)}
#flood .lpr-theme-parcels .lpr-parcels-count{color:color-mix(in srgb,var(--paper) 78%,transparent)}
