/* ==========================================================================
   HLC — «Highway Logistics Center» planning section
   --------------------------------------------------------------------------
   The render is an untouched background; the traffic, the pins and the leader
   lines are drawn on top of it in the image's own coordinate system
   (viewBox 0 0 950 380, stage 1030 × 560).

   The section continues the «Планировки складских помещений» block above it:
   same background, no second headline. Every object is a card and a pin that
   opens the full-screen dialog at the end of this file — the dialog styles live
   here too, because the dialog only exists together with this section.
   ========================================================================== */

.hlc-plans {
	--plans-bg: #03031a;
	--plans-card-bg: rgba(14, 15, 37, 0.9);
	--plans-card-border: rgba(255, 255, 255, 0.1);
	--plans-accent: #84b2bd;
	position: relative;
	/* Same rule as the ULS plan above: the page's background shows through. */
	background: transparent;
	color: var(--uls-text, #fff);
	font-family: var(--uls-font, "Manrope", system-ui, sans-serif);
	padding: 0 0 clamp(48px, 7vw, 96px);
	overflow: hidden;                            /* clips the zoomed plan */
	scroll-margin-top: 96px;
}

.hlc-plans__inner {
	max-width: var(--uls-container, 1440px);
	margin: 0 auto;
	padding-inline: var(--uls-gutter, 20px);
}

/* ---------- Composition: the stage alone, full width ---------- */
.hlc-plans__body {
	position: relative;
}

/* ---------- Stage ---------- */
.hlc-plans__stage {
	position: relative;
	width: 100%;
	aspect-ratio: 1030 / 560;
	container-type: inline-size;                /* cards scale with cqw */
	transform-origin: 0 0;
	will-change: transform;
}

.hlc-plans__scene {
	position: absolute;
	left: 7.767%;                              /* 80 / 1030 */
	top: 18.75%;                               /* 105 / 560 */
	width: 92.233%;                            /* 950 / 1030 */
	aspect-ratio: 950 / 380;
	isolation: isolate;
}
.hlc-plans__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;                         /* SVG layers repeat cover with «slice» */
	display: block;
	user-select: none;
	-webkit-user-drag: none;
}
.hlc-plans__fx,
.hlc-plans__pins {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}
.hlc-plans__fx { overflow: hidden; }
.hlc-plans__pins { overflow: visible; }

/* ---------- Leader lines and cards ---------- */
.hlc-plans__notes {
	position: absolute;
	inset: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}
.hlc-plans__leaders {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}
.hlc-plans__leaders path {
	fill: none;
	stroke: rgba(255, 255, 255, 0.55);
	stroke-width: 1;
	vector-effect: non-scaling-stroke;
}

/* ---------- Pins ---------- */
.hlc-plans__pin { pointer-events: all; cursor: pointer; outline: none; }
.hlc-plans__hit { fill: transparent; }
.hlc-plans__ring {
	fill: none;
	stroke: #fff;
	stroke-width: 1.5;
	opacity: 0;
	transition: opacity 0.2s ease;
	vector-effect: non-scaling-stroke;
}
.hlc-plans__pin:hover .hlc-plans__ring,
.hlc-plans__pin:focus-visible .hlc-plans__ring { opacity: 0.85; }
.hlc-plans__dot { fill: #fff; }
.hlc-plans__pulse {
	fill: none;
	stroke: #fff;
	stroke-width: 1;
	vector-effect: non-scaling-stroke;
	transform-box: fill-box;
	transform-origin: center;
	animation: hlc-plans-pulse 2.6s ease-out infinite;
}
.hlc-plans__pins > a:nth-of-type(2n) .hlc-plans__pulse { animation-delay: 0.9s; }
@keyframes hlc-plans-pulse {
	0%   { transform: scale(0.6); opacity: 0.9; }
	100% { transform: scale(3.2); opacity: 0; }
}

/* Beacons of the special vehicles (classes come from plans-scene.js) */
.hlc-plans .ps-beacon { animation: hlc-plans-beacon 1.2s ease-in-out infinite; }
@keyframes hlc-plans-beacon {
	0%, 100% { opacity: 0.15; }
	45%      { opacity: 1; }
}

/* ---------- Cards ---------- */
.hlc-plans__card {
	position: absolute;
	pointer-events: auto;
	box-sizing: border-box;
	display: block;
	background: var(--plans-card-bg);
	border: 1px solid var(--plans-card-border);
	border-radius: clamp(6px, 0.97cqw, 10px);
	padding: 0.97cqw 1.17cqw 1.07cqw;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
	transition: border-color 0.25s ease, transform 0.25s ease, background-color 0.25s ease;
	text-decoration: none;
	color: inherit;
}
.hlc-plans__card:hover,
.hlc-plans__card:focus-visible {
	border-color: rgba(141, 166, 255, 0.55);
	background: rgba(20, 26, 62, 0.92);
	transform: translateY(-2px);
	outline: none;
}
.hlc-plans__card-class {
	display: block;
	font-size: max(9px, 1.07cqw);
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--plans-accent);
}
.hlc-plans__card-name {
	display: block;
	font-size: max(11px, 1.46cqw);
	font-weight: 500;
	margin-top: 0.1em;
	white-space: nowrap;
}
.hlc-plans__card-area {
	display: block;
	font-size: max(14px, 1.94cqw);
	font-weight: 500;
	margin-top: 0.4em;
	white-space: nowrap;
}
.hlc-plans__card-num { display: none; }

