/*
Theme Name: Hope Beyond
Description: A child theme of twentytwentyfour, scaffolded by Studio Code.
Template: twentytwentyfour
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.2
Version: 0.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hope-beyond
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready, style-variations
*/

:root {
	--hb-green: var( --wp--preset--color--brand-green );
	--hb-green-dark: var( --wp--preset--color--brand-green-dark );
	--hb-ink: var( --wp--preset--color--contrast );
	--hb-navy: var( --wp--preset--color--brand-navy );
	--hb-paper: var( --wp--preset--color--base );
	--hb-white: var( --wp--preset--color--base-2 );
}

/* === reset === */
.hb-home-sections {
	--wp--style--block-gap: 0;
}

.hb-home-sections > * {
	margin-block-start: 0;
}
/* === hero === */
.hb-hero .wp-block-cover__inner-container {
	width: 100%;
	max-width: 900px;
	margin-inline: auto;
	padding-inline: var( --wp--preset--spacing--40 );
}

.hb-hero-title {
	font-size: clamp( 3.5rem, 11vw, 7rem );
	line-height: 1.1;
}

/* Subtitle spacing/color now native (style.spacing.margin.top + textColor on the block). */
/* === bio === */
.hb-bio-photo img {
	width: 100%;
}
/* .hb-bio-name line-height now native (style.typography.lineHeight on the block). */
/* === page hero === */
/* Shared navy banner + white cursive title, reused across the Newsletter archive,
   single posts, and the default page template. One class, one place to style it. */
.hb-page-hero h1 {
	font-size: 6rem;
	margin: 0;
}

.hb-newsletter-query {
	max-width: 720px;
	margin-inline: auto;
}

.hb-newsletter-card {
	position: relative;
	padding: var( --wp--preset--spacing--40 ) var( --wp--preset--spacing--40 ) var( --wp--preset--spacing--40 ) calc( var( --wp--preset--spacing--40 ) + 6px );
	margin-bottom: var( --wp--preset--spacing--30 );
	background: var( --hb-white );
	border-left: 6px solid var( --hb-green );
	border-radius: 4px;
	box-shadow: 0 4px 16px rgba( 47, 54, 63, 0.08 );
}

.hb-newsletter-query .wp-block-post-template > li:nth-child( even ) .hb-newsletter-card,
.hb-newsletter-query > ul > li:nth-child( even ) .hb-newsletter-card {
	border-left-color: var( --hb-navy );
}

/* Pill shape/spacing/uppercase for post-date: not available via block inspector
   (Post Date has no border-radius or text-transform control). Colors are native
   (backgroundColor/textColor attributes on the block). */
.hb-newsletter-date {
	display: inline-block;
	padding: 0.25em 0.85em;
	border-radius: 999px;
	font-size: 0.7rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	margin-bottom: var( --wp--preset--spacing--20 );
}

.hb-newsletter-title {
	margin: 0 0 var( --wp--preset--spacing--10 );
}

/* Link color is native (style.elements.link.color.text on the post-title block).
   Hover color has no inspector control, so it stays here. */
.hb-newsletter-title a:hover {
	color: var( --hb-green-dark );
}

.hb-newsletter-readmore {
	display: inline-flex !important;
	align-items: center;
	gap: 0.4em;
	margin-top: var( --wp--preset--spacing--10 );
	font-weight: 700;
	text-decoration: none !important;
	transition: color 0.2s ease;
}

.hb-newsletter-readmore::after {
	content: "\2192";
	display: inline-block;
	transition: transform 0.2s ease;
}

.hb-newsletter-readmore:hover {
	color: var( --hb-green ) !important;
}

.hb-newsletter-readmore:hover::after {
	transform: translateX( 4px );
}

.hb-newsletter-pagination {
	margin-top: var( --wp--preset--spacing--40 );
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
}

.hb-newsletter-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.5rem;
	border-radius: 999px;
	color: var( --hb-navy );
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.hb-newsletter-pagination a.page-numbers:hover {
	background: var( --hb-green );
	color: var( --hb-white );
}

.hb-newsletter-pagination .page-numbers.current {
	background: var( --hb-navy );
	color: var( --hb-white );
}

.hb-newsletter-pagination .wp-block-query-pagination-previous,
.hb-newsletter-pagination .wp-block-query-pagination-next {
	display: inline-flex;
	align-items: center;
	height: 2.5rem;
	padding: 0 1rem;
	border-radius: 999px;
	background: var( --hb-paper );
	color: var( --hb-navy );
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.hb-newsletter-pagination .wp-block-query-pagination-previous:hover,
.hb-newsletter-pagination .wp-block-query-pagination-next:hover {
	background: var( --hb-green );
	color: var( --hb-white );
}

/* === services === */
/* Everything below is scoped to the single ".hb-services" wrapper class on the outer
   group — no other custom classNames exist on any block inside this section. If that
   changes in the future, keep it to this one entry point. */
.hb-services {
	--hb-gallery-size: 175px;
}

.hb-services .wp-block-column {
	min-width: 0;
}

.hb-services .wp-block-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 1.15rem;
}

