/* Ensure full viewport height */
html, body {
	height: 100%;
}

/* Article overlay for click-outside-to-close */
.article-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	z-index: 10;
	padding: 2rem;
	overflow-y: auto;
}

/* Hide header and footer when article is visible */
body.is-article-visible #header {
	position: absolute;
	pointer-events: none;
}

body.is-article-visible #footer {
	position: absolute;
	pointer-events: none;
}

/* Adjust vertical line above nav to align with border */
#header nav:before {
	left: 50% !important;
}

/* Navigation fix for additional buttons */
#header nav {
	position: relative;
}

#header nav ul {
	flex-wrap: nowrap;
	justify-content: center;
}

#header nav ul li {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	align-items: stretch;
}

#header nav ul li a {
	min-width: 0;
	white-space: normal;
	line-height: 1.3;
	padding: 0.5rem 0.75rem;
	height: auto;
	min-height: 2.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	width: 100%;
}

@media screen and (max-width: 980px) {
	#header nav ul {
		flex-wrap: wrap;
		max-width: 100%;
	}

	#header nav ul li {
		flex: 0 0 calc(100% / 3);
	}

	#header nav ul li:nth-child(n+4) {
		border-top: solid 1px #ffffff;
	}

	#header nav ul li:nth-child(4) {
		border-left: 0;
	}
}

@media screen and (max-width: 480px) {
	#header nav ul {
		flex-direction: column;
	}

	#header nav ul li {
		flex: 1 1 100%;
		border-left: 0 !important;
	}

	#header nav ul li:nth-child(n+2) {
		border-top: solid 1px #ffffff;
	}
}

/* Small Groups Registration Modal Styles */
.sg-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
	align-items: center;
	justify-content: center;
}

.sg-modal.active {
	display: flex;
	opacity: 1;
	transition: opacity 0.3s ease;
}

.sg-modal.active.fade-out {
	opacity: 0;
}

.sg-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.85);
	backdrop-filter: blur(4px);
}

.sg-modal-content {
	position: relative;
	background: rgba(27, 31, 34, 0.98);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 8px;
	padding: 2rem;
	max-width: 600px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
	from {
		opacity: 0;
		transform: translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Ensure tel input matches other inputs */
.sg-modal input[type="tel"] {
	height: 2.75rem;
}

/* Registration confirmation styles */
.confirmation-message {
	text-align: center;
	padding: 1rem 0;
}

.confirmation-icon {
	font-size: 4rem;
	color: #4a9eff;
	margin-bottom: 1rem;
}

.confirmation-message h4 {
	color: #ffffff;
	font-size: 1.25rem;
	margin: 0 0 1rem 0;
	text-transform: uppercase;
	letter-spacing: 0.1rem;
}

.confirmation-message p {
	color: #b8b8b8;
	margin: 0.5rem 0;
}

.confirmation-message #confirm-group-name {
	color: #4a9eff;
	font-weight: 600;
}

.confirmation-ukrainian {
	font-style: italic;
	margin-top: 1rem !important;
	font-size: 0.9rem;
}

.confirmation-message .button {
	margin-top: 1.5rem;
}

.sg-modal-close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	background: transparent;
	border: none;
	color: #ffffff;
	font-size: 1.75rem;
	cursor: pointer;
	width: 2.5rem;
	height: 2.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background-color 0.2s ease;
	box-shadow: none;
	line-height: 1;
}

.sg-modal-close:hover {
	background-color: rgba(255, 255, 255, 0.1);
}

.sg-modal-title {
	color: #ffffff;
	font-size: 1.25rem;
	text-transform: uppercase;
	letter-spacing: 0.15rem;
	margin: 0 0 1.5rem 0;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
	font-weight: 600;
}

.sg-modal-group-info {
	background: rgba(255, 255, 255, 0.05);
	border-radius: 6px;
	padding: 1rem 1.25rem;
	margin-bottom: 1.5rem;
}

