/*
Theme Name: Evolve
Theme URI: https://example.com/evolve
Author: Evolve Public Health Consultancy
Description: A clean, mobile-first theme for Evolve Public Health Consultancy. Brand colours, Outfit typeface, an editable home page (Appearance → Customize → Evolve home page), and block editor support.
Version: 1.0.1
Requires at least: 6.2
Tested up to: 6.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: evolve
Tags: one-column, custom-logo, custom-menu, featured-images, theme-options, translation-ready, block-styles, wide-blocks, accessibility-ready
*/

/* ---------- Fonts (Outfit, SIL Open Font License, self-hosted) ---------- */
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/outfit-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/outfit-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/outfit-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 800; font-display: swap; src: url("assets/fonts/outfit-latin-800-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
	--navy: #13396B;
	--navy-deep: #0E2B52;
	--green: #3E9B3A;
	--green-dark: #2E7A2B;
	--green-deeper: #1F5F1D;
	--green-light: #7CC46B;
	--ink: #1B2533;
	--muted: #4A5566;
	--line: #DCE3EA;
	--surface: #F4F7F5;
	--white: #FFFFFF;
	--font: "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
	--wrap: 1200px;
	--gutter: 20px;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(14, 43, 82, .06), 0 8px 24px rgba(14, 43, 82, .08);
}
@media (min-width: 768px) { :root { --gutter: 32px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.65; color: var(--ink); background: var(--white); -webkit-font-smoothing: antialiased; }
img, svg, video, iframe { max-width: 100%; height: auto; }
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-dark); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font); color: var(--navy); line-height: 1.15; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: clamp(1.7rem, 3.8vw, 2.5rem); font-weight: 800; }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.4rem); }
p { margin: 0 0 1.1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
blockquote { margin: 1.5rem 0; padding: .25rem 0 .25rem 1.25rem; border-left: 4px solid var(--green); color: var(--navy); font-size: 1.15rem; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); text-align: left; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.screen-reader-text:focus { position: fixed !important; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto; clip: auto; padding: 12px 18px; background: var(--white); color: var(--navy); border-radius: 8px; box-shadow: var(--shadow); font-weight: 700; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.wrap--narrow { max-width: 800px; }

/* ---------- Buttons ---------- */
.btn, .wp-block-button__link, button, input[type="submit"] {
	display: inline-flex; align-items: center; justify-content: center; gap: .5em;
	min-height: 48px; padding: .7em 1.4em; border-radius: 999px; border: 2px solid transparent;
	font: 600 1rem/1.2 var(--font); text-decoration: none; cursor: pointer;
	background: var(--green-dark); color: var(--white); transition: background .15s, color .15s, border-color .15s;
}
.btn:hover, .wp-block-button__link:hover, button:hover, input[type="submit"]:hover { background: var(--green-deeper); color: var(--white); }
.btn--outline { background: transparent; border-color: currentColor; color: var(--white); }
.btn--outline:hover { background: var(--white); color: var(--navy); border-color: var(--white); }
.btn--navy { background: var(--navy); }
.btn--navy:hover { background: var(--navy-deep); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--line); }
.admin-bar .site-header { top: 46px; }
@media (min-width: 783px) { .admin-bar .site-header { top: 32px; } }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.site-branding { display: flex; align-items: center; flex-shrink: 0; }
.site-branding a { display: block; line-height: 0; }
.site-branding img, .custom-logo { width: auto; height: 44px; max-width: 200px; }
@media (min-width: 1024px) { .site-header__inner { min-height: 84px; } .site-branding img, .custom-logo { height: 54px; max-width: 240px; } }

.menu-toggle { background: transparent; color: var(--navy); border: 2px solid var(--line); min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 10px; gap: 8px; font-weight: 600; }
.menu-toggle:hover { background: var(--surface); color: var(--navy); }
.menu-toggle__bars { position: relative; width: 20px; height: 14px; }
.menu-toggle__bars span { position: absolute; left: 0; width: 100%; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s, top .2s; }
.menu-toggle__bars span:nth-child(1) { top: 0; } .menu-toggle__bars span:nth-child(2) { top: 6px; } .menu-toggle__bars span:nth-child(3) { top: 12px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

.main-navigation ul { list-style: none; margin: 0; padding: 0; }
.main-navigation a { display: flex; align-items: center; min-height: 48px; text-decoration: none; color: var(--navy); font-weight: 500; }
.main-navigation .current-menu-item > a, .main-navigation .current_page_item > a, .main-navigation a:hover { color: var(--green-dark); }
.main-navigation a.header-cta, .main-navigation a.header-cta:hover { color: var(--white); justify-content: center; }

/* Mobile menu panel */
@media (max-width: 1023px) {
	.main-navigation { position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); max-height: calc(100vh - 68px); overflow-y: auto; display: none; }
	.main-navigation.is-open { display: block; }
	.main-navigation > .wrap { padding-top: 8px; padding-bottom: 20px; }
	.main-navigation li { border-bottom: 1px solid var(--line); }
	.main-navigation a { font-size: 1.1rem; }
	.main-navigation .sub-menu { padding-left: 16px; }
	.main-navigation .sub-menu li { border-bottom: 0; }
	.main-navigation .sub-menu a { font-size: 1rem; color: var(--muted); min-height: 44px; }
	.header-cta { margin-top: 16px; width: 100%; }
	.no-js .main-navigation { position: static; display: block; box-shadow: none; }
}
/* Desktop menu */
@media (min-width: 1024px) {
	.menu-toggle { display: none; }
	.main-navigation { display: flex; align-items: center; }
	.main-navigation > .wrap { display: flex; align-items: center; gap: 28px; padding: 0; max-width: none; }
	.main-navigation .menu { display: flex; gap: 28px; }
	.main-navigation li { position: relative; }
	.main-navigation .sub-menu { position: absolute; top: 100%; left: -16px; min-width: 220px; padding: 8px 0; background: var(--white); border-radius: 12px; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s, transform .15s, visibility .15s; z-index: 10; }
	.main-navigation li:hover > .sub-menu, .main-navigation li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
	.main-navigation .sub-menu a { padding: 0 16px; min-height: 42px; }
	.main-navigation .menu-item-has-children > a::after { content: ""; width: 7px; height: 7px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); }
	.header-cta { min-height: 44px; padding: .55em 1.2em; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--navy-deep); color: var(--white); }
