/*
Theme Name: DJPF
Description: WordPress theme for the Dr Janerita Peters Foundation (DJPF).
Author: Dr Janerita Peters Foundation (DJPF)
Version: 2.3.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: djpf
*/

/*
 * The theme's main styles live in css/style.css (loaded from functions.php).
 * Put your own small changes below so they are easy to find.
 */

/* ---- DJPF brand (logo option A "Sheltering Hands") ----
 * Deep Teal #14524A · Marigold #E9A23B · Sand #F7F3EC · Ink #1E2A28
 * Big headings: DM Serif Display. Everything else: Nunito Sans.
 */
h1, h2, .h1, .h2, .display-1, .display-2, .display-3, .display-4, .sec-title {
	font-family: var(--font-family-display);
	font-weight: 400;
	letter-spacing: 0;
}

/* Dark text on marigold: white on marigold is too faint to read */
.btn-secondary,
.btn-secondary:hover,
.btn-secondary:focus {
	color: #1E2A28;
}

/* Handwritten kicker above section titles: a deeper gold so it stays readable on white */
.sub-title {
	color: #A86A12;
}

/* Content written in the WordPress editor */
.entry-content img { max-width: 100%; height: auto; }
.entry-content > * + * { margin-top: 1rem; }
.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption-text, .gallery-caption { font-size: .875rem; }
.sticky, .bypostauthor { }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Pagination (paginate_links) inside the template's .pager */
.pager .page-numbers.dots { border: 0; }

/* Contact form messages */
#form-messages.success { color: #198754; margin-top: 1rem; }
#form-messages.error { color: #dc3545; margin-top: 1rem; }

/* ---- Home page ---- */

/* Silent YouTube video behind the "Giving has never made anyone poor" banner.
 * The section's photo shows until the video starts (or if it can't play). */
.djpf-video-sec {
	background-size: cover;
	background-position: center;
	overflow: hidden;
}
.djpf-video-bg {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}
.djpf-video-bg iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	/* Always cover the section, whatever its shape: at least full width and full height at 16:9 */
	height: max(100%, 56.25vw);
	width: auto;
	aspect-ratio: 16 / 9;
	transform: translate(-50%, -50%);
	border: 0;
}
.djpf-video-sec .parallax-overly,
.djpf-video-sec .container,
.djpf-video-sec .anim-img {
	position: relative;
	z-index: 1;
}
.djpf-video-sec .parallax-overly {
	position: absolute;
	inset: 0;
}
@media (prefers-reduced-motion: reduce) {
	.djpf-video-bg { display: none; }
}

/* Programme cards: a short description under the title */
.cause-entry .cause-txt p {
	margin: 0 0 18px;
}

/* "Registered 2024" badges (no counting animation) */
.about-sec .about-stat .abs-info p {
	margin: 6px 0 0;
	line-height: 1.4;
}

/* "2024 · Registered with the CAC" badge: four digits need more room than the template's two */
.sc-media-wrap .success-year {
	width: auto;
	gap: 14px;
	padding: 14px 26px;
}
.sc-media-wrap .success-year span {
	width: auto;
	font-family: var(--font-family-display);
	font-weight: 400;
	font-size: 56px;
	line-height: 1;
}
.sc-media-wrap .success-year .sy-txt {
	font-size: 22px;
	line-height: 1.15;
}

/* The video fades in once loaded; until then (or if YouTube is blocked) the photo shows */
.djpf-video-bg iframe {
	opacity: 0;
	transition: opacity 1.2s ease;
}
.djpf-video-bg iframe.is-loaded {
	opacity: 1;
}