.sg-modal-group-info h4 {
	color: #4a9eff;
	font-size: 1.1rem;
	margin: 0 0 0.75rem 0;
	text-transform: uppercase;
	letter-spacing: 0.1rem;
	font-weight: 600;
}

.modal-detail {
	color: #b8b8b8;
	font-size: 0.9rem;
	margin: 0.35rem 0;
}

.modal-detail i {
	color: #4a9eff;
	width: 20px;
	margin-right: 0.5rem;
}

.sg-modal #small-group-form {
	margin-bottom: 0;
}

.sg-modal .actions {
	margin-top: 1.5rem;
}

.form-error {
	background: rgba(220, 53, 69, 0.15);
	border: 1px solid rgba(220, 53, 69, 0.4);
	border-radius: 6px;
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	color: #ff6b6b;
	font-size: 0.9rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.form-error i {
	font-size: 1rem;
}

/* SMS Consent Checkbox */
.sms-consent-field {
	margin-top: 1rem;
}

.sms-consent-field input[type="checkbox"] + label {
	font-size: 0.75rem;
	line-height: 1.5;
	color: #b8b8b8;
	padding-left: 2rem;
}

.sms-consent-field input[type="checkbox"] + label:before {
	width: 1.2rem;
	height: 1.2rem;
	line-height: 1.2rem;
	top: 0;
}

.sms-consent-field label a {
	color: #4a9eff;
	text-decoration: none;
	border-bottom: 1px dotted rgba(74, 158, 255, 0.5);
	transition: color 0.2s ease;
}

.sms-consent-field label a:hover {
	color: #6bb3ff;
	border-bottom-color: #6bb3ff;
}

@media screen and (max-width: 736px) {
	.sg-modal-content {
		padding: 1.5rem;
		width: 95%;
		margin: 1rem;
	}

	.sg-modal-title {
		font-size: 1rem;
		padding-right: 2rem;
	}

	.sg-modal-group-info {
		padding: 0.875rem 1rem;
	}

	.sg-modal-group-info h4 {
		font-size: 1rem;
	}
}

/* Service times styles */
.service-times {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 1rem;
	margin: 1.5rem 0;
	padding: 0 1rem;
}

.service-card {
	background: rgba(255, 255, 255, 0.05);
	padding: 1.5rem;
	border-radius: 8px;
	text-align: center;
	flex: 1;
	min-width: 200px;
	max-width: 300px;
	transition: transform 0.3s ease;
}

.service-card:hover {
	transform: translateY(-3px);
}

.service-icon {
	font-size: 2rem;
	margin-bottom: 0.5rem;
	color: #4a9eff;
}

.service-info h3 {
	margin: 0 0 0.25rem 0;
	color: #ffffff;
	font-size: 1.1rem;
}

.service-info .time {
	font-size: 1.25rem;
	font-weight: bold;
	margin: 0;
	color: #4a9eff;
}

.location-info {
	background: rgba(255, 255, 255, 0.05);
	padding: 1.5rem;
	border-radius: 8px;
	text-align: center;
	margin: 1.5rem 1rem 0 1rem;
	margin-bottom: 2rem;
}

.location-icon {
	font-size: 2rem;
	margin-bottom: 0.5rem;
	color: #4a9eff;
}

.location-details h3 {
	margin: 0 0 0.25rem 0;
	color: #ffffff;
	font-size: 1.1rem;
}

.location-details p {
	margin: 0.25rem 0 1rem 0;
	color: #b8b8b8;
}

.button-container {
	display: flex;
	justify-content: center;
	align-items: center;
}

.button.primary {
	background-color: #4a9eff;
	color: #ffffff;
	padding: 0.75rem 1.5rem;
	border-radius: 4px;
	text-decoration: none;
	transition: background-color 0.3s ease;
	font-size: 0.9rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 140px;
	height: 40px;
}

.button.primary:hover {
	background-color: #357abd;
}

/* Mobile Styles for service times */
@media screen and (max-width: 736px) {
	.service-times {
		flex-direction: column;
		align-items: center;
		gap: 1rem;
	}

	.service-card {
		width: 100%;
		max-width: 100%;
		padding: 1.25rem;
	}

	.location-info {
		margin: 1rem 0.5rem 0 0.5rem;
		padding: 1.25rem;
		margin-bottom: 1.5rem;
	}

	.button.primary {
		width: 100%;
		max-width: 200px;
	}
}

/* Small groups grid styles */
.small-groups-grid {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin: 1.5rem 0;
}

.small-group-card {
	background: rgba(255, 255, 255, 0.05);
	border-radius: 8px;
	overflow: hidden;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	display: flex;
	flex-direction: row;
	align-items: stretch;
}

.small-group-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.leader-image-wrapper {
	width: 32%;
	min-width: 32%;
	flex-shrink: 0;
}

.leader-image-container {
	width: 100%;
	min-height: 280px;
	overflow: hidden;
	position: relative;
}

.leader-image-container .leader-image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	background: rgba(255, 255, 255, 0.1);
}

