/* -------------------------------------------------------------------------- */
/* Service pages — premium hover & interaction layer                          */
/* Applies to HEDIS (.dit-hedis), QA (.dit-qa), and HCC (.dit-hcc-page).       */
/* Load AFTER page CSS. Hover only on devices that support hover.             */
/* -------------------------------------------------------------------------- */

/* QA hero — documentation validation imagery (distinct from HEDIS/HCC heroes). */
.dit-qa .dit-hedis-hero {
	background-image: url("../assets/img/qa-overview.jpg");
	background-position: center right;
	background-size: cover;
}

.dit-qa .dit-hedis-overview__media {
	min-height: 30rem;
}

.dit-qa .dit-hedis-overview__media img {
	object-position: center 18%;
}

@media (max-width: 900px) {
	.dit-qa .dit-hedis-overview__media {
		min-height: 16rem;
	}
}

@media (max-width: 480px) {
	.dit-qa .dit-hedis-overview__media {
		min-height: 14rem;
	}
}

.dit-qa .dit-hedis-benefits__media img {
	object-position: center 40%;
}

.dit-qa .dit-hedis-pilot__media img {
	object-fit: cover;
	object-position: center;
	width: 100%;
	height: 100%;
}

/* Base accents the hover layer animates. */
.dit-hedis-card,
.dit-hcc-cap-card {
	position: relative;
	overflow: hidden;
}

.dit-hedis-card::before,
.dit-hcc-cap-card::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 3px;
	background: linear-gradient(90deg, var(--dit-teal) 0%, rgba(13, 115, 119, 0.35) 100%);
	transform-origin: left;
	transform: scaleX(0.35);
	pointer-events: none;
}

.dit-hedis-card::after,
.dit-hcc-cap-card::after {
	content: "";
	position: absolute;
	right: -18%;
	bottom: -28%;
	width: 7rem;
	height: 7rem;
	border-radius: 50%;
	background: rgba(13, 115, 119, 0.06);
	pointer-events: none;
	opacity: 0.7;
}

