/*
Theme Name: Joy of Sharing
Theme URI: https://thejoyofsharing.in
Description: Block theme for thejoyofsharing.in. v1 rebuilt the March 2025 site; v2 modernises the look.
Version: 0.2.0
Requires at least: 6.5
Requires PHP: 8.0
Text Domain: joyofsharing
*/

:root {
	--jos-radius: 16px;
	--jos-radius-sm: 10px;
	--jos-shadow: 0 1px 2px rgba(22, 33, 58, 0.06), 0 12px 32px -12px rgba(22, 33, 58, 0.18);
	--jos-shadow-lg: 0 2px 4px rgba(22, 33, 58, 0.06), 0 24px 48px -16px rgba(22, 33, 58, 0.28);
	--jos-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

::selection {
	background: var(--wp--preset--color--accent-soft);
}

h1, h2, h3 {
	font-optical-sizing: auto;
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

a {
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
	transition: color 0.2s var(--jos-ease);
}

/* Small uppercase label above headings */
.jos-eyebrow {
	font-size: 0.8rem !important;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-dark);
	margin-bottom: 0.5rem !important;
}
.jos-eyebrow + h1,
.jos-eyebrow + h2 {
	margin-top: 0 !important;
}

.jos-lead {
	font-size: var(--wp--preset--font-size--large) !important;
	line-height: 1.7;
	color: var(--wp--preset--color--body-text);
}
.jos-lead-small {
	color: var(--wp--preset--color--muted);
}

.wp-element-button,
.wp-block-button__link {
	transition: background-color 0.2s var(--jos-ease), color 0.2s var(--jos-ease), transform 0.2s var(--jos-ease);
}
.wp-block-button__link:hover {
	transform: translateY(-1px);
}

/* ---------- Header ---------- */
.jos-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(255, 255, 255, 0.92) !important;
	backdrop-filter: saturate(1.4) blur(10px);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid rgba(22, 33, 58, 0.07);
}
.admin-bar .jos-header {
	top: 32px;
}
.jos-header .wp-block-site-logo img {
	display: block;
}
.jos-header .wp-block-navigation a {
	text-decoration: none;
	padding: 6px 0;
	position: relative;
}
.jos-header .wp-block-navigation-item:not(.jos-nav-cta) > a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: var(--wp--preset--color--accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.25s var(--jos-ease);
}
.jos-header .wp-block-navigation-item:not(.jos-nav-cta) > a:hover::after,
.jos-header .wp-block-navigation-item.current-menu-item > a::after,
.jos-header .wp-block-navigation-item > a[aria-current="page"]::after {
	transform: scaleX(1);
}
.jos-header .jos-nav-cta > a {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--contrast) !important;
	padding: 9px 18px !important;
	border-radius: 999px;
	font-weight: 600;
}
.jos-header .jos-nav-cta > a:hover {
	background: var(--wp--preset--color--navy);
	color: #fff !important;
}

/* ---------- Hero slider ---------- */
.jos-slider {
	position: relative;
	overflow: hidden;
	height: min(620px, 78vh);
	background: var(--wp--preset--color--navy);
}
.jos-slider__track {
	display: flex;
	height: 100%;
	transition: transform 0.7s var(--jos-ease);
}
.jos-slider .jos-slide {
	flex: 0 0 100%;
	height: 100%;
	min-height: 0 !important;
	margin: 0 !important;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}
.jos-slide .wp-block-cover__image-background {
	transform: scale(1.06);
	transition: transform 6s linear;
}
.jos-slide.is-active .wp-block-cover__image-background {
	transform: scale(1);
}
.jos-slide h2 {
	font-weight: 500 !important;
	letter-spacing: -0.02em;
	text-shadow: 0 2px 24px rgba(0, 0, 0, 0.18);
}
.jos-slide p {
	max-width: 36ch;
	margin-left: auto !important;
	margin-right: auto !important;
	opacity: 0.95;
}
.jos-slide.is-active h2,
.jos-slide.is-active p {
	animation: jos-fade-up 0.9s var(--jos-ease) both;
}
.jos-slide.is-active p {
	animation-delay: 0.12s;
}
@keyframes jos-fade-up {
	from { opacity: 0; transform: translateY(18px); }
	to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.jos-slider__track,
	.jos-slide .wp-block-cover__image-background { transition: none; }
	.jos-slide.is-active h2,
	.jos-slide.is-active p { animation: none; }
}
.jos-slide--flyer .wp-block-image {
	margin: 0 auto;
}
.jos-slide--flyer .wp-block-image img {
	max-height: min(540px, 68vh);
	width: auto;
	border-radius: var(--jos-radius-sm);
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.45);
}
.jos-slider__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: rgba(255, 255, 255, 0.12);
	backdrop-filter: blur(6px);
	color: #fff;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s var(--jos-ease);
}
.jos-slider__arrow:hover {
	background: rgba(255, 255, 255, 0.28);
}
.jos-slider__arrow--prev { left: 24px; }
.jos-slider__arrow--next { right: 24px; }
.jos-slider__dots {
	position: absolute;
	bottom: 22px;
	left: 0;
	right: 0;
	display: flex;
	justify-content: center;
	gap: 8px;
}
.jos-slider__dots button {
	width: 8px;
	height: 8px;
	border-radius: 999px;
	border: 0;
	padding: 0;
	background: #fff;
	opacity: 0.45;
	cursor: pointer;
	transition: width 0.3s var(--jos-ease), opacity 0.3s;
}
.jos-slider__dots button[aria-current="true"] {
	width: 28px;
	opacity: 1;
}