/* Font weight is native (Typography > Appearance on the List block itself, inherited
   by list items). Background/pill shape/dot have no inspector equivalent. */
.hb-services .wp-block-list li {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	background: var( --hb-navy );
	color: var( --hb-white );
	padding: 0.7em 1.1em;
	border-radius: 8px;
	font-size: 0.95rem;
	min-width: 0;
}

.hb-services .wp-block-list li::before {
	content: "";
	flex: 0 0 auto;
	width: 15px;
	height: 15px;
	border-radius: 50%;
	background: var( --hb-green );
}

.hb-services .wp-block-gallery {
	display: grid !important;
	grid-template-columns: repeat( 3, minmax( 0, var( --hb-gallery-size ) ) ) !important;
	justify-content: center !important;
	row-gap: 0.6rem !important;
	column-gap: 0.6rem !important;
	min-width: 0 !important;
}

.hb-services .wp-block-gallery figure.wp-block-image {
	margin-inline: 0 !important;
	width: 100% !important;
	max-width: var( --hb-gallery-size ) !important;
	min-width: 0 !important;
}

.hb-services .wp-block-gallery img {
	aspect-ratio: 1 / 1 !important;
	object-fit: cover !important;
	border-radius: 50%;
	border: 5px solid var( --hb-white );
	box-shadow: 0 6px 14px rgba( 47, 54, 63, 0.25 );
	max-width: 100% !important;
	width: 100% !important;
	margin-inline: auto;
	display: block;
}

/* === single === */
/* Letter-spacing, size, and margin are native (Typography/Dimensions panel on the block).
   Only uppercase stays here — text-transform has no inspector control, and the date
   text itself is generated dynamically so it can't just be typed in caps. */
.hb-single-date {
	display: block;
	text-transform: uppercase;
}

/* === events === */
/* Background, padding, and border-radius on the card are native (Color/Dimensions/Border
   panels on the Columns block itself). Only shadow and inter-card spacing need CSS. */
.hb-event-card {
	margin-bottom: var( --wp--preset--spacing--20 );
	box-shadow: 0 4px 16px rgba( 47, 54, 63, 0.1 );
}

/* === latest === */
.hb-latest-card {
	max-width: 700px;
	margin: 0 auto;
	text-align: center;
}

.hb-latest-card .hb-newsletter-date {
	margin-inline: auto;
}

.hb-latest-title {
	font-size: clamp( 1.85rem, 4vw, 2.75rem );
}

.hb-latest .wp-block-buttons {
	margin-top: var( --wp--preset--spacing--40 );
}

/* === signup === */
/* Slim dark-green banner: label on the left, form inline on the right. */
.ctct-form-wrapper {
	width: 100%;
}

/* Placeholder text shown only until the real Constant Contact form is pasted in. */
.hb-signup-placeholder {
	padding: var( --wp--preset--spacing--20 );
	border: 2px dashed var( --hb-white );
	border-radius: 8px;
	color: var( --hb-white );
	font-style: italic;
	margin: 0;
}

/* Hide the disclaimer text + its rule entirely (real Constant Contact markup:
   <div class="ctct-disclosure"><hr><small>...</small></div>). */
.ctct-form-wrapper .ctct-disclosure {
	display: none;
}

/* Lay the form out as a single inline row: email field grows, button stays auto-width.
   Bottom-aligned rather than centered — the email field is taller than the button now
   that it carries a label, so centering would float the button above the input. */
.ctct-form-wrapper .ctct-form {
	display: flex;
	align-items: flex-end;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 0;
}

.ctct-form-wrapper .ctct-form-field {
	margin: 0;
}

.ctct-form-wrapper .ctct-form-field-email {
	flex: 1 1 220px;
}

.ctct-form-wrapper .ctct-form-field-submit {
	flex: 0 0 auto;
}

/* Show the "Email" label above the field, in white to read against the green banner.
   Still scoped to span. deliberately: Constant Contact puts .ctct-label-top on the
   <input> too, and an unscoped selector would restyle the field itself. */
