/* ==========================================================================
   Sandy Plains ARP Church — Component Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Global Base
   -------------------------------------------------------------------------- */

html {
	scroll-behavior: smooth;
}

::selection {
	background: rgba(201, 168, 76, 0.25);
	color: var(--sp-primary);
}

body {
	background-color: var(--sp-surface-light);
	color: var(--sp-text);
	font-family: var(--sp-font-body);
}

/* --------------------------------------------------------------------------
   Section Labels — Playfair Display SC small-caps
   -------------------------------------------------------------------------- */

.sp-section-label {
	font-family: var(--sp-font-accent);
	text-transform: uppercase;
	letter-spacing: 0.15em;
	color: var(--sp-accent);
	font-size: 0.85rem;
	font-weight: 400;
	margin-bottom: var(--sp-space-sm) !important;
}

/* --------------------------------------------------------------------------
   Gold Accent Rule
   -------------------------------------------------------------------------- */

.sp-gold-rule {
	border: none;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--sp-accent), transparent);
	margin: var(--sp-space-lg) auto;
	max-width: 120px;
}

.sp-gold-rule-left {
	border: none;
	height: 2px;
	background: linear-gradient(90deg, var(--sp-accent), transparent);
	max-width: 80px;
	margin: var(--sp-space-sm) 0;
}

/* --------------------------------------------------------------------------
   Header — Sticky Green Nav
   -------------------------------------------------------------------------- */

.sp-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: var(--sp-primary);
	border-bottom: 1px solid rgba(201, 168, 76, 0.2);
	transition: box-shadow var(--sp-ease);
}

.sp-header .wp-block-site-title a {
	color: var(--sp-white) !important;
	text-decoration: none !important;
	font-family: var(--sp-font-heading);
	font-weight: 700;
	letter-spacing: 0.02em;
}

.sp-header .wp-block-navigation-item a {
	color: rgba(255, 255, 255, 0.9) !important;
	text-decoration: none !important;
	font-family: var(--sp-font-body);
	font-weight: 500;
	position: relative;
	padding-bottom: 4px;
	transition: color var(--sp-ease);
}

.sp-header .wp-block-navigation-item a::after {
	content: '';
	position: absolute;
	bottom: -2px;
	left: 0;
	width: 0;
	height: 2px;
	background: var(--sp-accent);
	transition: width var(--sp-ease);
}

.sp-header .wp-block-navigation-item a:hover {
	color: var(--sp-accent) !important;
}

.sp-header .wp-block-navigation-item a:hover::after {
	width: 100%;
}

/* Mobile nav overlay */
.wp-block-navigation__responsive-container.is-menu-open {
	background: var(--sp-primary);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item a {
	color: var(--sp-white) !important;
}

/* --------------------------------------------------------------------------
   Hero / Cover Block
   -------------------------------------------------------------------------- */

.sp-hero {
	position: relative;
}

.sp-hero .wp-block-cover__inner-container {
	max-width: var(--sp-wide-width);
	text-align: center;
}

.sp-hero h1 {
	font-family: var(--sp-font-heading);
	color: var(--sp-white) !important;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sp-hero p {
	color: rgba(255, 255, 255, 0.85) !important;
}

/* Scroll indicator */
.sp-scroll-indicator {
	text-align: center;
	margin-top: var(--sp-space-xl);
	animation: sp-bounce 2s ease infinite;
	color: rgba(255, 255, 255, 0.6);
}

@keyframes sp-bounce {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(8px); }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.wp-block-button__link {
	font-family: var(--sp-font-body);
	font-weight: 600;
	transition: all var(--sp-ease);
	position: relative;
	overflow: hidden;
}

.wp-block-button__link:hover {
	transform: translateY(-1px);
	box-shadow: var(--sp-shadow-md);
}

.wp-block-button__link:active {
	transform: translateY(0);
}

/* Gold button (default) */
.sp-btn-gold .wp-block-button__link {
	background: var(--sp-accent) !important;
	color: var(--sp-surface-dark) !important;
}

.sp-btn-gold .wp-block-button__link:hover {
	background: #b8973f !important;
}

/* Outline button */
.wp-block-button.is-style-outline .wp-block-button__link {
	border: 2px solid currentColor;
	background: transparent !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: rgba(255, 255, 255, 0.1) !important;
}

/* --------------------------------------------------------------------------
   Service Times Cards
   -------------------------------------------------------------------------- */

.sp-service-icon {
	text-align: center;
	margin-bottom: var(--sp-space-sm);
}

.sp-service-icon svg {
	display: inline-block;
}

.sp-service-divider {
	width: 1px;
	background: var(--sp-accent);
	align-self: stretch;
	opacity: 0.4;
}

/* --------------------------------------------------------------------------
   Sermon Cards
   -------------------------------------------------------------------------- */

.sp-sermon-card {
	background: rgba(247, 243, 236, 0.95);
	border-radius: var(--sp-radius-lg);
	padding: var(--sp-space-md);
	transition: transform var(--sp-ease), box-shadow var(--sp-ease);
	border: 1px solid rgba(201, 168, 76, 0.15);
}

.sp-sermon-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--sp-shadow-lg);
}