/* ---------- Home sections ---------- */
.jos-intro h1 {
	margin-bottom: 1.5rem;
}
.jos-intro .wp-block-buttons {
	margin-top: 2rem;
}
.jos-split .wp-block-image {
	margin: 0;
}
.jos-split .wp-block-image img,
.jos-portrait-pair img {
	display: block;
	width: 100%;
	border-radius: var(--jos-radius);
	box-shadow: var(--jos-shadow-lg);
	object-fit: cover;
}
.jos-split__media > .wp-block-image img {
	aspect-ratio: 4 / 3;
}
.jos-split__text h2 {
	margin-bottom: 1.25rem;
}
.jos-split__text .wp-block-buttons {
	margin-top: 1.75rem;
}

/* Two trainer portraits, offset like a pair of cards */
.jos-portrait-pair {
	display: grid !important;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	align-items: start;
}
.jos-portrait-pair .wp-block-image {
	margin: 0 !important;
}
.jos-portrait-pair img {
	aspect-ratio: 4 / 5;
}
.jos-portrait-pair .wp-block-image:nth-child(2) {
	margin-top: 56px !important;
}

.jos-callout {
	border-left: 3px solid var(--wp--preset--color--accent);
	padding: 0.25rem 0 0.25rem 1.1rem;
	color: var(--wp--preset--color--contrast);
	font-weight: 500;
}

/* ---------- Events ---------- */
.jos-events-section .jos-lead-small {
	margin-bottom: 3rem !important;
}
.jos-events {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
	gap: 18px;
	align-items: start;
}
.jos-events > * {
	margin: 0 !important;
}
.jos-event {
	background: #fff;
	border-radius: var(--jos-radius-sm);
	box-shadow: var(--jos-shadow);
	border: 1px solid rgba(22, 33, 58, 0.05);
	transition: box-shadow 0.25s var(--jos-ease), transform 0.25s var(--jos-ease);
	overflow: hidden;
}
.jos-event:hover {
	box-shadow: var(--jos-shadow-lg);
	transform: translateY(-2px);
}
.jos-event summary {
	list-style: none;
	cursor: pointer;
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-areas:
		"city icon"
		"title icon"
		"date icon";
	column-gap: 16px;
	padding: 20px 22px;
}
.jos-event summary::-webkit-details-marker { display: none; }
.jos-event summary::after {
	content: "+";
	grid-area: icon;
	align-self: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--wp--preset--color--accent-soft);
	color: var(--wp--preset--color--contrast);
	font-size: 1.2rem;
	transition: transform 0.25s var(--jos-ease), background 0.2s;
}
.jos-event[open] summary::after {
	transform: rotate(45deg);
	background: var(--wp--preset--color--accent);
}
.jos-event__city {
	grid-area: city;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-dark);
}
.jos-event__title {
	grid-area: title;
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: 1.2rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--wp--preset--color--contrast);
	margin: 4px 0 6px;
}
.jos-event__date {
	grid-area: date;
	font-size: 0.9rem;
	color: var(--wp--preset--color--muted);
}
.jos-event > :not(summary) {
	padding: 0 22px;
	margin: 0 0 0.6rem !important;
	font-size: 0.95rem;
}
.jos-event[open] > :not(summary):first-of-type {
	border-top: 1px solid rgba(22, 33, 58, 0.08);
	padding-top: 16px;
}
.jos-event[open] {
	padding-bottom: 10px;
}

/* ---------- Inner pages ---------- */
.jos-page-header .wp-block-post-title {
	margin-top: 0;
}
.jos-page-body {
	padding-top: 72px;
}
.jos-page-body h2 {
	margin-top: 3rem;
	padding-bottom: 0.6rem;
	position: relative;
}
.jos-page-body h2::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 48px;
	height: 3px;
	border-radius: 3px;
	background: var(--wp--preset--color--accent);
}
.jos-page-body > h2:first-child {
	margin-top: 0;
}
.jos-page-body h3 {
	margin-top: 2.25rem;
}
.jos-page-body .wp-block-list {
	padding-left: 0;
	list-style: none;
}
.jos-page-body .wp-block-list li {
	position: relative;
	padding-left: 1.6rem;
	margin-bottom: 0.6rem;
}
.jos-page-body .wp-block-list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.7em;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 3px var(--wp--preset--color--accent-soft);
}
.jos-page-body .wp-block-separator {
	border: 0;
	height: 1px;
	background: rgba(22, 33, 58, 0.1);
	margin: 4.5rem 0;
}