.ctct-form-wrapper span.ctct-label-top {
	display: block;
	margin-bottom: 0.4rem;
	color: var( --hb-white );
	font-family: var( --wp--preset--font-family--display );
	font-size: 0.8rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* Hide the required asterisk. The input still carries required/aria-required, so this
   is visual only. Note the plugin's class name is misspelled "indicatior". */
.ctct-form-wrapper .ctct-required-indicatior {
	display: none;
}

/* Modern pill-shaped input: matches the rounded language used everywhere else on
   the site (buttons, date badges), soft shadow for depth, no visible border. */
.ctct-form-wrapper input.ctct-email {
	width: 100%;
	box-sizing: border-box;
	padding: 0.85em 1.5em;
	background-color: var( --hb-white );
	color: var( --hb-ink );
	border: 2px solid transparent;
	border-radius: 15px;
	box-shadow: 0 2px 10px rgba( 0, 0, 0, 0.15 );
	font-family: var( --wp--preset--font-family--body );
	font-size: 1rem;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.ctct-form-wrapper input.ctct-email:focus {
	outline: none;
	border-color: var( --hb-green );
	box-shadow: 0 2px 12px rgba( 0, 0, 0, 0.2 );
}

/* Button matches the site's sitewide button conventions exactly: same padding
   rhythm and weight as .wp-element-button, transparent border reserved so the
   hover state doesn't shift size, hover-inverts like our other dark-section
   buttons (transparent bg + white border, text stays white). */
.ctct-form-wrapper input.ctct-submit {
	display: inline-block;
	background-color: var( --hb-white );
	color: var( --hb-green-dark );
	border: 2px solid transparent;
	border-radius: 999px;
	padding: 0.8em 1.85em;
	font-family: var( --wp--preset--font-family--body );
	font-weight: 700;
	font-size: 1rem;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ctct-form-wrapper input.ctct-submit:hover {
	background-color: transparent;
	border-color: var( --hb-white );
	color: var( --hb-white );
}

/* Post-submission notice. The plugin ships #2ecc40 border + dark green text, which
   clashes with the dark-green banner behind it — recolor the whole notice white. */
.ctct-form-wrapper .ctct-message.ctct-success {
	background-color: rgba( 255, 255, 255, 0.12 );
	border-color: var( --hb-white );
	color: var( --hb-white );
}

/* The dismiss "x" on the notice isn't useful here — hide it. */
.ctct-form-wrapper .ctct-message .ctct-dismiss-ajax-notice {
	display: none;
}

/* === buttons === */
/* Base button color/shape/padding now set natively in theme.json (styles.elements.button),
   editable via Site Editor > Styles > Blocks > Button. Only hover states stay here since
   Gutenberg has no hover-color control yet. A transparent border is reserved on the
   default state so the hover border doesn't shift the button's size. */
.wp-element-button {
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Primary (filled) buttons only: reserve an invisible border matching the hover
   border's width, so the hover state doesn't shift the button's size. Scoped away
   from .is-style-outline, which already has its own real border in both states. */
.wp-block-button:not( .is-style-outline ) .wp-element-button {
	border: 2px solid transparent;
}

/* Primary (filled) buttons: hover becomes a green outline. Text defaults to green too,
   since that stays readable on light backgrounds — including default WordPress areas
   like the comment form, which have no background-color class to scope against. */
.wp-block-button:not( .is-style-outline ) .wp-element-button:hover {
	background-color: transparent;
	border-color: var( --hb-green );
	color: var( --hb-green );
}

/* Within dark (navy / dark green) sections, keep the hover text white instead —
   green would blend in too much against those backgrounds. */
.has-brand-navy-background-color .wp-block-button:not( .is-style-outline ) .wp-element-button:hover,
.has-brand-green-dark-background-color .wp-block-button:not( .is-style-outline ) .wp-element-button:hover {
	color: var( --hb-white );
}

/* Outline buttons: hover fills in, matching the default primary look. */
.wp-block-button.is-style-outline .wp-element-button:hover {
	background-color: var( --hb-green );
	border-color: var( --hb-green );
	color: var( --hb-white );
}

/* === responsive === */
@media ( max-width: 781px ) {
	.hb-signup h2 {
		text-align: center;
		margin-bottom: var( --wp--preset--spacing--20 ) !important;
	}

	.hb-bio {
		padding-top: 0;
	}

	.hb-bio-photo {
		width: 78%;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 0;
		margin-top: -3.75rem !important;
		position: relative;
		z-index: 1;
		border: 8px solid var( --hb-white );
		border-radius: 12px;
		box-shadow: 0 16px 28px rgba( 0, 0, 0, 0.28 );
		overflow: hidden;
	}

	.hb-hero {
		min-height: 50vh !important;
	}

	.hb-services .wp-block-list {
		gap: 0.6rem;
	}

	.hb-services .wp-block-list li {
		gap: 0.5rem;
		padding: 0.5em 0.8em;
		font-size: 0.8rem;
	}

	.hb-services .wp-block-list li::before {
		width: 10px;
		height: 10px;
	}

	.hb-services .wp-block-gallery {
		grid-template-columns: repeat( 3, 1fr ) !important;
		column-gap: 0.4rem !important;
		row-gap: 0.4rem !important;
	}

	.hb-services .wp-block-gallery figure.wp-block-image {
		max-width: 100% !important;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.hb-newsletter-readmore::after,
	.hb-newsletter-readmore,
	.hb-newsletter-pagination .page-numbers,
	.hb-newsletter-pagination .wp-block-query-pagination-previous,
	.hb-newsletter-pagination .wp-block-query-pagination-next,
	.wp-element-button,
	.ctct-form-wrapper input.ctct-email,
	.ctct-form-wrapper input.ctct-submit {
		transition: none;
	}
}
