/*
Theme Name: Kethwal
Theme URI: https://kethwaltribe.blogspot.com/
Author: Raja Amanullah
Description: A clean, modern heritage theme for the Kethwal tribe of the Murree Hills, Pakistan. Light split hero with photo, history timeline, interactive settlements map, genealogy gallery with lightbox and a community contribution form.
Version: 1.1.0
Requires at least: 6.3
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: kethwal
Tags: blog, one-column, custom-menu, custom-logo, featured-images, translation-ready, rtl-language-support
*/

/* ---------- Tokens ---------- */
:root {
	--primary: #17633f;
	--primary-dark: #0f4a2e;
	--primary-soft: #e8f3ec;
	--primary-tint: #f3f9f5;
	--accent: #c98a1b;
	--accent-soft: #fdf3df;
	--accent-dark: #8a5a0f;

	--bg: #ffffff;
	--surface: #f7f9f7;
	--ink: #15211a;
	--body: #3c4a42;
	--muted: #64736b;
	--line: #e4ebe6;

	--ridge-1: #eef6f0;
	--ridge-2: #e3f0e7;
	--ridge-3: #d6e9dc;
	--ridge-4: var(--bg);

	--font-display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif;

	--radius-sm: 10px;
	--radius: 16px;
	--radius-lg: 24px;
	--shadow-sm: 0 1px 2px rgba(21, 33, 26, .05);
	--shadow: 0 1px 2px rgba(21, 33, 26, .04), 0 6px 20px rgba(21, 33, 26, .06);
	--shadow-lg: 0 2px 6px rgba(21, 33, 26, .04), 0 20px 50px rgba(21, 33, 26, .10);
	--header-h: 74px;
	--gutter: clamp(16px, 4vw, 32px);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
	margin: 0;
	background: var(--bg);
	color: var(--body);
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

body.nav-open,
body.lightbox-open { overflow: hidden; }

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-dark); }

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

h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--ink);
	margin: 0 0 .5em;
}

p { margin: 0 0 1.1em; }

[lang="ur"] { font-family: var(--font-urdu); line-height: 2.1; letter-spacing: 0; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto;
	top: 12px; left: 12px; z-index: 1000;
	padding: 10px 16px;
	background: var(--bg);
	color: var(--primary);
	border-radius: 8px;
	box-shadow: var(--shadow);
}

.container {
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: var(--gutter);
}

