/*
 * Front-end base stylesheet.
 *
 * Palette matches the rebuild-plan artifact: warm off-white ground, deep
 * talim green as the primary accent (evokes the akhara/training-ground
 * association), marigold as a secondary warm accent. This file is the
 * foundation — module-specific pages (events, blog, cities) add their own
 * stylesheets on top rather than growing this one indefinitely.
 */

:root {
	--bg: #FBFAF6;
	--surface: #FFFFFF;
	--surface-2: #F3F2EC;
	--ink: #161A18;
	--ink-2: #3D443E;
	--stone: #6D746E;
	--line: #E2E3DC;
	--marigold: #9C6206;
	--talim: #1D4636;
	--talim-soft: #E4EEE8;
	--clay: #95301A;
	--radius: 8px;
	--container: 1180px;
}

* { box-sizing: border-box; }

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: ui-sans-serif, "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
	line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: var(--talim); }

/* Splash screen ------------------------------------------------------------
Shown once per browser session while the page finishes loading, then fades
out and removes itself. body.ka-splash-active locks scroll while it's up. */
body.ka-splash-active { overflow: hidden; }
.ka-splash {
	position: fixed; inset: 0; z-index: 9999;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
	background: var(--bg);
	opacity: 1; transition: opacity .45s ease;
}
.ka-splash--hide { opacity: 0; pointer-events: none; }
.ka-splash__logo {
	width: min(32vw, 132px); max-width: 132px; height: auto;
	animation: ka-splash-pulse 1.6s ease-in-out infinite;
}
.ka-splash__text {
	font-size: 1.6rem; font-weight: 800; color: var(--talim); letter-spacing: .02em;
	animation: ka-splash-pulse 1.6s ease-in-out infinite;
}
@keyframes ka-splash-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: .85; transform: scale(.97); }
}
@media (prefers-reduced-motion: reduce) {
	.ka-splash { transition: none; }
	.ka-splash__logo, .ka-splash__text { animation: none; }
}

.eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--marigold);
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; }