@media (hover: hover) and (pointer: fine) {

	/* ---------- Capability cards ---------- */

	.dit-hedis-card::before,
	.dit-hcc-cap-card::before {
		transform-origin: left;
		transform: scaleX(0.35);
		transition: transform 0.5s var(--dit-ease);
	}

	.dit-hedis-card:hover::before,
	.dit-hcc-cap-card:hover::before {
		transform: scaleX(1);
	}

	.dit-hedis-card__icon,
	.dit-hcc-cap-card__icon {
		transition: transform 0.4s var(--dit-ease), box-shadow 0.4s ease, background-color 0.3s ease;
	}

	.dit-hedis-card:hover .dit-hedis-card__icon,
	.dit-hcc-cap-card:hover .dit-hcc-cap-card__icon {
		transform: scale(1.08);
		box-shadow: 0 0 0 8px rgba(13, 115, 119, 0.16), 0 12px 22px rgba(13, 115, 119, 0.32);
	}

	.dit-hedis-card__index,
	.dit-hcc-cap-card__index {
		transition: color 0.3s ease, transform 0.4s var(--dit-ease);
	}

	.dit-hedis-card:hover .dit-hedis-card__index,
	.dit-hcc-cap-card:hover .dit-hcc-cap-card__index {
		color: rgba(13, 115, 119, 0.6);
		transform: translateX(-4px);
	}

	.dit-hedis-card__title,
	.dit-hcc-cap-card__title {
		transition: color 0.25s ease;
	}

	.dit-hedis-card:hover .dit-hedis-card__title,
	.dit-hcc-cap-card:hover .dit-hcc-cap-card__title {
		color: var(--dit-teal);
	}

	.dit-hedis-card::after,
	.dit-hcc-cap-card::after {
		transition: transform 0.6s var(--dit-ease), opacity 0.4s ease;
	}

	.dit-hedis-card:hover::after,
	.dit-hcc-cap-card:hover::after {
		transform: scale(1.6);
	}

	/* ---------- Benefit glass cards ---------- */

	.dit-hedis-benefit,
	.dit-hcc-benefit {
		transition: transform 0.35s var(--dit-ease), border-color 0.3s ease, box-shadow 0.35s ease, background 0.3s ease;
	}

	.dit-hedis-benefit:hover,
	.dit-hcc-benefit:hover {
		background: linear-gradient(160deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.08) 100%);
	}

	.dit-hedis-benefit__icon,
	.dit-hcc-benefit__icon {
		transition: transform 0.4s var(--dit-ease), box-shadow 0.4s ease;
	}

	.dit-hedis-benefit:hover .dit-hedis-benefit__icon,
	.dit-hcc-benefit:hover .dit-hcc-benefit__icon {
		transform: scale(1.08);
		box-shadow: 0 0 0 9px rgba(13, 115, 119, 0.34), 0 14px 26px rgba(4, 20, 38, 0.38);
	}

	/* ---------- Related-service cards ---------- */

	.dit-hedis-related-card,
	.dit-hcc-related-card {
		position: relative;
		overflow: hidden;
		transition: transform 0.35s var(--dit-ease), box-shadow 0.35s ease, background-color 0.3s ease, border-left-color 0.3s ease;
	}

	.dit-hedis-related-card::after,
	.dit-hcc-related-card::after {
		content: "";
		position: absolute;
		inset: 0;
		background: linear-gradient(135deg, rgba(13, 115, 119, 0.06) 0%, transparent 60%);
		opacity: 0;
		transition: opacity 0.35s ease;
		pointer-events: none;
	}

	.dit-hedis-related-card:hover,
	.dit-hcc-related-card:hover {
		border-left-color: var(--dit-teal-mid);
	}

	.dit-hedis-related-card:hover::after,
	.dit-hcc-related-card:hover::after {
		opacity: 1;
	}

	.dit-hedis-related-card__icon,
	.dit-hcc-related-card__icon {
		transition: transform 0.4s var(--dit-ease), background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
	}

	.dit-hedis-related-card:hover .dit-hedis-related-card__icon,
	.dit-hcc-related-card:hover .dit-hcc-related-card__icon {
		transform: scale(1.08);
		background: var(--dit-teal);
		border-color: var(--dit-teal);
		color: var(--dit-white);
	}

	.dit-hedis-related-card__link,
	.dit-hcc-related-card__link {
		position: relative;
		display: inline-block;
		transition: color 0.25s ease, transform 0.3s var(--dit-ease);
	}

	.dit-hedis-related-card__link::after,
	.dit-hcc-related-card__link::after {
		content: "";
		position: absolute;
		left: 0;
		bottom: -3px;
		width: 100%;
		height: 2px;
		border-radius: 2px;
		background: currentColor;
		transform: scaleX(0);
		transform-origin: left;
		transition: transform 0.35s var(--dit-ease);
	}

	.dit-hedis-related-card__link:hover,
	.dit-hedis-related-card__link:focus-visible,
	.dit-hcc-related-card__link:hover,
	.dit-hcc-related-card__link:focus-visible {
		text-decoration: none;
		transform: translateX(4px);
	}

	.dit-hedis-related-card__link:hover::after,
	.dit-hedis-related-card__link:focus-visible::after,
	.dit-hcc-related-card__link:hover::after,
	.dit-hcc-related-card__link:focus-visible::after {
		transform: scaleX(1);
	}

	/* ---------- Insight article cards ---------- */

	.dit-hedis-insights__grid .dit-insights__thumb img,
	.dit-hedis-insight-card__thumb img,
	.dit-hcc-insight-card__thumb img {
		transition: transform 0.6s var(--dit-ease);
	}

	.dit-hedis-insights__grid .dit-insights__item:hover .dit-insights__thumb img,
	.dit-hedis-insight-card:hover .dit-hedis-insight-card__thumb img,
	.dit-hcc-insight-card:hover .dit-hcc-insight-card__thumb img {
		transform: scale(1.07);
	}

	.dit-hedis-insights__grid .dit-insights__more,
	.dit-hedis-insight-card__more,
	.dit-hcc-insight-card__more {
		display: inline-block;
		transition: transform 0.3s var(--dit-ease), color 0.25s ease;
	}

	.dit-hedis-insights__grid .dit-insights__item:hover .dit-insights__more,
	.dit-hedis-insight-card:hover .dit-hedis-insight-card__more,
	.dit-hcc-insight-card:hover .dit-hcc-insight-card__more {
		transform: translateX(5px);
	}

	/* ---------- Hero & pilot imagery ---------- */

	.dit-hedis-hero__media,
	.dit-hedis-pilot__media,
	.dit-hcc-pilot__media {
		transition: transform 0.5s var(--dit-ease), box-shadow 0.5s ease;
	}

	.dit-hedis-hero__media img,
	.dit-hedis-pilot__media img,
	.dit-hcc-pilot__media img {
		transition: transform 0.8s var(--dit-ease);
	}

	.dit-hedis-hero__media:hover {
		transform: translateY(-4px);
		box-shadow: 0 30px 60px rgba(11, 42, 74, 0.2);
	}

	.dit-hedis-pilot__media,
	.dit-hcc-pilot__media {
		overflow: hidden;
	}

	.dit-hedis-pilot__visual:hover .dit-hedis-pilot__media img,
	.dit-hcc-pilot__visual:hover .dit-hcc-pilot__media img {
		transform: scale(1.05);
	}

	.dit-hedis-pilot__badge,
	.dit-hcc-pilot__badge {
		transition: transform 0.5s var(--dit-ease), box-shadow 0.4s ease;
	}

	.dit-hedis-pilot__visual:hover .dit-hedis-pilot__badge,
	.dit-hcc-pilot__visual:hover .dit-hcc-pilot__badge {
		transform: scale(1.08);
		box-shadow: 0 0 0 11px rgba(13, 115, 119, 0.2), 0 22px 40px rgba(13, 115, 119, 0.42);
	}

	/* ---------- Callout & pilot note ---------- */

	.dit-hedis-overview__callout,
	.dit-hedis-pilot__note,
	.dit-hcc-pilot__note {
		transition: transform 0.35s var(--dit-ease), box-shadow 0.35s ease, border-color 0.3s ease;
	}

	.dit-hedis-overview__callout:hover {
		transform: translateX(6px);
		box-shadow: 0 16px 34px rgba(11, 42, 74, 0.1);
	}

	.dit-hedis-pilot__note:hover,
	.dit-hcc-pilot__note:hover {
		border-color: var(--dit-teal);
		box-shadow: 0 10px 24px rgba(11, 42, 74, 0.08);
	}

	/* ---------- Buttons: inherit site-wide hover from main.css ---------- */

	.dit-hedis .dit-btn--outline .wp-block-button__link:hover,
	.dit-hedis .dit-btn--outline .wp-block-button__link:focus-visible,
	.dit-hcc-page .dit-btn--outline .wp-block-button__link:hover,
	.dit-hcc-page .dit-btn--outline .wp-block-button__link:focus-visible {
		background: linear-gradient(135deg, var(--dit-teal) 0%, var(--dit-teal-mid) 100%);
		color: var(--dit-white);
		border-color: var(--dit-teal);
	}
}

