/*
Theme Name: ThemeOne
Author: Nate Paine
Description: A clean, mobile-friendly block theme for Indian Valley Faith Fellowship.
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
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: themeone
Tags: full-site-editing, block-patterns, wide-blocks, custom-colors, one-column
*/

/* Most styling lives in theme.json. Keep this file for the few things theme.json can't express. */

/* Header logo: smaller on phones so it fits beside the menu and buttons. */
@media (max-width: 600px) {
	.themeone-logo img {
		width: 170px !important;
	}
}

/* Open cards: photo on top, text below, no box. */
.themeone-card .themeone-card__image {
	margin: 0 0 var(--wp--preset--spacing--30);
}

.themeone-card .themeone-card__image img {
	width: 100%;
	display: block;
}

/* Linked headings read as headings: no underline until hovered. */
.wp-block-heading a {
	color: inherit;
	text-decoration: none;
}

.wp-block-heading a:hover,
.wp-block-heading a:focus-visible {
	text-decoration: underline;
}

/* Events and staff lists: text fills the row beside the photo, and wraps below it on narrow screens. */
.themeone-event__text,
.themeone-person__text {
	flex: 1 1 18rem;
	min-width: 0;
}

.themeone-event__text > .wp-block-post-content > :first-child {
	margin-top: 0.5rem;
}

.themeone-person__text > .wp-block-heading:first-child {
	margin-top: 0;
}

.themeone-person .wp-block-image {
	margin: 0;
}

/* Embedded Google map (Plan Your Visit, Contact). */
.themeone-map iframe {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	border: 0;
}


/* ------------------------------------------------------------------
 * Servantly sermon plugin: match the theme - square corners, no shadows,
 * theme fonts. Its colors are set in its settings (themeone_servantly_palette()).
 * ------------------------------------------------------------------ */
body {
	--servantly-radius: 0;
	--servantly-shadow: none;
}

:is(.servantly-sermons-page, .servantly-sermon-page, .servantly-single, .servantly-hero, .servantly-watch, .servantly-recent, .servantly-library, .servantly-countdown-banner, .servantly-live-banner, .servantly-res-drawer),
:is(.servantly-sermons-page, .servantly-sermon-page, .servantly-single, .servantly-hero, .servantly-watch, .servantly-recent, .servantly-library, .servantly-countdown-banner, .servantly-live-banner, .servantly-res-drawer) *:not(.servantly-live-banner__dot, .servantly-spinner, .servantly-watch__live-dot) {
	border-radius: 0 !important;
	box-shadow: none !important;
}

:is(.servantly-sermons-page, .servantly-sermon-page, .servantly-single, .servantly-hero, .servantly-watch) :is(h1, h2, h3, h4) {
	font-family: var(--wp--preset--font-family--heading) !important;
	font-weight: 400 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
}

/* Single sermon: the theme's layout already sets the width, so undo the plugin's full-viewport
 * "breakout" (100vw + left: 50%), which conflicts with it and shifts the content left. */
.themeone-sermon .servantly-single__bg-wrap {
	width: auto !important;
	max-width: 880px !important;
	left: auto !important;
	right: auto !important;
	margin-left: auto !important;
	margin-right: auto !important;
	background: transparent !important;
}

.themeone-sermon .servantly-single__content-inner {
	padding: 0 0 var(--wp--preset--spacing--40) !important;
}

/* On the sermon library, the theme prints the page banner and livestream block instead of the
 * plugin's stretched-thumbnail header; its "Most Recent Sermons" strip just repeats the library. */
.page-template-page-sermons .servantly-hero,
.page-template-page-sermons .servantly-recent {
	display: none !important;
}

.themeone-sermon .themeone-outline-label {
	display: block;
	margin-bottom: 0.25rem;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 400;
}

/* ------------------------------------------------------------------
 * Mobile menu (navigation overlay): left-aligned with margins.
 * The header menu is right-justified on desktop, which the overlay
 * would otherwise inherit.
 * ------------------------------------------------------------------ */
.wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--40) var(--wp--preset--spacing--50) !important;
	background-color: var(--wp--preset--color--base) !important;
	color: var(--wp--preset--color--contrast) !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-close {
	max-width: none;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	top: var(--wp--preset--spacing--40);
	right: var(--wp--preset--spacing--40);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: stretch !important;
	padding-top: var(--wp--preset--spacing--50) !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: stretch !important;
	gap: 0 !important;
	width: 100%;
}