/* Trainer profiles */
.jos-profile {
	gap: 40px !important;
	margin-top: 1.5rem !important;
}
.jos-profile .wp-block-image {
	margin: 0;
}
.jos-profile .wp-block-image img {
	border-radius: var(--jos-radius);
	box-shadow: var(--jos-shadow-lg);
	aspect-ratio: 4 / 5;
	object-fit: cover;
	width: 100%;
	max-width: 320px;
}

/* Udyog gallery */
.jos-page-body .wp-block-gallery {
	gap: 14px !important;
	margin-top: 1.5rem !important;
}
.jos-page-body .wp-block-gallery .wp-block-image {
	border-radius: var(--jos-radius-sm);
	overflow: hidden;
}
.jos-page-body .wp-block-gallery .wp-block-image img {
	aspect-ratio: 3 / 2;
	transition: transform 0.6s var(--jos-ease);
}
.jos-page-body .wp-block-gallery .wp-block-image:hover img {
	transform: scale(1.04);
}

/* Contact form */
.wpcf7 {
	background: var(--wp--preset--color--cream);
	border-radius: var(--jos-radius);
	padding: clamp(24px, 4vw, 40px);
	margin-top: 2rem;
}
.wpcf7-form label {
	font-weight: 500;
	color: var(--wp--preset--color--contrast);
	font-size: 0.95rem;
}
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form textarea {
	width: 100%;
	margin-top: 6px;
	padding: 12px 14px;
	border: 1px solid rgba(22, 33, 58, 0.15);
	border-radius: var(--jos-radius-sm);
	background: #fff;
	font: inherit;
	transition: border-color 0.2s, box-shadow 0.2s;
}
.wpcf7-form input:focus,
.wpcf7-form textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--navy);
	box-shadow: 0 0 0 3px var(--wp--preset--color--accent-soft);
}
.wpcf7-form textarea {
	min-height: 160px;
}
.wpcf7-form input[type="submit"] {
	background: var(--wp--preset--color--navy);
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 13px 30px;
	font: 600 0.95rem var(--wp--preset--font-family--inter);
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}
.wpcf7-form input[type="submit"]:hover {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--contrast);
}

/* ---------- Footer ---------- */
.jos-footer {
	font-size: 0.95rem;
	color: rgba(255, 255, 255, 0.72);
}
.jos-footer a {
	color: #fff;
	text-decoration: none;
}
.jos-footer a:hover {
	color: var(--wp--preset--color--accent);
}
.jos-footer__logo img {
	background: #fff;
	border-radius: 12px;
	padding: 8px;
}
.jos-footer__motto {
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: 1.5rem;
	color: #fff;
	margin-top: 1.25rem !important;
}
.jos-footer__muted {
	max-width: 36ch;
}
.jos-footer__heading {
	font-family: var(--wp--preset--font-family--inter) !important;
	font-size: 0.8rem !important;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent) !important;
}
.jos-footer__links {
	list-style: none;
	padding: 0;
}
.jos-footer__links li {
	margin-bottom: 0.5rem;
}
.jos-footer__bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	padding-top: 24px;
	font-size: 0.85rem;
}
.jos-footer__bottom p {
	margin: 0;
}

/* ---------- Mobile ---------- */
@media (max-width: 781px) {
	.jos-band,
	.jos-intro,
	.jos-events-section {
		padding-top: 64px !important;
		padding-bottom: 64px !important;
	}
	.jos-split {
		gap: 32px !important;
	}
	.jos-split--reverse {
		flex-direction: column-reverse;
	}
	.jos-portrait-pair .wp-block-image:nth-child(2) {
		margin-top: 32px !important;
	}
	.jos-page-body {
		padding-top: 48px;
	}
	.jos-profile .wp-block-image img {
		max-width: 260px;
	}
}
@media (max-width: 600px) {
	.jos-slider {
		height: 440px;
	}
	.jos-slider__arrow {
		display: none;
	}
	.jos-slide--flyer .wp-block-image img {
		max-height: 340px;
	}
	.jos-events {
		grid-template-columns: 1fr;
	}
}

/* ---------- Layout seams ---------- */
/* Header, main and footer sit flush; sections carry their own spacing. */
.wp-site-blocks > main,
.wp-site-blocks > footer,
.wp-site-blocks > .wp-block-template-part + * {
	margin-block-start: 0 !important;
}
.wp-site-blocks > .wp-block-template-part:last-child,
.wp-site-blocks > footer {
	margin-block-start: 0 !important;
}
.entry-content > .alignfull:first-child {
	margin-block-start: 0 !important;
}
.entry-content > .alignfull:last-child {
	margin-block-end: 0 !important;
}
.entry-content > .alignfull + .alignfull {
	margin-block-start: 0 !important;
}

/* Long intro paragraph: readable measure rather than display size */
.jos-intro .jos-lead {
	font-size: 1.2rem !important;
	line-height: 1.8;
	max-width: 680px;
	margin-left: auto !important;
	margin-right: auto !important;
}
