/*
Theme Name: Brethren Movement
Description: Bilingual (English and Telugu) commemorative theme for 200 years of Brethren history.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: brethren
*/

:root {
	--paper: #fbf7ee;
	--paper-deep: #f3ecdc;
	--ink: #241a16;
	--ink-soft: #5c4e46;
	--wine: #680721;
	--wine-deep: #3f0414;
	--gold: #c29b45;
	--gold-text: #80611a;
	--straw: #efeeac;
	--rule: #dccfb6;
	--display: "Fraunces", "Noto Serif Telugu", Georgia, serif;
	--body: "Source Serif 4", "Noto Serif Telugu", Georgia, serif;
	--ui: "Source Sans 3", "Noto Sans Telugu", system-ui, sans-serif;
	--leading: 1.7;
	--gutter: clamp(16px, 4vw, 40px);
}

.lang-te {
	--leading: 1.95;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--body);
	font-size: 1.125rem;
	line-height: var(--leading);
	overflow-wrap: break-word;
}

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

a { color: var(--wine); text-underline-offset: .18em; }

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

h1, h2, h3 {
	font-family: var(--display);
	font-weight: 600;
	line-height: 1.15;
	margin: 0;
	text-wrap: balance;
}

.lang-te h1, .lang-te h2, .lang-te h3 { font-weight: 700; line-height: 1.4; }

h1 { font-size: clamp(2.3rem, 5.4vw, 4.1rem); }
.lang-te h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }

.wrap {
	width: min(1180px, 100%);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.section { padding-block: clamp(56px, 8vw, 104px); }
.section--tight { padding-block: clamp(32px, 5vw, 56px) clamp(56px, 8vw, 96px); }

.section-head { text-align: center; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
.section-action { text-align: center; margin: clamp(32px, 5vw, 48px) 0 0; }

.eyebrow {
	font-family: var(--ui);
	font-size: .85rem;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--gold-text);
	margin: 0 0 12px;
}
.eyebrow--light { color: var(--straw); }
.lang-te .eyebrow { letter-spacing: 0; text-transform: none; font-size: .95rem; }

.button {
	display: inline-block;
	padding: .7em 1.5em;
	font-family: var(--ui);
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--paper);
	background: var(--wine);
	border-radius: 2px;
	transition: background-color .2s;
}
.button:hover { background: var(--wine-deep); }
.button--gold { background: var(--gold); color: var(--wine-deep); }
.button--gold:hover { background: var(--straw); }

.skip-link {
	position: absolute;
	left: 8px;
	top: -60px;
	z-index: 20;
	padding: 8px 16px;
	background: var(--ink);
	color: var(--paper);
}
.skip-link:focus { top: 8px; }

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Header */

.site-header {
	position: sticky;
	top: 0;
	z-index: 10;
	background: var(--paper);
	border-bottom: 1px solid var(--rule);
}
.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 72px;
}
.brand {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: var(--wine);
}
.brand img { width: 52px; height: 52px; }
.brand__name { font-family: var(--display); font-weight: 600; font-size: 1.25rem; line-height: 1.2; }

.site-nav { display: flex; align-items: center; gap: 28px; font-family: var(--ui); font-size: 1rem; }
.nav-list { display: flex; gap: 24px; margin: 0; padding: 0; list-style: none; }
.nav-list a { color: var(--ink); text-decoration: none; padding-block: 6px; border-bottom: 2px solid transparent; }
.nav-list a:hover, .nav-list .current-menu-item > a { color: var(--wine); border-bottom-color: var(--gold); }