/* Top-level items: full width, divided by thin lines. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item {
	align-items: flex-start !important;
	width: 100%;
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--wp--preset--color--base-2);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	padding: 0 !important;
}

/* Sub-items: indented under their section with a short blue rule. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	align-items: flex-start !important;
	gap: 0.15rem !important;
	margin-top: 0.5rem !important;
	padding: 0 0 0 1rem !important;
	border-left: 3px solid var(--wp--preset--color--primary) !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	font-size: var(--wp--preset--font-size--medium);
	padding: 0.35rem 0 !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:focus-visible {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
}

/* Tablets (600–959px): the full menu no longer fits beside the logo, so use the hamburger menu there
 * too (WordPress only switches below 600px). */
@media (min-width: 600px) and (max-width: 959px) {
	.wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex !important;
	}

	.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none !important;
	}
}

/* Two-column lists (e.g. New Friends goals and afternoon extras); one column on phones. */
.themeone-two-col {
	columns: 2 16rem;
	column-gap: var(--wp--preset--spacing--50);
}

.themeone-two-col li {
	break-inside: avoid;
	margin-bottom: 0.4rem;
}

/* A page that ends with a full-width colored band sits flush against the footer
 * (cancels the page template's bottom padding). */
.wp-block-post-content > .alignfull.has-background:last-child {
	margin-bottom: calc(-1 * var(--wp--preset--spacing--60)) !important;
}

/* Page banners (page template, sermon library, sermon tag pages): compact. With a featured photo
 * ~220px and a lighter tint so the photo shows; without one, a slim title band at full tint. */
.wp-block-cover.themeone-page-banner {
	min-height: 220px !important;
	padding-top: var(--wp--preset--spacing--40) !important;
	padding-bottom: var(--wp--preset--spacing--40) !important;
}

.wp-block-cover.themeone-page-banner:not(:has(.wp-block-cover__image-background)) {
	min-height: 150px !important;
}

.wp-block-cover.themeone-page-banner:not(:has(.wp-block-cover__image-background)) .wp-block-cover__background {
	opacity: 1 !important;
}

.wp-block-cover.themeone-page-banner h1 {
	text-shadow: 0 1px 12px rgba(30, 43, 54, 0.35);
}

/* Subsection items (text "cards" with a top rule - Adult Ministries, NowKids, New Friends classes,
 * Church leadership, sermon series…). Their 3px rule is saved in page content as inline style, so it's
 * restyled here: a faint hairline separates items, and a short Valley Blue underline sits under each
 * title so the title is the focus. */
.wp-block-group[style*="border-top-width:3px"] {
	/* Same weight and color as the dividers between events. */
	border-top-width: 2px !important;
	border-top-color: var(--wp--preset--color--base-2) !important;
	padding-top: var(--wp--preset--spacing--40) !important;
}

/* On a Mist-colored band the Mist divider would vanish, so use a deeper tint there. */
.has-base-2-background-color .wp-block-group[style*="border-top-width:3px"] {
	border-top-color: rgba(30, 43, 54, 0.12) !important;
}

.wp-block-group[style*="border-top-width:3px"] > .wp-block-heading:first-child {
	margin-top: 0;
}

.wp-block-group[style*="border-top-width:3px"] > .wp-block-heading:first-child::after {
	content: "";
	display: block;
	width: 7.5rem;
	height: 3px;
	margin-top: 0.6rem;
	background: var(--wp--preset--color--primary);
}

/* Title card for events without an image (see themeone_event_title_card() in inc/gcal-sync.php):
 * the event name on the valley-sky gradient with the site's cross-and-hills icon. */
.themeone-title-card {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 16 / 9;
	padding: 1rem 1.25rem;
	box-sizing: border-box;
	background: var(--wp--preset--gradient--valley-sky);
	color: var(--wp--preset--color--base);
	text-align: center;
	overflow: hidden;
}

.themeone-title-card__text {
	font-family: var(--wp--preset--font-family--heading, Georgia, serif);
	font-size: clamp(1.1rem, 2.2vw, 1.6rem);
	line-height: 1.2;
	text-wrap: balance;
}

.themeone-title-card__icon {
	position: absolute;
	right: 0.6rem;
	bottom: 0.6rem;
	width: 1.6rem;
	height: 1.6rem;
	opacity: 0.85;
}

/* In the narrow event-list thumbnails, keep the card text small enough to fit. */
.themeone-event .themeone-title-card__text {
	font-size: 1.05rem;
}

/* Event pages (templates/single-event.html): picture on the left, title and details on the right;
 * stacked on narrow screens. */
.themeone-event-page__back {
	margin-bottom: var(--wp--preset--spacing--40);
}

.themeone-event-page__back a {
	text-decoration: none;
}

.themeone-event-page__image {
	flex: 0 1 380px;
	margin: 0;
}

.themeone-event-page__image img:not(.themeone-title-card__icon) {
	width: 100%;
	height: auto;
	display: block;
}

