/* Internal page presentation. Front-page CSS and layout are intentionally separate. */
:root .kelcom-page :is(.kelcom-page-hero-grid, .kelcom-page-hero-copy, .kelcom-page-visual, .kelcom-page-layout, .kelcom-page-aside) > * {
	margin-block: 0;
}

.kelcom-page-hero {
	padding-block: clamp(2.25rem, 5vw, 4.5rem);
	border-bottom: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--background);
}

.kelcom-page-hero-grid {
	display: grid;
	align-items: center;
	gap: var(--wp--preset--spacing--50);
}

.kelcom-page-hero-copy {
	display: grid;
	gap: var(--wp--preset--spacing--30);
}

.kelcom-page-title {
	max-width: 24ch;
	font-size: clamp(2rem, 3.8vw, 3.5rem);
	line-height: 1.1;
}

.kelcom-page-lead {
	max-width: 58ch;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--lead);
	line-height: 1.65;
}

.kelcom-page-lead > p {
	margin: 0;
}

/* The native featured image occupies this same slot; no placeholder content. */
.kelcom-page-visual {
	position: relative;
	display: grid;
	min-width: 0;
	aspect-ratio: 16 / 9;
	isolation: isolate;
	border-radius: var(--wp--custom--radius--medium);
	background: var(--wp--preset--color--graphite);
}

.kelcom-page-image,
.kelcom-page-fallback {
	grid-area: 1 / 1;
	min-width: 0;
	min-height: 0;
	border-radius: inherit;
}

.kelcom-page-image {
	width: 100%;
	height: 100%;
}

.kelcom-page-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
}

.kelcom-page-fallback {
	position: relative;
	background-image: linear-gradient(#ffffff09 1px, transparent 1px), linear-gradient(90deg, #ffffff09 1px, transparent 1px);
	background-size: 32px 32px;
	pointer-events: none;
}

.kelcom-page-fallback::after {
	content: "";
	position: absolute;
	inset: auto 1.5rem 0 auto;
	width: 4rem;
	height: 5px;
	background: var(--wp--preset--color--brand);
}

.kelcom-page-fallback .kelcom-art {
	position: absolute;
	inset: 1.5rem;
}

.kelcom-page--technical .kelcom-page-fallback .kelcom-art {
	mask-image: url("../graphics/kelcom-signal-route.svg");
}

.kelcom-page-visual:has(> .kelcom-page-image img) > .kelcom-page-fallback {
	display: none;
}

.kelcom-page-layout {
	display: grid;
	align-items: start;
	gap: var(--wp--preset--spacing--50);
	padding-block: clamp(2.5rem, 5vw, 4.5rem);
}

.kelcom-page-body {
	width: 100%;
	max-width: 860px;
	min-width: 0;
	line-height: 1.75;
}

.kelcom-page-body > .kelcom-page-section + .kelcom-page-section {
	margin-top: clamp(2.5rem, 5vw, 4rem);
}

.kelcom-page-section > :first-child,
.kelcom-page-related p {
	margin-top: 0;
}

.kelcom-page-section > :last-child,
.kelcom-page-related p {
	margin-bottom: 0;
}

.kelcom-page-section > :is(p, ul, ol),
.kelcom-page-related {
	max-width: 68ch;
}

.kelcom-page-section h2 {
	padding-top: 1.25rem;
	margin-bottom: 1.25rem;
	border-top: 1px solid var(--wp--preset--color--border);
	font-size: clamp(1.5rem, 2.5vw, 2rem);
	line-height: 1.25;
}

.kelcom-page-section h2::before {
	content: "";
	display: block;
	width: 2.5rem;
	height: 3px;
	margin-top: calc(-1.25rem - 2px);
	margin-bottom: 1.25rem;
	background: var(--wp--preset--color--brand);
}

.kelcom-page-section h3 {
	margin-top: 2rem;
	margin-bottom: 0.75rem;
}

.kelcom-page-section :is(ul, ol) {
	padding-left: 1.5rem;
}

.kelcom-page-section li + li {
	margin-top: 0.65rem;
}

.kelcom-page-section li::marker {
	color: var(--wp--preset--color--action);
}

.kelcom-page-related {
	padding: 1.25rem 1.5rem;
	border-left: 3px solid var(--wp--preset--color--action);
	border-radius: 0 var(--wp--custom--radius--small) var(--wp--custom--radius--small) 0;
	background: var(--wp--preset--color--surface);
}

.kelcom-page-related a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--wp--preset--color--action);
	font-weight: 600;
}

.kelcom-page-aside {
	display: none;
	padding: 1.5rem;
	border-top: 4px solid var(--wp--preset--color--action);
	border-radius: 0 0 var(--wp--custom--radius--medium) var(--wp--custom--radius--medium);
	background: var(--wp--preset--color--surface);
}

:is(.kelcom-page--service, .kelcom-page--technical) .kelcom-page-aside {
	display: grid;
	gap: 1rem;
}

.kelcom-page-aside h2 {
	font-size: 1.25rem;
	line-height: 1.35;
}

.kelcom-page-aside-links {
	display: grid;
	gap: 0.5rem;
}

.kelcom-page-aside a {
	display: flex;
	align-items: center;
	min-height: 48px;
}