.hero__inner { position: relative; z-index: 1; display: grid; gap: 32px; padding-top: 56px; padding-bottom: 64px; }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: .85rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--green-light); }
.hero__eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--green-light); }
.hero h1 { color: var(--white); max-width: 16ch; }
.hero__text { font-size: 1.15rem; color: #D5DEEA; max-width: 40ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__actions .btn { flex: 1 1 auto; }
@media (min-width: 480px) { .hero__actions .btn { flex: 0 0 auto; } }
.hero__visual { display: none; }
.hero__visual img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 24px; }
.hero__mark { position: absolute; right: -120px; bottom: -140px; width: 420px; opacity: .08; pointer-events: none; }
@media (min-width: 900px) {
	.hero__inner { grid-template-columns: 1.15fr .85fr; align-items: center; padding-top: 96px; padding-bottom: 104px; }
	.hero__visual { display: block; aspect-ratio: 4 / 5; max-height: 520px; }
	.hero__visual--mark { display: flex; align-items: center; justify-content: center; aspect-ratio: auto; }
	.hero__visual--mark img { width: 78%; height: auto; border-radius: 0; }
	.hero__mark { width: 620px; right: -160px; bottom: -220px; }
}

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
@media (min-width: 900px) { .section { padding: 96px 0; } }
.section--tint { background: var(--surface); }
.section__head { max-width: 680px; margin-bottom: 36px; }
.section__kicker { display: block; margin-bottom: 10px; font-size: .85rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--green-dark); }
.section__intro { color: var(--muted); font-size: 1.1rem; }

