/*
 * Joydom service hub + service page styles.
 * Extends home.css (same design tokens, scoped under body.jd-home).
 */

/* Page hero — compact red panel, same language as the homepage hero. */
.jd-page-hero {
	padding-top: 28px;
}

.jd-page-hero__panel {
	background: var(--jd-accent);
	border-radius: 28px;
	color: #fff;
	padding: 56px;
	position: relative;
	overflow: hidden;
}

.jd-service-hero__slides,
.jd-service-hero__slide {
	position: absolute;
	inset: 0;
}

.jd-service-hero__slides {
	z-index: 0;
}

.jd-service-hero__slide {
	background-position: center;
	background-size: cover;
	opacity: 0;
	transition: opacity 1s ease;
}

.jd-service-hero__slide.is-active {
	opacity: 1;
}

.jd-service-hero--category {
	display: grid;
	grid-template-columns: minmax(0, 62fr) minmax(340px, 38fr);
	align-items: stretch;
	padding: 0;
	background: transparent;
}

.jd-service-hero--category::after {
	display: none;
}

.jd-service-hero__media {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: 560px;
	padding: 56px;
	overflow: hidden;
	background: var(--jd-accent);
}

.jd-service-hero--category.has-slides .jd-service-hero__media {
	background: var(--jd-dark);
}

.jd-service-hero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(0deg, rgba(18, 15, 12, 0.8) 0%, rgba(18, 15, 12, 0.48) 27%, rgba(18, 15, 12, 0.08) 66%, transparent 100%);
	pointer-events: none;
}

.jd-service-hero__content {
	position: relative;
	z-index: 2;
	width: 100%;
}

.jd-service-hero__form-panel {
	display: grid;
	align-items: center;
	padding: 40px;
	background: #f4f1ec;
}

.jd-service-hero__form-panel .jd-form {
	padding: 30px;
	box-shadow: 0 28px 60px -38px rgba(26, 23, 19, 0.45);
}

@keyframes jd-claim-highlight {
	0%, 100% { box-shadow: 0 28px 60px -38px rgba(26, 23, 19, 0.45); }
	18%, 72% { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.28), 0 28px 60px -38px rgba(26, 23, 19, 0.45); }
}

.jd-form.is-claim-highlighted {
	animation: jd-claim-highlight 2s ease;
}

@media (prefers-reduced-motion: reduce) {
	.jd-form.is-claim-highlighted {
		animation: none;
		box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.28), 0 28px 60px -38px rgba(26, 23, 19, 0.45);
	}
}

@media (max-width: 900px) {
	.jd-service-hero--category {
		grid-template-columns: 1fr;
		height: auto;
		min-height: 0;
		overflow: visible;
	}

	.jd-service-hero__media {
		height: auto;
		min-height: 360px;
		padding: 32px;
		overflow: hidden;
		border-radius: 28px 28px 0 0;
	}

	.jd-service-hero__form-panel {
		min-width: 0;
		width: 100%;
		padding: 24px;
		border-radius: 0 0 28px 28px;
	}

	.jd-service-hero__form-panel .jd-form {
		min-width: 0;
		width: 100%;
	}
}

.jd-page-hero__panel::after {
	content: "";
	position: absolute;
	top: -40%;
	right: -10%;
	width: 55%;
	height: 130%;
	background: radial-gradient(closest-side, rgba(255, 255, 255, 0.22), transparent);
	pointer-events: none;
	z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
	.jd-service-hero__slide { transition: none; }
}

.jd-page-hero__title {
	font-size: clamp(38px, 5vw, 64px);
	line-height: 1;
	letter-spacing: -0.035em;
	font-weight: 800;
	max-width: 15ch;
}

.jd-page-hero__sub {
	margin-top: 16px;
	font-size: 19px;
	color: rgba(255, 255, 255, 0.9);
	max-width: 560px;
}

.jd-page-hero .jd-hero__buttons {
	margin-top: 28px;
}

/* Breadcrumbs */
.jd-crumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	font-size: 13.5px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.75);
	margin-bottom: 22px;
}

.jd-crumbs a:hover {
	color: #fff;
}

.jd-crumbs span[aria-hidden] {
	opacity: 0.5;
}

/* Intro paragraph + long-form body */
.jd-section--flush {
	padding-top: 64px;
	padding-bottom: 64px;
}

.jd-lede {
	font-size: 21px;
	line-height: 1.55;
	color: var(--jd-ink);
	font-weight: 500;
	margin-bottom: 28px;
}

.jd-service-intro--text {
	border-left: 3px solid var(--jd-accent);
	padding: 4px 0 4px clamp(18px, 2.2vw, 30px);
	background: transparent;
}

.jd-service-intro--text .jd-lede {
	font-size: clamp(17px, 1.25vw, 20px);
	line-height: 1.55;
	margin-bottom: 28px;
}

.jd-prose {
	color: var(--jd-muted);
	font-size: 17px;
	line-height: 1.7;
}

.jd-prose h2,
.jd-prose h3 {
	color: var(--jd-ink);
	letter-spacing: -0.02em;
	font-weight: 800;
	margin: 1.6em 0 0.5em;
}

.jd-prose h2 {
	font-size: 28px;
}

.jd-prose h3 {
	font-size: 21px;
}

.jd-prose p,
.jd-prose ul,
.jd-prose ol {
	margin: 0 0 1.1em;
}

.jd-prose img {
	max-width: 100%;
	height: auto;
	border-radius: var(--jd-r);
}

.jd-prose a {
	color: var(--jd-accent);
	font-weight: 600;
}

/* Scannable child-service highlights and long-form details. */
.jd-child-highlights {
	background: var(--jd-alt-bg);
}

