/**
 * 关怀与奉献合并页：两大 Section + 四卡片（沿用 service-box 悬停）
 */

.ccgc-care-section__head {
	margin: 0 0 28px;
	text-align: center;
}

.ccgc-care-section__eyebrow {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ccgc-gold-2, #c9a15c);
}

.ccgc-care-section__title {
	margin: 0;
	font-size: clamp(1.75rem, 3vw, 2.35rem);
	font-weight: 700;
	line-height: 1.25;
	color: #22211e;
}

.ccgc-giving-board {
	background: #fff;
	scroll-margin-top: 96px;
}

.ccgc-care-board {
	scroll-margin-top: 96px;
}

.ccgc-care-intro,
.ccgc-giving-intro {
	max-width: 760px;
	margin: 0 auto 36px;
	text-align: center;
	font-size: 16px;
	line-height: 1.8;
	color: #555;
}

.ccgc-care-intro > *:first-child,
.ccgc-giving-intro > *:first-child {
	margin-top: 0;
}

.ccgc-care-intro > *:last-child,
.ccgc-giving-intro > *:last-child {
	margin-bottom: 0;
}

.ccgc-giving-intro a {
	color: var(--ccgc-gold-ink, #8a6528);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ccgc-giving-intro a:hover,
.ccgc-giving-intro a:focus {
	color: var(--ccgc-ink, #22211e);
}

.ccgc-care-cards,
.ccgc-giving-cards {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* 关怀四卡：flex 悬停轻微加宽；文字区宽度锁定为默认卡宽 */
.ccgc-care-cards {
	--ccgc-care-gap: 24px;
	--ccgc-care-cols: 4;
	/* 默认单卡内容宽 =（行宽 - 间隙）/ 列数 */
	--ccgc-care-text-w: calc(
		(100cqw - (var(--ccgc-care-cols) - 1) * var(--ccgc-care-gap)) / var(--ccgc-care-cols)
	);
	display: flex;
	align-items: stretch;
	container-type: inline-size;
	container-name: ccgc-care-cards;
}

.ccgc-care-cards > li {
	flex: 1 1 0;
	min-width: 0;
	transition: flex-grow 0.45s ease;
}

/* 悬停未翻转：仅卡片轻微横向放大 */
.ccgc-care-cards > li:has(.ccgc-care-flip:hover:not(.is-flipped)),
.ccgc-care-cards > li:has(.ccgc-care-flip:focus-visible:not(.is-flipped)) {
	flex-grow: 1.18;
}

/* 奉献：三卡一行（微信/支付宝 · 银行 · 现场） */
.ccgc-giving-cards {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ccgc-care-board .service-box,
.ccgc-giving-board .service-box {
	height: 100%;
}

/* 奉献卡：ICON + 标题置顶，下方内容在剩余空间垂直居中 */
.ccgc-giving-board .service-box {
	display: flex;
	flex-direction: column;
}

.ccgc-giving-board .service-content {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	height: 100%;
	min-height: 0;
}

.ccgc-giving-board .service-content > i,
.ccgc-giving-board .service-content > h3 {
	flex-shrink: 0;
}

.ccgc-giving-card__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	flex: 1 1 auto;
	min-height: 0;
}

.ccgc-giving-card__body > p:first-child {
	margin-top: 0;
}

.ccgc-giving-card__body > p:last-child {
	margin-bottom: 0;
}

.ccgc-care-board .service-box:hover .service-content h3,
.ccgc-care-board .service-box:hover .service-content p,
.ccgc-care-board .service-box:hover .service-icon i,
.ccgc-giving-board .service-box:hover .service-content h3,
.ccgc-giving-board .service-box:hover .service-content p,
.ccgc-giving-board .service-box:hover .service-icon i,
.ccgc-giving-board .service-box:hover .ccgc-giving-qr-empty {
	color: #fff;
}

.ccgc-care-board .service-box:hover .service-content i,
.ccgc-giving-board .service-box:hover .service-content i {
	color: #ffc105;
}

/* ---------- 关怀卡片翻转：正面背景图 / 悬停藏图黄字 / 背面联系人 ---------- */
.ccgc-care-flip {
	perspective: 1200px;
	min-height: 450px;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.ccgc-care-flip:focus-visible {
	outline: 2px solid var(--ccgc-gold, #b78838);
	outline-offset: 4px;
	border-radius: 8px;
}

.ccgc-care-flip__inner {
	position: relative;
	width: 100%;
	height: 100%;
	min-height: 450px;
	transform-style: preserve-3d;
	transition: transform 0.55s ease;
}

.ccgc-care-flip.has-flip.is-flipped .ccgc-care-flip__inner {
	transform: rotateY(180deg);
}

.ccgc-care-flip__face {
	position: absolute;
	inset: 0;
	display: flex;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	border-radius: 5px;
	overflow: hidden;
	box-shadow: 0px 20px 30px 5px rgba(61, 1, 4, 0.1);
}

/* 正面：白底托底 + 背景图层 */
.ccgc-care-flip__face--front {
	background: #fff;
	z-index: 1;
}

.ccgc-care-flip__bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transition: filter 0.4s ease, transform 0.45s ease;
	z-index: 0;
	pointer-events: none;
}

.ccgc-care-flip__shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgba(20, 18, 14, 0.28) 0%,
		rgba(20, 18, 14, 0.45) 50%,
		rgba(20, 18, 14, 0.62) 100%
	);
	transition: opacity 0.4s ease;
	z-index: 0;
	pointer-events: none;
}

/* 悬停未翻转：去掉遮罩、提亮底图（点击翻转效果不变） */
.ccgc-care-flip:hover:not(.is-flipped) .ccgc-care-flip__shade,
.ccgc-care-flip:focus-visible:not(.is-flipped) .ccgc-care-flip__shade {
	opacity: 0;
}

.ccgc-care-flip:hover:not(.is-flipped) .ccgc-care-flip__bg,
.ccgc-care-flip:focus-visible:not(.is-flipped) .ccgc-care-flip__bg {
	filter: brightness(1.12) contrast(1.04);
	transform: scale(1.03);
}

.ccgc-care-flip__front-body {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	/* 悬停卡变宽时，正文仍保持默认卡宽并居中 */
	box-sizing: border-box;
	width: min(100%, var(--ccgc-care-text-w, 100%));
	max-width: var(--ccgc-care-text-w, 100%);
	margin-inline: auto;
	padding: 38px 28px;
	position: relative;
	z-index: 1;
}

.ccgc-care-flip__title {
	margin: 0 0 12px;
	font-size: 18px;
	line-height: 26px;
	font-weight: 600;
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 2px 12px rgba(0, 0, 0, 0.35);
	transition: text-shadow 0.35s ease;
}

.ccgc-care-flip__text {
	margin: 0;
	font-size: 14px;
	line-height: 1.7;
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 2px 10px rgba(0, 0, 0, 0.3);
	transition: text-shadow 0.35s ease;
}

/* 悬停去遮罩后略加强字影，保持可读 */
.ccgc-care-flip:hover:not(.is-flipped) .ccgc-care-flip__title,
.ccgc-care-flip:hover:not(.is-flipped) .ccgc-care-flip__text,
.ccgc-care-flip:focus-visible:not(.is-flipped) .ccgc-care-flip__title,
.ccgc-care-flip:focus-visible:not(.is-flipped) .ccgc-care-flip__text {
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55), 0 3px 16px rgba(0, 0, 0, 0.4);
}

/* 背面：联系人信息 */
.ccgc-care-flip__face--back {
	align-items: center;
	justify-content: center;
	background: var(--ccgc-gold-wash, #f6f0e5);
	transform: rotateY(180deg);
	padding: 28px 22px;
	box-sizing: border-box;
}

.ccgc-care-flip__contact {
	width: 100%;
	font-size: 15px;
	line-height: 1.75;
	color: var(--ccgc-ink, #22211e);
	text-align: center;
	word-break: break-word;
}

.ccgc-care-flip__contact-empty {
	color: var(--ccgc-muted, #666);
	font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
	.ccgc-care-cards > li,
	.ccgc-care-flip__bg,
	.ccgc-care-flip__shade,
	.ccgc-care-flip__inner,
	.ccgc-care-flip__face--front {
		transition: none;
	}

	.ccgc-care-flip.has-flip .ccgc-care-flip__inner,
	.ccgc-care-flip.has-flip.is-flipped .ccgc-care-flip__inner {
		transform: none;
		min-height: 0;
	}

	.ccgc-care-flip.has-flip .ccgc-care-flip__face {
		position: relative;
		backface-visibility: visible;
		-webkit-backface-visibility: visible;
		transform: none;
	}

	.ccgc-care-flip.has-flip .ccgc-care-flip__face--back {
		margin-top: 12px;
		min-height: 180px;
	}
}

.ccgc-giving-qr {
	margin-top: 12px;
}

.ccgc-giving-card__body > .ccgc-giving-qr:first-child,
.ccgc-giving-card__body > .ccgc-giving-qr-empty:first-child {
	margin-top: 0;
}

.ccgc-giving-qr img {
	display: block;
	width: 140px;
	max-width: 70%;
	height: auto;
	margin: 0 auto;
	border-radius: 8px;
	background: #fff;
	padding: 8px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.ccgc-giving-board .service-box.has-qr:hover .ccgc-giving-qr img {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.ccgc-giving-qr-empty {
	margin: 14px 0 0;
	font-size: 13px;
	color: #999;
}

@media (max-width: 991px) {
	.ccgc-giving-cards {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 1199px) {
	.ccgc-care-cards {
		--ccgc-care-cols: 2;
		flex-wrap: wrap;
	}

	.ccgc-care-cards > li {
		flex: 1 1 calc(50% - 12px);
	}

	.ccgc-care-cards > li:has(.ccgc-care-flip:hover:not(.is-flipped)),
	.ccgc-care-cards > li:has(.ccgc-care-flip:focus-visible:not(.is-flipped)) {
		flex-grow: 1.12;
	}
}

@media (max-width: 575px) {
	.ccgc-care-cards,
	.ccgc-giving-cards {
		grid-template-columns: 1fr;
	}

	.ccgc-care-cards {
		--ccgc-care-cols: 1;
		flex-direction: column;
	}

	.ccgc-care-cards > li,
	.ccgc-care-cards > li:has(.ccgc-care-flip:hover:not(.is-flipped)),
	.ccgc-care-cards > li:has(.ccgc-care-flip:focus-visible:not(.is-flipped)) {
		flex: 1 1 auto;
		width: 100%;
	}
}