/* Services */
.cards { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1024px) { .cards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--muted); }
.card__icon { width: 52px; height: 52px; border-radius: 14px; background: #E7F3E6; color: var(--green-dark); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.card__icon svg { width: 26px; height: 26px; }

/* About */
.split { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 64px; } }
.split__media img { display: block; width: 100%; border-radius: 20px; aspect-ratio: 4 / 3; object-fit: cover; }
.split__media--mark { background: var(--navy); border-radius: 20px; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.split__media--mark img { width: 42%; aspect-ratio: auto; border-radius: 0; }
.split__body > *:last-child { margin-bottom: 0; }

/* Posts */
.post-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.post-card__thumb img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.post-card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card__meta { font-size: .85rem; color: var(--muted); }
.post-card h3 { margin: 0; font-size: 1.2rem; }
.post-card h3 a { text-decoration: none; color: var(--navy); }
.post-card h3 a:hover { color: var(--green-dark); }
.post-card p { margin: 0; color: var(--muted); font-size: 1rem; }

/* CTA */
.section:not(.section--tint) + .section--cta { padding-top: 0; }
.cta { background: var(--green-dark); color: var(--white); border-radius: 22px; padding: 36px 24px; display: grid; gap: 20px; }
.cta h2 { color: var(--white); margin: 0; }
.cta p { margin: 0; color: #EAF6E8; font-size: 1.1rem; }
.cta .btn { background: var(--navy-deep); justify-self: start; }
.cta .btn:hover { background: var(--navy); }
@media (min-width: 900px) { .cta { grid-template-columns: 1fr auto; align-items: center; padding: 48px 56px; } .cta .btn { justify-self: end; } }

/* ---------- Content pages ---------- */
.page-header { background: var(--surface); padding: 48px 0 40px; border-bottom: 1px solid var(--line); }
.page-header h1 { margin: 0; font-size: clamp(1.9rem, 4.5vw, 3rem); }
.page-header .entry-meta, .page-header .archive-description { margin-top: 12px; color: var(--muted); }
.site-main--content { padding: 48px 0 72px; }
.entry-content > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.entry-content > .alignwide { max-width: 1100px; }
.entry-content > .alignfull { max-width: none; width: 100vw; margin-left: calc(50% - 50vw); }
.entry-content h2 { margin-top: 1.8em; }
.entry-content h3 { margin-top: 1.5em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: .35em; }
.entry-content img { border-radius: 10px; }
.entry-thumbnail { max-width: 1000px; margin: 0 auto 36px; }
.entry-thumbnail img { width: 100%; border-radius: 16px; display: block; }
.alignleft { float: left; margin: .3em 1.5em 1em 0; } .alignright { float: right; margin: .3em 0 1em 1.5em; } .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption-text, figcaption { font-size: .9rem; color: var(--muted); margin-top: .5em; }
.sticky, .bypostauthor, .gallery-caption { }
.post-nav { display: grid; gap: 12px; max-width: 760px; margin: 48px auto 0; }
@media (min-width: 640px) { .post-nav { grid-template-columns: 1fr 1fr; } .post-nav .nav-next { text-align: right; } }
.post-nav a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.post-nav span { display: block; font-size: .85rem; color: var(--muted); }

.pagination { margin-top: 40px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.pagination .page-numbers.current { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* Forms */
input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="password"], textarea, select {
	width: 100%; min-height: 48px; padding: .7em .9em; font: inherit; color: var(--ink); background: var(--white); border: 1.5px solid #B9C4D0; border-radius: 10px;
}
textarea { min-height: 140px; }
input:focus, textarea:focus, select:focus { border-color: var(--navy); outline: 3px solid rgba(62, 155, 58, .35); outline-offset: 0; }
label { font-weight: 600; color: var(--navy); }
.search-form { display: flex; gap: 8px; max-width: 520px; }
.search-form label { flex: 1; }

/* Comments */
.comments-area { max-width: 760px; margin: 56px auto 0; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 20px; }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--line); }
.comment-meta { font-size: .9rem; color: var(--muted); }
.comment-form p { margin-bottom: 16px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: #C9D4E3; padding: 56px 0 0; margin-top: 0; }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { color: var(--green-light); }
.footer-grid { display: grid; gap: 36px; padding-bottom: 40px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; } }
.footer-brand img { width: 260px; max-width: 100%; height: auto; margin-bottom: 16px; }
.footer-brand p { max-width: 36ch; }
.site-footer h2 { color: var(--white); font-size: 1rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px; }
.footer-menu, .contact-list { list-style: none; margin: 0; padding: 0; }
.footer-menu a, .contact-list a, .contact-list span { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; }
.contact-list svg { width: 18px; height: 18px; color: var(--green-light); flex-shrink: 0; }
.social-links { display: flex; gap: 10px; margin-top: 16px; }
.social-links a { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); display: inline-flex; align-items: center; justify-content: center; }
.social-links a:hover { background: var(--green-dark); border-color: var(--green-dark); color: var(--white); }
.social-links svg { width: 18px; height: 18px; }
.site-info { border-top: 1px solid rgba(255, 255, 255, .12); padding: 20px 0 28px; font-size: .9rem; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* 404 / empty */
.not-found { text-align: center; padding: 40px 0; }
.not-found .search-form { margin: 24px auto 0; }
.site-credit a { text-decoration: underline; text-underline-offset: 3px; }
