/*
Theme Name: WUDA Theme
Theme URI: https://ugandadjs.com
Author: WUDA
Description: Mobile-first theme for the WUDA Savings & Loans system. Provides the header, footer, landing page and clean page layouts around the member portal. Install the WUDA Savings & Loans Manager plugin for the system itself. Use the WUDA Theme Child to customise safely.
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: wuda-theme
Tags: custom-logo, custom-menu, one-column, responsive-layout, accessibility-ready, translation-ready
*/

:root {
	--wuda-primary: #0E3B2B;
	--wuda-accent: #B8F000;
	--wt-bg: #F3F5F9;
	--wt-ink: #14213d;
	--wt-muted: #5a667c;
	--wt-line: #e1e6ee;
	--wt-font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--wt-radius: 16px;
	--wt-header-h: 64px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--wt-header-h) + 12px); }
body { margin: 0; background: var(--wt-bg); color: var(--wt-ink); font: 16px/1.6 var(--wt-font); -webkit-font-smoothing: antialiased; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; height: auto; }
a { color: var(--wuda-primary); }
.wt-skip { position: absolute; left: -9999px; top: 8px; background: #fff; color: #000; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.wt-skip:focus { left: 8px; }

/* Header */
.wt-header { position: sticky; top: 0; z-index: 50; background: var(--wuda-primary); border-bottom: 3px solid var(--wuda-accent); padding-top: env(safe-area-inset-top); }
.wt-header__in { max-width: 1180px; margin: 0 auto; min-height: var(--wt-header-h); display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 16px; }
.wt-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; min-width: 0; }
.wt-brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #fff; }
.wt-brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.wt-brand__text strong { letter-spacing: .14em; font-size: 16px; }
.wt-brand__text small { font-size: 11px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.wt-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: transparent; border: 1px solid rgba(255,255,255,.35); border-radius: 12px; color: #fff; cursor: pointer; }
.wt-toggle svg { width: 22px; height: 22px; }
.wt-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--wuda-primary); padding: 8px 16px 18px; border-bottom: 3px solid var(--wuda-accent); }
.wt-header.is-open .wt-nav { display: block; }
.wt-menu { list-style: none; margin: 0; padding: 0; }
.wt-menu a { display: flex; align-items: center; min-height: 48px; color: #fff; text-decoration: none; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.12); }
.wt-menu .current-menu-item > a, .wt-menu a:hover { color: var(--wuda-accent); }
.wt-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.wt-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 22px; border-radius: 999px; font-weight: 700; text-decoration: none; border: 1px solid transparent; background: var(--wuda-accent); color: var(--wuda-primary); }
.wt-btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.wt-btn:hover { filter: brightness(1.05); }

/* Content */
.wt-main { max-width: 1180px; margin: 0 auto; padding: 22px 16px 48px; min-height: 60vh; }
.wt-entry { background: #fff; border: 1px solid var(--wt-line); border-radius: var(--wt-radius); padding: 22px 18px; }
.wt-title { margin: 0 0 14px; color: var(--wuda-primary); font-size: clamp(26px, 6vw, 38px); line-height: 1.15; letter-spacing: -.01em; }
.wt-entry .entry-content > :first-child { margin-top: 0; }
.wt-entry .entry-content > :last-child { margin-bottom: 0; }
.wt-posts { display: grid; gap: 14px; }
.wt-card { background: #fff; border: 1px solid var(--wt-line); border-radius: var(--wt-radius); padding: 18px; }
.wt-card h2 { margin: 0 0 6px; font-size: 20px; }
.wt-card h2 a { text-decoration: none; }
.wt-meta { color: var(--wt-muted); font-size: 13px; }

/* Footer */
.wt-footer { background: #fff; border-top: 1px solid var(--wt-line); padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); font-size: 13px; color: var(--wt-muted); }
.wt-footer__in { max-width: 1180px; margin: 0 auto; display: grid; gap: 10px; }
.wt-footer .wt-menu { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.wt-footer .wt-menu a { color: var(--wuda-primary); border: 0; min-height: 36px; font-weight: 600; }
.wt-whatsapp { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 999px; background: #1fa855; color: #fff; font-weight: 700; text-decoration: none; box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); }


/* Link colours: the plugin sets a colour on ".wuda-app a", so theme links use higher specificity. */
.wt-header a.wt-brand, .wt-header .wt-menu a { color: #fff; }
.wt-header .wt-menu .current-menu-item > a, .wt-header .wt-menu a:hover { color: var(--wuda-accent); }
.wt-header a.wt-btn { background: var(--wuda-accent); color: var(--wuda-primary); border-color: transparent; }
.wt-header a.wt-btn--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.wt-header a.wt-btn:hover { filter: brightness(1.06); }
.wt-entry a.wt-btn, .wt-main a.wt-btn { color: var(--wuda-primary); }
.wt-footer .wt-menu a { color: var(--wuda-primary); }
body a.wt-whatsapp { color: #fff; }
.wt-card h2 a { color: var(--wuda-primary); }

@media (max-width: 959px) {
	/* Keep the footer and chat button clear of the portal's bottom tab bar. */
	body.wuda-app .wt-footer { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
	body.wuda-app .wt-whatsapp { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (min-width: 960px) {
	.wt-toggle { display: none; }
	.wt-nav { display: flex !important; position: static; background: transparent; border: 0; padding: 0; align-items: center; gap: 20px; flex: 1; justify-content: flex-end; }
	.wt-menu { display: flex; gap: 4px; }
	.wt-menu a { border: 0; padding: 0 14px; font-size: 15px; }
	.wt-actions { flex-direction: row; margin: 0; align-items: center; }
	.wt-entry { padding: 34px 38px; }
	.wt-posts { grid-template-columns: repeat(2, 1fr); }
	.wt-footer__in { grid-template-columns: 1fr auto; align-items: center; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* v1.2.0 header: mode switch next to the menu button; menu panel above page content */
.wt-header__in { position: relative; }
.wt-mode { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: auto; background: transparent; border: 1px solid rgba(255,255,255,.35); border-radius: 12px; color: #fff; cursor: pointer; }
.wt-mode svg { width: 20px; height: 20px; }
html[data-wuda-theme] .wt-mode { display: inline-flex; }
.wt-nav { z-index: 60; box-shadow: 0 24px 40px -20px rgba(0,0,0,.6); max-height: calc(100vh - 70px); overflow-y: auto; }
@media (min-width: 960px) { .wt-mode { margin-left: 0; order: 3; } .wt-toggle { display: none; } }
