/*
Theme Name: Engnova
Theme URI: https://example.com/engnova
Description: A learning-platform theme for English and IELTS sites. Built around a resource hub homepage — test grids, tool cards, course rows and sample libraries — with a dedicated full-width template for the IELTS Tests plugin. Sections are driven by menus, categories and the Customizer, so the homepage can be rearranged without touching code.
Version: 1.0.1
Requires at least: 5.6
Tested up to: 6.6
Requires PHP: 7.0
Author: —
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: engnova
Tags: education, blog, custom-menu, custom-logo, featured-images, full-width-template, translation-ready
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */

:root {
	--brand:      #e0342b;
	--brand-dark: #b8231c;
	--brand-wash: #fdf0ef;
	--ink:        #17172b;
	--ink-2:      #3d3d55;
	--ink-soft:   #6b6b80;
	--paper:      #ffffff;
	--wash:       #f7f7fa;
	--wash-2:     #eef0f5;
	--rule:       #e5e6ec;
	--rule-2:     #d3d5df;
	--deep:       #3a1a72;
	--deep-2:     #2b1256;
	--gold:       #f0b429;
	--green:      #0f7b46;

	--sans: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;

	--wrap: 1200px;
	--gap: 24px;
	--radius: 10px;
	--shadow: 0 1px 2px rgba(23,23,43,.05), 0 4px 14px rgba(23,23,43,.05);
	--shadow-lift: 0 6px 26px rgba(23,23,43,.12);
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.65;
	color: var(--ink-2);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
	color: var(--ink);
	line-height: 1.2;
	margin: 0 0 .5em;
	font-weight: 700;
	letter-spacing: -.015em;
}
h1 { font-size: clamp(30px, 4.4vw, 50px); }
h2 { font-size: clamp(24px, 3vw, 34px); }
h3 { font-size: 20px; }
h4 { font-size: 17px; }

