/* Nontokozo Mkhize Foundation – main styles
   Most layout lives inline in the page templates (ported from the approved design).
   This file holds the base, header, footer, forms and responsive rules. */

:root {
	--nmf-accent: #E0006A;
	--nmf-ink: #2F3C45;
	--nmf-purple: #6366AC;
	--nmf-lilac: #F1EFF8;
	--nmf-muted: #52606A;
	--nmf-pink-soft: #FF9CC7;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
	color: var(--nmf-ink);
	background: #FFFFFF;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--nmf-ink); }
a:hover { color: var(--nmf-purple); }
:focus-visible { outline: 3px solid var(--nmf-accent); outline-offset: 3px; }
[id] { scroll-margin-top: 110px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.nmf-skip { position: absolute; left: -9999px; top: 0; background: var(--nmf-ink); color: #fff; padding: 12px 18px; z-index: 1000; }
.nmf-skip:focus { left: 12px; top: 12px; color: #fff; }

/* Buttons used in header & generic templates */
.nmf-btn { display: inline-block; text-decoration: none; font-weight: 700; padding: 12px 22px; border-radius: 999px; line-height: 1.3; }
.nmf-btn--accent { background: var(--nmf-accent); color: #FFFFFF !important; }
.nmf-btn--accent:hover { filter: brightness(0.92); }

/* ---------- Top bar ---------- */
.nmf-icon { flex-shrink: 0; }
.nmf-topbar { background: var(--nmf-ink); color: #FFFFFF; font-size: 14px; font-weight: 500; position: relative; z-index: 101; }
.nmf-topbar__inner { max-width: 1200px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.nmf-topbar a, .nmf-topbar button { color: #FFFFFF; text-decoration: none; }
.nmf-topbar a:hover, .nmf-topbar button:hover { color: var(--nmf-pink-soft); }
.nmf-topbar__contact, .nmf-topbar__right { display: flex; align-items: center; gap: 28px; }
.nmf-topbar__contact a, .nmf-topbar__link { display: inline-flex; align-items: center; gap: 8px; }
.nmf-topbar__social { display: flex; align-items: center; gap: 16px; }
.nmf-topbar__social a { display: inline-flex; }
.nmf-topbar button { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.nmf-ask { background: #FFFFFF; border-bottom: 1px solid #E6E9EC; box-shadow: 0 18px 30px rgba(47, 60, 69, 0.12); position: absolute; left: 0; right: 0; top: 100%; }
.nmf-ask__inner { max-width: 820px; margin: 0 auto; padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 14px; color: var(--nmf-ink); }
.nmf-ask__form { display: flex; align-items: center; gap: 10px; border: 2px solid #C9CCE3; border-radius: 999px; padding: 6px 6px 6px 18px; }
.nmf-ask__form:focus-within { border-color: var(--nmf-accent); }
.nmf-ask__form > .nmf-icon { color: var(--nmf-accent); width: 22px; height: 22px; }
.nmf-ask__form input { flex: 1; min-width: 0; font: inherit; font-size: 17px; padding: 10px 4px; border: 0; outline: none !important; color: var(--nmf-ink); background: transparent; }
.nmf-ask__form button[type="submit"] { font: inherit; font-weight: 700; background: var(--nmf-accent); color: #FFFFFF !important; border: 0; border-radius: 999px; padding: 11px 24px; cursor: pointer; }
.nmf-ask__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nmf-topbar .nmf-ask__chip { background: var(--nmf-lilac); color: #4A4D8F; border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 500; }
.nmf-topbar .nmf-ask__chip:hover { background: #E3E1F3; color: #4A4D8F; }
.nmf-ask__answer:empty { display: none; }
.nmf-ask__bubble { background: var(--nmf-lilac); border-radius: 20px 20px 20px 6px; padding: 18px 20px; font-size: 16px; }
.nmf-ask__bubble p { margin: 0 0 12px; }
.nmf-ask__links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.nmf-topbar a.nmf-ask__link { background: var(--nmf-accent); color: #FFFFFF; padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.nmf-topbar a.nmf-ask__link:hover { color: #FFFFFF; filter: brightness(0.92); }
.nmf-topbar a.nmf-ask__more { color: var(--nmf-purple); font-size: 14px; text-decoration: underline; }
.nmf-ask__note { margin: 10px 0 0 !important; font-size: 12px; color: var(--nmf-muted); }
.nmf-ask__typing { display: inline-flex; gap: 6px; width: auto; align-self: flex-start; }
.nmf-ask__typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--nmf-purple); animation: nmf-dot 1s infinite ease-in-out; }
.nmf-ask__typing span:nth-child(2) { animation-delay: .15s; }
.nmf-ask__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes nmf-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.nmf-ask-result { background: var(--nmf-lilac); border-radius: 24px; padding: 28px 32px; margin-bottom: 40px; font-size: 18px; }
.nmf-ask-result p { margin: 0 0 16px; }
.nmf-ask-result__links { display: flex; flex-wrap: wrap; gap: 10px; }
.nmf-topbar .nmf-search__close { background: none; border: 0; color: var(--nmf-ink); cursor: pointer; padding: 8px; display: inline-flex; }

/* ---------- Header ---------- */
.nmf-header { position: sticky; top: 0; z-index: 100; background: #FFFFFF; border-bottom: 1px solid #E6E9EC; }
.admin-bar .nmf-header { top: 32px; }
.nmf-header__inner { max-width: 1200px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nmf-brand { display: inline-flex; align-items: center; }
.nmf-brand__logo { width: 92px; height: auto; display: block; }
.nmf-nav { display: flex; align-items: center; gap: 32px; }
.nmf-nav__list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 30px; font-family: 'Bricolage Grotesque', sans-serif; font-size: 17px; font-weight: 700; }
.nmf-nav__list li { position: relative; }
.nmf-nav__list > li > a { display: inline-flex; align-items: center; gap: 4px; padding: 14px 0; color: var(--nmf-ink); text-decoration: none; }
.nmf-nav__list > li > a .nmf-icon { width: 16px; height: 16px; transition: transform .2s ease; }
.nmf-nav__list a:hover { color: var(--nmf-accent); }
.nmf-nav__list .current-menu-item > a, .nmf-nav__list .current-menu-ancestor > a, .nmf-nav__list a[aria-current="page"] { color: var(--nmf-accent); }
.nmf-nav__list .sub-menu { list-style: none; margin: 0; padding: 10px; position: absolute; top: 100%; left: -14px; min-width: 250px; background: #FFFFFF; border-radius: 16px; box-shadow: 0 18px 40px rgba(47, 60, 69, 0.16); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s ease, transform .15s ease, visibility .15s; font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 500; }
.nmf-nav__list li:hover > .sub-menu, .nmf-nav__list li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.nmf-nav__list li:hover > a .nmf-icon, .nmf-nav__list li:focus-within > a .nmf-icon { transform: rotate(180deg); }
.nmf-nav__list .sub-menu a { display: block; padding: 10px 14px; border-radius: 10px; color: var(--nmf-ink); text-decoration: none; }
.nmf-nav__list .sub-menu a:hover { background: var(--nmf-lilac); color: var(--nmf-accent); }
.nmf-nav__donate { padding: 14px 28px; font-size: 16px; }
.nmf-menu-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nmf-menu-toggle__bars, .nmf-menu-toggle__bars::before, .nmf-menu-toggle__bars::after { display: block; width: 26px; height: 3px; border-radius: 3px; background: var(--nmf-ink); position: relative; transition: transform .2s ease; }
.nmf-menu-toggle__bars::before, .nmf-menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nmf-menu-toggle__bars::before { top: -8px; }
.nmf-menu-toggle__bars::after { top: 8px; }
.nmf-menu-toggle[aria-expanded="true"] .nmf-menu-toggle__bars { background: transparent; }
.nmf-menu-toggle[aria-expanded="true"] .nmf-menu-toggle__bars::before { transform: translateY(8px) rotate(45deg); }
.nmf-menu-toggle[aria-expanded="true"] .nmf-menu-toggle__bars::after { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 1080px) {
	.nmf-brand__logo { width: 70px; }
	.nmf-menu-toggle { display: block; }
	.nmf-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; max-height: calc(100vh - 100px); overflow-y: auto; background: #FFFFFF; border-bottom: 1px solid #E6E9EC; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 24px 24px; box-shadow: 0 16px 24px rgba(47, 60, 69, 0.08); }
	.nmf-nav.is-open { display: flex; }
	.nmf-nav__list { flex-direction: column; align-items: stretch; gap: 0; font-size: 19px; }
	.nmf-nav__list > li > a { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid #EEF0F2; }
	.nmf-nav__list > li > a .nmf-icon { display: none; }
	.nmf-nav__list .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; padding: 4px 0 10px 14px; min-width: 0; border-radius: 0; }
	.nmf-nav__list .sub-menu a { padding: 8px 0; color: var(--nmf-muted); }
	.nmf-nav__donate { margin-top: 18px; text-align: center; padding: 16px 22px; }
}
@media (max-width: 860px) {
	.nmf-topbar__inner { justify-content: center; padding: 8px 16px; }
	.nmf-topbar__contact { gap: 18px; }
	.nmf-topbar__right { gap: 18px; }
	.nmf-topbar__link span { display: none; }
}
@media (max-width: 520px) {
	.nmf-ask__form button[type="submit"] { padding: 10px 16px; }
	.nmf-ask__inner { padding: 16px; }
	.nmf-topbar__contact a span { display: none; }
	.nmf-topbar__inner { justify-content: space-between; }
	.nmf-topbar__social { gap: 14px; }
}
@media (max-width: 782px) { .admin-bar .nmf-header { top: 0; } }

/* ---------- Back to top ---------- */
.nmf-to-top { position: fixed; right: 22px; bottom: 22px; z-index: 90; width: 52px; height: 52px; border-radius: 50%; background: var(--nmf-accent); color: #FFFFFF; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(224, 0, 106, 0.35); opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity .2s ease, transform .2s ease, visibility .2s; }
.nmf-to-top .nmf-icon { width: 24px; height: 24px; }
.nmf-to-top:hover { color: #FFFFFF; filter: brightness(0.92); }
.nmf-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }

/* ---------- Footer ---------- */
.nmf-footer { background: var(--nmf-ink); color: #C9D3D9; padding: 48px 24px 40px; font-size: 14px; }
.nmf-footer__inner { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.nmf-footer__brand { display: flex; align-items: center; gap: 20px; }
.nmf-footer__brand img { width: 96px; height: auto; }
.nmf-footer__text { display: flex; flex-direction: column; gap: 6px; }
.nmf-footer__name { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 18px; color: #FFFFFF; }
.nmf-footer__tagline { font-style: italic; color: var(--nmf-pink-soft); }
.nmf-footer a { color: #C9D3D9; }
.nmf-footer a:hover { color: #FFFFFF; }
.nmf-footer__links { display: flex; gap: 20px; align-items: flex-end; }
.nmf-footer__credit { max-width: 1200px; margin: 32px auto 0; padding-top: 20px; border-top: 1px solid #4A5A65; font-size: 13px; color: #9FB0BA; }
.nmf-footer__credit a { color: #FFFFFF; font-weight: 700; text-decoration: none; }
.nmf-footer__credit a:hover { color: var(--nmf-pink-soft); }

/* ---------- Forms ---------- */
.nmf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.nmf-notice { border-radius: 14px; padding: 14px 18px; font-weight: 500; }
.nmf-notice--ok { background: #E6F5EE; color: #1C5E3F; }
.nmf-notice--error { background: #FDE8EF; color: #8A0040; }
form input:focus, form select:focus, form textarea:focus { outline: 3px solid var(--nmf-accent); outline-offset: 1px; }
form button[type="submit"]:hover { filter: brightness(0.92); }

/* ---------- Upcoming programmes (posts) ---------- */
.nmf-upcoming-card a { color: inherit; text-decoration: none; }
.nmf-upcoming-card a:hover h3 { color: var(--nmf-accent); }

/* ---------- Generic pages & posts ---------- */
.nmf-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.nmf-generic__hero { background: var(--nmf-ink); color: #FFFFFF; padding: 88px 0 72px; margin-bottom: 56px; }
.nmf-generic__hero h1 { margin: 0; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.05; }
.nmf-generic__hero p { color: #E4EAEE; font-size: 18px; }
.nmf-generic__meta { color: var(--nmf-pink-soft); font-weight: 700; font-size: 14px; margin: 0 0 10px; }
.nmf-prose { max-width: 760px; padding-bottom: 96px; font-size: 18px; }
.nmf-prose h2, .nmf-prose h3 { font-family: 'Bricolage Grotesque', sans-serif; line-height: 1.15; }
.nmf-prose img { height: auto; border-radius: 20px; }
.nmf-generic__img { margin-bottom: 32px; }
.nmf-posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; padding-bottom: 96px; }
.nmf-post-card img { width: 100%; height: 220px; object-fit: cover; border-radius: 20px; }
.nmf-post-card h2 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 24px; margin: 0 0 8px; }
.nmf-post-card h2 a { text-decoration: none; }

/* ---------- Responsive fixes for the page templates ---------- */
@media (max-width: 720px) {
	/* tame tall image blocks and big paddings on phones */
	main section { padding-left: 20px !important; padding-right: 20px !important; }
	main section[style*="padding: 128px"] { padding-top: 88px !important; padding-bottom: 88px !important; }
	main section[style*="padding: 96px"] { padding-top: 64px !important; padding-bottom: 64px !important; }
	main img[style*="height: 440px"], main img[style*="height: 480px"], main img[style*="height: 560px"] { height: 320px !important; }
	main img[style*="height: 420px"] { height: 300px !important; }
	main [style*="flex: 1 1 520px"], main [style*="flex: 1 1 480px"], main [style*="flex: 1 1 440px"], main [style*="flex: 1 1 420px"], main [style*="flex: 1 1 380px"], main [style*="flex: 1 1 360px"] { flex-basis: 100% !important; }
	main [style*="minmax(340px"] { grid-template-columns: 1fr !important; }
	main [style*="repeat(2, minmax(0, 1fr))"] { grid-template-columns: 1fr !important; }
	main [style*="padding: 44px"] { padding: 32px !important; }
	main [style*="padding: 36px"] { padding: 26px !important; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition: none !important; }
}
.nmf-ask__form input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
