/*
Theme Name: Seva
Description: A light, custom theme for community organisations. Logo in the middle, sliding images, "what we do" cards, recent posts by category, about section, a join/contact box, WhatsApp and back-to-top buttons, built-in SEO, and automatic WebP/AVIF image compression. All settings are in Appearance > Customize > Seva theme.
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: seva
*/

:root {
	--seva-accent: #b4360f;
	--seva-dark: #3b1206;
	--seva-text: #2a211d;
	--seva-muted: #6f625b;
	--seva-line: #eadfd6;
	--seva-soft: #fbf5ee;
	--seva-bg: #ffffff;
	--seva-radius: 14px;
	--seva-width: 1100px;
	--seva-font: "Mukta", "Noto Sans Devanagari", "Kohinoor Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

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

body {
	margin: 0;
	background: var(--seva-bg);
	color: var(--seva-text);
	font-family: var(--seva-font);
	font-size: 18px;
	line-height: 1.7;
	overflow-x: hidden;
}

img,
video,
iframe {
	max-width: 100%;
}

img {
	height: auto;
}

a {
	color: var(--seva-accent);
	text-underline-offset: 3px;
}

a:hover {
	color: var(--seva-dark);
}

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

h1,
h2,
h3,
h4 {
	color: var(--seva-dark);
	line-height: 1.3;
	margin: 0 0 0.5em;
}

p {
	margin: 0 0 1em;
}

.seva-footer :focus-visible,
.seva-cta :focus-visible {
	outline-color: #fff;
}

.seva-slide a:focus-visible {
	outline-offset: -4px;
}

h1,
h2,
h3,
.seva-content,
.seva-post-row__body,
.seva-card__body,
.seva-footer {
	overflow-wrap: anywhere;
}

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

.seva-skip {
	position: absolute;
	left: -999px;
	top: 8px;
	z-index: 100;
	background: var(--seva-dark);
	color: #fff;
	padding: 8px 14px;
	border-radius: 8px;
}

.seva-skip:focus {
	left: 8px;
}

.seva-icon {
	display: block;
	flex: none;
}

.seva-wrap {
	width: 100%;
	max-width: var(--seva-width);
	margin: 0 auto;
	padding: 0 20px;
}

.seva-wrap--narrow {
	max-width: 800px;
}

.seva-center {
	text-align: center;
}

.seva-section {
	padding: 56px 0;
}

.seva-heading {
	text-align: center;
	font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem);
	margin-bottom: 0.9em;
}

.seva-heading::after {
	content: "";
	display: block;
	width: 64px;
	height: 4px;
	border-radius: 4px;
	background: var(--seva-accent);
	margin: 12px auto 0;
}

.seva-heading--left {
	text-align: left;
}

.seva-heading--left::after {
	margin-left: 0;
}

.seva-intro {
	text-align: center;
	color: var(--seva-muted);
	max-width: 720px;
	margin: -8px auto 28px;
}

.seva-meta {
	color: var(--seva-muted);
	font-size: 0.88rem;
}

/* Buttons */
.seva-btn,
.wp-block-button__link,
input[type="submit"],
button[type="submit"] {
	display: inline-block;
	background: var(--seva-accent);
	color: #fff;
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	border: 2px solid var(--seva-accent);
	border-radius: 999px;
	padding: 10px 26px;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.seva-btn:hover,
.wp-block-button__link:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
	background: var(--seva-dark);
	border-color: var(--seva-dark);
	color: #fff;
}

.seva-btn--ghost {
	background: transparent;
	color: var(--seva-accent);
}

.seva-btn--light {
	background: #fff;
	border-color: #fff;
	color: var(--seva-dark);
}

.seva-btn--light:hover {
	background: var(--seva-soft);
	border-color: var(--seva-soft);
	color: var(--seva-dark);
}

/* Header: logo in the top middle, menu under it */
.seva-header {
	border-bottom: 1px solid var(--seva-line);
	background: #fff;
}

.seva-brand {
	text-align: center;
	padding: 18px 20px 8px;
}

.seva-brand .custom-logo-link {
	display: inline-block;
}

.seva-brand .custom-logo {
	display: block;
	max-height: 110px;
	width: auto;
	margin: 0 auto;
}

.seva-brand__name {
	font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem);
	font-weight: 700;
	line-height: 1.25;
	margin: 6px 0 0;
}