.sp-sermon-card .wp-block-post-featured-image img {
	border-radius: var(--sp-radius-md);
}

.sp-sermon-card .wp-block-post-title a {
	font-family: var(--sp-font-heading);
	color: var(--sp-primary) !important;
	text-decoration: none;
}

.sp-sermon-card .wp-block-post-title a:hover {
	color: var(--sp-secondary) !important;
}

/* --------------------------------------------------------------------------
   Staff Cards
   -------------------------------------------------------------------------- */

.sp-staff-card {
	text-align: center;
	padding: var(--sp-space-lg) var(--sp-space-md);
}

.sp-staff-photo {
	width: 160px;
	height: 160px;
	border-radius: var(--sp-radius-full);
	overflow: hidden;
	margin: 0 auto var(--sp-space-md);
	border: 3px solid var(--sp-accent);
	box-shadow: var(--sp-shadow-md);
}

.sp-staff-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sp-staff-card h3 {
	font-family: var(--sp-font-heading);
	margin-bottom: 4px !important;
}

.sp-staff-title {
	color: var(--sp-accent);
	font-weight: 600;
	font-size: 0.9rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: var(--sp-space-sm) !important;
}

/* --------------------------------------------------------------------------
   About Page — Belief Cards
   -------------------------------------------------------------------------- */

.sp-belief-card {
	position: relative;
	padding: var(--sp-space-md) var(--sp-space-sm) var(--sp-space-sm);
	background: var(--sp-white);
	border-radius: var(--sp-radius-lg);
	border: 1px solid rgba(201, 168, 76, 0.15);
	transition: transform var(--sp-ease), box-shadow var(--sp-ease);
}

.sp-belief-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--sp-shadow-md);
}

.sp-belief-card h3 {
	position: relative;
	padding-bottom: 10px;
}

.sp-belief-card h3::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 32px;
	height: 2px;
	background: var(--sp-accent);
	border-radius: 1px;
}

/* --------------------------------------------------------------------------
   About Page — Heritage Quote
   -------------------------------------------------------------------------- */

.sp-about-quote {
	margin: 32px auto;
	max-width: 520px;
	text-align: center;
}

.sp-about-quote blockquote {
	margin: 0;
	padding: 24px 32px;
	background: rgba(255, 255, 255, 0.07);
	border-radius: var(--sp-radius-lg);
	border-left: 3px solid var(--sp-accent);
}

.sp-about-quote blockquote p {
	font-family: var(--sp-font-heading);
	font-size: 1.15rem;
	font-style: italic;
	line-height: 1.6;
	color: var(--sp-accent);
	margin: 0 0 8px;
}

.sp-about-quote blockquote cite {
	font-family: var(--sp-font-body);
	font-style: normal;
	font-size: 0.85rem;
	color: rgba(255, 255, 255, 0.55);
	letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   About Page — Pastor Photo
   -------------------------------------------------------------------------- */

.sp-pastor-photo {
	width: 180px;
	height: 180px;
	border-radius: var(--sp-radius-full);
	overflow: hidden;
	border: 3px solid var(--sp-accent);
	box-shadow: var(--sp-shadow-md);
	margin: 0 auto;
}

.sp-pastor-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* --------------------------------------------------------------------------
   About Page — Service Time Pills
   -------------------------------------------------------------------------- */

.sp-expect-time {
	box-shadow: var(--sp-shadow-sm);
	border: 1px solid rgba(201, 168, 76, 0.12);
	transition: transform var(--sp-ease);
}

.sp-expect-time:hover {
	transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   History Page — Timeline
   -------------------------------------------------------------------------- */

.sp-timeline {
	position: relative;
	padding: 32px 0 16px;
}

/* Vertical center line */
.sp-timeline::before {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 2px;
	background: linear-gradient(180deg, var(--sp-accent), var(--sp-primary), var(--sp-accent));
	transform: translateX(-50%);
}

.sp-timeline-item {
	position: relative;
	display: flex;
	align-items: flex-start;
	margin-bottom: 48px;
	width: 100%;
}

.sp-timeline-item:last-child {
	margin-bottom: 0;
}

/* Dot on the center line */
.sp-timeline-dot {
	position: absolute;
	left: 50%;
	top: 8px;
	width: 14px;
	height: 14px;
	background: var(--sp-accent);
	border: 3px solid var(--sp-white);
	border-radius: var(--sp-radius-full);
	transform: translateX(-50%);
	box-shadow: 0 0 0 3px var(--sp-accent);
	z-index: 1;
}

/* Card */
.sp-timeline-card {
	width: calc(50% - 40px);
	background: var(--sp-white);
	border: 1px solid rgba(201, 168, 76, 0.15);
	border-radius: var(--sp-radius-lg);
	padding: 24px 28px;
	transition: transform var(--sp-ease), box-shadow var(--sp-ease);
}

.sp-timeline-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--sp-shadow-md);
}

