/*
Theme Name: Siaya Project Stocktaking & Verification
Theme URI: https://projects.siaya.go.ke/
Author: County Government of Siaya
Description: Official theme for the County Government of Siaya Project Stocktaking & Verification portal. Branded from the county coat of arms (leaf green, sand gold, charcoal and lake blue). Includes a Projects register with status, verification tracking, filters and a front page stocktake summary.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: siaya-psv
*/

:root{
  --forest:#143a22; --forest-2:#1d4d2e; --leaf:#5aa844; --leaf-d:#2f7430; --leaf-l:#e7f3e1;
  --sand:#c9a863; --sand-l:#f4ecda; --ink:#1c211e; --muted:#566058; --line:#dce2d9;
  --paper:#f6f8f4; --white:#fff; --lake:#2d7fb3; --amber:#d49a22; --brick:#b5472f; --slate:#7d867f;
  --radius:6px; --wrap:1200px;
  --font-head:"Bricolage Grotesque","Segoe UI",system-ui,sans-serif;
  --font-body:"Public Sans","Segoe UI",system-ui,-apple-system,sans-serif;
}
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--paper);color:var(--ink);font:400 1rem/1.65 var(--font-body);-webkit-font-smoothing:antialiased}
img{max-width:100%;height:auto;display:block}
a{color:var(--leaf-d);text-underline-offset:3px}
a:hover{color:var(--forest)}
:focus-visible{outline:3px solid var(--lake);outline-offset:2px}
h1,h2,h3,h4{font-family:var(--font-head);line-height:1.15;color:var(--forest);margin:0 0 .6em;letter-spacing:-.01em}
h1{font-size:clamp(2rem,4vw,3rem);font-weight:700}
h2{font-size:clamp(1.5rem,2.6vw,2.1rem);font-weight:700}
h3{font-size:1.2rem;font-weight:600}
p{margin:0 0 1.1em}
.wrap{width:min(100% - 2.5rem,var(--wrap));margin-inline:auto}
.screen-reader-text{position:absolute!important;clip:rect(1px,1px,1px,1px);width:1px;height:1px;overflow:hidden}
.skip-link:focus{position:fixed;top:8px;left:8px;z-index:999;background:#fff;padding:.7rem 1rem;clip:auto;width:auto;height:auto}

/* Buttons */
.btn{display:inline-flex;align-items:center;gap:.5rem;padding:.8rem 1.4rem;border-radius:var(--radius);font:600 .98rem var(--font-body);text-decoration:none;border:2px solid transparent;cursor:pointer;transition:background .2s,color .2s,border-color .2s}
.btn--primary{background:var(--leaf);color:var(--forest);border-color:var(--leaf)}
.btn--primary:hover{background:#6dbb57;color:var(--forest)}
.btn--ghost{border-color:rgba(255,255,255,.55);color:#fff}
.btn--ghost:hover{background:#fff;color:var(--forest)}
.btn--dark{background:var(--forest);color:#fff}
.btn--dark:hover{background:var(--forest-2);color:#fff}

/* Header */
.utility{background:var(--forest);color:#d7e6d4;font-size:.82rem}
.utility .wrap{display:flex;justify-content:space-between;gap:1rem;padding:.45rem 0}
.utility a{color:#fff}
.site-header{background:#fff;position:sticky;top:0;z-index:50;box-shadow:0 1px 0 var(--line)}
.site-header::after{content:"";display:block;height:4px;background:linear-gradient(90deg,var(--leaf) 0 40%,var(--sand) 40% 70%,var(--ink) 70% 100%)}
.site-header .wrap{display:flex;align-items:center;justify-content:space-between;gap:1.5rem;padding:.7rem 0}
.brand{display:flex;align-items:center;gap:.9rem;text-decoration:none;color:inherit}
.brand img,.brand .custom-logo{width:auto;height:64px}
.brand__text{display:flex;flex-direction:column;line-height:1.15}
.brand__org{font-size:.85rem;color:var(--muted);font-weight:500}
.brand__name{font:700 1.3rem var(--font-head);color:var(--forest)}
.nav-toggle{display:none;background:none;border:2px solid var(--forest);border-radius:var(--radius);padding:.45rem .8rem;font:600 .9rem var(--font-body);color:var(--forest)}
.primary-nav ul{list-style:none;margin:0;padding:0;display:flex;align-items:center;gap:.3rem}
.primary-nav a{display:block;padding:.55rem .85rem;text-decoration:none;color:var(--ink);font-weight:600;font-size:.95rem;border-radius:var(--radius)}
.primary-nav a:hover,.primary-nav .current-menu-item>a,.primary-nav .current_page_item>a{background:var(--leaf-l);color:var(--forest)}
.primary-nav li.nav-cta a{background:var(--forest);color:#fff;margin-left:.4rem}
.primary-nav li.nav-cta a:hover{background:var(--leaf-d)}

/* Hero */
.hero{position:relative;background:var(--forest);color:#fff;overflow:hidden;padding:clamp(3rem,7vw,5.5rem) 0 clamp(4.5rem,9vw,7rem)}
.hero::before{content:"";position:absolute;inset:auto 0 0 0;height:120px;opacity:.5;pointer-events:none;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='40' viewBox='0 0 240 40'%3E%3Cpath d='M0 20 Q30 4 60 20 T120 20 T180 20 T240 20' fill='none' stroke='%232d7fb3' stroke-width='2'/%3E%3Cpath d='M0 32 Q30 16 60 32 T120 32 T180 32 T240 32' fill='none' stroke='%232d7fb3' stroke-width='1.5' opacity='.6'/%3E%3C/svg%3E") repeat-x bottom/240px 40px}
.hero::after{content:"";position:absolute;right:-6%;top:-20%;width:520px;height:520px;border-radius:50%;background:radial-gradient(circle,rgba(90,168,68,.35),transparent 65%);pointer-events:none}
.hero .wrap{position:relative;z-index:1;display:grid;grid-template-columns:1.15fr .85fr;gap:clamp(2rem,5vw,4.5rem);align-items:center}
.hero h1{color:#fff;font-size:clamp(2.3rem,5vw,3.9rem);margin-bottom:.5em}
.hero p.lead{font-size:1.15rem;color:#d3e4cf;max-width:34em}
.hero__actions{display:flex;flex-wrap:wrap;gap:.8rem;margin-top:1.8rem}
.hero__motto{margin-top:2.2rem;display:flex;align-items:center;gap:.8rem;color:var(--sand);font:italic 500 1rem var(--font-head)}
.hero__motto::before{content:"";width:42px;height:3px;background:var(--sand)}

/* Ledger */
.ledger{background:#fff;color:var(--ink);border-radius:10px;padding:1.6rem;box-shadow:0 24px 60px -20px rgba(0,0,0,.5);border-top:5px solid var(--sand)}
.ledger h2{font-size:1.05rem;color:var(--muted);font-weight:600;margin-bottom:.3rem;font-family:var(--font-body)}
.ledger__total{margin:0 0 1rem;font:700 3.2rem/1 var(--font-head);color:var(--forest)}
.ledger__total small{font:500 1rem var(--font-body);color:var(--muted);margin-left:.4rem}
.ledger__bar{display:flex;gap:3px;height:16px;border-radius:4px;overflow:hidden;background:var(--line);margin-bottom:1.1rem}
.ledger__bar span{display:block;background:var(--c);min-width:3px}
.ledger__legend{list-style:none;margin:0 0 1.2rem;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:.5rem 1.2rem;font-size:.92rem}
.ledger__legend li{display:flex;align-items:center;gap:.5rem}
.ledger__legend i{width:12px;height:12px;border-radius:3px;background:var(--c);flex:none}
.ledger__legend b{margin-left:auto;font-variant-numeric:tabular-nums}
.ledger__facts{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin:0;padding-top:1.1rem;border-top:1px solid var(--line)}
.ledger__facts dt{font-size:.82rem;color:var(--muted)}
.ledger__facts dd{margin:0;font:700 1.35rem var(--font-head);color:var(--forest)}

/* Sections */
.section{padding:clamp(3rem,6vw,4.5rem) 0}
.section--white{background:#fff}
.section__head{display:flex;justify-content:space-between;align-items:flex-end;gap:1rem;flex-wrap:wrap;margin-bottom:1.8rem}
.section__head h2{margin:0}
.section__head p{margin:.3rem 0 0;color:var(--muted)}

/* Sector tiles */
.sectors{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:.9rem}
.sector{display:flex;flex-direction:column;gap:.2rem;padding:1.1rem 1.2rem;background:#fff;border:1px solid var(--line);border-left:5px solid var(--leaf);border-radius:var(--radius);text-decoration:none;color:var(--ink);transition:border-color .2s,transform .2s}
.sector:nth-child(3n+2){border-left-color:var(--sand)}
.sector:nth-child(3n){border-left-color:var(--lake)}
.sector:hover{transform:translateY(-2px);border-color:var(--forest)}
.sector strong{font:700 1.7rem var(--font-head);color:var(--forest)}
.sector span{font-size:.92rem;color:var(--muted)}

/* Filters */
.chips{display:flex;flex-wrap:wrap;gap:.5rem;margin:0 0 1.6rem}
.chip{padding:.45rem 1rem;border:1.5px solid var(--line);background:#fff;border-radius:99px;font:600 .88rem var(--font-body);cursor:pointer;color:var(--ink)}
.chip[aria-pressed="true"]{background:var(--forest);border-color:var(--forest);color:#fff}
.filter-bar{display:grid;grid-template-columns:2fr repeat(4,1fr) auto;gap:.7rem;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:1rem;margin-bottom:2rem}
.filter-bar input,.filter-bar select,.search-form input[type=search]{width:100%;padding:.7rem .8rem;border:1.5px solid var(--line);border-radius:var(--radius);font:inherit;background:#fff;color:var(--ink)}

/* Project cards */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:1.4rem}
.card{background:#fff;border:1px solid var(--line);border-radius:8px;overflow:hidden;display:flex;flex-direction:column}
.card__media{aspect-ratio:3/2;background:linear-gradient(135deg,var(--leaf-l),var(--sand-l));display:grid;place-items:center;overflow:hidden}
.card__media img{width:100%;height:100%;object-fit:cover}
.card__media .ph{width:64px;opacity:.35}
.card__body{padding:1.2rem 1.3rem 1.4rem;display:flex;flex-direction:column;gap:.6rem;flex:1}
.card__tags{display:flex;gap:.4rem;flex-wrap:wrap}
.card h3{margin:0;font-size:1.15rem}
.card h3 a{color:var(--forest);text-decoration:none}
.card h3 a:hover{text-decoration:underline}
.card__meta{font-size:.88rem;color:var(--muted);margin:0}
.meter{height:8px;background:var(--line);border-radius:99px;overflow:hidden}
.meter span{display:block;height:100%;background:var(--c,var(--leaf));border-radius:99px}
.card__foot{margin-top:auto;display:flex;justify-content:space-between;font-size:.85rem;color:var(--muted)}
.card__foot strong{color:var(--ink)}
.pill{display:inline-flex;align-items:center;gap:.4rem;padding:.2rem .7rem;border-radius:99px;font:600 .78rem var(--font-body);background:color-mix(in srgb,var(--c) 14%,#fff);color:color-mix(in srgb,var(--c) 70%,#000)}
.pill::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--c)}
.pill--check::before{content:"\2713";width:auto;height:auto;background:none;font-size:.8rem}

/* Process */
.steps{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:1.5rem;counter-reset:s}
.steps li{counter-increment:s;position:relative;padding-top:3.4rem}
.steps li::before{content:counter(s);position:absolute;top:0;left:0;width:2.6rem;height:2.6rem;display:grid;place-items:center;border-radius:50%;background:var(--forest);color:#fff;font:700 1.1rem var(--font-head)}
.steps li::after{content:"";position:absolute;top:1.3rem;left:3.2rem;right:-1rem;height:2px;background:repeating-linear-gradient(90deg,var(--sand) 0 6px,transparent 6px 12px)}
.steps li:last-child::after{display:none}
.steps h3{margin-bottom:.3em}
.steps p{color:var(--muted);margin:0;font-size:.95rem}

/* CTA */
.cta{background:var(--sand-l);border-radius:12px;padding:clamp(1.8rem,4vw,3rem);display:flex;justify-content:space-between;align-items:center;gap:1.5rem;flex-wrap:wrap;border-left:8px solid var(--sand)}
.cta h2{margin-bottom:.3em}
.cta p{margin:0;color:var(--muted);max-width:40em}

/* Content pages */
.page-head{background:var(--forest);color:#fff;padding:2.6rem 0}
.page-head h1{color:#fff;margin:0}
.page-head p{margin:.6rem 0 0;color:#cfe0cb}
.crumbs{font-size:.85rem;margin-bottom:.8rem;color:#b5ceb0}
.crumbs a{color:#fff}
.content{padding:3rem 0}
.entry{max-width:780px}
.entry>*{max-width:100%}
.entry h2,.entry h3{margin-top:1.6em}
.entry table{width:100%;border-collapse:collapse;margin:1.5em 0;font-size:.95rem}
.entry th{background:var(--forest);color:#fff;text-align:left}
.entry th,.entry td{padding:.65rem .8rem;border:1px solid var(--line)}
.entry tr:nth-child(even) td{background:var(--paper)}
.entry blockquote{margin:1.5em 0;padding:.5em 1.2em;border-left:5px solid var(--sand);background:var(--sand-l)}
.alignwide{width:min(100%,1100px)}
.post-list article{padding:1.4rem 0;border-bottom:1px solid var(--line)}

/* Single project */
.facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:1px;background:var(--line);border:1px solid var(--line);border-radius:8px;overflow:hidden;margin:0 0 2rem}
.facts div{background:#fff;padding:1rem 1.2rem}
.facts dt{font-size:.82rem;color:var(--muted)}
.facts dd{margin:.15rem 0 0;font:700 1.15rem var(--font-head);color:var(--forest)}
.project-layout{display:grid;grid-template-columns:2fr 1fr;gap:3rem;align-items:start}
.panel{background:#fff;border:1px solid var(--line);border-radius:8px;padding:1.4rem}
.panel h3{font-size:1.05rem}
.progress-big{font:700 2.6rem var(--font-head);color:var(--forest);margin:0}

/* Pagination, search, 404 */
.pagination{display:flex;gap:.4rem;flex-wrap:wrap;margin-top:2.2rem}
.pagination .page-numbers{padding:.5rem .9rem;border:1.5px solid var(--line);border-radius:var(--radius);text-decoration:none;background:#fff;color:var(--ink);font-weight:600}
.pagination .current{background:var(--forest);color:#fff;border-color:var(--forest)}
.search-form{display:flex;gap:.5rem}
.empty{padding:2.5rem;text-align:center;background:#fff;border:1px dashed var(--sand);border-radius:8px;color:var(--muted)}
.empty strong{display:block;color:var(--forest);font:700 1.2rem var(--font-head);margin-bottom:.3rem}
.error-404{text-align:center;padding:5rem 0}
.error-404 img{width:110px;margin:0 auto 1.5rem}

/* Footer */
.site-footer{background:var(--ink);color:#bcc6bd;margin-top:0}
.site-footer::before{content:"";display:block;height:4px;background:linear-gradient(90deg,var(--leaf) 0 40%,var(--sand) 40% 70%,var(--lake) 70% 100%)}
.footer-grid{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:2.5rem;padding:3rem 0 2rem}
.site-footer h2{font:700 1rem var(--font-head);color:#fff;margin-bottom:.8rem}
.site-footer a{color:#e5ece6}
.site-footer ul{list-style:none;margin:0;padding:0}
.site-footer li{margin-bottom:.4rem}
.footer-brand{display:flex;gap:1rem;align-items:flex-start}
.footer-brand img{width:72px;flex:none}
.footer-brand p{margin:0;font-size:.92rem}
.footer-brand .motto{color:var(--sand);font:italic 600 1.05rem var(--font-head);margin-top:.5rem}
.footer-bottom{border-top:1px solid rgba(255,255,255,.12);padding:1.1rem 0;font-size:.85rem;display:flex;justify-content:space-between;flex-wrap:wrap;gap:.5rem}

/* Responsive */
@media (max-width:980px){
  .hero .wrap,.project-layout{grid-template-columns:1fr}
  .filter-bar{grid-template-columns:1fr 1fr}
  .filter-bar>:first-child,.filter-bar>:last-child{grid-column:1/-1}
  .footer-grid{grid-template-columns:1fr 1fr}
  .steps li::after{display:none}
}
@media (max-width:820px){
  .nav-toggle{display:block}
  .primary-nav{display:none;position:absolute;left:0;right:0;top:100%;background:#fff;border-bottom:1px solid var(--line);padding:.8rem 1.25rem 1.2rem}
  .primary-nav.is-open{display:block}
  .primary-nav ul{flex-direction:column;align-items:stretch}
  .primary-nav li.nav-cta a{margin:.4rem 0 0;text-align:center}
  .site-header .wrap{position:relative}
  .brand img,.brand .custom-logo{height:52px}
  .brand__name{font-size:1.05rem}
  .utility .wrap span+span{display:none}
}
@media (max-width:560px){
  .footer-grid,.filter-bar{grid-template-columns:1fr}
  .ledger__legend{grid-template-columns:1fr}
  .grid{grid-template-columns:1fr}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
@media print{.utility,.site-header,.site-footer,.hero__actions,.filter-bar{display:none}}
[hidden]{display:none!important}
