/* King's Academy of Mathematics — main stylesheet */

:root {
	--navy: #11224f;
	--navy-dark: #0a1533;
	--gold: #c4a14e;
	--gold-dark: #a8862f;
	--ink: #0f172a;
	--body: #3f4756;
	--muted: #6b7280;
	--surface: #f6f7fb;
	--cream: #faf7ef;
	--border: #e5e7eb;
	--white: #ffffff;
	--radius: 14px;
	--shadow: 0 12px 34px rgba(17, 34, 79, 0.10);
	--shadow-sm: 0 4px 14px rgba(17, 34, 79, 0.08);
	--container: 1200px;
}

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

body {
	margin: 0;
	font-family: "Inter", system-ui, -apple-system, sans-serif;
	color: var(--body);
	font-size: 1.05rem;
	line-height: 1.7;
	background: var(--white);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
	font-family: "Playfair Display", Georgia, serif;
	color: var(--navy);
	line-height: 1.2;
	margin: 0 0 0.5em;
}

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container {
	width: 100%;
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 24px;
}

.container--narrow { max-width: 880px; }

.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(--navy);
	color: #fff;
	padding: 10px 16px;
	z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

.eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--gold-dark);
	margin: 0 0 12px;
}

/* Buttons */
.btn {
	display: inline-block;
	padding: 13px 26px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.98rem;
	border: 2px solid transparent;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--lg { padding: 16px 34px; font-size: 1.05rem; }
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-dark); color: #fff; }
.btn--gold { background: var(--gold); color: var(--navy-dark); }
.btn--gold:hover { background: var(--gold-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn--ghost:hover { background: rgba(17, 34, 79, 0.06); color: var(--navy); }
.btn--ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.6); }
.btn--ghost-light:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: saturate(180%) blur(8px);
	border-bottom: 1px solid var(--border);
}
.site-header__inner {
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: 84px;
}
.site-branding { display: flex; align-items: center; }
.site-logo img, .custom-logo { max-height: 60px; width: auto; }
.site-branding__text {
	display: flex;
	flex-direction: column;
	line-height: 1.1;
}
.site-title {
	font-family: "Playfair Display", Georgia, serif;
	font-weight: 700;
	font-size: 1.35rem;
	color: var(--navy);
}
.site-title:hover { text-decoration: none; }
.site-branding__sub {
	font-size: 0.72rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gold-dark);
	font-weight: 600;
}

.site-nav { margin-left: auto; }
.nav-menu {
	display: flex;
	gap: 22px;
	list-style: none;
	margin: 0;
	padding: 0;
	align-items: center;
}
.nav-menu a { color: var(--navy); font-weight: 500; font-size: 0.97rem; }
.nav-menu a:hover { color: var(--gold-dark); text-decoration: none; }
.nav-menu .current-menu-item > a,
.nav-menu .current-menu-ancestor > a { color: var(--gold-dark); }

/* Dropdown sub-menus */
.nav-menu li { position: relative; }
.nav-menu .menu-item-has-children > a::after {
	content: "";
	display: inline-block;
	width: 6px; height: 6px;
	margin-left: 7px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	opacity: 0.7;
}
.nav-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 210px;
	list-style: none;
	margin: 0;
	padding: 8px 0;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 10px;
	box-shadow: var(--shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
	z-index: 110;
}
.nav-menu .menu-item-has-children:hover > .sub-menu,
.nav-menu .menu-item-has-children:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.nav-menu .sub-menu li { padding: 0; }
.nav-menu .sub-menu a {
	display: block;
	padding: 9px 18px;
	font-size: 0.95rem;
	white-space: nowrap;
}
.nav-menu .sub-menu a:hover { background: var(--cream); }

.site-header__cta { white-space: nowrap; }

.nav-toggle {
	display: none;
	width: 46px; height: 46px;
	background: transparent;
	border: 1px solid var(--border);
	border-radius: 10px;
	position: relative;
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
	content: "";
	position: absolute;
	left: 12px;
	width: 20px; height: 2px;
	background: var(--navy);
	transition: transform 0.2s ease;
}
.nav-toggle__bar { top: 22px; }
.nav-toggle__bar::before { top: -6px; }
.nav-toggle__bar::after { top: 6px; }