.themeone-event-page__text {
	flex: 1 1 22rem;
	min-width: 0;
	max-width: 42rem;
}

.themeone-event-page__title {
	margin-top: 0;
	font-size: clamp(2rem, 4vw, 2.75rem);
	line-height: 1.15;
}

/* Details panel (When / Next or Dates / Where), generated by the calendar sync. */
.themeone-event-meta {
	margin: var(--wp--preset--spacing--40) 0;
	padding: var(--wp--preset--spacing--30) 0;
	border-top: 2px solid var(--wp--preset--color--base-2);
	border-bottom: 2px solid var(--wp--preset--color--base-2);
}

.themeone-event-meta > * + * {
	margin-top: 0.6rem;
}

.themeone-event-meta__row {
	display: grid;
	grid-template-columns: 4.5rem minmax(0, 1fr);
	gap: 0 1rem;
	margin: 0;
	line-height: 1.5;
}

.themeone-event-meta__label {
	padding-top: 0.2rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--secondary);
}

.themeone-event-meta__value {
	font-weight: 600;
}

/* In the Events list rows the panel is lighter: no rules or padding. */
.themeone-event .themeone-event-meta {
	margin: 0.5rem 0 0.75rem;
	padding: 0;
	border: 0;
}

.themeone-event .themeone-event-meta > * + * {
	margin-top: 0.25rem;
}

/* Site alert (inc/site-alert.php): a Valley Blue bar above the header on every page, and a box on
 * the homepage banner. */
.themeone-alert {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	text-align: center;
	padding: 0.75rem var(--wp--preset--spacing--40);
}

.themeone-alert p,
.themeone-alert-box p {
	margin: 0;
	line-height: 1.45;
}

.themeone-alert a {
	color: inherit;
	text-decoration: underline;
	white-space: nowrap;
}

.themeone-alert-box {
	max-width: 36rem;
	margin: 0 auto var(--wp--preset--spacing--40);
	padding: 0.9rem 1.25rem;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	border-left: 6px solid var(--wp--preset--color--primary);
	border-radius: 2px;
	text-align: left;
	font-size: 1.05rem;
}

.themeone-alert-box a {
	color: var(--wp--preset--color--primary) !important;
	font-weight: 600;
}

/* Past event pages (kept ~3 months for the calendar): a note, and no RSVP button. */
.themeone-event-past-note {
	margin: 0 0 var(--wp--preset--spacing--30);
	padding: 0.6rem 0.9rem;
	background: var(--wp--preset--color--base-2);
	border-left: 4px solid var(--wp--preset--color--secondary);
	font-weight: 600;
}

.themeone-event-is-past .themeone-event-page .wp-block-post-content .wp-block-buttons {
	display: none;
}


/* Following Jesus page: a numbered path of steps joined by a line (vertical, so it reads the same
 * on phones), and the three means of grace. */
.themeone-path {
	counter-reset: themeone-step;
	position: relative;
	margin-top: var(--wp--preset--spacing--50);
}

.themeone-path::before {
	content: "";
	position: absolute;
	top: 1.5rem;
	bottom: 1.5rem;
	left: 1.375rem;
	width: 3px;
	background: var(--wp--preset--color--base-2);
}

.themeone-path > .themeone-path__step {
	counter-increment: themeone-step;
	position: relative;
	margin: 0;
	padding: 0 0 var(--wp--preset--spacing--50) 4.25rem;
}

.themeone-path > .themeone-path__step::before {
	content: counter(themeone-step);
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	font-family: var(--wp--preset--font-family--heading, Georgia, serif);
	font-size: 1.35rem;
}

.themeone-path__step > .wp-block-heading:first-child {
	margin-top: 0.35rem;
}

.themeone-path__means {
	color: var(--wp--preset--color--secondary);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.04em;
}

/* Highlighted Bible verse (Following Jesus page): large serif text with a Valley Blue rule. */
.wp-block-quote.themeone-verse {
	margin: 0 0 var(--wp--preset--spacing--50);
	padding: 0.25rem 0 0.25rem var(--wp--preset--spacing--40);
	border-left: 4px solid var(--wp--preset--color--primary);
}

.wp-block-quote.themeone-verse p {
	font-family: var(--wp--preset--font-family--heading, Georgia, serif);
	font-size: clamp(1.4rem, 3vw, 1.9rem);
	line-height: 1.35;
	font-style: normal;
	margin: 0;
}

.wp-block-quote.themeone-verse cite {
	display: block;
	margin-top: 0.75rem;
	color: var(--wp--preset--color--secondary);
	font-size: var(--wp--preset--font-size--small);
	font-style: normal;
	font-weight: 600;
	letter-spacing: 0.04em;
}