/* Diagonal slash effect */
.leader-image-wrapper.leader-left .leader-image-container {
	clip-path: polygon(0 0, 100% 0, 90% 100%, 0 100%);
}

.leader-image-wrapper.leader-right .leader-image-container {
	clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%);
}

/* Family names under images */
.leader-name-mobile {
	display: block;
	color: #4a9eff;
	font-size: 0.9rem;
	font-weight: 600;
	padding: 0.5rem 0.5rem;
	margin: 0;
	background: transparent;
}

.leader-image-wrapper.leader-left .leader-name-mobile {
	text-align: left;
}

.leader-image-wrapper.leader-right .leader-name-mobile {
	text-align: right;
}

/* Hide combined names since individual names show under images */
.group-info .leader-names {
	display: none;
}

/* Group language/type badge */
.group-language-row {
	display: flex;
	flex-direction: row;
	justify-content: center;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.group-language {
	display: inline-block;
	width: fit-content;
	align-self: center;
	background: rgba(74, 158, 255, 0.15);
	color: #4a9eff;
	font-size: 0.85rem;
	font-weight: 600;
	padding: 0.35rem 0.85rem;
	border-radius: 20px;
	margin: 0 0 0.75rem 0;
	letter-spacing: 0.05em;
	border: 1px solid rgba(74, 158, 255, 0.3);
}

.group-language-row .group-language {
	margin: 0;
}

/* Single leader card styles */
.small-group-card.single-leader .leader-image-wrapper.leader-single {
	width: 40%;
	min-width: 40%;
}

.small-group-card.single-leader .leader-image-wrapper.leader-single .leader-image-container {
	clip-path: none;
}

.small-group-card.single-leader .leader-image-wrapper.leader-single .leader-name-mobile {
	text-align: center;
}

.group-info {
	flex: 1;
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
	text-align: center;
}

.group-details-row {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: 0.5rem;
}

.group-details {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	color: #e0e0e0;
	font-size: 0.95rem;
	margin: 0;
	padding: 0.4rem 0;
}

.group-details i {
	color: #4a9eff;
	font-size: 1rem;
	width: 20px;
	text-align: center;
}

/* Placeholder for missing images */
.leader-image-container.no-image {
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.1);
}

.leader-image-container.no-image::after {
	font-family: 'Font Awesome 5 Free';
	font-weight: 900;
	content: '\f007';
	font-size: 3rem;
	color: #4a9eff;
}

.leader-names {
	color: #4a9eff;
	font-size: 1.1rem;
	margin: 0 0 0.5rem 0;
	font-weight: 600;
}

