/*
 * Conference / event hall modal (assets/js/design-hall-modal.js).
 *
 * The modal is appended to document.body at JS init time, so it lives
 * outside the .teledom-design wrapper. Selectors are left UNSCOPED.
 */

.hall-modal {
	position: fixed;
	inset: 0;
	background: rgba(13, 13, 13, 0.85);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 200;
	padding: 30px;
	backdrop-filter: blur(8px);
}

.hall-modal.open {
	display: flex;
	animation: teledom-fade-in 0.3s var(--ease);
}

.hall-modal .box {
	background: var(--paper);
	border-radius: var(--r-lg);
	max-width: 1080px;
	width: 100%;
	max-height: 92vh;
	overflow-y: auto;
	position: relative;
	box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4);
	display: grid;
	/* minmax(0,…) overrides the implicit min-content sizing of fr units —
	 * without it a wide intrinsic image could blow up the gallery column
	 * and squish the body to a thin strip. */
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.hall-modal .close {
	position: absolute;
	top: 18px;
	right: 18px;
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	border: 0;
	cursor: pointer;
	z-index: 10;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* Hide the text "×" glyph (kept for accessibility); draw a clean X via
	 * the two pseudo-elements below — pixel-perfect across fonts, geometric
	 * centering doesn't drift with character baseline. */
	font-size: 0;
	color: transparent;
	transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.hall-modal .close::before,
.hall-modal .close::after {
	content: '';
	position: absolute;
	width: 16px;
	height: 2px;
	background: var(--ink);
	border-radius: 1px;
	transition: background 0.25s var(--ease);
}

.hall-modal .close::before { transform: rotate(45deg); }
.hall-modal .close::after  { transform: rotate(-45deg); }

.hall-modal .close:hover {
	background: var(--ink);
	transform: rotate(90deg);
}

.hall-modal .close:hover::before,
.hall-modal .close:hover::after {
	background: #fff;
}

.hall-modal .gallery {
	background: var(--paper-2);
	display: flex;
	flex-direction: column;
}

.hall-modal .gallery .main {
	flex: 1 1 auto;
	/* Fixed aspect-ratio locks image area size so navigating between
	 * portrait / landscape images never makes the modal jump. */
	aspect-ratio: 4 / 3;
	min-height: 380px;
	background: var(--ink);
	position: relative;
	overflow: hidden;
}

.hall-modal .gallery .main img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: var(--r-lg) 0 0 0;
	/* Smooth fade between images on prev/next so they don't snap. */
	transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
	user-select: none;
	-webkit-user-drag: none;
}

.hall-modal .nav-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	border: 0;
	cursor: pointer;
	z-index: 5;
	display: grid;
	place-items: center;
	font-size: 28px;
	line-height: 1;
	color: var(--ink);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
	transition: all 0.2s var(--ease);
	padding: 0;
	font-family: var(--display);
}

.hall-modal .nav-arrow.prev { left: 14px; }
.hall-modal .nav-arrow.next { right: 14px; }

.hall-modal .nav-arrow:hover {
	background: var(--ink);
	color: #fff;
	transform: translateY(-50%) scale(1.06);
}

.hall-modal .counter {
	position: absolute;
	bottom: 14px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(13, 13, 13, 0.7);
	color: #fff;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.18em;
	padding: 6px 14px;
	border-radius: 20px;
	backdrop-filter: blur(6px);
	z-index: 5;
}

.hall-modal .gallery .thumbs {
	display: flex;
	flex-wrap: wrap;                   /* fall back to 2 rows when >6 thumbs */
	gap: 6px;
	padding: 10px;
	background: var(--paper-2);
	overflow-x: auto;
	scroll-behavior: smooth;
	/* Hide scrollbar across browsers — strip remains scrollable via mouse
	 * drag, touch swipe, or keyboard arrows from the active thumb. */
	scrollbar-width: none;             /* Firefox */
	-ms-overflow-style: none;          /* IE / legacy Edge */
}

.hall-modal .gallery .thumbs::-webkit-scrollbar {
	display: none;                     /* Chrome / Safari / Edge Chromium */
}