.seva-brand__name a {
	color: var(--seva-dark);
	text-decoration: none;
}

.seva-brand__tagline {
	color: var(--seva-muted);
	font-size: 0.95rem;
	margin: 2px 0 0;
}

.seva-nav {
	text-align: center;
	padding: 4px 12px 10px;
}

.seva-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2px 6px;
}

.seva-nav li {
	position: relative;
}

.seva-nav a {
	display: block;
	padding: 8px 14px;
	border-radius: 999px;
	color: var(--seva-text);
	font-weight: 500;
	text-decoration: none;
}

.seva-nav a:hover,
.seva-nav .current-menu-item > a,
.seva-nav .current_page_item > a {
	background: var(--seva-soft);
	color: var(--seva-accent);
}

.seva-nav ul ul {
	display: none;
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	top: 100%;
	z-index: 30;
	min-width: 210px;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--seva-line);
	border-radius: var(--seva-radius);
	padding: 6px;
	box-shadow: 0 10px 30px rgba(59, 18, 6, 0.12);
}

.seva-nav li:hover > ul,
.seva-nav li:focus-within > ul {
	display: flex;
}

.seva-nav__toggle {
	display: none;
	align-items: center;
	gap: 8px;
	margin: 0 auto;
	background: none;
	border: 1px solid var(--seva-line);
	border-radius: 999px;
	padding: 8px 18px;
	font: inherit;
	font-weight: 500;
	color: var(--seva-text);
	cursor: pointer;
}

.seva-nav__close {
	display: none;
}

@media (max-width: 760px) {
	.seva-nav__toggle {
		display: inline-flex;
	}

	.seva-nav > ul,
	.seva-nav > div > ul {
		display: none;
		flex-direction: column;
		margin-top: 10px;
	}

	.seva-nav.is-open > ul,
	.seva-nav.is-open > div > ul {
		display: flex;
	}

	.seva-nav.is-open .seva-nav__open {
		display: none;
	}

	.seva-nav.is-open .seva-nav__close {
		display: block;
	}

	.seva-nav ul ul {
		display: flex;
		position: static;
		transform: none;
		border: 0;
		box-shadow: none;
		padding: 0;
	}

	.seva-nav ul ul a {
		font-size: 0.95rem;
		color: var(--seva-muted);
	}
}

/* Slider: always full width, height follows the image */
.seva-slider {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: var(--seva-soft);
}

.seva-slider.is-ready {
	transition: height 0.45s ease;
}

.seva-slider__track {
	display: flex;
	align-items: flex-start;
	transition: transform 0.6s ease;
}

.seva-slide {
	flex: 0 0 100%;
	min-width: 0;
}

.seva-slide a {
	display: block;
}

.seva-slide img {
	display: block;
	width: 100%;
	height: auto;
	max-height: var(--seva-slide-max, none);
	object-fit: contain;
}

.seva-slider__btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.88);
	color: var(--seva-dark);
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.seva-slider__btn:hover {
	background: #fff;
}

.seva-slider__btn--prev {
	left: 14px;
}

.seva-slider__btn--next {
	right: 14px;
}

.seva-slider__pause {
	position: absolute;
	right: 14px;
	bottom: 12px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: var(--seva-dark);
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.seva-slider__pause:hover {
	background: #fff;
}

.seva-slider__play-icon,
.seva-slider.is-paused .seva-slider__pause-icon {
	display: none;
}

.seva-slider.is-paused .seva-slider__play-icon {
	display: block;
}

.seva-slider__dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 12px;
	display: flex;
	justify-content: center;
	gap: 8px;
}

.seva-slider__dots button {
	width: 11px;
	height: 11px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.35);
	cursor: pointer;
}

.seva-slider__dots button.is-active {
	background: #fff;
}

