/* Page-level styles from the <helmet> of _redesign_project/Fellowship Site.dc.html.
   Section markup copies the design's inline styles, so most layout lives in the
   components. This file holds what inline styles can't express: the navy
   accent, hover states (the design's style-hover), and breakpoints the design
   computed in JavaScript. */


:root {
	--color-accent: #1c2f57;
	--color-accent-100: #eef2f9;
	--color-accent-200: #dde4f1;
	--color-accent-300: #bccbe4;
	--color-accent-400: #8ea6cf;
	--color-accent-500: #3f5f99;
	--color-accent-600: #27417a;
	--color-accent-700: #1c2f57;
	--color-accent-800: #142342;
	--color-accent-900: #0d172d;
	--color-divider: color-mix(in srgb, #201e1d 16%, transparent);
	--gutter: clamp(20px, 4vw, 56px);
}

body {
	margin: 0;
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	-webkit-font-smoothing: antialiased;
}

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	color: var(--color-accent-500);
}

@keyframes fmRise {
	from {
		opacity: 0;
		transform: translateY(0.35em);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

html {
	scroll-padding-top: 76px;
}

.fm-skip {
	position: absolute;
	left: -9999px;
	top: 8px;
	z-index: 100;
	padding: 12px 16px;
	background: var(--color-accent);
	color: var(--color-bg);
	font-weight: 800;
}

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

/* Photos fill their frame, like the design's absolutely positioned <img> */
.fm-fill {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---- hover states (the design's style-hover attributes) ---- */

.fm-h-accent:hover {
	background: var(--color-accent-600) !important;
	color: var(--color-bg) !important;
}

.fm-h-light:hover {
	background: var(--color-accent-200) !important;
	color: var(--color-accent) !important;
}

.fm-h-card:hover {
	background: var(--color-accent) !important;
	color: var(--color-bg) !important;
}

.fm-h-row:hover {
	background: var(--color-accent-200) !important;
	color: var(--color-text) !important;
}

.fm-h-chip:hover {
	background: var(--color-bg) !important;
	color: var(--color-accent) !important;
}

.fm-h-toggle:hover {
	color: var(--color-accent-500) !important;
}

/* ---- header: the design switches layouts at 960px ---- */

.fm-nav-narrow,
.fm-nav-menu {
	display: none !important;
}

@media (max-width: 959px) {
	.fm-nav-wide {
		display: none !important;
	}

	.fm-nav-narrow {
		display: block !important;
	}

	.is-open .fm-nav-menu {
		display: flex !important;
	}
}

/* ---- home hero rotating words ---- */

.fm-hero-word {
	display: block;
	min-height: 0.92em;
	text-wrap: balance;
	animation: fmRise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@media (max-width: 719px) {
	.fm-hero-word {
		min-height: 1.84em;
	}
}

/* ---- ministries: two columns with a sticky photo from 1040px ---- */

.fm-ministry-photo {
	margin: 0;
	position: static;
	top: 100px;
	aspect-ratio: 16 / 9;
	max-height: none;
	overflow: hidden;
	background: var(--color-surface);
}

@media (min-width: 1040px) {
	.fm-ministry-photo {
		position: sticky;
		aspect-ratio: 4 / 5;
		max-height: 78vh;
	}

	.fm-ministry-flip .fm-ministry-photo {
		order: 2;
	}
}

/* ---- beliefs accordion ---- */

.fm-belief-panel {
	display: grid;
	grid-template-rows: 0fr;
	opacity: 0;
	transition:
		grid-template-rows 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
		opacity 0.35s ease;
}

.fm-belief-panel > div {
	overflow: hidden;
	min-height: 0;
}

.fm-belief-sign {
	transform: rotate(0deg);
	transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.is-open > .fm-belief-panel {
	grid-template-rows: 1fr;
	opacity: 1;
}

.is-open > .fm-belief-panel > div {
	overflow: visible;
}

.is-open > button .fm-belief-sign {
	transform: rotate(45deg);
}

.fm-ref-chip {
	background: var(--color-accent-200);
	color: var(--color-accent);
}

.fm-ref.is-open .fm-ref-chip {
	background: var(--color-accent);
	color: var(--color-bg);
}

.fm-ref-pop {
	display: none;
}

.fm-ref.is-open .fm-ref-pop {
	display: block;
}

/* ---- rich text (sermon notes and generic text sections) ---- */

.fm-prose {
	display: flex;
	flex-direction: column;
	gap: 14px;
	font-size: 17px;
	line-height: 1.65;
	max-width: 62ch;
}

.fm-prose p,
.fm-prose ul,
.fm-prose ol {
	margin: 0;
}

.fm-prose h2 {
	margin: 12px 0 0;
	font-size: 32px;
	line-height: 1.05;
	letter-spacing: -0.03em;
}

.fm-prose h3 {
	margin: 8px 0 0;
	font-size: 16px;
	color: var(--color-accent);
}

.fm-prose ul,
.fm-prose ol {
	padding-left: 1.2em;
}

.fm-prose a {
	font-weight: 600;
	color: var(--color-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.fm-prose blockquote {
	margin: 0;
	padding-left: 20px;
	border-left: 2px solid var(--color-accent);
	font-weight: 600;
}

/* ---- sermon player (src/pages/podcast/[slug].astro): one slim bar ---- */

.fm-player {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 10px 18px 10px 10px;
	/* Sits on the gray header, so it takes the page color */
	background: var(--color-bg);
}

.fm-player-play {
	width: 48px;
	height: 48px;
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: var(--color-accent);
	color: var(--color-bg);
	cursor: pointer;
}

.fm-player-play:hover {
	background: var(--color-accent-600);
}

.fm-player-play svg {
	width: 16px;
	height: 16px;
}

.fm-player-play .fm-icon-pause,
.fm-player.is-playing .fm-player-play .fm-icon-play {
	display: none;
}

.fm-player.is-playing .fm-player-play .fm-icon-pause {
	display: block;
}

.fm-player-time {
	flex: none;
	min-width: 5ch;
	font-size: 14px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.fm-player-time[data-total] {
	color: var(--color-neutral-700);
	text-align: right;
}

.fm-player-seek {
	--p: 0%;
	-webkit-appearance: none;
	appearance: none;
	flex: 1 1 0;
	min-width: 0;
	height: 24px;
	margin: 0;
	background: transparent;
	cursor: pointer;
}

.fm-player-seek::-webkit-slider-runnable-track {
	height: 3px;
	background: linear-gradient(to right, var(--color-accent) var(--p), var(--color-neutral-300) var(--p));
}

.fm-player-seek::-moz-range-track {
	height: 3px;
	background: var(--color-neutral-300);
}

.fm-player-seek::-moz-range-progress {
	height: 3px;
	background: var(--color-accent);
}

.fm-player-seek::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 3px;
	height: 15px;
	margin-top: -6px;
	border: 0;
	border-radius: 0;
	background: var(--color-accent);
}

.fm-player-seek::-moz-range-thumb {
	width: 3px;
	height: 15px;
	border: 0;
	border-radius: 0;
	background: var(--color-accent);
}

.fm-player-tool {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 6px;
	border: 0;
	background: transparent;
	color: var(--color-accent);
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
}

.fm-player-tool:hover {
	background: var(--color-accent-200);
	color: var(--color-accent);
}

.fm-player :focus-visible {
	outline: 2px solid var(--color-accent-500);
	outline-offset: 2px;
}

@media (max-width: 520px) {
	.fm-player {
		gap: 10px;
		padding-right: 10px;
	}

	.fm-player-time[data-total] {
		display: none;
	}
}

/* Quiet rows for the nearby-messages list */
.fm-row-quiet:hover {
	background: var(--color-surface);
	color: var(--color-text) !important;
}

/* ---- "Listen on" podcast badges (src/components/PodcastBadges.astro) ---- */

.fm-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.fm-badge {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 48px;
	padding: 0 15px 0 12px;
	background: var(--color-bg);
	color: #000;
}

.fm-badge:hover {
	background: var(--color-accent-200);
	color: #000;
}

.fm-badge img {
	display: block;
	max-width: none;
	width: auto;
}

.fm-badge > img {
	height: 26px;
}

.fm-badge-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	/* Matches the "Listen on" line in Apple's badge */
	font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 9.5px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.01em;
}

.fm-badge-text img {
	height: 16px;
}

/* ---- events list (src/pages/events/index.astro): stack rows on phones ---- */

@media (max-width: 600px) {
	.fm-newsletter-year {
		flex-direction: column;
	}

	.fm-event-row {
		flex-direction: column;
		align-items: stretch !important;
		padding: 12px 12px 20px !important;
	}

	.fm-event-row > figure {
		width: 100% !important;
		aspect-ratio: 16 / 9 !important;
	}

	.fm-event-row > span:not(.fm-event-arrow) {
		padding: 0 8px;
	}

	.fm-event-arrow {
		display: none;
	}
}