.kelcom-page-aside a:last-child {
	justify-content: center;
	padding: 0.75rem 1rem;
	border-radius: var(--wp--custom--radius--small);
	background: var(--wp--preset--color--action);
	color: var(--wp--preset--color--background);
	font-weight: 600;
	text-align: center;
}

.kelcom-page-aside a:last-child:focus-visible {
	outline-color: var(--wp--preset--color--graphite);
}

.kelcom-page-section .wp-block-table {
	margin-inline: 0;
}

.kelcom-page-section .wp-block-table :is(th, td) {
	padding: 0.875rem;
	border-color: var(--wp--preset--color--border);
	text-align: left;
	overflow-wrap: anywhere;
}

.kelcom-page-section .wp-block-table th {
	background: var(--wp--preset--color--graphite);
	color: var(--wp--preset--color--background);
}

.kelcom-page-section .wp-block-table tr:nth-child(even) td {
	background: var(--wp--preset--color--surface);
}

/* These are still native lists in the DOM, in the original reading order. */
:is(.kelcom-page--contact, .kelcom-page--directory, .kelcom-page--references) .kelcom-page-section > ul {
	display: grid;
	gap: 1rem;
	max-width: none;
	padding: 0;
	list-style: none;
}

:is(.kelcom-page--contact, .kelcom-page--directory, .kelcom-page--references) .kelcom-page-section > ul > li {
	position: relative;
	min-width: 0;
	margin: 0;
	padding: 1.25rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--small);
	background: var(--wp--preset--color--background);
	overflow-wrap: anywhere;
}

.kelcom-page--directory .kelcom-page-section > ul > li {
	min-height: 100px;
	border-left: 3px solid var(--wp--preset--color--action);
	font-weight: 600;
}

.kelcom-page--directory .kelcom-page-section > ul a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.kelcom-page--directory .kelcom-page-section > ul > li:is(:hover, :focus-within) {
	border-color: var(--wp--preset--color--action);
}

.kelcom-page--directory .kelcom-page-section > ul > li:focus-within {
	outline: 3px solid var(--wp--preset--color--graphite);
	outline-offset: 3px;
}

/* Contact data comes from its existing first two paragraphs, never a second copy. */
.kelcom-page--contact .kelcom-page-visual {
	min-height: 280px;
	aspect-ratio: auto;
}

.kelcom-page--contact .kelcom-page-fallback .kelcom-art {
	mask-image: url("../graphics/kelcom-signal-route.svg");
	opacity: 0.15;
}

.kelcom-contact-service {
	z-index: 1;
	grid-area: 1 / 1;
	align-self: center;
	padding: clamp(1.5rem, 3vw, 2.5rem);
	color: var(--wp--preset--color--background);
}

.kelcom-contact-service p {
	margin: 0;
	line-height: 1.6;
}

.kelcom-contact-service br {
	display: none;
}

.kelcom-contact-service strong {
	display: block;
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.035em;
	text-transform: uppercase;
}

.kelcom-contact-service strong + strong,
.kelcom-contact-service strong:nth-of-type(2) {
	margin-top: 1.5rem;
}

.kelcom-contact-service a {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	color: inherit;
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	font-weight: 700;
	letter-spacing: -0.025em;
}

.kelcom-page--contact .kelcom-page-visual:has(> .kelcom-page-image img) .kelcom-contact-service {
	grid-row: 2;
}

.kelcom-page--contact .kelcom-page-image {
	aspect-ratio: 3 / 2;
	height: auto;
}

.kelcom-page--contact .kelcom-page-lead a,
.kelcom-page--contact .kelcom-page-section a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

.kelcom-page--contact .kelcom-page-lead strong {
	color: var(--wp--preset--color--graphite);
}

.kelcom-page--contact .kelcom-page-section > ul > li {
	font-weight: 600;
}

.kelcom-page--contact .kelcom-page-section > ul a {
	width: fit-content;
	max-width: 100%;
	font-weight: 400;
	overflow-wrap: anywhere;
}

.kelcom-page--contact .kelcom-page-section > ul + p {
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--wp--preset--color--border);
}

.kelcom-page--contact .kelcom-page-section > p {
	color: var(--wp--preset--color--muted);
}

.kelcom-page--contact .kelcom-page-section a[href*="maps.google."] {
	padding-inline: 1.25rem;
	border: 1px solid var(--wp--preset--color--muted);
	border-radius: var(--wp--custom--radius--small);
}

@media (min-width: 768px) {
	:is(.kelcom-page--contact, .kelcom-page--directory, .kelcom-page--references) .kelcom-page-section > ul {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 900px) {
	.kelcom-page-hero-grid {
		grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
		gap: clamp(2rem, 4vw, 3.5rem);
	}

	.kelcom-page-visual {
		aspect-ratio: 5 / 4;
	}

	.kelcom-page--contact .kelcom-page-visual {
		aspect-ratio: auto;
		min-height: 320px;
	}

	:is(.kelcom-page--service, .kelcom-page--technical) .kelcom-page-layout {
		grid-template-columns: minmax(0, 720px) minmax(220px, 280px);
		gap: clamp(2rem, 4vw, 3.5rem);
	}
}