.lang-switch {
	padding: 4px 14px;
	border: 1px solid var(--wine);
	border-radius: 2px;
	color: var(--wine);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.lang-switch[lang="te"] { font-family: "Noto Sans Telugu", var(--ui); }
.lang-switch:hover { background: var(--wine); color: var(--paper); }

.nav-toggle {
	display: none;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 12px;
	font: 600 1rem var(--ui);
	color: var(--wine);
	background: none;
	border: 1px solid var(--rule);
	border-radius: 2px;
}
.nav-toggle__bars, .nav-toggle__bars::before {
	display: block;
	width: 18px;
	height: 2px;
	background: currentColor;
	box-shadow: 0 5px 0 currentColor;
}
.nav-toggle__bars { transform: translateY(-3px); }
.nav-toggle__bars::before { content: ""; transform: translateY(10px); box-shadow: none; }

@media (max-width: 760px) {
	.nav-toggle { display: inline-flex; }
	.brand { gap: 10px; }
	.brand img { width: 44px; height: 44px; }
	.brand__name { font-size: 1.1rem; }
	.site-header__inner { flex-wrap: wrap; min-height: 64px; padding-block: 6px; }
	.site-nav {
		display: none;
		flex-basis: 100%;
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
		padding-block: 8px 16px;
	}
	.site-nav.is-open { display: flex; }
	.site-nav .nav-list { flex-direction: column; gap: 4px; width: 100%; }
	.site-nav .nav-list a { display: block; padding-block: 10px; }
}

@media (max-width: 400px) {
	.nav-toggle__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

/* Hero */

.hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background: var(--wine-deep);
	color: #fff;
}
.hero__image {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 25% 100%;
	transform: scaleX(-1);
}
.hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(90deg, rgba(63, 4, 20, .94) 0%, rgba(63, 4, 20, .82) 42%, rgba(63, 4, 20, .1) 78%);
}
.hero__content {
	padding-block: clamp(72px, 11vw, 148px) clamp(96px, 13vw, 176px);
}
.hero h1 { max-width: 15em; }
.hero__lede { max-width: 34em; margin: 24px 0 32px; font-size: 1.2rem; color: #f6ecd8; }

@media (max-width: 760px) {
	.hero::after { background: linear-gradient(180deg, rgba(63, 4, 20, .94) 0%, rgba(63, 4, 20, .86) 62%, rgba(63, 4, 20, .15) 100%); }
	.hero__content { padding-bottom: 220px; }
	.hero__image { object-position: 40% 100%; }
}

/* Eras */

.eras { background: var(--wine); color: var(--paper); }
.eras__list {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 32px;
	margin-block: 0;
	padding-block: 36px 40px;
	list-style: none;
}
.era { position: relative; padding-left: 26px; }
.era__dot {
	position: absolute;
	left: 0;
	top: .5em;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--gold);
	box-shadow: 0 0 0 4px rgba(194, 155, 69, .25);
}
.era h2 { font-size: 1.3rem; line-height: 1.3; }
.era p { margin: 4px 0 0; font-family: var(--ui); color: var(--straw); }

@media (max-width: 760px) {
	.eras__list { grid-template-columns: 1fr; gap: 20px; }
}

/* Welcome */

.welcome__grid {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: clamp(32px, 6vw, 80px);
	align-items: start;
}
.welcome__intro h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); margin-bottom: 32px; }
.print-frame {
	margin: 0;
	padding: 10px;
	width: fit-content;
	max-width: 100%;
	background: #fff;
	border: 1px solid var(--rule);
	box-shadow: 0 10px 24px rgba(36, 26, 22, .12);
	transform: rotate(-1.2deg);
}
.essay { border-top: 1px solid var(--rule); }
.essay:last-child { border-bottom: 1px solid var(--rule); }
.essay summary {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding-block: 20px;
	font-family: var(--display);
	font-size: 1.35rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--wine);
	cursor: pointer;
	list-style: none;
}
.essay summary::-webkit-details-marker { display: none; }
.essay summary::after { content: "+"; font-family: var(--ui); color: var(--gold-text); }
.essay[open] summary::after { content: "–"; }
.essay__body { padding-bottom: 12px; }
.essay__body p { margin: 0 0 16px; }

@media (max-width: 860px) {
	.welcome__grid { grid-template-columns: 1fr; }
}

/* Stats */

.stats { background: var(--paper-deep); border-block: 1px solid var(--rule); }
.stats__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
	margin-block: 0;
	padding-block: clamp(36px, 5vw, 56px);
	text-align: center;
}
.stat { display: flex; flex-direction: column; }
.stat dd {
	margin: 0;
	font-family: "Fraunces", Georgia, serif;
	font-size: clamp(1.8rem, 3.4vw, 2.8rem);
	font-weight: 600;
	line-height: 1.15;
	color: var(--wine);
	font-variant-numeric: lining-nums;
}
.stat dt { margin-top: 6px; font-family: var(--ui); color: var(--ink-soft); }

@media (max-width: 760px) {
	.stats__grid { grid-template-columns: repeat(2, 1fr); }
}

/* Leaders */