.btn {
	display: inline-block;
	padding: 0.7em 1.4em;
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none;
	border: 1px solid transparent;
}
.btn--primary { background: var(--talim); color: #fff; }
.btn--ghost { border-color: var(--line); color: var(--ink); }
.btn--on-dark { background: var(--marigold); color: #1B1404; }
.btn--on-dark-ghost { border-color: rgba(255,255,255,.4); color: #fff; }
.btn:hover { filter: brightness(1.06); }
.btn:focus-visible { outline: 2px solid var(--marigold); outline-offset: 3px; }

/* Header ---------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 500; }
.site-header__inner {
	max-width: var(--container); margin: 0 auto; padding: 12px 24px;
	display: flex; align-items: center; gap: 24px; justify-content: space-between;
}
.site-header__brand { font-weight: 800; text-decoration: none; color: var(--ink); font-size: 1.1rem; display: flex; align-items: center; gap: 12px; }
.site-header__logo { height: 46px; width: auto; display: block; }
.site-header__brand-text { line-height: 1.15; }
.site-header__nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-header__nav a { text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 0.92rem; }
.site-header__nav a:hover { color: var(--talim); }
.site-header__actions { display: flex; align-items: center; gap: 14px; }
.site-header__lang { text-decoration: none; font-size: 0.85rem; color: var(--stone); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }

/* Mobile menu toggle — hidden on desktop, three bars that morph into an X. */
.site-header__toggle {
	display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
	width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 8px;
	background: var(--surface); cursor: pointer; flex-shrink: 0;
}
.site-header__toggle-bar { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.site-header__toggle.is-active .site-header__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header__toggle.is-active .site-header__toggle-bar:nth-child(2) { opacity: 0; }
.site-header__toggle.is-active .site-header__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-header__backdrop {
	position: fixed; inset: 0; z-index: 499; background: rgba(12,16,13,.4);
	opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.site-header__backdrop.is-open { opacity: 1; pointer-events: auto; }
body.nav-open { overflow: hidden; }

@media (max-width: 900px) {
	.site-header__inner { padding: 10px 20px; }
	.site-header__logo { height: 38px; }
	.site-header__brand-text { font-size: .98rem; }
	.site-header__toggle { display: flex; }

	.site-header__nav {
		position: fixed; top: 0; right: 0; height: 100%; width: min(320px, 84vw);
		background: var(--surface); z-index: 500;
		flex-direction: column; flex-wrap: nowrap; gap: 0; align-items: stretch;
		padding: 88px 8px 24px; overflow-y: auto;
		box-shadow: -18px 0 40px rgba(22,26,24,.18);
		transform: translateX(100%); transition: transform .3s ease;
	}
	.site-header__nav.is-open { transform: translateX(0); }
	.site-header__nav a {
		padding: 15px 16px; border-bottom: 1px solid var(--line); font-size: 1.02rem;
	}
	.site-header__nav a:last-child { border-bottom: none; }
}

/* =============================================================================
 * Hero
 * =========================================================================== */
.section-hero {
	position: relative;
	background-color: var(--talim-soft);
	background-size: cover; background-position: center;
	padding: 128px 24px 108px;
	overflow: hidden;
}
/* Earth-tone texture standing in for photography until real photos are
   uploaded via the media library — a considered placeholder, not a blank. */
.section-hero:not(.section-hero--photo)::before {
	content: ""; position: absolute; inset: 0;
	background:
		radial-gradient(circle at 15% 20%, rgba(156,98,6,.10), transparent 45%),
		radial-gradient(circle at 85% 75%, rgba(29,70,54,.14), transparent 50%);
	pointer-events: none;
}
.section-hero--photo { padding: 148px 24px 116px; }
.section-hero--photo::before {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(12,16,13,.55) 0%, rgba(12,16,13,.72) 100%);
}
.section-hero--photo .eyebrow,
.section-hero--photo h1,
.section-hero--photo .section-hero__lede { color: #fff; position: relative; z-index: 1; }
.section-hero--photo .eyebrow { color: #F2C879; }
.section-hero--photo .section-hero__actions { position: relative; z-index: 1; }

.section-hero__inner { max-width: 780px; margin: 0 auto; text-align: center; position: relative; }
.section-hero h1 { font-size: clamp(2.3rem, 5.4vw, 3.6rem); margin: 10px 0 18px; }
.section-hero__lede { font-size: 1.15rem; color: var(--ink-2); max-width: 58ch; margin: 0 auto 1.7em; line-height: 1.6; }
.section-hero__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.section-hero .btn { padding: 0.85em 1.7em; font-size: .98rem; }

/* Split layout — text column + a large framed leadership portrait. Only
   applied when a secretary photo is set (see hero.php); otherwise the
   single centered column above is used untouched. */
.section-hero--split { padding-top: 96px; padding-bottom: 96px; }
.section-hero--split .section-hero__inner {
	max-width: var(--container); text-align: left;
	display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 64px; align-items: center;
}
.section-hero--split .section-hero__lede { margin-left: 0; margin-right: 0; }
.section-hero--split .section-hero__actions { justify-content: flex-start; }
.section-hero--split.section-hero--photo .section-hero__content { position: relative; z-index: 1; }

.hero-portrait { margin: 0; position: relative; }
.hero-portrait__frame {
	position: relative; aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden;
	box-shadow: 0 30px 70px -24px rgba(22,26,24,.4);
}
.hero-portrait__frame::after {
	content: ""; position: absolute; inset: 0; border-radius: inherit;
	box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.hero-portrait__frame img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.hero-portrait::before {
	content: ""; position: absolute; top: 22px; right: -22px; width: 100%; height: 100%;
	background: var(--marigold); opacity: .16; border-radius: 22px; z-index: -1;
}
.hero-portrait__caption {
	position: absolute; left: 18px; right: 18px; bottom: 18px;
	background: rgba(255,255,255,.95); backdrop-filter: blur(6px);
	border-radius: 12px; padding: 12px 16px;
}
.hero-portrait__caption strong { display: block; font-size: 1rem; color: var(--ink); }
.hero-portrait__caption span { display: block; font-size: .82rem; color: var(--stone); margin-top: 2px; }

@media (max-width: 860px) {
	.section-hero--split .section-hero__inner { grid-template-columns: 1fr; text-align: center; gap: 40px; }
	.section-hero--split .section-hero__lede { margin-left: auto; margin-right: auto; }
	.section-hero--split .section-hero__actions { justify-content: center; }
	.hero-portrait { max-width: 320px; margin: 0 auto; }
	.hero-portrait::before { right: -14px; top: 14px; }
}

/* =============================================================================
 * Mission band
 * =========================================================================== */
.section-mission { padding: 76px 24px; background: var(--surface); }
.section-mission__inner { max-width: 720px; margin: 0 auto; text-align: center; }
.section-mission h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 10px 0 20px; }
.section-mission__body { font-size: 1.08rem; line-height: 1.75; color: var(--ink-2); }
.section-mission__body p + p { margin-top: 1em; }

/* =============================================================================
 * Services / activities grid
 * =========================================================================== */
.section-services { padding: 76px 24px 88px; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-services__inner { max-width: var(--container); margin: 0 auto; }
.section-services h2 { margin: 10px 0 44px; }

.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; }
.service-card {
	background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
	padding: 28px 24px; display: flex; flex-direction: column; gap: 10px;
	transition: transform .18s ease, box-shadow .18s ease;
}
.service-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px -16px rgba(22,26,24,.22); }
.service-card__icon {
	width: 42px; height: 42px; padding: 9px; color: var(--talim);
	background: var(--talim-soft); border-radius: 10px; margin-bottom: 4px;
}
.service-card h3 { font-size: 1.08rem; margin: 0; }
.service-card p { font-size: .92rem; color: var(--ink-2); line-height: 1.6; margin: 0; }

/* =============================================================================
 * CTA band
 * =========================================================================== */
.section-cta {
	background: var(--talim); color: #fff; padding: 80px 24px; text-align: center;
	background-image: radial-gradient(circle at 20% 15%, rgba(255,255,255,.06), transparent 45%);
}
.section-cta__inner { max-width: 640px; margin: 0 auto; }
.section-cta h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); color: #fff; margin: 10px 0 16px; }
.section-cta__lede { font-size: 1.05rem; color: rgba(255,255,255,.82); margin: 0 auto 28px; max-width: 55ch; }

/* =============================================================================
 * Gallery teaser
 * =========================================================================== */
.section-gallery { padding: 76px 24px 88px; background: var(--surface); }
.section-gallery__inner { max-width: var(--container); margin: 0 auto; }
.section-gallery h2 { margin: 10px 0 40px; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; gap: 12px; }
.gallery-grid__item { margin: 0; border-radius: 10px; overflow: hidden; }
.gallery-grid__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.gallery-grid__item:hover img { transform: scale(1.05); }
.gallery-grid__item:nth-child(4n+1) { grid-row: span 2; }
@media (max-width: 900px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } .gallery-grid__item:nth-child(4n+1) { grid-row: span 1; } }
@media (max-width: 520px) { .gallery-grid { grid-template-columns: 1fr; } }

/* Empty / 404 state */
.empty-state { min-height: 50vh; display: flex; align-items: center; justify-content: center; padding: 60px 24px; }
.empty-state__inner { max-width: 520px; text-align: center; }

/* Footer */
.site-footer { background: var(--surface-2); border-top: 1px solid var(--line); margin-top: 60px; }
.site-footer__inner {
	max-width: var(--container); margin: 0 auto; padding: 48px 24px 24px;
	display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.site-footer__col h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--stone); margin-bottom: 12px; }
.site-footer__col a, .site-footer__col p { display: block; text-decoration: none; color: var(--ink-2); font-size: 0.92rem; margin-bottom: 8px; }
.site-footer__bottom {
	max-width: var(--container); margin: 0 auto; padding: 16px 24px;
	border-top: 1px solid var(--line); display: flex; gap: 16px; flex-wrap: wrap;
	justify-content: space-between; font-size: 0.82rem; color: var(--stone);
}
.site-footer__bottom a { color: var(--stone); text-decoration: none; }

/* =============================================================================
 * Content modules — shared by blog, events, documents, cities, gallery
 * =========================================================================== */

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

.page-header { background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 56px 24px; text-align: center; }
.page-header__inner { max-width: 760px; margin: 0 auto; }
.page-header__lede { color: var(--ink-2); font-size: 1.05rem; margin: 10px 0 0; }

.search-form { display: flex; gap: 10px; max-width: 480px; margin: 32px 0 28px; }
.search-form input { flex: 1; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; font-size: 0.95rem; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; padding: 8px 0 40px; }

.post-card {
	display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
	border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit;
	transition: box-shadow .15s ease;
}
.post-card:hover { box-shadow: 0 8px 24px -12px rgba(22,26,24,.18); }
.post-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.post-card__body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.post-card__body h3 { font-size: 1.05rem; margin: 2px 0 4px; }
.post-card__body p { font-size: 0.9rem; color: var(--ink-2); margin: 0; flex: 1; }
.post-card__meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.78rem; color: var(--stone); margin-top: 8px; }

.pagination { display: flex; gap: 8px; justify-content: center; padding-bottom: 48px; }
.pagination a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--ink-2); }
.pagination a.is-active { background: var(--talim); color: #fff; border-color: var(--talim); }

.answer-summary {
	font-size: 1.08rem; color: var(--ink-2); background: var(--talim-soft); border-left: 3px solid var(--talim);
	padding: 14px 18px; border-radius: 0 8px 8px 0; margin: 24px 0;
}

.single-post__image { width: 100%; border-radius: var(--radius); margin: 20px 0; }
.prose { font-size: 1.02rem; line-height: 1.75; }
.prose img { border-radius: 8px; margin: 16px 0; }
.prose h2, .prose h3 { margin-top: 1.6em; }

.about-secretary {
	display: flex; align-items: center; gap: 20px; margin-top: 32px; padding: 20px;
	background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
}
.about-secretary img { width: 96px; height: 118px; object-fit: cover; border-radius: 8px; margin: 0; flex-shrink: 0; }
.about-secretary strong { display: block; font-size: 1.05rem; }
.about-secretary span { display: block; font-size: 0.9rem; color: var(--ink-2); margin-top: 4px; }
@media (max-width: 480px) { .about-secretary { flex-direction: column; text-align: center; } }

.faq-item { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item div { margin-top: 10px; color: var(--ink-2); }

.info-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.info-table th, .info-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.info-table th { width: 35%; color: var(--stone); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }

.doc-list { display: flex; flex-direction: column; gap: 12px; padding: 8px 0 40px; }
.doc-row {
	display: flex; justify-content: space-between; align-items: center; gap: 16px;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.doc-row h3 { margin: 0 0 4px; font-size: 1rem; }
.doc-row p { margin: 0; font-size: 0.85rem; color: var(--stone); }

/* =============================================================================
 * Verified members directory
 * =========================================================================== */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; padding: 8px 0 48px; }
.member-card { text-align: center; }
.member-card img {
	width: 128px; height: 128px; object-fit: cover; border-radius: 50%;
	margin: 0 auto 12px; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line);
}
.member-card__placeholder {
	width: 128px; height: 128px; border-radius: 50%; margin: 0 auto 12px;
	background: var(--talim-soft); color: var(--talim); display: flex; align-items: center; justify-content: center;
	font-size: 2.4rem; font-weight: 700;
}
.member-card h3 { font-size: 0.98rem; margin: 0 0 2px; }
.member-card p { font-size: 0.82rem; color: var(--stone); margin: 0; }

/* Testimonials ------------------------------------------------------------ */
.section-testimonials { padding: 76px 24px 88px; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-testimonials__inner { max-width: var(--container); margin: 0 auto; }
.section-testimonials h2 { margin: 10px 0 40px; }
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.testimonial-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; margin: 0; }
.testimonial-card__rating { color: var(--clay); letter-spacing: 2px; margin-bottom: 8px; }
.testimonial-card blockquote { margin: 0 0 16px; font-size: 1rem; line-height: 1.6; color: var(--ink); }
.testimonial-card figcaption { display: flex; align-items: center; gap: 12px; }
.testimonial-card figcaption img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.testimonial-card figcaption strong { display: block; font-size: 0.92rem; }
.testimonial-card figcaption span { display: block; font-size: 0.82rem; color: var(--ink-2); }

/* Gallery — album index + album detail ------------------------------------ */
.album-card__meta { font-size: 0.82rem; color: var(--stone); margin: 4px 0 0; }
.album-card__count { font-size: 0.78rem; color: var(--talim); font-weight: 600; }
.gallery-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.gallery-media-grid figure { margin: 0; border-radius: 10px; overflow: hidden; background: var(--surface-2); position: relative; }
.gallery-media-grid img, .gallery-media-grid video { width: 100%; height: 200px; object-fit: cover; display: block; }
.gallery-media-grid figcaption { padding: 8px 10px; font-size: 0.8rem; color: var(--ink-2); }

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0F120F; --surface: #171B17; --surface-2: #1E231E;
		--ink: #E9EAE3; --ink-2: #BFC4BC; --stone: #8B928A; --line: #2B312B;
		--talim-soft: #15241C;
	}
}