/* Hero */
.hero {
	position: relative;
	background:
		linear-gradient(150deg, rgba(17, 34, 79, 0.93) 0%, rgba(10, 21, 51, 0.88) 70%),
		url("../images/hero-home.jpg") center / cover no-repeat;
	color: #fff;
	padding: 96px 0 88px;
	overflow: hidden;
}
.hero::after {
	content: "";
	position: absolute;
	right: -120px; top: -120px;
	width: 460px; height: 460px;
	background: radial-gradient(circle, rgba(196,161,78,0.25), transparent 65%);
	pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; max-width: 760px; }
.hero .eyebrow { color: var(--gold); }
.hero__title { font-size: clamp(2.3rem, 5vw, 3.6rem); margin-bottom: 18px; color: #fff; }
.hero__subtitle {
	font-size: 1.25rem;
	color: rgba(255, 255, 255, 0.85);
	margin: 0 0 30px;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* Page header (interior pages) */
.page-hero {
	background:
		linear-gradient(150deg, rgba(17, 34, 79, 0.92) 0%, rgba(10, 21, 51, 0.95) 100%),
		url("../images/page-hero.jpg") center / cover no-repeat;
	color: #fff;
	padding: 72px 0;
	text-align: center;
}
.page-hero h1 { color: #fff; font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 10px; }
.page-hero p { color: rgba(255,255,255,0.82); margin: 0 auto; max-width: 680px; font-size: 1.15rem; }

/* Sections */
.section { padding: 80px 0; }
.section--surface { background: var(--surface); }
.section--cream { background: var(--cream); }
.section--navy { background: var(--navy); color: rgba(255,255,255,0.85); }
.section--navy h2, .section--navy h3 { color: #fff; }
.section__header { text-align: center; max-width: 720px; margin: 0 auto 50px; }
.section__title { font-size: clamp(1.9rem, 3.5vw, 2.5rem); }
.section__title::after {
	content: "";
	display: block;
	width: 56px; height: 3px;
	background: var(--gold);
	margin: 16px auto 0;
	border-radius: 2px;
}
.section__lead { color: var(--muted); font-size: 1.15rem; margin: 14px 0 0; }
.section--navy .section__lead { color: rgba(255,255,255,0.75); }

/* Cards */
.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 26px;
}
.card {
	background: var(--white);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 30px;
	box-shadow: var(--shadow-sm);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card__icon {
	width: 48px; height: 48px;
	display: flex; align-items: center; justify-content: center;
	background: var(--cream);
	color: var(--gold-dark);
	border-radius: 10px;
	font-weight: 700; font-size: 1.2rem;
	margin-bottom: 16px;
}
.card__title { font-size: 1.3rem; margin-bottom: 8px; }
.card__desc { color: var(--muted); margin: 0; }

/* KAM Five — centered flex layout so the last row is balanced, not stranded */
.cards--five {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 26px;
}
.cards--five .card {
	flex: 1 1 300px;
	max-width: 340px;
	padding: 0;
	overflow: hidden;
	text-align: center;
	display: flex;
	flex-direction: column;
}
.cards--five .card__num {
	width: 100%;
	padding: 20px 0;
	background: var(--navy);
	color: var(--gold);
	font-family: "Playfair Display", serif;
	font-weight: 700;
	font-size: 1.9rem;
	line-height: 1;
	text-align: center;
}
.cards--five .card__body { padding: 26px 28px 30px; }
.cards--five .card__title { font-size: 1.25rem; }

/* Value cards (numbered/lettered) */
.values {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 26px;
}
.value {
	background: #fff;
	border: 1px solid var(--border);
	border-top: 4px solid var(--gold);
	border-radius: var(--radius);
	padding: 30px;
	box-shadow: var(--shadow-sm);
}
.value__name {
	font-family: "Playfair Display", serif;
	font-size: 1.4rem;
	color: var(--navy);
	margin: 0 0 10px;
}
.value p { margin: 0; color: var(--muted); }

/* The KAM Five — numbered feature list */
.feature-list { display: grid; gap: 22px; max-width: 900px; margin: 0 auto; }
.feature {
	display: grid;
	grid-template-columns: 64px 1fr;
	gap: 22px;
	align-items: start;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 26px 28px;
	box-shadow: var(--shadow-sm);
}
.feature__num {
	width: 56px; height: 56px;
	display: flex; align-items: center; justify-content: center;
	border-radius: 50%;
	background: var(--navy);
	color: var(--gold);
	font-family: "Playfair Display", serif;
	font-weight: 700;
	font-size: 1.5rem;
}
.feature__title { margin: 0 0 6px; font-size: 1.25rem; }
.feature__body { margin: 0; color: var(--muted); }

/* Steps */
.steps {
	list-style: none; margin: 0; padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 28px;
}
.step {
	text-align: center;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 32px 24px;
	box-shadow: var(--shadow-sm);
}
.step__num {
	display: inline-flex; align-items: center; justify-content: center;
	width: 54px; height: 54px;
	border-radius: 50%;
	background: var(--gold);
	color: var(--navy-dark);
	font-weight: 700; font-size: 1.3rem;
	margin-bottom: 16px;
}
.step__title { font-size: 1.2rem; }
.step p { color: var(--muted); }

/* Generic lists */
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 32px; }
.ticks li::before {
	content: "✓";
	position: absolute; left: 0; top: 0;
	width: 22px; height: 22px;
	display: flex; align-items: center; justify-content: center;
	background: var(--cream); color: var(--gold-dark);
	border-radius: 50%; font-size: 0.85rem; font-weight: 700;
}

/* Tables (courses, pricing) */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; background: #fff; min-width: 640px; }
.data-table thead th {
	background: var(--navy);
	color: #fff;
	text-align: left;
	padding: 15px 18px;
	font-family: "Inter", sans-serif;
	font-size: 0.9rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}
.data-table td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tbody tr:nth-child(even) { background: var(--surface); }
.data-table tbody tr:hover { background: var(--cream); }
.data-table td:first-child { font-weight: 600; color: var(--navy); }

/* Pricing options */
.pricing {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 24px;
	max-width: 980px;
	margin: 0 auto;
}
.price-card {
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 30px;
	text-align: center;
	box-shadow: var(--shadow-sm);
	position: relative;
}
.price-card--featured { border: 2px solid var(--gold); }
.price-card__badge {
	position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
	background: var(--gold); color: var(--navy-dark);
	font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
	letter-spacing: 0.06em; padding: 5px 14px; border-radius: 999px;
}
.price-card__amount { font-family: "Playfair Display", serif; font-size: 2.2rem; color: var(--navy); margin: 8px 0; }
.price-card__period { color: var(--muted); font-size: 0.95rem; }

/* Book store categories */
.bookstore-cat {
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 30px;
	box-shadow: var(--shadow-sm);
	margin-bottom: 24px;
}
.bookstore-cat h3 { display: flex; align-items: baseline; gap: 12px; }
.bookstore-cat__level { font-size: 0.8rem; color: var(--gold-dark); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.tag { display: inline-block; background: var(--cream); color: var(--gold-dark); padding: 4px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; margin: 4px 6px 0 0; }

/* Accordion (FAQ) */
.accordion { max-width: 820px; margin: 0 auto; }
.accordion__item { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; background: #fff; overflow: hidden; }
.accordion__btn {
	width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
	padding: 18px 22px; font-size: 1.05rem; font-weight: 600; color: var(--navy);
	display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.accordion__btn::after { content: "+"; font-size: 1.4rem; color: var(--gold-dark); }
.accordion__btn[aria-expanded="true"]::after { content: "\2013"; }
.accordion__panel { padding: 0 22px; max-height: 0; overflow: hidden; transition: max-height 0.25s ease, padding 0.25s ease; }
.accordion__panel[hidden] { display: block; }
.accordion__item.is-open .accordion__panel { max-height: 600px; padding: 0 22px 20px; }

/* CTA band */
.cta-band {
	background:
		linear-gradient(135deg, rgba(10,21,51,0.96), rgba(17,34,79,0.96));
	color: #fff;
	padding: 70px 0;
	text-align: center;
}
.cta-band__title { color: #fff; font-size: clamp(1.8rem, 3.5vw, 2.4rem); }
.cta-band__text { color: rgba(255, 255, 255, 0.82); margin: 0 0 28px; font-size: 1.15rem; }

/* Membership levels grid */
.levels {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 16px;
}
.level {
	background: #fff; border: 1px solid var(--border); border-radius: 12px;
	padding: 20px; text-align: center; box-shadow: var(--shadow-sm);
}
.level__tag { font-family: "Playfair Display", serif; font-size: 1.2rem; color: var(--navy); font-weight: 700; }
.level__desc { color: var(--muted); font-size: 0.95rem; margin-top: 4px; }

/* Forms */
.kam-form { max-width: 760px; margin: 0 auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow-sm); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.form-field input, .form-field select, .form-field textarea {
	padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px;
	font: inherit; color: var(--ink); background: #fff;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
	outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(17,34,79,0.12);
}
.form-note { color: var(--muted); font-size: 0.9rem; }

/* Content / prose */
.content-area { padding: 70px 0; }
.prose { max-width: 820px; margin: 0 auto; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 1.6em; }
.lead { font-size: 1.2rem; color: var(--body); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.two-col--media { align-items: center; gap: 56px; }

/* Media (content images) */
.media-figure { margin: 0; }
.media-figure img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); display: block; }
.media-figure figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 12px; text-align: center; }

.page-header { margin-bottom: 28px; }
.page-title { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.entry-content { max-width: 820px; }
.entry-content > * + * { margin-top: 1.1em; }

.post-list { display: grid; gap: 36px; max-width: 820px; }
.post-card__title { font-size: 1.6rem; margin: 8px 0; }
.post-card__meta { color: var(--muted); font-size: 0.9rem; }
.post-card__thumb img { border-radius: var(--radius); }
.single-article__thumb { margin: 0 0 24px; }
.single-article__thumb img { border-radius: var(--radius); }

/* Footer */
.site-footer { background: var(--navy-dark); color: #c7cede; padding: 60px 0 0; }
.site-footer a { color: #c7cede; }
.site-footer a:hover { color: var(--gold); }
.site-footer__inner {
	display: grid;
	grid-template-columns: 1.6fr 1fr 1fr;
	gap: 40px;
	padding-bottom: 44px;
}
.site-footer__name { font-family: "Playfair Display", serif; font-size: 1.3rem; color: #fff; }
.site-footer__tagline { color: #9aa6c2; margin: 8px 0 0; }
.site-footer h4 { color: #fff; font-size: 1.05rem; margin-bottom: 14px; }
.footer-menu, .footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); padding: 20px 0; font-size: 0.9rem; }
.site-footer__bottom p { margin: 0; }
.social-links { display: flex; gap: 14px; margin-top: 6px; }
.social-links a { font-weight: 600; }

/* Responsive */
@media (max-width: 980px) {
	.site-header__cta { display: none; }
	.nav-toggle { display: block; margin-left: auto; }
	.site-nav { margin-left: 0; }
	.nav-menu {
		display: none;
		position: absolute;
		left: 0; right: 0; top: 84px;
		flex-direction: column;
		gap: 0;
		align-items: stretch;
		background: #fff;
		border-bottom: 1px solid var(--border);
		padding: 8px 24px 16px;
		box-shadow: var(--shadow);
	}
	.site-nav.is-open .nav-menu { display: flex; }
	.nav-menu li { padding: 10px 0; border-bottom: 1px solid var(--border); }
	.nav-menu .menu-item-has-children > a::after { float: right; transform: rotate(45deg); }
	.nav-menu .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: 0;
		padding: 4px 0 0 16px;
		min-width: 0;
	}
	.nav-menu .sub-menu li { border-bottom: 0; padding: 6px 0; }
	.two-col { grid-template-columns: 1fr; }
	.site-footer__inner { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
	.form-row { grid-template-columns: 1fr; }
	.feature { grid-template-columns: 1fr; }
	.feature__num { margin-bottom: 4px; }
}