/* ---------- Buttons & small pieces ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5em;
	min-height: 46px;
	padding: .7em 1.35em;
	border: 1.5px solid transparent;
	border-radius: 12px;
	font: 600 .95rem/1 var(--font-body);
	text-decoration: none;
	cursor: pointer;
	transition: transform .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--lg { min-height: 52px; padding: .85em 1.6em; font-size: 1rem; }
.btn--primary,
.btn--pine { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(23, 99, 63, .22); }
.btn--primary:hover,
.btn--pine:hover { background: var(--primary-dark); color: #fff; }
.btn--outline { background: var(--bg); border-color: var(--line); color: var(--ink); }
.btn--outline:hover { border-color: var(--primary); color: var(--primary); }
.btn--saffron { background: var(--accent); color: #fff; }
.btn--saffron:hover { background: #b37810; color: #fff; }

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font: 600 .78rem/1.4 var(--font-body);
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--primary);
	margin-bottom: .9rem;
}

.link-arrow { font-weight: 600; text-decoration: none; color: var(--primary); }
.link-arrow::after { content: " →"; transition: margin .15s ease; }
.link-arrow:hover::after { margin-left: 4px; }

.tag {
	display: inline-block;
	padding: .25em .75em;
	border-radius: 999px;
	background: var(--primary-soft);
	color: var(--primary);
	font-size: .75rem;
	font-weight: 600;
	text-decoration: none;
}

/* ---------- Header ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(255, 255, 255, .9);
	backdrop-filter: saturate(1.6) blur(12px);
	-webkit-backdrop-filter: saturate(1.6) blur(12px);
	border-bottom: 1px solid var(--line);
	transition: box-shadow .25s ease;
}
.site-header.is-scrolled { box-shadow: 0 6px 24px rgba(21, 33, 26, .06); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: var(--header-h);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	color: var(--primary);
	text-decoration: none;
	--emblem-cut: var(--bg);
}
.brand .emblem { width: 42px; height: 42px; flex: none; }
.brand__logo {
	width: 46px; height: 46px;
	flex: none;
	padding: 2px;
	border-radius: 50%;
	background: #fff;
	object-fit: contain;
	box-shadow: 0 0 0 1px var(--line), 0 4px 12px rgba(21, 33, 26, .08);
}
.brand-text { display: flex; align-items: baseline; gap: 10px; line-height: 1; }
.brand-name { font: 800 1.2rem/1.1 var(--font-display); letter-spacing: -.02em; color: var(--ink); white-space: nowrap; }
.brand-urdu { font-size: 1.1rem; font-weight: 600; line-height: 1.6; color: var(--primary); }

.primary-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.primary-nav a {
	display: block;
	padding: .5em .85em;
	border-radius: 10px;
	color: var(--body);
	font-weight: 500;
	font-size: .94rem;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .15s ease, color .15s ease;
}
.primary-nav a:hover { background: var(--surface); color: var(--primary); }
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.primary-nav .sub-menu {
	list-style: none;
	position: absolute;
	min-width: 200px;
	margin: 6px 0 0;
	padding: 8px;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
	opacity: 0;
	visibility: hidden;
	transition: opacity .15s ease;
}
.primary-nav .menu-item-has-children { position: relative; }
.primary-nav .menu-item-has-children:hover > .sub-menu,
.primary-nav .menu-item-has-children:focus-within > .sub-menu { opacity: 1; visibility: visible; }

.nav-toggle {
	display: none;
	width: 46px; height: 46px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--bg);
	cursor: pointer;
	position: relative;
	z-index: 120;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
	position: absolute;
	left: 12px;
	width: 20px; height: 2px;
	background: var(--ink);
	border-radius: 2px;
	transition: transform .2s ease, opacity .2s ease;
	content: "";
}
.nav-toggle__bars { top: 21px; }
.nav-toggle__bars::before { left: 0; top: -6px; }
.nav-toggle__bars::after { left: 0; top: 6px; }
.nav-open .nav-toggle__bars { background: transparent; }
.nav-open .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1120px) {
	.nav-toggle { display: block; }
	.primary-nav {
		position: fixed;
		inset: 0;
		z-index: 110;
		display: flex;
		align-items: flex-start;
		justify-content: center;
		padding: calc(var(--header-h) + 32px) 24px 40px;
		background: var(--bg);
		opacity: 0;
		visibility: hidden;
		transition: opacity .2s ease, visibility .2s;
		overflow-y: auto;
	}
	.nav-open .primary-nav { opacity: 1; visibility: visible; }
	.primary-nav .menu { flex-direction: column; width: 100%; max-width: 420px; gap: 4px; }
	.primary-nav a { font: 600 1.15rem/1.3 var(--font-display); color: var(--ink); padding: .85em 1em; border-radius: 12px; border: 1px solid var(--line); }
	.primary-nav .sub-menu { position: static; opacity: 1; visibility: visible; border: 0; box-shadow: none; padding: 4px 0 0 12px; }
	.nav-open .brand { position: relative; z-index: 120; }
}

/* ---------- Ridges (decorative, pale) ---------- */
.ridges { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; pointer-events: none; }
.ridges--page { height: clamp(50px, 7vw, 96px); }

/* ---------- Hero ---------- */
.hero {
	position: relative;
	overflow: hidden;
	padding: clamp(40px, 6vw, 80px) 0 clamp(48px, 7vw, 96px);
	background:
		radial-gradient(ellipse 60% 70% at 100% 0%, var(--primary-tint), transparent 70%),
		radial-gradient(ellipse 40% 50% at 0% 100%, var(--accent-soft), transparent 70%),
		var(--bg);
}
.hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	align-items: center;
	gap: clamp(32px, 5vw, 72px);
}
.hero__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 22px;
	padding: 7px 14px 7px 10px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--bg);
	box-shadow: var(--shadow-sm);
	font: 600 .82rem/1.3 var(--font-body);
	color: var(--body);
}
.hero__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); flex: none; }