p { margin: 0 0 1.1em; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 3px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(1px,1px,1px,1px);
	white-space: nowrap;
}
.skip-link {
	position: absolute; left: -9999px; top: 0;
	background: var(--ink); color: #fff; padding: 12px 20px; z-index: 999;
}
.skip-link:focus { left: 0; color: #fff; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--brand);
	color: #fff;
	border: 2px solid var(--brand);
	border-radius: 6px;
	padding: 12px 26px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease, transform .15s ease;
	text-align: center;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-outline { background: transparent; color: var(--brand); }
.btn-outline:hover { background: var(--brand); color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); }
.btn-dark:hover { background: #000; border-color: #000; }
.btn-sm { padding: 8px 16px; font-size: 13.5px; border-width: 1px; }
.btn-lg { padding: 15px 34px; font-size: 16.5px; }

/* ==========================================================================
   Announcement bar
   ========================================================================== */

.announce {
	background: var(--brand);
	color: #fff;
	text-align: center;
	font-size: 14.5px;
	font-weight: 600;
	padding: 9px 44px 9px 20px;
	position: relative;
}
.announce a { color: #fff; text-decoration: underline; }
.announce a:hover { color: #fff; }
.announce-close {
	position: absolute;
	right: 12px; top: 50%;
	transform: translateY(-50%);
	background: none; border: none;
	color: #fff; font-size: 20px; line-height: 1;
	cursor: pointer; padding: 4px 8px; opacity: .8;
}
.announce-close:hover { opacity: 1; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
	background: var(--paper);
	border-bottom: 1px solid var(--rule);
	position: sticky;
	top: 0;
	z-index: 200;
}
.header-inner {
	display: flex;
	align-items: center;
	gap: 26px;
	padding: 12px 20px;
	max-width: 1400px;
	margin: 0 auto;
}
.site-brand { display: flex; align-items: center; gap: 10px; flex: none; }
.site-brand img { max-height: 54px; width: auto; }
.site-title {
	font-size: 21px;
	font-weight: 800;
	color: var(--ink);
	letter-spacing: -.02em;
	line-height: 1.1;
}
.site-title:hover { text-decoration: none; color: var(--brand); }
.site-desc { font-size: 12px; color: var(--ink-soft); margin: 0; }

.primary-nav { flex: 1 1 auto; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.primary-nav li { position: relative; }
.primary-nav > ul > li > a {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 9px 12px;
	font-size: 14.5px;
	font-weight: 600;
	color: var(--ink);
	border-radius: 6px;
}
.primary-nav > ul > li > a:hover,
.primary-nav > ul > li.current-menu-item > a { background: var(--wash); color: var(--brand); text-decoration: none; }
.primary-nav li.menu-item-has-children > a::after {
	content: "";
	width: 7px; height: 7px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	margin-left: 3px;
}
.primary-nav .sub-menu {
	position: absolute;
	left: 0; top: 100%;
	background: var(--paper);
	border: 1px solid var(--rule);
	border-radius: 8px;
	box-shadow: var(--shadow-lift);
	min-width: 226px;
	padding: 6px;
	display: none;
	flex-direction: column;
	gap: 0;
}
.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu { display: flex; }
.primary-nav .sub-menu a {
	display: block;
	padding: 9px 12px;
	font-size: 14px;
	color: var(--ink-2);
	border-radius: 5px;
	font-weight: 500;
}
.primary-nav .sub-menu a:hover { background: var(--wash); color: var(--brand); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.header-search-toggle {
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	color: var(--ink);
	display: inline-flex;
	border-radius: 6px;
}
.header-search-toggle:hover { background: var(--wash); }
.header-search-toggle svg { width: 21px; height: 21px; }

.nav-toggle {
	display: none;
	background: none;
	border: 1px solid var(--rule-2);
	border-radius: 6px;
	padding: 8px 10px;
	cursor: pointer;
	color: var(--ink);
}
.nav-toggle svg { width: 20px; height: 20px; display: block; }

.header-search {
	border-top: 1px solid var(--rule);
	background: var(--wash);
	padding: 16px 20px;
}
.header-search[hidden] { display: none; }
.search-form { display: flex; gap: 8px; max-width: 640px; margin: 0 auto; }
.search-form input[type="search"] {
	flex: 1 1 auto;
	border: 1px solid var(--rule-2);
	border-radius: 6px;
	padding: 11px 14px;
	font-size: 15px;
	font-family: inherit;
	background: var(--paper);
	color: var(--ink);
}
.search-form input[type="search"]:focus { outline: none; border-color: var(--brand); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero { padding: 56px 0 44px; }
.hero-grid {
	display: grid;
	grid-template-columns: 1.1fr .9fr;
	gap: 48px;
	align-items: center;
}
.hero-eyebrow {
	color: var(--brand);
	font-weight: 800;
	font-size: 17px;
	margin: 0 0 14px;
	letter-spacing: -.01em;
}
.hero h1 { margin: 0 0 18px; }
.hero-lede { font-size: 17.5px; line-height: 1.7; color: var(--ink-2); max-width: 34em; margin: 0 0 26px; }
.hero-note { font-size: 13px; color: var(--ink-soft); font-style: italic; margin: 14px 0 0; }
.hero-media { text-align: center; }
.hero-media img { margin: 0 auto; border-radius: var(--radius); }
.hero-badge {
	display: inline-block;
	margin-top: 20px;
	border: 1px solid var(--rule-2);
	border-radius: 8px;
	padding: 12px 18px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ink);
	background: var(--paper);
}

/* ==========================================================================
   Section furniture
   ========================================================================== */

.section { padding: 52px 0; }
.section-alt { background: var(--wash); }
.section-head { text-align: center; margin-bottom: 34px; }
.section-head h2 { margin: 0 0 10px; }
.section-head p { color: var(--ink-soft); max-width: 46em; margin: 0 auto; font-size: 15.5px; }
.section-foot { text-align: center; margin-top: 32px; }

.divider { border: none; border-top: 1px solid var(--rule); margin: 0; }

/* Purple partner band */
.band {
	background: var(--deep);
	color: #fff;
	border-radius: var(--radius);
	padding: 30px 28px;
	text-align: center;
}
.band h2, .band h3 { color: #fff; margin: 0 0 8px; }
.band p { color: rgba(255,255,255,.86); margin: 0 0 18px; }
.band p:last-child { margin-bottom: 0; }
.band .btn { background: var(--gold); border-color: var(--gold); color: var(--deep-2); }
.band .btn:hover { background: #fff; border-color: #fff; color: var(--deep-2); }

/* ==========================================================================
   Cards
   ========================================================================== */

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }

.card {
	background: var(--paper);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--rule-2); }
.card-media { aspect-ratio: 16 / 10; background: var(--wash-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px 18px 18px; flex: 1 1 auto; display: flex; flex-direction: column; }
.card-title { font-size: 16.5px; margin: 0 0 8px; line-height: 1.35; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--brand); text-decoration: none; }
.card-excerpt { font-size: 14px; color: var(--ink-soft); margin: 0 0 14px; flex: 1 1 auto; }
.card-meta {
	font-size: 12.5px;
	color: var(--ink-soft);
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	align-items: center;
}
.card-meta strong { color: var(--ink); font-weight: 600; }

/* Test category tiles — the four coloured blocks */
.tile {
	border-radius: var(--radius);
	padding: 30px 22px;
	text-align: center;
	color: #fff;
	display: block;
	font-weight: 800;
	font-size: 19px;
	letter-spacing: -.01em;
	line-height: 1.25;
	transition: transform .16s ease, box-shadow .16s ease;
	border: none;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); color: #fff; text-decoration: none; }
.tile span { display: block; font-size: 12.5px; font-weight: 600; opacity: .85; margin-top: 8px; letter-spacing: 0; }
.tile-1 { background: linear-gradient(135deg, #e0342b, #f0714b); }
.tile-2 { background: linear-gradient(135deg, #1560c4, #2fa3e8); }
.tile-3 { background: linear-gradient(135deg, #0f7b46, #4bbf7a); }
.tile-4 { background: linear-gradient(135deg, #6b2fb5, #a55ce0); }

/* Tool cards — small icon squares */
.tool {
	background: var(--paper);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	padding: 18px 14px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
	min-height: 100%;
}
.tool:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--brand); text-decoration: none; }
.tool-icon {
	width: 46px; height: 46px;
	border-radius: 11px;
	background: var(--brand-wash);
	color: var(--brand);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 800;
	flex: none;
}
.tool-name { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.tool-desc { font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; }

/* Sample list rows — image left, text right */
.rows { display: grid; gap: 18px; }
.row-item {
	display: grid;
	grid-template-columns: 210px 1fr;
	gap: 20px;
	background: var(--paper);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	overflow: hidden;
	transition: box-shadow .16s ease, border-color .16s ease;
}
.row-item:hover { box-shadow: var(--shadow); border-color: var(--rule-2); }
.row-media { background: var(--wash-2); }
.row-media img { width: 100%; height: 100%; object-fit: cover; }
.row-body { padding: 18px 20px 18px 0; }
.row-body h3 { font-size: 17px; margin: 0 0 8px; }
.row-body h3 a { color: var(--brand); }
.row-body p { font-size: 14.3px; color: var(--ink-2); margin: 0 0 10px; }
.row-cats { font-size: 12.5px; color: var(--ink-soft); }
.row-cats a { color: var(--ink-soft); text-decoration: underline; }

/* ==========================================================================
   Posts and pages
   ========================================================================== */

.page-hero {
	background: var(--wash);
	border-bottom: 1px solid var(--rule);
	padding: 40px 0;
}
.page-hero h1 { margin: 0 0 8px; }
.page-hero p { color: var(--ink-soft); margin: 0; }
.breadcrumbs { font-size: 13px; color: var(--ink-soft); margin: 0 0 10px; }
.breadcrumbs a { color: var(--ink-soft); }

.content-area { padding: 44px 0 60px; }
.content-grid { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 44px; align-items: start; }
.content-grid.no-sidebar { grid-template-columns: minmax(0,1fr); max-width: 800px; margin: 0 auto; }

.entry-content { font-size: 16.8px; line-height: 1.75; }
.entry-content h2 { margin-top: 1.6em; }
.entry-content h3 { margin-top: 1.4em; }
.entry-content img { border-radius: 8px; margin: 1.4em 0; }
.entry-content blockquote {
	border-left: 4px solid var(--brand);
	margin: 1.6em 0;
	padding: 4px 0 4px 20px;
	color: var(--ink-2);
	font-style: italic;
}
.entry-content ul, .entry-content ol { padding-left: 24px; }
.entry-content li { margin: .45em 0; }
.entry-content code {
	background: var(--wash);
	padding: 2px 6px;
	border-radius: 4px;
	font-size: .9em;
}
.entry-content pre {
	background: var(--ink);
	color: #f0f0f5;
	padding: 18px;
	border-radius: 8px;
	overflow-x: auto;
}
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.4em 0; }
.entry-content th, .entry-content td { border: 1px solid var(--rule); padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--wash); }

.entry-meta { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 18px; display: flex; gap: 14px; flex-wrap: wrap; }
.entry-thumb { margin-bottom: 26px; }
.entry-thumb img { border-radius: var(--radius); width: 100%; }

.widget { margin-bottom: 30px; }
.widget-title { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.widget li:last-child { border-bottom: none; }
.widget a { color: var(--ink-2); }
.widget a:hover { color: var(--brand); }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.pagination .page-numbers {
	border: 1px solid var(--rule-2);
	border-radius: 6px;
	padding: 8px 14px;
	color: var(--ink-2);
	font-size: 14px;
	font-weight: 600;
}
.pagination .page-numbers:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }

.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; flex-wrap: wrap; }
.post-nav a { font-weight: 600; font-size: 14.5px; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { background: var(--wash); border-top: 1px solid var(--rule); padding: 46px 0 0; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 36px; }
.footer-brand img { max-height: 54px; margin-bottom: 12px; }
.footer-about { font-size: 14px; color: var(--ink-soft); }
.footer-col h4 { font-size: 15px; margin: 0 0 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { font-size: 14px; color: var(--ink-2); }
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
	border-top: 1px solid var(--rule);
	margin-top: 36px;
	padding: 18px 0;
	font-size: 13.5px;
	color: var(--ink-soft);
	display: flex;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
}
.social { display: flex; gap: 10px; }
.social a {
	width: 34px; height: 34px;
	border: 1px solid var(--rule-2);
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--ink-2);
}
.social a:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.social svg { width: 17px; height: 17px; }

/* ==========================================================================
   Exam template — lets the IELTS Tests plugin run edge to edge
   ========================================================================== */

.exam-page { padding: 0; }
.exam-page .site-footer { margin-top: 0; }
.exam-shell { padding: 22px 0 40px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1080px) {
	.grid-5 { grid-template-columns: repeat(4, minmax(0,1fr)); }
	.content-grid { grid-template-columns: minmax(0,1fr); }
	.content-grid aside { max-width: 640px; }
}

@media (max-width: 960px) {
	.nav-toggle { display: inline-flex; order: 3; }
	.primary-nav {
		order: 5;
		flex-basis: 100%;
		display: none;
		border-top: 1px solid var(--rule);
		padding-top: 12px;
		margin-top: 4px;
	}
	.primary-nav.is-open { display: block; }
	.primary-nav ul { flex-direction: column; gap: 2px; }
	.primary-nav .sub-menu {
		position: static;
		display: flex;
		border: none;
		box-shadow: none;
		padding: 0 0 0 14px;
		border-left: 2px solid var(--rule);
		border-radius: 0;
		margin: 2px 0 6px;
	}
	.header-inner { flex-wrap: wrap; gap: 12px; }
	.hero-grid { grid-template-columns: 1fr; gap: 30px; }
	.hero-media { order: -1; }
	.grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
	.grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
	.footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
	.section { padding: 38px 0; }
	.grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
	.grid-5 { grid-template-columns: repeat(2, minmax(0,1fr)); }
	.row-item { grid-template-columns: 1fr; }
	.row-media { aspect-ratio: 16/9; }
	.row-body { padding: 16px 18px; }
	.footer-grid { grid-template-columns: 1fr; gap: 26px; }
	.footer-bottom { flex-direction: column; }
	.hero { padding: 36px 0 30px; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