/* Card positions — percentages of the 1030 × 560 stage (taken from the design) */
.hlc-plans__card[data-card="1"] { left: 0.1%;   top: 24.64%; width: 18.45%; }
.hlc-plans__card[data-card="2"] { left: 26.02%; top: 1.07%;  width: 18.45%; }
.hlc-plans__card[data-card="3"] { left: 50.39%; top: 1.07%;  width: 16.89%; }
.hlc-plans__card[data-card="4"] { left: 75.44%; top: 1.07%;  width: 16.89%; }
.hlc-plans__card[data-card="5"] { left: 50.19%; top: 83.21%; width: 16.89%; }

/* ---------- Zoom-in state ---------- */
.hlc-plans.is-zooming .hlc-plans__notes { opacity: 0; }
.hlc-plans.is-zooming .hlc-plans__notes { pointer-events: none; }

/* ---------- Mobile: cards become a list under the scene ---------- */
@media (max-width: 720px) {
	.hlc-plans__stage { aspect-ratio: auto; }
	.hlc-plans__scene {
		position: relative;
		left: auto;
		top: auto;
		width: 100%;
		aspect-ratio: 950 / 470;                /* crops the empty sides via cover */
	}
	.hlc-plans__leaders { display: none; }
	.hlc-plans__notes { position: static; }
	.hlc-plans__cards {
		display: grid;
		gap: 10px;
		margin-top: 20px;
	}
	.hlc-plans__card {
		position: relative;
		left: auto !important;
		top: auto !important;
		width: auto !important;
		padding: 14px 16px 14px 52px;
		border-radius: 12px;
	}
	.hlc-plans__card-class { font-size: 11px; }
	.hlc-plans__card-name { font-size: 15px; }
	.hlc-plans__card-area { font-size: 20px; margin-top: 4px; }
	.hlc-plans__card-num {
		display: grid;
		place-items: center;
		position: absolute;
		left: 14px;
		top: 50%;
		width: 26px;
		height: 26px;
		margin-top: -13px;
		border-radius: 50%;
		background: #fff;
		color: var(--plans-bg);
		font-size: 13px;
		font-weight: 700;
	}
	.hlc-plans__hit { r: 48px; }               /* ≈ 40 px touch target at 390 px */
}
.hlc-plans__badge { display: none; }
@media (max-width: 720px) {
	.hlc-plans__badge { display: inline; }
	.hlc-plans__badge circle { fill: #fff; }
	.hlc-plans__badge text { fill: #03031a; font: 700 23px var(--uls-font, sans-serif); }
}

/* ==========================================================================
   Object dialog
   --------------------------------------------------------------------------
   A full-screen sheet: the back button, the text column and the gallery. It is
   hidden with `display: none` and shown by `.is-open` (the script) or `:target`
   (a direct link without JavaScript); the script animates the panel from the
   clicked point with the Web Animations API, so no transition is declared here.
   ========================================================================== */

html.plans-modal-open,
html.plans-modal-open body { overflow: hidden; }

.hlc-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: none;
	background: #05051a;
	color: #fff;
	font-family: var(--uls-font, "Manrope", system-ui, sans-serif);
}
.hlc-modal.is-open,
.hlc-modal:target { display: block; }

/* With the script running the hash is an implementation detail: a pushed
   #hlc-object-N must not keep the sheet displayed once it has been closed. */
html.plans-js .hlc-modal:target:not(.is-open) { display: none; }

.hlc-modal__panel {
	position: absolute;
	inset: 0;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	padding: clamp(16px, 2.4vw, 28px) clamp(20px, 4vw, 56px) clamp(24px, 4vw, 48px);
	display: flex;
	flex-direction: column;
	transform-origin: 50% 50%;
}

.hlc-modal__bar {
	position: sticky;
	top: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 1240px;
	margin-inline: auto;
	padding-block: clamp(2px, 0.6vw, 8px);
	background: linear-gradient(#05051a 62%, rgba(5, 5, 26, 0));
}
.hlc-modal__back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border-radius: var(--uls-radius-pill, 999px);
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: #17172b;
	color: #fff;
	font-size: 12px;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}
.hlc-modal__back:hover,
.hlc-modal__back:focus-visible {
	background: var(--uls-blue, #2b4bf2);
	border-color: var(--uls-blue, #2b4bf2);
	outline: none;
}
.hlc-modal__back svg { flex: none; }

.hlc-modal__grid {
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
	padding: clamp(24px, 5vh, 56px) 0 clamp(8px, 2vh, 24px);
	display: grid;
	grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
	gap: clamp(28px, 5vw, 80px);
	align-items: start;
}
.hlc-modal__grid:not(.hlc-modal__grid--text) .hlc-modal__text {
	padding-top: clamp(0px, 6vh, 48px);
}

.hlc-modal__grid--text {
	grid-template-columns: minmax(0, 720px);
	justify-content: center;
}

.hlc-modal__eyebrow {
	margin: 0 0 18px;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8d94a9;
}
.hlc-modal__title {
	margin: 0;
	font-size: clamp(30px, 3.4vw, 54px);
	font-weight: 500;
	line-height: 1.08;
	letter-spacing: -0.02em;
	max-width: 14ch;
}
.hlc-modal__area {
	margin: 14px 0 0;
	font-size: clamp(22px, 2.4vw, 38px);
	font-weight: 500;
	line-height: 1.1;
	color: rgba(255, 255, 255, 0.86);
}
.hlc-modal__desc {
	margin-top: clamp(18px, 2.6vh, 30px);
	max-width: 38ch;
	color: #9aa3b8;
	font-size: 14px;
	line-height: 1.55;
}
.hlc-modal__desc p { margin: 0 0 10px; }
.hlc-modal__desc p:last-child { margin-bottom: 0; }

.hlc-modal__specs {
	margin: clamp(20px, 3vh, 32px) 0 0;
	padding: 0;
	max-width: 38ch;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.hlc-modal__spec {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	padding: 10px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	font-size: 13px;
}
.hlc-modal__spec dt { color: #8d94a9; }
.hlc-modal__spec dd { margin: 0; text-align: right; }

.hlc-modal__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: clamp(24px, 4vh, 40px);
	padding: 12px 26px;
	border-radius: var(--uls-radius-pill, 999px);
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: #1b1b30;
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}
.hlc-modal__cta:hover,
.hlc-modal__cta:focus-visible {
	background: var(--uls-blue, #2b4bf2);
	border-color: var(--uls-blue, #2b4bf2);
	outline: none;
}

/* ---------- Gallery ---------- */
.hlc-modal__media { min-width: 0; }
.hlc-modal__main {
	position: relative;
	margin: 0;
	aspect-ratio: 8 / 5;
	border-radius: 14px;
	overflow: hidden;
	background: #0b0d22;
}
.hlc-modal__main img,
.hlc-modal__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.hlc-modal__thumbs {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin-top: 10px;
}
.hlc-modal__thumb {
	display: block;
	padding: 0;
	aspect-ratio: 8 / 5;
	border: 1px solid transparent;
	border-radius: 10px;
	overflow: hidden;
	background: #0b0d22;
	opacity: 0.72;
	cursor: pointer;
	transition: opacity 0.2s ease, border-color 0.2s ease;
}
.hlc-modal__thumb:hover,
.hlc-modal__thumb:focus-visible { opacity: 1; outline: none; }
.hlc-modal__thumb.is-active {
	border-color: var(--uls-blue, #2b4bf2);
	opacity: 1;
}

/* ---------- Dialog on narrow screens ---------- */
@media (max-width: 900px) {
	.hlc-modal__grid {
		grid-template-columns: 1fr;
		align-items: start;
		gap: 28px;
		padding-top: 24px;
	}
	.hlc-modal__grid:not(.hlc-modal__grid--text) .hlc-modal__text { padding-top: 0; }
	.hlc-modal__title { max-width: none; }
	.hlc-modal__desc { max-width: none; }
	.hlc-modal__specs { max-width: none; }
}
@media (max-width: 560px) {
	.hlc-modal__panel { padding-inline: 18px; }
	.hlc-modal__back { font-size: 12px; padding: 9px 15px; }
	.hlc-modal__thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
	.hlc-modal__main { border-radius: 10px; }
	.hlc-modal__thumb { border-radius: 7px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.hlc-plans__pulse { animation: none; opacity: 0; }
	.hlc-plans .ps-beacon { animation: none; }
	.hlc-plans__card,
	.hlc-plans__notes { transition: none; }
}