@media (max-width: 600px) {
	.seva-slider__btn {
		width: 36px;
		height: 36px;
	}

	.seva-slider__btn--prev {
		left: 6px;
	}

	.seva-slider__btn--next {
		right: 6px;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.seva-slider__track,
	.seva-slider.is-ready {
		transition: none;
	}
}

/* What we do */
.seva-what {
	background: var(--seva-soft);
}

.seva-cards {
	display: grid;
	gap: 24px;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.seva-cards--2 {
	max-width: 780px;
	margin: 0 auto;
}

.seva-card {
	background: #fff;
	border: 1px solid var(--seva-line);
	border-radius: var(--seva-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.seva-card__img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.seva-card__media {
	overflow: hidden;
}

.seva-what--zoom .seva-card__img {
	transition: transform 1.2s ease;
	will-change: transform;
}

.seva-what--zoom .seva-card:hover .seva-card__img,
.seva-what--zoom .seva-card:focus-within .seva-card__img {
	transform: scale(1.1);
}

@keyframes seva-card-zoom {
	0% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.1);
	}

	100% {
		transform: scale(1);
	}
}

/* Phones have no mouse: zoom once when the card scrolls into view. */
@media (hover: none) {
	.seva-what--zoom .seva-card.is-inview .seva-card__img {
		animation: seva-card-zoom 3s ease 0.2s 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.seva-what--zoom .seva-card__img {
		transition: none;
		animation: none !important;
		transform: none !important;
	}
}

.seva-card__body {
	padding: 18px 20px 8px;
}

.seva-card__title {
	font-size: 1.2rem;
}

.seva-card__title a {
	color: inherit;
	text-decoration: none;
}

.seva-card__title a:hover {
	color: var(--seva-accent);
}

.seva-card p {
	color: var(--seva-muted);
	font-size: 0.98rem;
}

/* Recent posts: small image left, text right */
.seva-post-list {
	display: grid;
	gap: 22px 36px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin-bottom: 30px;
}

.seva-post-row {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	padding-bottom: 22px;
	border-bottom: 1px solid var(--seva-line);
}

.seva-post-row__img {
	flex: 0 0 132px;
}

.seva-post-row__img img {
	display: block;
	width: 132px;
	height: 99px;
	object-fit: cover;
	border-radius: 10px;
}

.seva-post-row__body {
	min-width: 0;
}

.seva-post-row__title {
	font-size: 1.08rem;
	margin: 0 0 2px;
}

.seva-post-row__title a {
	color: var(--seva-dark);
	text-decoration: none;
}

.seva-post-row__title a:hover {
	color: var(--seva-accent);
	text-decoration: underline;
}

.seva-post-row__text {
	color: var(--seva-muted);
	font-size: 0.95rem;
	line-height: 1.55;
	margin: 4px 0 0;
}

@media (max-width: 800px) {
	.seva-post-list {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 420px) {
	.seva-post-row__img {
		flex-basis: 96px;
	}

	.seva-post-row__img img {
		width: 96px;
		height: 72px;
	}
}

/* About */
.seva-about {
	background: var(--seva-soft);
}

.seva-about__text {
	text-align: center;
	font-size: 1.08rem;
}

.seva-about__img {
	margin-top: 30px;
}

.seva-about__img img {
	display: block;
	width: 100%;
	border-radius: var(--seva-radius);
}

/* Join / contact / subscribe box */
.seva-cta__box {
	padding: 0;
}

.seva-cta__box > * {
	min-width: 0;
}

.seva-cta__box {
	display: grid;
	background: var(--seva-dark);
	color: #fff;
	border-radius: var(--seva-radius);
	overflow: hidden;
	max-width: calc(var(--seva-width) - 40px);
	width: calc(100% - 40px);
}

.seva-cta__box--img {
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}

.seva-cta__img img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 260px;
	object-fit: cover;
}

.seva-cta__body {
	padding: 40px 36px;
	align-self: center;
}

.seva-cta__title {
	color: #fff;
	font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
}

.seva-cta__text {
	color: rgba(255, 255, 255, 0.88);
}

.seva-cta__body a:not(.seva-btn) {
	color: #fff;
}

.seva-cta__form {
	margin-bottom: 1em;
}

.seva-cta__form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.seva-cta__form textarea,
.seva-cta__form select {
	width: 100%;
	max-width: 420px;
}

@media (max-width: 800px) {
	.seva-cta__box--img {
		grid-template-columns: 1fr;
	}

	.seva-cta__img img {
		min-height: 0;
		max-height: 320px;
	}

	.seva-cta__body {
		padding: 28px 22px;
	}
}

/* Posts and pages */
.seva-page-head {
	margin-bottom: 24px;
}

.seva-article__img {
	margin: 0 0 24px;
}

.seva-article__img img {
	display: block;
	width: 100%;
	border-radius: var(--seva-radius);
}

.seva-content > * {
	margin-top: 0;
	margin-bottom: 1.2em;
}

.seva-content img {
	border-radius: 10px;
}

.seva-content .alignwide {
	margin-left: -60px;
	margin-right: -60px;
	max-width: none;
}

.seva-content .aligncenter {
	margin-left: auto;
	margin-right: auto;
}

.seva-content img.aligncenter {
	display: block;
}

.seva-content .alignleft {
	float: left;
	margin: 0 20px 12px 0;
}

.seva-content .alignright {
	float: right;
	margin: 0 0 12px 20px;
}

.seva-content figure {
	margin-left: 0;
	margin-right: 0;
}

.seva-content figcaption,
.wp-caption-text {
	color: var(--seva-muted);
	font-size: 0.88rem;
	text-align: center;
}

.seva-content blockquote {
	margin-left: 0;
	padding: 6px 0 6px 20px;
	border-left: 4px solid var(--seva-accent);
	color: var(--seva-muted);
}

.seva-content table {
	width: 100%;
	border-collapse: collapse;
}

.seva-content th,
.seva-content td {
	border: 1px solid var(--seva-line);
	padding: 8px 12px;
	text-align: left;
}

@media (max-width: 960px) {
	.seva-content .alignwide {
		margin-left: 0;
		margin-right: 0;
	}
}

.seva-post-nav {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	border-top: 1px solid var(--seva-line);
	margin-top: 36px;
	padding-top: 20px;
	font-size: 0.95rem;
}

.seva-post-nav a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
}

.seva-post-nav div:last-child {
	text-align: right;
}

.pagination .nav-links {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
}

.pagination .page-numbers {
	display: grid;
	place-items: center;
	min-width: 42px;
	height: 42px;
	padding: 0 10px;
	border: 1px solid var(--seva-line);
	border-radius: 999px;
	text-decoration: none;
}

.pagination .page-numbers.current {
	background: var(--seva-accent);
	border-color: var(--seva-accent);
	color: #fff;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="number"],
textarea,
select {
	font: inherit;
	color: inherit;
	background: #fff;
	border: 1px solid #cbbdb2;
	border-radius: 10px;
	padding: 10px 14px;
	max-width: 100%;
}

textarea {
	width: 100%;
}

.search-form {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 0 0 1em;
}

.seva-comments {
	border-top: 1px solid var(--seva-line);
	margin-top: 36px;
	padding-top: 24px;
}

.seva-comments__list {
	list-style: none;
	padding: 0;
}

.seva-comments__list .comment-body {
	border-bottom: 1px solid var(--seva-line);
	padding: 14px 0;
}

.seva-comments .comment-form label {
	display: block;
	font-weight: 500;
}

/* Footer */
.seva-footer {
	background: var(--seva-dark);
	color: rgba(255, 255, 255, 0.85);
	text-align: center;
	padding: 36px 0 90px;
	font-size: 0.95rem;
}

.seva-footer a {
	color: #fff;
}

.seva-footer ul {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 22px;
}

.seva-footer__list a {
	text-decoration: none;
	font-weight: 500;
}

.seva-footer__list a:hover {
	text-decoration: underline;
}

.seva-footer ul.seva-footer__social {
	gap: 12px;
}

.seva-footer__social a {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	transition: background 0.2s, color 0.2s;
}

.seva-footer__social a:hover {
	background: #fff;
	color: var(--seva-dark);
}

.seva-footer__text {
	margin: 0;
}

/* Floating buttons */
.seva-float {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 50;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
}

.seva-top {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border: 0;
	border-radius: 50%;
	background: var(--seva-dark);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.seva-top[hidden] {
	display: none;
}

.seva-top:hover {
	background: var(--seva-accent);
}

.seva-wa {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #128c4a;
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	border-radius: 999px;
	padding: 11px 18px 11px 14px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.seva-wa:hover {
	background: #0c6b38;
	color: #fff;
}

@media (max-width: 480px) {
	.seva-wa span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
	}

	.seva-wa {
		padding: 13px;
	}
}

@media print {
	.seva-float,
	.seva-nav,
	.seva-slider__btn,
	.seva-slider__pause,
	.seva-slider__dots {
		display: none !important;
	}
}