/* ---------- Keyboard focus: clear, consistent, on-brand (all devices) ---------- */

.dit-hedis a:focus-visible,
.dit-hedis button:focus-visible,
.dit-hedis .wp-block-button__link:focus-visible,
.dit-hcc-page a:focus-visible,
.dit-hcc-page button:focus-visible,
.dit-hcc-page .wp-block-button__link:focus-visible {
	outline: 3px solid var(--dit-teal-mid);
	outline-offset: 3px;
	border-radius: 8px;
}

.dit-hedis-benefits__panel a:focus-visible,
.dit-hedis-contact__panel a:focus-visible,
.dit-hcc-benefits__panel a:focus-visible,
.dit-hcc-connect a:focus-visible {
	outline-color: #8fd6d8;
}

/* ---------- Scroll-reveal polish for sections using .dit-reveal ---------- */

@media (prefers-reduced-motion: no-preference) {
	.dit-hedis-cards > *,
	.dit-hedis-benefit-cards > *,
	.dit-hedis-related-cards > *,
	.dit-hcc-cap-cards > *,
	.dit-hcc-benefit-grid > *,
	.dit-hcc-related-cards > * {
		animation: dit-svc-rise 0.7s var(--dit-ease) both;
	}

	.dit-hedis-cards > :nth-child(2),
	.dit-hedis-benefit-cards > :nth-child(2),
	.dit-hedis-related-cards > :nth-child(2),
	.dit-hcc-cap-cards > :nth-child(2),
	.dit-hcc-benefit-grid > :nth-child(2),
	.dit-hcc-related-cards > :nth-child(2) { animation-delay: 0.08s; }

	.dit-hedis-cards > :nth-child(3),
	.dit-hedis-benefit-cards > :nth-child(3),
	.dit-hedis-related-cards > :nth-child(3),
	.dit-hcc-cap-cards > :nth-child(3),
	.dit-hcc-benefit-grid > :nth-child(3),
	.dit-hcc-related-cards > :nth-child(3) { animation-delay: 0.16s; }

	.dit-hedis-cards > :nth-child(4),
	.dit-hedis-benefit-cards > :nth-child(4),
	.dit-hcc-cap-cards > :nth-child(4),
	.dit-hcc-benefit-grid > :nth-child(4) { animation-delay: 0.24s; }

	.dit-hedis-cards > :nth-child(5),
	.dit-hcc-cap-cards > :nth-child(5) { animation-delay: 0.32s; }

	.dit-hedis-cards > :nth-child(6),
	.dit-hcc-cap-cards > :nth-child(6) { animation-delay: 0.4s; }
}

@keyframes dit-svc-rise {
	from {
		opacity: 0;
		transform: translateY(18px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ---------- Reduced motion: switch every effect off ---------- */

@media (prefers-reduced-motion: reduce) {
	.dit-hedis *,
	.dit-hedis *::before,
	.dit-hedis *::after,
	.dit-hcc-page *,
	.dit-hcc-page *::before,
	.dit-hcc-page *::after {
		transition: none !important;
		animation: none !important;
	}
}