.hall-modal .thumb {
	/* 1 1 calc lets the row split available width across the visible
	 * thumbs — auditorium with 7 photos, classroom with 3, both look
	 * intentional. min-width keeps thumbs readable; max-width caps them
	 * so a 3-photo modal doesn't blow tiles up to a strange size. */
	flex: 1 1 64px;
	min-width: 56px;
	max-width: 96px;
	aspect-ratio: 1.3;
	border: 2px solid transparent;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	padding: 0;
	background: none;
	transition: all 0.2s var(--ease);
}

.hall-modal .thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hall-modal .thumb:hover {
	transform: translateY(-2px);
}

.hall-modal .thumb.active {
	border-color: var(--gold-deep);
}

.hall-modal .body {
	padding: 50px 50px 40px;
	overflow-y: auto;
}

.hall-modal .body .eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--gold-deep);
	font-weight: 500;
	margin-bottom: 12px;
}

.hall-modal .body .eyebrow::before {
	content: "";
	width: 24px;
	height: 1px;
	background: var(--gold);
}

.hall-modal h3 {
	font-family: var(--display);
	font-size: 38px;
	font-weight: 400;
	margin: 0 0 6px;
	letter-spacing: -0.02em;
	line-height: 1.1;
	color: var(--ink);
}

.hall-modal .tag {
	font-family: var(--display);
	font-style: italic;
	color: var(--gold-deep);
	font-size: 18px;
	margin: 0 0 24px;
}

.hall-modal .specs {
	display: grid;
	grid-template-columns: repeat(3, auto);
	gap: 24px;
	padding: 20px 0;
	border-top: 1px solid var(--line-light);
	border-bottom: 1px solid var(--line-light);
	margin: 0 0 24px;
}

.hall-modal .specs > div {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.hall-modal .specs .l {
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--muted);
}

.hall-modal .specs .v {
	font-family: var(--display);
	font-size: 16px;
	color: var(--ink);
	font-weight: 500;
	line-height: 1.3;
}

.hall-modal .desc p {
	margin: 0 0 14px;
	color: var(--muted-light);
	line-height: 1.65;
	font-size: 15px;
}

.hall-modal .features-head {
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--muted);
	margin: 24px 0 14px;
	font-weight: 500;
}

.hall-modal .features {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px 24px;
	list-style: none;
	padding: 0;
	margin: 0 0 28px;
	font-size: 14px;
}

.hall-modal .features li {
	padding: 6px 0 6px 22px;
	position: relative;
	color: var(--ink-2);
}

.hall-modal .features li::before {
	content: "→";
	position: absolute;
	left: 0;
	top: 6px;
	color: var(--gold-deep);
}

.hall-modal .cta {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
}

.hall-modal .cta .btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 24px;
	font-size: 13px;
	font-weight: 500;
	border-radius: 99px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: all 0.3s var(--ease);
	letter-spacing: 0.01em;
	text-decoration: none;
}

.hall-modal .cta .btn-dark {
	background: var(--ink);
	color: var(--paper);
	border-color: var(--ink);
}

.hall-modal .cta .btn-dark:hover {
	background: var(--gold);
	border-color: var(--gold);
	color: var(--ink);
	transform: translateY(-2px);
}

.hall-modal .cta .btn-outline {
	background: transparent;
	color: var(--ink);
	border-color: var(--ink);
}

.hall-modal .cta .btn-outline:hover {
	background: var(--ink);
	color: var(--paper);
}

.hall-modal .cta .arrow {
	transition: transform 0.3s var(--ease);
}

.hall-modal .cta .btn:hover .arrow {
	transform: translateX(4px);
}

@media (max-width: 920px) {
	.hall-modal { padding: 0; }
	.hall-modal .box { grid-template-columns: 1fr; max-height: 100vh; border-radius: 0; }
	.hall-modal .gallery .main img { min-height: 240px; border-radius: 0; }
	.hall-modal .body { padding: 32px 24px; }
	.hall-modal .specs { grid-template-columns: 1fr; }
}