.jd-child-highlights__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
}

.jd-child-highlights__item {
	display: flex;
	align-items: flex-start;
	gap: 15px;
	padding: 22px;
	border: 1px solid var(--jd-hairline-strong);
	border-radius: var(--jd-r);
	background: #fff;
	box-shadow: 0 18px 40px -34px rgba(26, 23, 19, 0.45);
}

.jd-child-highlights__icon {
	flex: 0 0 42px;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	color: #fff;
	background: var(--jd-accent);
}

.jd-child-highlights__icon svg {
	width: 22px;
	height: 22px;
}

.jd-child-highlights__item p {
	margin: 7px 0 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.5;
	color: var(--jd-ink);
}

.jd-child-detail__body {
	max-width: 760px;
	margin: 0 auto;
}

/* Responsive project gallery with a stronger opening image. */
.jd-child-gallery {
	background: var(--jd-alt-bg);
}

.jd-child-gallery__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	grid-auto-rows: minmax(220px, 1fr);
	gap: 16px;
}

.jd-child-gallery__item {
	margin: 0;
	min-height: 220px;
	aspect-ratio: 4 / 3;
	border-radius: var(--jd-r);
	overflow: hidden;
	background: var(--jd-hairline);
}

.jd-child-gallery__item.is-featured {
	grid-column: span 2;
	grid-row: span 2;
}

.jd-child-gallery__trigger {
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: zoom-in;
}

.jd-child-gallery__trigger:focus-visible {
	outline: 4px solid var(--jd-accent);
	outline-offset: -5px;
}

.jd-child-gallery__item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.jd-child-gallery__item:hover img {
	transform: scale(1.025);
}

/* Full-viewport viewer for child-service gallery images. */
.jd-gallery-lightbox {
	position: fixed;
	inset: 0;
	z-index: 10040;
	display: grid;
	place-items: center;
	padding: 24px;
	background: rgba(9, 10, 14, 0.92);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.18s ease, visibility 0.18s ease;
}

.jd-gallery-lightbox[hidden] {
	display: none;
}

.jd-gallery-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.jd-gallery-lightbox__viewer {
	position: relative;
	display: grid;
	place-items: center;
	width: min(92vw, 1400px);
	height: min(90vh, 980px);
}

.jd-gallery-lightbox__image {
	display: block;
	max-width: min(92vw, 1400px);
	max-height: 86vh;
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.jd-gallery-lightbox__close,
.jd-gallery-lightbox__nav {
	position: absolute;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.94);
	color: #1a1713;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
	cursor: pointer;
}

.jd-gallery-lightbox__close:hover,
.jd-gallery-lightbox__nav:hover {
	background: #fff;
	color: var(--jd-accent);
}

.jd-gallery-lightbox__close:focus-visible,
.jd-gallery-lightbox__nav:focus-visible {
	outline: 3px solid #ffb900;
	outline-offset: 3px;
}

.jd-gallery-lightbox__close svg,
.jd-gallery-lightbox__nav svg {
	width: 22px;
	height: 22px;
}

.jd-gallery-lightbox__close {
	top: 0;
	right: 0;
}

.jd-gallery-lightbox__prev {
	left: 0;
	top: 50%;
	transform: translateY(-50%);
}

.jd-gallery-lightbox__next {
	right: 0;
	top: 50%;
	transform: translateY(-50%);
}

.jd-gallery-lightbox__status {
	position: absolute;
	left: 50%;
	bottom: 0;
	margin: 0;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	transform: translateX(-50%);
}

body.jd-gallery-lightbox-open {
	overflow: hidden;
}

/* Sub-service cards — photo on top of the standard service card. */
.jd-service--sub .jd-service__photo {
	display: block;
	margin: -8px -4px 14px;
	border-radius: 14px;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: var(--jd-hairline);
}

.jd-service--sub .jd-service__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Chips that act as links (related sub-services). */
.jd-chips--center {
	justify-content: center;
}

.jd-chips a {
	border: 1px solid var(--jd-hairline-strong);
	border-radius: 999px;
	padding: 9px 18px;
	font-size: 14px;
	font-weight: 600;
	color: var(--jd-muted);
	transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.jd-chips a:hover {
	border-color: var(--jd-accent);
	color: var(--jd-accent);
	transform: translateY(-2px);
}

@media (max-width: 900px) {
	.jd-child-highlights__grid,
	.jd-child-gallery__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

}

@media (max-width: 640px) {
	.jd-child-highlights__grid,
	.jd-child-gallery__grid {
		grid-template-columns: 1fr;
	}

	.jd-child-gallery__item.is-featured {
		grid-column: auto;
		grid-row: auto;
	}

	.jd-gallery-lightbox {
		padding: 12px;
	}

	.jd-gallery-lightbox__viewer {
		width: 100%;
		height: 92vh;
	}

	.jd-gallery-lightbox__image {
		max-width: 100%;
		max-height: 80vh;
	}

	.jd-gallery-lightbox__close,
	.jd-gallery-lightbox__nav {
		width: 44px;
		height: 44px;
	}

	.jd-gallery-lightbox__close { top: 2px; right: 2px; }
	.jd-gallery-lightbox__prev { left: 2px; }
	.jd-gallery-lightbox__next { right: 2px; }
}

@media (prefers-reduced-motion: reduce) {
	.jd-gallery-lightbox,
	.jd-child-gallery__item img {
		transition: none;
	}
}

@media (max-width: 720px) {
	.jd-page-hero__panel {
		padding: 36px 26px;
	}

	.jd-page-hero__panel.jd-service-hero--category {
		padding: 0;
	}
}