/* Left-aligned items: card on left side */
.sp-timeline-left .sp-timeline-card {
	margin-right: auto;
}

/* Right-aligned items: card on right side */
.sp-timeline-right .sp-timeline-card {
	margin-left: auto;
}

/* Year badge */
.sp-timeline-year {
	display: inline-block;
	font-family: var(--sp-font-accent);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--sp-white);
	background: var(--sp-primary);
	padding: 4px 14px;
	border-radius: var(--sp-radius-full);
	margin-bottom: 10px;
}

.sp-timeline-card h3 {
	font-family: var(--sp-font-heading);
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--sp-primary);
	margin: 0 0 8px;
	line-height: 1.3;
}

.sp-timeline-card p {
	font-family: var(--sp-font-body);
	font-size: 0.9rem;
	line-height: 1.7;
	color: var(--sp-text);
	margin: 0;
}

/* Mobile: single column, line on left */
@media (max-width: 600px) {
	.sp-timeline::before {
		left: 16px;
	}

	.sp-timeline-dot {
		left: 16px;
	}

	.sp-timeline-left .sp-timeline-card,
	.sp-timeline-right .sp-timeline-card {
		width: calc(100% - 48px);
		margin-left: 48px;
		margin-right: 0;
	}
}

/* --------------------------------------------------------------------------
   Inner Page Hero / Title Banner
   -------------------------------------------------------------------------- */

.sp-inner-hero {
	background: var(--sp-primary);
	text-align: center;
	position: relative;
	overflow: hidden;
}

.sp-inner-hero::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--sp-accent), var(--sp-secondary), var(--sp-accent));
}

.sp-inner-hero h1 {
	color: var(--sp-white) !important;
	font-family: var(--sp-font-heading);
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */

.sp-breadcrumb {
	font-size: 0.85rem;
	color: var(--sp-text-muted);
	margin-bottom: var(--sp-space-lg) !important;
}

.sp-breadcrumb a {
	color: var(--sp-primary);
	text-decoration: none;
}

.sp-breadcrumb a:hover {
	color: var(--sp-secondary);
	text-decoration: underline;
}

.sp-breadcrumb .sep {
	margin: 0 0.5em;
	opacity: 0.5;
}

/* --------------------------------------------------------------------------
   Contact Form Styles
   -------------------------------------------------------------------------- */

.sp-contact-form-wrap {
	max-width: 640px;
	margin: 0 auto;
}

.sp-contact-form .sp-form-field {
	position: relative;
	margin-bottom: 24px;
}

.sp-contact-form input[type="text"],
.sp-contact-form input[type="email"],
.sp-contact-form select,
.sp-contact-form textarea {
	width: 100%;
	padding: 14px 16px;
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius-md);
	font-family: var(--sp-font-body);
	font-size: 1rem;
	color: var(--sp-text);
	background: var(--sp-white);
	transition: border-color var(--sp-ease), box-shadow var(--sp-ease);
	box-sizing: border-box;
}

.sp-contact-form input:focus,
.sp-contact-form select:focus,
.sp-contact-form textarea:focus {
	outline: none;
	border-color: var(--sp-primary);
	box-shadow: 0 0 0 3px rgba(45, 74, 62, 0.1);
}

.sp-contact-form textarea {
	resize: vertical;
	min-height: 120px;
}

.sp-contact-form label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	color: var(--sp-text);
	font-size: 0.9rem;
}

.sp-contact-form label .required {
	color: var(--sp-secondary);
}

.sp-form-submit {
	display: inline-block;
	padding: 14px 36px;
	background: var(--sp-accent);
	color: var(--sp-surface-dark);
	border: none;
	border-radius: var(--sp-radius-md);
	font-family: var(--sp-font-body);
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all var(--sp-ease);
}

.sp-form-submit:hover {
	background: #b8973f;
	transform: translateY(-1px);
	box-shadow: var(--sp-shadow-md);
}