.arch {
	display: block;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border-radius: 999px 999px 4px 4px;
	background: var(--paper-deep);
	box-shadow: 0 0 0 1px var(--gold), 0 0 0 5px var(--paper), 0 0 0 6px var(--rule);
}
.arch img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 15%;
	transition: transform .4s ease;
}

.leader-card { display: block; text-decoration: none; color: inherit; text-align: center; }
.leader-card:hover .arch img { transform: scale(1.04); }
.leader-card:hover .leader-card__name { color: var(--wine); }
.leader-card__name {
	display: block;
	margin-top: 18px;
	font-family: var(--display);
	font-weight: 600;
	font-size: 1.15rem;
	line-height: 1.3;
}
.leader-card__years { display: block; margin-top: 2px; font-family: var(--ui); font-size: .95rem; color: var(--gold-text); }
.leader-card__tag { display: block; margin-top: 8px; font-size: 1.02rem; font-style: italic; line-height: 1.5; color: var(--ink-soft); }
.lang-te .leader-card__tag { font-style: normal; line-height: 1.75; }

.feature-leaders {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: clamp(24px, 4vw, 48px);
	margin: 0;
	padding: 0;
	list-style: none;
}
.feature-leaders .leader-card__name { font-size: 1.4rem; }

@media (max-width: 700px) {
	.feature-leaders { grid-template-columns: 1fr; max-width: 340px; margin-inline: auto; }
}

/* Marks */

.marks { background: var(--wine-deep); color: var(--paper); }
.marks .eyebrow { color: var(--straw); }
.marks__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: mark;
	background: rgba(239, 238, 172, .22);
	border: 1px solid rgba(239, 238, 172, .22);
}
.mark { padding: clamp(24px, 3vw, 36px); background: var(--wine-deep); counter-increment: mark; }
.mark::before {
	content: counter(mark, upper-roman);
	display: block;
	margin-bottom: 12px;
	font-family: "Fraunces", Georgia, serif;
	color: var(--gold);
}
.mark h3 { font-size: 1.35rem; margin-bottom: 10px; color: #fff; }
.mark p { margin: 0; color: #eadfcb; font-size: 1.05rem; }

@media (max-width: 860px) {
	.marks__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
	.marks__grid { grid-template-columns: 1fr; }
}

/* Page head */

.page-head {
	padding-block: clamp(48px, 7vw, 88px) clamp(32px, 5vw, 56px);
	background: var(--paper-deep);
	border-bottom: 1px solid var(--rule);
}
.page-head h1 { color: var(--wine); }
.page-head__lede { max-width: 38em; margin: 16px 0 0; font-size: 1.2rem; color: var(--ink-soft); }

/* Leader directory */

.leader-tools { display: grid; gap: 16px; margin-bottom: clamp(32px, 5vw, 48px); }
.search input {
	width: 100%;
	max-width: 440px;
	min-height: 48px;
	padding: 0 14px;
	font: 1.05rem var(--ui);
	color: var(--ink);
	background: #fff;
	border: 1px solid var(--rule);
	border-radius: 2px;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
	min-height: 44px;
	padding: 4px 14px;
	font: 1rem var(--ui);
	color: var(--ink);
	background: transparent;
	border: 1px solid var(--rule);
	border-radius: 2px;
	cursor: pointer;
}
.filter:hover { border-color: var(--wine); }
.filter[aria-pressed="true"] { background: var(--wine); border-color: var(--wine); color: var(--paper); }
.filter__count { opacity: .7; font-size: .9em; margin-left: 2px; }
.leader-count { margin: 0; font-family: var(--ui); font-size: .95rem; color: var(--ink-soft); }
.leader-empty { font-size: 1.15rem; text-align: center; }
.leader-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: clamp(28px, 4vw, 44px) clamp(20px, 3vw, 36px);
	margin: 0;
	padding: 0;
	list-style: none;
}
.leader-grid > li[hidden] { display: none; }

@media (max-width: 480px) {
	.leader-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Biography */

.bio-head { padding-block: clamp(32px, 5vw, 64px); background: var(--paper-deep); border-bottom: 1px solid var(--rule); }
.bio-head__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(200px, 300px);
	gap: clamp(28px, 6vw, 72px);
	align-items: center;
}
.crumb { margin: 0 0 24px; font-family: var(--ui); }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.bio-head h1 { color: var(--wine); }
.bio-head__en { margin: 6px 0 0; font-size: 1.15rem; color: var(--ink-soft); }
.bio-head__years { margin: 10px 0 0; font-family: var(--ui); font-size: 1.15rem; font-weight: 600; color: var(--gold-text); }
.bio-head__tag { max-width: 30em; margin: 14px 0 0; font-size: 1.3rem; font-style: italic; line-height: 1.5; color: var(--ink-soft); }
.lang-te .bio-head__tag { font-style: normal; line-height: 1.75; }

.bio-body {
	display: grid;
	grid-template-columns: minmax(0, 260px) minmax(0, 720px);
	gap: clamp(32px, 6vw, 72px);
	justify-content: center;
	padding-block: clamp(40px, 6vw, 72px);
}
.toc {
	position: sticky;
	top: 96px;
	align-self: start;
	max-height: calc(100vh - 120px);
	overflow-y: auto;
	font-family: var(--ui);
	font-size: .98rem;
	line-height: 1.45;
}
.toc h2 { margin-bottom: 12px; font-family: var(--ui); font-size: .95rem; font-weight: 600; color: var(--gold-text); }
.toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--rule); }
.toc li a { display: block; padding: 7px 0 7px 14px; color: var(--ink-soft); text-decoration: none; }
.toc li a:hover { color: var(--wine); }