.hero__title {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: .35em;
	margin: 0 0 .3em;
	white-space: nowrap;
}
.hero__name {
	font-family: var(--font-display);
	font-size: clamp(2.6rem, 6.2vw, 5rem);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -.045em;
	color: var(--ink);
}
.hero__urdu {
	font-size: clamp(1.9rem, 4.2vw, 3.3rem);
	font-weight: 600;
	line-height: 1.5;
	color: var(--primary);
	transform: translateY(-.08em);
}
.hero__text { max-width: 540px; font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.7; color: var(--body); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__links { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.hero__links a { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; font-weight: 500; color: var(--muted); text-decoration: none; }
.hero__links a::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero__links a:hover { color: var(--primary); }

.hero__visual { position: relative; padding: 0 0 28px 28px; }
.hero__photo {
	margin: 0;
	aspect-ratio: 5 / 4;
	border-radius: 28px;
	overflow: hidden;
	box-shadow: var(--shadow-lg);
	background: var(--primary-soft);
}
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; transition: transform .8s ease; }
.hero__visual:hover .hero__photo img { transform: scale(1.03); }
.hero__visual::before {
	content: "";
	position: absolute;
	right: -18px;
	top: -18px;
	width: 140px;
	height: 140px;
	border-radius: 28px;
	background-image: radial-gradient(var(--primary) 1.5px, transparent 1.6px);
	background-size: 14px 14px;
	opacity: .18;
	z-index: -1;
}
.hero__badge {
	position: absolute;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: rgba(255, 255, 255, .96);
	box-shadow: var(--shadow-lg);
}
.hero__badge p { margin: 0; }
.hero__badge--year { top: 24px; left: 0; flex-direction: column; align-items: flex-start; gap: 2px; }
.hero__badge--year strong { font: 800 1.6rem/1 var(--font-display); color: var(--primary); letter-spacing: -.02em; }
.hero__badge--year span { font-size: .8rem; color: var(--muted); }
.hero__badge--place { right: 20px; bottom: 0; max-width: 320px; }
.hero__pin { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--primary-soft); color: var(--primary); }
.hero__place { font: 700 .95rem/1.3 var(--font-display); color: var(--ink); }
.hero__credit { font-size: .74rem; color: var(--muted); margin-top: 2px !important; }
.hero__credit a { color: inherit; }

@media (max-width: 960px) {
	.hero__grid { grid-template-columns: 1fr; }
	.hero__visual { padding: 0 0 24px; }
	.hero__badge--year { left: 16px; top: 16px; }
	.hero__badge--place { right: 16px; }
}
@media (max-width: 560px) {
	.hero__actions .btn { flex: 1 1 100%; }
	.hero__photo { border-radius: 20px; aspect-ratio: 4 / 3; }
	.hero__badge--year { display: none; }
	.hero__badge--place { left: 12px; right: 12px; max-width: none; padding: 10px 14px; }
}

/* ---------- Stats ---------- */
.stats { padding: 0 0 clamp(16px, 3vw, 32px); }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
	padding: 24px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}