.sp-form-submit:active {
	transform: translateY(0);
}

.sp-form-message {
	padding: 14px 20px;
	border-radius: var(--sp-radius-md);
	margin-bottom: 24px;
	font-weight: 500;
}

.sp-form-success {
	background: #f0f9f4;
	color: #2D4A3E;
	border: 1px solid rgba(45, 74, 62, 0.3);
}

.sp-form-error {
	background: #fef2f2;
	color: #C4622D;
	border: 1px solid rgba(196, 98, 45, 0.3);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.sp-footer {
	position: relative;
}

.sp-footer::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--sp-accent), var(--sp-secondary), var(--sp-accent));
}

.sp-footer h3 {
	color: var(--sp-accent) !important;
	font-family: var(--sp-font-heading);
	font-size: 1.15rem;
}

.sp-footer a {
	transition: color var(--sp-ease);
}

.sp-footer a:hover {
	color: var(--sp-accent) !important;
}

.sp-footer-copyright {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------------------------------
   Sermon Meta Display
   -------------------------------------------------------------------------- */

.sp-sermon-meta {
	display: flex;
	gap: 24px;
	flex-wrap: wrap;
	padding: 16px 20px;
	background: var(--sp-surface-light);
	border-radius: var(--sp-radius-md);
	border-left: 3px solid var(--sp-accent);
	margin-bottom: 24px;
}

.sp-sermon-meta-label {
	font-weight: 600;
	color: var(--sp-primary);
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* --------------------------------------------------------------------------
   Audio Player
   -------------------------------------------------------------------------- */

.wp-block-audio audio {
	width: 100%;
	border-radius: var(--sp-radius-md);
}

.wp-block-audio {
	margin-bottom: 24px;
}

.wp-block-audio figcaption {
	color: var(--sp-text-muted);
	font-size: 0.85rem;
	text-align: center;
	margin-top: 8px;
}

/* --------------------------------------------------------------------------
   Card System
   -------------------------------------------------------------------------- */

.sp-card {
	background: var(--sp-white);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius-lg);
	padding: var(--sp-space-md);
	transition: transform var(--sp-ease), box-shadow var(--sp-ease);
}

.sp-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--sp-shadow-lg);
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

.wp-block-query-pagination-numbers .page-numbers,
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 4px 14px;
	border-radius: var(--sp-radius-md);
	font-weight: 500;
	text-decoration: none;
	color: var(--sp-text);
	border: 1px solid var(--sp-border);
	transition: all var(--sp-ease);
}

.wp-block-query-pagination-numbers .page-numbers:hover,
.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover {
	background: var(--sp-primary);
	color: var(--sp-white);
	border-color: var(--sp-primary);
}

.wp-block-query-pagination-numbers .page-numbers.current {
	background: var(--sp-primary);
	color: var(--sp-white);
	border-color: var(--sp-primary);
}

/* --------------------------------------------------------------------------
   Responsive — Sermon Archive Grid
   -------------------------------------------------------------------------- */

@media (max-width: 781px) {
	.wp-block-post-template.is-layout-grid {
		grid-template-columns: 1fr !important;
	}
}

@media (min-width: 782px) and (max-width: 1024px) {
	.wp-block-post-template.is-layout-grid {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

/* --------------------------------------------------------------------------
   Responsive — General
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
	.sp-staff-photo {
		width: 120px;
		height: 120px;
	}

	.sp-pastor-photo {
		width: 140px;
		height: 140px;
		margin-bottom: var(--sp-space-md);
	}

	.sp-scroll-indicator {
		display: none;
	}

	.sp-about-quote blockquote {
		padding: 20px 20px;
	}

	.sp-about-quote blockquote p {
		font-size: 1rem;
	}

	.sp-expect-time {
		flex: 1 1 100%;
	}
}

/* --------------------------------------------------------------------------
   Image Hover
   -------------------------------------------------------------------------- */

.wp-block-image img,
.wp-block-post-featured-image img {
	transition: box-shadow var(--sp-ease);
}

.wp-block-image:hover img,
.wp-block-post-featured-image:hover img {
	box-shadow: var(--sp-shadow-md);
}

/* --------------------------------------------------------------------------
   Accessibility — Reduced Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	html {
		scroll-behavior: auto;
	}

	.sp-card:hover,
	.sp-sermon-card:hover,
	.wp-block-button__link:hover {
		transform: none;
	}
}

/* --------------------------------------------------------------------------
   Focus Styles
   -------------------------------------------------------------------------- */

:focus-visible {
	outline: 2px solid var(--sp-accent);
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Screen-Reader Only
   -------------------------------------------------------------------------- */

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