.register-btn {
	margin-top: 2.5rem;
	width: auto;
	background-color: rgba(255, 255, 255, 0.1);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.register-btn:hover {
	background-color: rgba(255, 255, 255, 0.2);
}

/* Mobile Styles for Small Groups */
@media screen and (max-width: 736px) {
	.small-groups-grid {
		gap: 1.25rem;
		margin: 1rem 0;
	}

	.small-group-card {
		flex-direction: row;
		flex-wrap: wrap;
		border-radius: 12px;
	}

	.leader-image-wrapper {
		width: 50%;
		min-width: unset;
		flex: 0 0 50%;
		display: flex;
		flex-direction: column;
	}

	.leader-image-wrapper.leader-left {
		order: 1;
	}

	.leader-image-wrapper.leader-right {
		order: 2;
	}

	.leader-image-container {
		min-height: 180px;
	}

	.leader-image-wrapper.leader-left .leader-image-container {
		clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%);
	}

	.leader-image-wrapper.leader-right .leader-image-container {
		clip-path: polygon(8% 0, 100% 0, 100% 100%, 0 100%);
	}

	/* Show individual family names on mobile */
	.leader-name-mobile {
		display: block;
		color: #4a9eff;
		font-size: 1rem;
		font-weight: 600;
		padding: 0.5rem 0.5rem;
		margin: 0;
		background: rgba(255, 255, 255, 0.03);
	}

	.leader-image-wrapper.leader-left .leader-name-mobile {
		text-align: left;
	}

	.leader-image-wrapper.leader-right .leader-name-mobile {
		text-align: right;
	}

	/* Hide combined names on mobile */
	.group-info .leader-names {
		display: none;
	}

	.group-info {
		order: 3;
		flex: 0 0 100%;
		width: 100%;
		text-align: center;
		padding: 1rem 1.25rem 1.5rem;
		border-top: 1px solid rgba(255, 255, 255, 0.1);
	}

	.group-info .group-details-row {
		display: flex;
		flex-direction: row;
		justify-content: center;
		gap: 1rem;
		flex-wrap: wrap;
	}

	.group-details {
		font-size: 0.9rem;
		padding: 0.3rem 0;
	}

	.group-language {
		font-size: 0.8rem;
		padding: 0.3rem 0.7rem;
		margin-bottom: 0.75rem;
	}

	.register-btn {
		width: 100%;
		margin-top: 1.25rem;
		padding: 0.85rem 1.5rem;
		display: flex;
		align-items: center;
		justify-content: center;
		line-height: 1;
	}

	/* Single leader mobile styles */
	.small-group-card.single-leader .leader-image-wrapper.leader-single {
		width: 100%;
		flex: 0 0 100%;
	}

	.small-group-card.single-leader .leader-image-wrapper.leader-single .leader-image-container {
		clip-path: none;
		min-height: 200px;
	}

	.small-group-card.single-leader .leader-image-wrapper.leader-single .leader-name-mobile {
		text-align: center;
	}
}

/* Footer layout */
#footer {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
}

#footer a {
	font-size: 0.6rem;
	color: gainsboro;
	border-bottom: none;
	letter-spacing: 0.15rem;
	transition: color 0.2s ease;
}

#footer a:hover {
	color: white;
}

.footer-links {
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
	justify-content: center;
}

.footer-links a {
	font-size: 0.6rem;
	color: gainsboro;
	border-bottom: none;
	letter-spacing: 0.1rem;
	transition: color 0.2s ease;
	text-decoration: none;
}

.footer-links a:hover {
	color: white;
}

/* Legal pages styles */
.legal-wrapper {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	min-height: 100vh;
	padding: 2rem;
}

.legal-wrapper #header {
	position: relative !important;
	opacity: 1 !important;
	margin-bottom: 2rem;
	background-image: none;
}

.legal-wrapper #header .logo {
	width: 5.5rem;
	height: 5.5rem;
	line-height: 5.5rem;
	border: solid 1px #ffffff;
	border-radius: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto;
}

.legal-wrapper #header .logo a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	border: none;
}