.prose { min-width: 0; }
.prose h2 { margin: 2em 0 .6em; padding-top: .9em; border-top: 1px solid var(--rule); font-size: 1.7rem; color: var(--wine); scroll-margin-top: 90px; }
.prose > div > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { margin: 1.6em 0 .4em; font-size: 1.25rem; }
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--gold-text); }
.prose li p { margin: 0; }
.prose blockquote { margin: 1.5em 0; padding-left: 1.2em; border-left: 3px solid var(--gold); font-style: italic; color: var(--ink-soft); }
.lang-te .prose blockquote { font-style: normal; }

.translation-notice {
	padding: 12px 16px;
	font-family: var(--ui);
	font-size: 1rem;
	background: var(--straw);
	border-left: 3px solid var(--gold);
}

.bio-pager {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	padding-bottom: clamp(48px, 7vw, 80px);
}
.bio-pager a {
	padding: 16px 20px;
	font-family: var(--display);
	font-weight: 600;
	font-size: 1.1rem;
	text-decoration: none;
	line-height: 1.35;
	border: 1px solid var(--rule);
	border-radius: 2px;
}
.bio-pager a:hover { border-color: var(--wine); }
.bio-pager small { display: block; font-family: var(--ui); font-weight: 400; font-size: .9rem; color: var(--ink-soft); }
.bio-pager__next { grid-column: 2; text-align: right; }

@media (max-width: 860px) {
	.bio-head__grid { grid-template-columns: 1fr; }
	.bio-head .arch { order: -1; width: min(240px, 60vw); }
	.bio-body { grid-template-columns: minmax(0, 1fr); }
	.toc { position: static; max-height: none; padding: 16px; background: var(--paper-deep); }
}

/* Generic pages */

.page-content { min-width: 0; }
.post-list { padding-left: 1.2em; }

/* Footer */

.site-footer { background: var(--ink); color: #e9e0d0; font-family: var(--ui); font-size: 1rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer__grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 40px;
	padding-block: clamp(40px, 6vw, 64px);
}
.site-footer__brand { display: flex; align-items: center; gap: 20px; }
.site-footer__brand img { flex: none; width: 110px; height: 110px; }
.site-footer__brand p { margin: 0; font-family: var(--display); font-size: 1.15rem; line-height: 1.45; }
.footer-title { margin-bottom: 12px; font-family: var(--ui); font-size: .95rem; font-weight: 600; color: var(--gold); }
.site-footer .nav-list { display: block; }
.site-footer .nav-list li { margin-bottom: 6px; }
.site-footer .nav-list a { color: #fff; border: 0; padding: 0; }
.site-footer p { margin: 0 0 8px; }
.social { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; }
.visitor-count { margin-top: 24px; }
.site-footer__legal { padding-block: 18px; font-size: .9rem; border-top: 1px solid rgba(255, 255, 255, .14); color: #bdb1a0; }
.site-footer__legal p { margin: 0; }

@media (max-width: 760px) {
	.site-footer__grid { grid-template-columns: 1fr; gap: 28px; }
}

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