.stat__value { display: block; font: 800 clamp(1.7rem, 3vw, 2.3rem)/1 var(--font-display); color: var(--primary); letter-spacing: -.03em; }
.stat__label { display: block; margin-top: 8px; font-size: .9rem; color: var(--muted); line-height: 1.4; }
@media (max-width: 760px) { .stats__grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } .stat { padding: 18px; } }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 8vw, 104px) 0; }
.section--tinted { background: var(--surface); }
.section-title { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.section-head { max-width: 720px; margin-bottom: 44px; }
.section-head--split { max-width: none; display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px 40px; }
.section-head--split > div { max-width: 680px; }
.section-head--split .section-title { margin-bottom: 0; }
.lead { font-size: 1.18rem; color: var(--ink); }

/* Intro */
.intro__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.intro__text p:not(.eyebrow):not(.lead) { color: var(--muted); }
.quote-card {
	position: relative;
	margin: 0;
	padding: clamp(32px, 4vw, 48px);
	background: linear-gradient(160deg, var(--primary-tint), var(--bg));
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	overflow: hidden;
}
.quote-card::before {
	content: "\201C";
	display: block;
	font: 800 5rem/0.6 var(--font-display);
	color: var(--accent);
	margin-bottom: 16px;
}
.quote-card blockquote { margin: 0; }
.quote-card blockquote p { font: 600 clamp(1.3rem, 2.4vw, 1.75rem)/1.35 var(--font-display); color: var(--ink); letter-spacing: -.015em; margin-bottom: 1em; }
.quote-card figcaption { color: var(--muted); font-size: .9rem; }
.quote-card__emblem { position: absolute; right: -24px; bottom: -24px; width: 160px; height: 160px; color: var(--primary); opacity: .07; --emblem-cut: transparent; }
@media (max-width: 860px) { .intro__grid { grid-template-columns: 1fr; } }

/* Timeline */
.timeline {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 20px;
	position: relative;
}
.timeline::before {
	content: "";
	position: absolute;
	left: 0; right: 0; top: 11px;
	height: 2px;
	background: var(--line);
}
.timeline__item { position: relative; padding-top: 40px; }
.timeline__item::before {
	content: "";
	position: absolute;
	left: 0; top: 3px;
	width: 18px; height: 18px;
	border-radius: 50%;
	background: var(--bg);
	border: 4px solid var(--primary);
	box-shadow: 0 0 0 4px var(--primary-soft);
}
.timeline__year { display: block; font: 800 1.35rem/1 var(--font-display); color: var(--primary); margin-bottom: 8px; letter-spacing: -.02em; }
.timeline__title { font: 600 1rem/1.3 var(--font-display); color: var(--ink); margin-bottom: 6px; letter-spacing: -.01em; }
.timeline__item p { font-size: .9rem; line-height: 1.55; color: var(--muted); margin: 0; }
@media (max-width: 1100px) {
	.timeline { grid-template-columns: 1fr; gap: 0; padding-left: 36px; }
	.timeline::before { left: 8px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
	.timeline__item { padding: 0 0 30px; }
	.timeline__item::before { left: -36px; top: 2px; }
	.timeline__item p { max-width: 560px; }
}

/* Tehsil cards */
.tehsil-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.tehsil-card {
	display: flex;
	flex-direction: column;
	padding: 24px;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	color: var(--body);
	text-decoration: none;
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tehsil-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; color: var(--body); }
.tehsil-card__count {
	display: inline-grid;
	place-items: center;
	width: 52px; height: 52px;
	border-radius: 14px;
	background: var(--primary-soft);
	font: 800 1.35rem/1 var(--font-display);
	color: var(--primary);
}
.tehsil-card__name { font: 700 1.1rem/1.3 var(--font-display); color: var(--ink); margin-top: 16px; }
.tehsil-card__urdu { font-size: .95rem; font-weight: 600; color: var(--accent-dark); }
.tehsil-card__places { font-size: .85rem; color: var(--muted); margin-top: 4px; line-height: 1.5; }

/* Book feature */
.book-feature { background: var(--surface); }
.book-feature__grid { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.book-feature__cover img,
.book-feature__placeholder {
	width: 100%;
	border-radius: 8px 16px 16px 8px;
	border: 1px solid var(--line);
	box-shadow: -8px 0 0 -3px var(--primary-soft), var(--shadow-lg);
	transform: rotate(-2deg);
	transition: transform .3s ease;
	background: #fff;
}
.book-feature__cover:hover img { transform: rotate(0); }
.book-feature__placeholder { aspect-ratio: 3/4; display: grid; place-items: center; color: var(--primary); }
.book-feature__placeholder .emblem { width: 40%; }
.book-feature__urdu { font-size: 1.3rem; color: var(--primary); }
.book-feature__text p:not(.eyebrow):not(.book-feature__urdu) { color: var(--muted); }
@media (max-width: 760px) { .book-feature__grid { grid-template-columns: 1fr; } .book-feature__cover { max-width: 280px; } }

/* Clans */
.clans__grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.clans__grid p:not(.eyebrow) { color: var(--muted); }
.clan-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.clan {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding: 28px 16px;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	font: 700 1.15rem/1.2 var(--font-display);
	color: var(--ink);
	text-align: center;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.clan:hover { border-color: var(--primary-soft); box-shadow: var(--shadow); }
.clan__emblem { width: 48px; height: 48px; color: var(--primary); --emblem-cut: var(--bg); }
@media (max-width: 860px) { .clans__grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .clan-list { grid-template-columns: 1fr; } .clan { flex-direction: row; padding: 16px 18px; } .clan__emblem { width: 38px; height: 38px; } }

/* Organisations */
.org-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.org-card {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: clamp(24px, 3vw, 32px);
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	overflow: hidden;
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.org-card::after {
	content: "";
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--primary), var(--accent));
}
.org-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.org-card__icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); margin-bottom: 18px; }
.org-card__name { font-size: 1.3rem; margin-bottom: 8px; }
.org-card__text { color: var(--muted); flex: 1; }
.org-card__link { margin-top: 4px; }

/* Cards */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.card {
	display: flex;
	flex-direction: column;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card__media { display: block; aspect-ratio: 38/25; overflow: hidden; background: var(--primary-soft); }
.card__media img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .4s ease; }
.card:hover .card__media img { transform: scale(1.04); }
.card__placeholder { position: relative; height: 100%; background: linear-gradient(180deg, var(--primary-tint), var(--primary-soft)); }
.card__placeholder .ridges { height: 55%; --ridge-1: #dcece1; --ridge-2: #cfe5d6; --ridge-3: #bfdcc8; --ridge-4: #b2d4bc; }
.card__emblem { position: absolute; top: 20%; left: 50%; width: 52px; height: 52px; transform: translateX(-50%); color: var(--primary); --emblem-cut: var(--primary-tint); }
.card__body { display: flex; flex-direction: column; padding: 20px 22px 24px; flex: 1; }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.meta { font-size: .82rem; color: var(--muted); }
.card__title { font-size: 1.2rem; line-height: 1.3; margin-bottom: 8px; letter-spacing: -.015em; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--primary); }
.card__excerpt { font-size: .95rem; color: var(--muted); margin: 0; line-height: 1.6; }

/* CTA */
.cta { padding: clamp(24px, 4vw, 48px) 0 clamp(64px, 8vw, 104px); }
.cta__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 24px 48px;
	padding: clamp(32px, 5vw, 56px);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background:
		radial-gradient(ellipse 50% 90% at 100% 0%, var(--accent-soft), transparent 70%),
		linear-gradient(135deg, var(--primary-tint), var(--primary-soft));
}
.cta__inner > div { max-width: 640px; }
.cta__title { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.cta__inner p { margin: 0; color: var(--body); }

/* ---------- Page hero ---------- */
.page-hero {
	position: relative;
	overflow: hidden;
	padding: clamp(48px, 7vw, 88px) 0 clamp(80px, 10vw, 128px);
	background:
		radial-gradient(ellipse 50% 80% at 100% 0%, var(--accent-soft), transparent 70%),
		var(--primary-tint);
	text-align: center;
}
.page-hero__inner { position: relative; z-index: 2; max-width: 860px; margin-inline: auto; }
.page-hero__title { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.035em; font-weight: 800; margin: 0; }
.page-hero__subtitle { margin: 16px auto 0; font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.page-hero__subtitle p { margin: 0; }
.page-hero .eyebrow { padding: 6px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); letter-spacing: .08em; }
.page-hero .card__meta { justify-content: center; margin-bottom: 18px; }

/* ---------- Entry content ---------- */
.entry { max-width: 900px; }
.entry-content { max-width: 740px; margin-inline: auto; }
.entry-content--intro { margin-bottom: 48px; }
.entry-content > * + * { margin-top: 0; }
.entry-content h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); margin-top: 1.8em; }
.entry-content h3 { font-size: 1.3rem; margin-top: 1.6em; }
.entry-content > h2:first-child,
.entry-content > h3:first-child { margin-top: 0; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.entry-content li { margin-bottom: .35em; }
.entry-content li::marker { color: var(--primary); }
.entry-content blockquote,
.entry-content .wp-block-quote {
	margin: 2em 0;
	padding: 24px 28px;
	border: 0;
	border-left: 4px solid var(--primary);
	border-radius: 0 var(--radius) var(--radius) 0;
	background: var(--primary-tint);
	font: 600 1.25rem/1.5 var(--font-display);
	color: var(--ink);
	letter-spacing: -.01em;
}
.entry-content blockquote p:last-of-type { margin-bottom: 0; }
.entry-content .wp-block-quote cite,
.entry-content blockquote cite { display: block; margin-top: 10px; font: 500 .85rem/1.4 var(--font-body); color: var(--muted); font-style: normal; }
.entry-content img { border-radius: var(--radius-sm); }
.entry-content figure { margin: 2em 0; }
.entry-content figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 8px; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 1.5em 0; }
.entry-content .wp-block-table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.entry-content .wp-block-table table { margin: 0; }
.entry-content th, .entry-content td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.entry-content tr:last-child td { border-bottom: 0; }
.entry-content th { font-weight: 600; color: var(--ink); background: var(--surface); }
.entry-content .alignwide { max-width: 1100px; margin-inline: calc(50% - min(550px, 50vw - var(--gutter))); }
.entry-content .alignfull { margin-inline: calc(50% - 50vw); max-width: 100vw; }
.entry-content .wp-block-separator { border: 0; height: 1px; background: var(--line); margin: 3em auto; }
.entry-content .wp-block-button__link { border-radius: 12px; background: var(--primary); padding: .85em 1.5em; font-weight: 600; font-size: .95rem; }
.entry-content .wp-block-button.is-style-outline .wp-block-button__link { background: var(--bg); color: var(--ink); border: 1.5px solid var(--line); }
.entry-content .has-background { padding: 28px 32px; border-radius: var(--radius); }
.entry-content .callout {
	padding: 22px 26px;
	background: var(--accent-soft);
	border: 1px solid #f3e2bd;
	border-radius: var(--radius);
	margin: 2em 0;
}
.entry-content .callout > :last-child { margin-bottom: 0; }
.entry-content .wp-block-columns { gap: 28px; }
.entry-content .fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 2em 0; }
.entry-content .fact { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.entry-content .fact strong { display: block; font: 800 1.6rem/1.1 var(--font-display); color: var(--primary); letter-spacing: -.02em; }
.entry-content .fact span { font-size: .88rem; color: var(--muted); }
.entry-content .urdu { font-family: var(--font-urdu); direction: rtl; text-align: right; font-size: 1.25rem; line-height: 2.2; color: var(--primary); }

.entry-content .wp-block-gallery { gap: 14px; }
.entry-content .wp-block-gallery figure.wp-block-image img { border-radius: var(--radius-sm); border: 1px solid var(--line); transition: transform .2s ease, box-shadow .2s ease; }
.entry-content .wp-block-gallery figure.wp-block-image a:hover img { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.entry-content .wp-block-gallery a { cursor: zoom-in; }

.entry-featured { margin: 0 auto 40px; max-width: 740px; }
.entry-featured img { border-radius: var(--radius); border: 1px solid var(--line); }

.entry-footer { max-width: 740px; margin: 56px auto 0; padding-top: 32px; border-top: 1px solid var(--line); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tags a { padding: .3em .8em; border: 1px solid var(--line); border-radius: 999px; font-size: .82rem; color: var(--muted); text-decoration: none; }
.tags a:hover { border-color: var(--primary); color: var(--primary); }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-navigation a { display: block; padding: 18px 20px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; height: 100%; transition: border-color .15s ease; }
.post-navigation a:hover { border-color: var(--primary); }
.post-navigation .nav-next { text-align: right; grid-column: 2; }
.nav-label { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.nav-title { font: 700 1rem/1.35 var(--font-display); color: var(--ink); }
@media (max-width: 600px) { .post-navigation .nav-links { grid-template-columns: 1fr; } .post-navigation .nav-next { grid-column: 1; } }

/* Pagination */
.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pagination .page-numbers { min-width: 44px; height: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; }
.pagination .page-numbers.current { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Settlements ---------- */
.settlements { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.settlements__map-wrap { position: sticky; top: calc(var(--header-h) + 20px); }
.settlements__map { height: min(70vh, 600px); border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--primary-tint); z-index: 1; }
.settlements__note { margin-top: 10px; font-size: .82rem; color: var(--muted); }
.settlements__search input {
	width: 100%;
	min-height: 54px;
	padding: 0 20px 0 48px;
	border: 1.5px solid var(--line);
	border-radius: 14px;
	background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364736b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 18px center / 20px no-repeat;
	font: inherit;
	color: var(--ink);
}
.settlements__search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.settlements__empty { margin-top: 18px; color: var(--muted); }
.settlement-group { margin-top: 18px; padding: 22px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.settlement-group[hidden] { display: none; }
.settlement-group__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.settlement-group__head h2 { font-size: 1.2rem; margin: 0; }
.settlement-group__urdu { font-size: 1rem; font-weight: 600; color: var(--accent-dark); }
.settlement-group__locate {
	margin-left: auto;
	padding: .45em .9em;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--bg);
	color: var(--primary);
	font: 600 .8rem/1.2 var(--font-body);
	cursor: pointer;
}
.settlement-group__locate:hover { border-color: var(--primary); background: var(--primary-tint); }
.settlement-group__note { font-size: .92rem; color: var(--muted); margin: 6px 0 14px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: .35em .85em; border-radius: 999px; background: var(--primary-tint); border: 1px solid var(--primary-soft); color: var(--primary-dark); font-size: .88rem; font-weight: 500; }
.chip[hidden] { display: none; }
.chip.is-match { background: var(--accent-soft); border-color: #f3e2bd; color: #85590a; }
.chips--muted .chip { background: var(--bg); border-color: var(--line); color: var(--muted); }
.leaflet-container { font-family: var(--font-body); }
.leaflet-popup-content { font-size: .9rem; line-height: 1.5; }
.leaflet-popup-content strong { font-family: var(--font-display); color: var(--ink); font-size: 1.02rem; }
.leaflet-popup-content p { margin: 6px 0 0 !important; }
@media (max-width: 900px) {
	.settlements { grid-template-columns: 1fr; }
	.settlements__map-wrap { position: static; }
	.settlements__map { height: 380px; }
}

/* ---------- Forms ---------- */
.contribute { max-width: 860px; }
.form { margin: 40px auto 0; max-width: 740px; padding: clamp(24px, 4vw, 40px); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form__field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; font-weight: 500; font-size: .92rem; color: var(--ink); }
.form__field input,
.form__field select,
.form__field textarea,
.comment-form input:not([type="submit"]):not([type="checkbox"]),
.comment-form textarea,
.search-form__input {
	width: 100%;
	min-height: 50px;
	padding: 12px 16px;
	border: 1.5px solid var(--line);
	border-radius: 12px;
	background: var(--bg);
	font: inherit;
	font-weight: 400;
	color: var(--ink);
}
.form__field textarea, .comment-form textarea { min-height: 150px; resize: vertical; }
.form__field :focus, .comment-form :focus, .search-form__input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.form__hp { position: absolute; left: -9999px; }
.notice { padding: 14px 18px; border-radius: 12px; margin-bottom: 22px; font-weight: 500; }
.notice--success { background: var(--primary-soft); color: var(--primary-dark); }
.notice--error { background: #fdecea; color: #8a2a17; }
@media (max-width: 600px) { .form__row { grid-template-columns: 1fr; gap: 0; } }

.search-form { display: flex; gap: 10px; max-width: 520px; margin: 0 auto 24px; }
.empty-state { text-align: center; }

/* Comments */
.comments { max-width: 740px; margin: 0 auto clamp(64px, 9vw, 112px); }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { padding: 20px 0; border-bottom: 1px solid var(--line); }
.comment-list .avatar { border-radius: 50%; float: left; margin-right: 14px; }

/* ---------- Lightbox ---------- */
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 56px 72px;
	background: rgba(15, 25, 20, .9);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}
.lightbox[hidden] { display: none; }
.lightbox__figure { margin: 0; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox__figure img { max-height: calc(100vh - 140px); width: auto; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); background: #fff; }
.lightbox__figure figcaption { margin-top: 14px; color: rgba(255, 255, 255, .75); font-size: .9rem; }
.lightbox button {
	position: absolute;
	width: 50px; height: 50px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--ink);
	font-size: 1.8rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: var(--shadow-lg);
	transition: transform .15s ease;
}
.lightbox button:hover { transform: scale(1.06); }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox__prev:hover, .lightbox__next:hover { transform: translateY(-50%) scale(1.06); }
@media (max-width: 600px) {
	.lightbox { padding: 64px 12px 88px; }
	.lightbox__prev, .lightbox__next { top: auto; bottom: 18px; transform: none; }
	.lightbox__prev:hover, .lightbox__next:hover { transform: scale(1.06); }
	.lightbox__prev { left: calc(50% - 62px); }
	.lightbox__next { right: calc(50% - 62px); }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); color: var(--muted); padding-top: clamp(56px, 7vw, 80px); font-size: .95rem; }
.site-footer a { color: var(--body); text-decoration: none; }
.site-footer a:hover { color: var(--primary); }
.site-footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding-bottom: 48px; }
.site-footer .brand { margin-bottom: 18px; --emblem-cut: var(--surface); }
.site-footer__about p { max-width: 420px; }
.footer-title { font: 700 .8rem/1.4 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); margin-bottom: 16px; }
.site-footer .menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer .current-menu-item > a { color: var(--primary); }
.footer-widget { margin-top: 28px; }
.footer-widget h2, .footer-widget h3, .footer-widget .wp-block-heading { font: 700 .8rem/1.4 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); margin-bottom: 14px; }
.footer-widget ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; padding-bottom: 32px; border-top: 1px solid var(--line); font-size: .85rem; }
.site-footer__bottom { align-items: center; }
.site-footer__bottom p { margin: 0; }
.site-credit a { color: var(--primary); font-weight: 600; }
.site-credit a:hover { text-decoration: underline; }
@media (max-width: 760px) { .site-footer__bottom { flex-direction: column; align-items: flex-start; } }
@media (max-width: 760px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__about { grid-column: 1 / -1; } }

/* ---------- Block alignment helpers (WordPress core) ---------- */
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { margin-inline: auto; }
.wp-caption-text { font-size: .85rem; color: var(--muted); }
.sticky { position: relative; }
.bypostauthor { position: relative; }
.gallery-caption { font-size: .85rem; }

/* ---------- Motion ---------- */
:root {
	--ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* Hero entrance on page load. */
@keyframes kw-fade-up {
	from { opacity: 0; transform: translate3d(0, 26px, 0); }
	to { opacity: 1; transform: none; }
}
@keyframes kw-photo-in {
	from { opacity: 0; transform: scale(.94) translate3d(0, 20px, 0); clip-path: inset(8% 8% 8% 8% round 28px); }
	to { opacity: 1; transform: none; clip-path: inset(0 0 0 0 round 28px); }
}
@keyframes kw-pop {
	from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.92); }
	to { opacity: 1; transform: none; }
}
@keyframes kw-float {
	0%, 100% { transform: translate3d(0, 0, 0); }
	50% { transform: translate3d(0, -8px, 0); }
}
@keyframes kw-pulse {
	0% { box-shadow: 0 0 0 0 rgba(23, 99, 63, .35); }
	70% { box-shadow: 0 0 0 10px rgba(23, 99, 63, 0); }
	100% { box-shadow: 0 0 0 0 rgba(23, 99, 63, 0); }
}