.legal-wrapper #header .logo img {
	width: 65px;
	height: auto;
	object-fit: contain;
}

.legal-main {
	width: 100%;
	max-width: 800px;
}

.legal-article {
	display: block !important;
	opacity: 1 !important;
	position: relative !important;
	background-color: rgba(27, 31, 34, 0.85);
	border-radius: 8px;
	padding: 2.5rem 3rem;
	margin: 0 auto;
}

.legal-article h2.major {
	margin: 0 0 0.5rem 0;
}

.legal-article .last-updated {
	color: #888;
	font-size: 0.85rem;
	margin-bottom: 2rem;
	font-style: italic;
}

.legal-article section {
	margin-bottom: 2rem;
}

.legal-article h3 {
	color: #ffffff;
	font-size: 1.1rem;
	text-transform: uppercase;
	letter-spacing: 0.1rem;
	margin: 0 0 1rem 0;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.legal-article h4 {
	color: #4a9eff;
	font-size: 0.95rem;
	text-transform: uppercase;
	letter-spacing: 0.05rem;
	margin: 1.5rem 0 0.75rem 0;
}

.legal-article p {
	color: #b8b8b8;
	line-height: 1.7;
	margin-bottom: 1rem;
}

.legal-article ul {
	color: #b8b8b8;
	margin: 0 0 1rem 1.5rem;
	padding: 0;
}

.legal-article ul li {
	margin-bottom: 0.5rem;
	line-height: 1.6;
}

.legal-article a {
	color: #4a9eff;
	text-decoration: none;
	border-bottom: 1px dotted rgba(74, 158, 255, 0.5);
	transition: color 0.2s ease, border-color 0.2s ease;
}

.legal-article a:hover {
	color: #6bb3ff;
	border-bottom-color: #6bb3ff;
}

.legal-article strong {
	color: #ffffff;
}

.legal-article .opt-instructions {
	background: rgba(74, 158, 255, 0.1);
	border-left: 3px solid #4a9eff;
	padding: 1rem 1.25rem;
	margin: 1rem 0;
	border-radius: 0 4px 4px 0;
}

.legal-article .opt-instructions strong {
	color: #4a9eff;
	font-size: 1.1em;
}

.legal-actions {
	margin-top: 2.5rem;
	text-align: center;
}

.legal-article .close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	cursor: pointer;
}

@media screen and (max-width: 736px) {
	.legal-wrapper {
		padding: 1rem;
	}

	.legal-article {
		padding: 1.5rem 1.25rem;
	}

	.legal-article h2.major {
		font-size: 1.25rem;
	}

	.legal-article h3 {
		font-size: 1rem;
	}

	.legal-article h4 {
		font-size: 0.9rem;
	}

	.footer-links {
		flex-direction: column;
		gap: 0.5rem;
		align-items: center;
	}
}

/* Staff section styles */
.staff-section {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2rem;
	padding: 1rem 0;
}

.staff-member {
	text-align: center;
}

.staff-member.senior-pastor .staff-image {
	width: 200px;
	height: 200px;
}

.staff-image {
	width: 160px;
	height: 160px;
	border-radius: 50%;
	object-fit: cover;
	object-position: center top;
	border: 3px solid #4a9eff;
}

.staff-name {
	color: #ffffff;
	font-size: 1rem;
	font-weight: 600;
	margin-top: 0.75rem;
	white-space: nowrap;
}

.staff-role {
	color: #4a9eff;
	font-size: 0.9rem;
	margin-top: 0.25rem;
}

.assistant-pastors {
	display: flex;
	flex-direction: row;
	gap: 3rem;
	justify-content: center;
	flex-wrap: nowrap;
}

@media screen and (max-width: 736px) {
	.assistant-pastors {
		gap: 2rem;
		flex-wrap: wrap;
	}

	.staff-member.senior-pastor .staff-image {
		width: 170px;
		height: 170px;
	}

	.staff-image {
		width: 140px;
		height: 140px;
	}
}
