/*
Theme Name: ZIMFundi
Description: A bright, fast theme for the ZIMFundi learning plugin – chalkboard home page with paper search, subjects, new papers, open questions, lessons from verified tutors and a "teach on ZIMFundi" band. Same chalkboard green and chalk yellow as the plugin.
Version: 1.0.0
Requires at least: 5.8
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: zimfundi-theme
Tags: education, custom-logo, custom-menu, featured-images, wide-blocks
*/

@font-face {
	font-family: "Bricolage ZT";
	src: url("assets/fonts/bricolage-heading.woff2") format("woff2");
	font-weight: 600 800;
	font-style: normal;
	font-display: swap;
}

:root {
	--zt-green: #12463a;
	--zt-green-2: #1b6352;
	--zt-board: #0f3b31;
	--zt-chalk: #f2b705;
	--zt-chalk-soft: #fff4cc;
	--zt-ink: #17201c;
	--zt-muted: #5b6862;
	--zt-line: #dde3df;
	--zt-soft: #f2f5f1;
	--zt-bg: #fbfcfa;
	--zt-w: 1200px;
	--zt-head: "Bricolage ZT", "Trebuchet MS", system-ui, sans-serif;
	--zt-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
html.zt-noscroll { overflow: hidden; }
body { margin: 0; background: var(--zt-bg); color: var(--zt-ink); font: 17px/1.6 var(--zt-body); -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--zt-green-2); text-underline-offset: .15em; }
h1, h2, h3, h4 { font-family: var(--zt-head); font-weight: 700; line-height: 1.12; letter-spacing: -.02em; color: var(--zt-ink); margin: 0 0 .5em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--zt-chalk); outline-offset: 2px; }
.zt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.zt-skip { position: absolute; left: -9999px; top: 8px; z-index: 1000; background: #fff; padding: 8px 14px; border-radius: 6px; }
.zt-skip:focus { left: 8px; }
.zt-container { width: 100%; max-width: var(--zt-w); margin: 0 auto; padding: 0 24px; }
.zt-narrow { max-width: 780px; }
.zt-main { min-height: 50vh; }
.zt-muted { color: var(--zt-muted); }

.zt-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; border-radius: 10px; border: 1px solid transparent; font: 700 16px/1.2 var(--zt-body); text-decoration: none; cursor: pointer; transition: transform .12s, background .15s; }
.zt-btn:active { transform: translateY(1px); }
.zt-btn--chalk { background: var(--zt-chalk); color: #2c2100; }
.zt-btn--chalk:hover { background: #ffc61a; color: #2c2100; }
.zt-btn--green { background: var(--zt-green); color: #fff; }
.zt-btn--green:hover { background: var(--zt-green-2); color: #fff; }
.zf .zt-btn--green, .zf .zt-btn--green:hover { color: #fff; }
.zf .zt-btn--chalk { color: #2c2100; }
.zt-btn--ghost { background: #fff; color: var(--zt-green); border-color: #c9d1cc; }
.zt-eyebrow { font: 700 13px/1.3 var(--zt-body); letter-spacing: .08em; text-transform: uppercase; color: var(--zt-green-2); margin: 0 0 6px; }
.zt-arrow { font-weight: 700; text-decoration: none; white-space: nowrap; }
.zt-arrow::after { content: " →"; }

/* ---------- header ---------- */
.zt-header { position: sticky; top: 0; z-index: 100; background: rgba(251, 252, 250, .96); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.admin-bar .zt-header { top: 32px; }
.zt-header.is-scrolled { border-bottom-color: var(--zt-line); box-shadow: 0 2px 14px rgba(23, 32, 28, .05); }
.zt-header__in { display: flex; align-items: center; gap: 20px; min-height: 70px; }
.zt-brand__name, .zt-foot__name { display: inline-flex; align-items: center; gap: 10px; font: 800 24px/1 var(--zt-head); letter-spacing: -.02em; color: var(--zt-ink); text-decoration: none; }
.zt-brand__mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--zt-green); color: var(--zt-chalk); font: 800 21px/1 var(--zt-head); transform: rotate(-4deg); }
.zt-brand .custom-logo { display: block; max-height: 50px; width: auto; }
.zt-nav { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.zt-nav__list { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.zt-nav__list a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--zt-ink); text-decoration: none; font-weight: 600; font-size: 16px; }
.zt-nav__list a:hover, .zt-nav__list .current-menu-item > a, .zt-nav__list .current_page_item > a { background: var(--zt-soft); }
.zt-nav__account { display: flex; align-items: center; gap: 12px; }
.zt-nav__signin { font-weight: 700; text-decoration: none; color: var(--zt-green); }
.zt-nav__account .zt-btn { min-height: 42px; padding: 0 18px; font-size: 15px; }
.zt-menu-btn { display: none; margin-left: auto; width: 46px; height: 46px; border: 1px solid var(--zt-line); border-radius: 10px; background: #fff; cursor: pointer; position: relative; }
.zt-menu-btn__bars, .zt-menu-btn__bars::before, .zt-menu-btn__bars::after { position: absolute; left: 12px; width: 20px; height: 2px; background: var(--zt-ink); border-radius: 2px; content: ""; transition: transform .2s; }
.zt-menu-btn__bars { top: 22px; }
.zt-menu-btn__bars::before { left: 0; top: -6px; }
.zt-menu-btn__bars::after { left: 0; top: 6px; }
.is-open .zt-menu-btn__bars { background: transparent; }
.is-open .zt-menu-btn__bars::before { transform: translateY(6px) rotate(45deg); }
.is-open .zt-menu-btn__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- chalkboard hero ---------- */
.zt-hero {
	position: relative; overflow: hidden; color: #fff; padding: 84px 0 92px;
	background:
		radial-gradient(ellipse 60% 50% at 20% 30%, rgba(255, 255, 255, .06), transparent 70%),
		radial-gradient(ellipse 50% 60% at 85% 70%, rgba(255, 255, 255, .05), transparent 70%),
		var(--zt-board);
	border-bottom: 10px solid #8a5a2b;
	box-shadow: inset 0 -4px 0 #6f4520;
}
.zt-hero__doodles { position: absolute; inset: 0; width: 100%; height: 100%; color: rgba(255, 255, 255, .13); pointer-events: none; }
.zt-hero__doodles .d { font: 600 40px var(--zt-head); fill: currentColor; stroke: none; }
.zt-hero__in { position: relative; text-align: center; }
.zt-hero__kicker { display: inline-block; padding: 5px 14px; border-radius: 999px; background: rgba(255, 255, 255, .1); font-weight: 700; font-size: 14px; letter-spacing: .02em; margin-bottom: 18px; }
.zt-hero__title { color: #fff; font-size: clamp(38px, 6.4vw, 70px); max-width: 16ch; margin: 0 auto 16px; text-wrap: balance; }
.zt-chalk { position: relative; white-space: nowrap; color: var(--zt-chalk); }
.zt-chalk::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: -.12em; height: .22em; background: no-repeat center / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C 40 2, 80 11, 120 5 S 180 3, 198 7' fill='none' stroke='%23f2b705' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.zt-hero__text { font-size: clamp(17px, 2vw, 20px); max-width: 56ch; margin: 0 auto 30px; color: rgba(255, 255, 255, .9); text-wrap: pretty; }
.zt-hero__note { background: rgba(255, 255, 255, .12); display: inline-block; padding: 10px 16px; border-radius: 8px; }

.zt-search {
	display: grid; grid-template-columns: minmax(240px, 2.2fr) 1fr 1fr auto; gap: 8px; max-width: 960px; margin: 0 auto;
	padding: 10px; background: #fff; border-radius: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, .3); text-align: left;
}
.zt-search input, .zt-search select { width: 100%; min-height: 52px; padding: 10px 14px; border: 0; border-radius: 10px; background: var(--zt-soft); font: 16px var(--zt-body); color: var(--zt-ink); }
.zt-search input { padding-left: 44px; background: var(--zt-soft) no-repeat 15px 50% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%235b6862' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m12.5 12.5 4 4'/%3E%3C/svg%3E"); }
.zt-search input:focus, .zt-search select:focus { outline: 2px solid var(--zt-green-2); }
.zt-search .zt-btn { min-height: 52px; padding: 0 26px; }
.zt-hero__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 20px 0 0; }
.zt-chip { padding: 6px 14px; border-radius: 999px; border: 1px dashed rgba(255, 255, 255, .45); color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; }
.zt-chip:hover { background: var(--zt-chalk); border-color: var(--zt-chalk); color: #2c2100; }
.zt-hero__stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 28px; margin: 26px 0 0; color: rgba(255, 255, 255, .8); font-size: 15px; }
.zt-hero__stats b { font: 800 22px var(--zt-head); color: #fff; margin-right: 4px; }

/* ---------- sections ---------- */
.zt-section { padding: 70px 0; }
.zt-section--soft { background: var(--zt-soft); }
.zt-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; }
.zt-head--small { align-items: center; margin-bottom: 14px; }
.zt-title { font-size: clamp(28px, 3.4vw, 40px); margin: 0; }
.zt-title--sm { font-size: 24px; }

.zt-subjects { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.zt-subject { display: grid; grid-template-columns: 46px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px; background: #fff; border: 1px solid var(--zt-line); border-radius: 14px; text-decoration: none; color: var(--zt-ink); transition: transform .15s, box-shadow .15s, border-color .15s; }
.zt-subject:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(23, 32, 28, .08); border-color: transparent; }
.zt-subject__letter { grid-row: span 2; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; font: 800 22px var(--zt-head); color: #fff; }
.zt-subject--0 .zt-subject__letter { background: var(--zt-green); }
.zt-subject--1 .zt-subject__letter { background: #2a4f78; }
.zt-subject--2 .zt-subject__letter { background: #b5651d; }
.zt-subject--3 .zt-subject__letter { background: #7a3e8f; }
.zt-subject--4 .zt-subject__letter { background: #c0392b; }
.zt-subject--5 .zt-subject__letter { background: var(--zt-chalk); color: #2c2100; }
.zt-subject__name { font-weight: 700; line-height: 1.25; }
.zt-subject__n { font-size: 13px; color: var(--zt-muted); }

.zt-split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.zt-split .zf-files, .zt-split .zf-qlist { margin-bottom: 14px; }
.zt-file { grid-template-columns: 44px 1fr !important; }
.zt-file .zf-file__icon { width: 40px; height: 50px; font-size: 10px; }

.zt-steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.zt-steps li { counter-increment: s; position: relative; padding: 22px 22px 22px 22px; background: #fff; border-radius: 16px; border: 1px solid var(--zt-line); }
.zt-steps li::before { content: counter(s); display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 12px; border-radius: 50%; background: var(--zt-chalk); color: #2c2100; font: 800 20px var(--zt-head); }
.zt-steps b { display: block; font: 700 21px/1.2 var(--zt-head); margin-bottom: 6px; }
.zt-steps span { color: var(--zt-muted); }

.zt-band { background: var(--zt-board); color: #fff; padding: 56px 0; border-top: 10px solid #8a5a2b; }
.zt-band__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.zt-band__title { color: #fff; font-size: clamp(28px, 3vw, 38px); margin-bottom: 6px; }
.zt-band p { margin: 0; opacity: .88; max-width: 60ch; }

/* ---------- pages ---------- */
.zt-pagehead { padding: 46px 0 18px; }
.zt-pagehead__title { font-size: clamp(32px, 4.4vw, 50px); margin: 0; }
.entry-content { padding-bottom: 72px; }
.entry-content > *:not(.zf):not(.alignwide):not(.alignfull) { max-width: 780px; margin-left: auto; margin-right: auto; }
.entry-content > .alignwide { max-width: var(--zt-w); }
.entry-content > .alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; }
.entry-content h2 { font-size: 30px; margin-top: 1.4em; }
.entry-content img { border-radius: 10px; }
.zt-item { padding-top: 22px; }
.zt-crumbs { font-size: 14px; color: var(--zt-muted); margin-bottom: 6px; }
.zt-crumbs a { color: var(--zt-muted); text-decoration: none; }
.zt-crumbs a:hover { color: var(--zt-green-2); text-decoration: underline; }
.zt-item__title { font-size: clamp(28px, 3.8vw, 44px); margin-bottom: 18px; max-width: 26ch; }
.zt-item .entry-content { padding-bottom: 40px; }
.zt-item .zf-back { display: none; }

.zt-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; padding-bottom: 40px; }
.zt-card__link { display: block; height: 100%; color: inherit; text-decoration: none; background: #fff; border: 1px solid var(--zt-line); border-radius: 14px; overflow: hidden; }
.zt-card__img img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.zt-card__body { padding: 18px 20px; }
.zt-card__title { font-size: 22px; }
.zt-pager { padding-bottom: 60px; }
.zt-pager .nav-links { display: flex; gap: 6px; justify-content: center; }
.zt-pager .page-numbers { min-width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--zt-line); border-radius: 8px; text-decoration: none; color: var(--zt-ink); font-weight: 600; }
.zt-pager .current { background: var(--zt-green); color: #fff; }
.zt-tip { background: var(--zt-chalk-soft); padding: 14px 18px; border-radius: 10px; }
.zt-empty, .zt-404 { padding: 20px 0 60px; }
.zt-404 .zt-btn { margin: 4px 8px 4px 0; }
.post-navigation .nav-links { display: flex; justify-content: space-between; gap: 20px; padding: 24px 0; border-top: 1px solid var(--zt-line); }
.post-navigation a { font-weight: 600; text-decoration: none; }
.search-form { display: flex; gap: 8px; }
.search-form label { flex: 1; }
.search-field, .comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #c9d1cc; border-radius: 8px; font: inherit; background: #fff; }
.search-submit, .comment-form .submit { min-height: 46px; padding: 0 20px; border: 0; border-radius: 8px; background: var(--zt-green); color: #fff; font: 700 16px var(--zt-body); cursor: pointer; }
.zt-comments { padding: 30px 0 60px; }
.zt-comments__list { padding-left: 0; list-style: none; }

/* ---------- footer ---------- */
.zt-foot { background: #0b2a23; color: rgba(255, 255, 255, .78); padding: 60px 0 26px; font-size: 15px; }
.zt-foot a { color: #fff; text-decoration: none; }
.zt-foot a:hover { text-decoration: underline; }
.zt-foot__grid { display: flex; flex-wrap: wrap; gap: 32px 40px; }
.zt-foot__grid > * { flex: 1 1 160px; }
.zt-foot__grid > .zt-foot__brand { flex: 2 1 300px; }
.zt-foot__name { color: #fff; margin-bottom: 12px; }
.zt-foot__brand p { max-width: 44ch; }
.zt-foot__h { color: var(--zt-chalk); font: 700 13px/1.3 var(--zt-body); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
.zt-foot__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.zt-foot__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 44px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 14px; }

/* ---------- smaller screens ---------- */
@media (max-width: 1000px) {
	.zt-subjects { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
	.zt-menu-btn { display: block; }
	.zt-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 12px; padding: 12px 24px 24px; background: var(--zt-bg); border-bottom: 1px solid var(--zt-line); box-shadow: 0 16px 30px rgba(23, 32, 28, .1); }
	.is-open .zt-nav { display: flex; }
	.zt-nav__list { flex-direction: column; }
	.zt-nav__list a { padding: 12px 8px; font-size: 18px; border-bottom: 1px solid var(--zt-line); border-radius: 0; }
	.zt-nav__account { justify-content: space-between; }
	.zt-nav__account .zt-btn { min-height: 48px; flex: 1; }
	.zt-split { grid-template-columns: 1fr; }
	.zt-steps { grid-template-columns: 1fr; }
	.zt-band__in { flex-direction: column; align-items: flex-start; }
	.zt-head { flex-direction: column; align-items: flex-start; gap: 6px; }
	.zt-head--small { flex-direction: row; align-items: center; justify-content: space-between; }
	.zt-search { grid-template-columns: 1fr 1fr; }
	.zt-search__q, .zt-search .zt-btn { grid-column: 1 / -1; }
	.admin-bar .zt-header { top: 46px; }
}
@media (max-width: 600px) {
	.zt-container { padding: 0 16px; }
	.zt-header__in { min-height: 62px; }
	.zt-hero { padding: 54px 0 64px; }
	.zt-hero__doodles .d { font-size: 30px; }
	.zt-section { padding: 52px 0; }
	.zt-subjects { grid-template-columns: 1fr 1fr; gap: 10px; }
	.zt-subject { grid-template-columns: 1fr; row-gap: 8px; }
	.zt-subject__letter { grid-row: auto; width: 40px; height: 40px; font-size: 19px; }
	.zt-foot__grid > * { flex-basis: 40%; }
	.zt-foot__grid > .zt-foot__brand { flex-basis: 100%; }
	.admin-bar .zt-header { top: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.zt-subject, .zt-btn, .zt-menu-btn__bars::before, .zt-menu-btn__bars::after { transition: none; }
}