.hero__eyebrow,
.hero__title,
.hero__text,
.hero__actions,
.hero__links { animation: kw-fade-up .8s var(--ease-out) both; }
.hero__title { animation-delay: .08s; }
.hero__text { animation-delay: .18s; }
.hero__actions { animation-delay: .28s; }
.hero__links { animation-delay: .38s; }
.hero__photo { animation: kw-photo-in 1.1s var(--ease-out) .15s both; }
.hero__badge--year { animation: kw-pop .7s var(--ease-out) .7s both, kw-float 6s ease-in-out 1.6s infinite; }
.hero__badge--place { animation: kw-pop .7s var(--ease-out) .9s both; }
.hero__dot { animation: kw-pulse 2.4s ease-out 1.2s infinite; }

/* Scroll reveal: content starts hidden only once the head script has set .js-reveal. */
.js-reveal :is(.section-head, .intro__text, .quote-card, .stat, .timeline__item, .tehsil-card, .book-feature__cover, .book-feature__text, .clans__grid > div, .clan, .org-card, .card, .cta__inner, .entry-content > h2, .entry-content > h3, .entry-content > blockquote, .entry-content > .wp-block-quote, .entry-content > .callout, .entry-content > .wp-block-buttons, .entry-content > .wp-block-table, .entry-content > .wp-block-gallery figure, .fact, .settlements__map-wrap, .settlement-group, .form, .entry-featured, .post-navigation a):not(.is-visible) {
	opacity: 0;
	transform: translate3d(0, 32px, 0);
}
.js-reveal :is(.quote-card, .book-feature__text):not(.is-visible) { transform: translate3d(40px, 0, 0); }
.js-reveal .book-feature__cover:not(.is-visible) { transform: translate3d(-40px, 0, 0) rotate(-4deg); }
.js-reveal :is(.clan, .stat, .entry-content > .wp-block-gallery figure, .fact):not(.is-visible) { transform: translate3d(0, 24px, 0) scale(.94); }
.js-reveal .is-revealing {
	transition: opacity .8s var(--ease-out), transform .9s var(--ease-out) !important;
	transition-delay: var(--reveal-delay, 0ms) !important;
}

/* Timeline line draws across as it scrolls into view. */
.js-reveal .timeline::before { transform: scaleX(0); transform-origin: left center; transition: transform 1.6s var(--ease-out) .1s; }
.js-reveal .timeline.is-visible::before { transform: scaleX(1); }
@media (max-width: 1100px) {
	.js-reveal .timeline::before { transform: scaleY(0); transform-origin: center top; }
	.js-reveal .timeline.is-visible::before { transform: scaleY(1); }
}
.js-reveal .timeline__item::before { transform: scale(0); transition: transform .5s var(--ease-out); transition-delay: calc(var(--reveal-delay, 0ms) + .25s); }
.js-reveal .timeline__item.is-visible::before { transform: scale(1); }

/* Section titles get a short accent bar that grows in. */
.section-head .section-title::after {
	content: "";
	display: block;
	width: 56px;
	height: 4px;
	margin-top: 16px;
	border-radius: 4px;
	background: linear-gradient(90deg, var(--primary), var(--accent));
	transform-origin: left center;
	transition: transform .9s var(--ease-out) .35s;
}
.section-head--split .section-title::after { display: none; }
.js-reveal .section-head:not(.is-visible) .section-title::after { transform: scaleX(0); }

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