.iih-wrapper {
	position: relative;
	max-width: 100%;
	margin: 1.5em 0;
}

.iih-frame {
	position: relative;
	width: 100%;
	line-height: 0;
	overflow: hidden;
	border-radius: 4px;
}

.iih-image {
	display: block;
	width: 100%;
	height: auto;
}

.iih-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

.iih-hotspot {
	fill: var(--iih-fill, #2271b1);
	fill-opacity: 0;
	stroke: var(--iih-stroke, #2271b1);
	stroke-opacity: 0;
	stroke-width: var(--iih-stroke-width, 2px);
	cursor: pointer;
	transition: fill-opacity 0.2s ease, stroke-opacity 0.2s ease;
	vector-effect: non-scaling-stroke;
}

.iih-hotspot:hover,
.iih-hotspot:focus,
.iih-hotspot.iih-active {
	fill-opacity: var(--iih-fill-opacity, 0.35);
	stroke-opacity: 1;
}

.iih-hotspot:focus {
	outline: none;
	stroke-dasharray: 4 2;
}

/* ---------- Tooltip ---------- */
.iih-tooltip {
	position: absolute;
	z-index: 30;
	max-width: 280px;
	background: #1e1e1e;
	color: #fff;
	padding: 12px 14px;
	border-radius: 6px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	font-size: 14px;
	line-height: 1.5;
}

.iih-tooltip::after {
	content: "";
	position: absolute;
	border: 7px solid transparent;
}

.iih-tooltip[data-arrow="top"]::after {
	top: 100%;
	left: 20px;
	border-top-color: #1e1e1e;
}

.iih-tooltip[data-arrow="bottom"]::after {
	bottom: 100%;
	left: 20px;
	border-bottom-color: #1e1e1e;
}

.iih-tooltip h4 {
	margin: 0 0 6px;
	font-size: 15px;
	padding-right: 18px;
}

.iih-tooltip p {
	margin: 0 0 6px;
}

.iih-description img,
.iih-description iframe,
.iih-description embed,
.iih-description video {
	max-width: 100%;
	height: auto;
}

.iih-description iframe {
	aspect-ratio: 16 / 9;
	width: 100%;
	border: none;
}

.iih-description .gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 8px 0;
}

.iih-description .gallery img {
	width: 70px;
	height: 70px;
	object-fit: cover;
	border-radius: 4px;
}

.iih-tooltip .iih-close {
	position: absolute;
	top: 6px;
	right: 8px;
	background: none;
	border: none;
	color: #fff;
	opacity: 0.7;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	padding: 2px;
}

.iih-tooltip .iih-close:hover {
	opacity: 1;
}

/* ---------- Opening animations (tooltip & lightbox) ---------- */
@keyframes iih-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes iih-zoom-in {
	from { opacity: 0; transform: scale(0.85); }
	to   { opacity: 1; transform: scale(1); }
}

@keyframes iih-slide-in {
	from { opacity: 0; transform: translateY(14px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes iih-bounce-in {
	0%   { opacity: 0; transform: scale(0.3); }
	60%  { opacity: 1; transform: scale(1.08); }
	100% { opacity: 1; transform: scale(1); }
}

@keyframes iih-pop-in {
	from { opacity: 0; transform: scale(0); }
	to   { opacity: 1; transform: scale(1); }
}

.iih-anim-fade   { animation: iih-fade-in 0.25s ease both; }
.iih-anim-zoom   { animation: iih-zoom-in 0.25s ease both; }
.iih-anim-slide  { animation: iih-slide-in 0.3s ease both; }
.iih-anim-bounce { animation: iih-bounce-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.iih-anim-pop    { animation: iih-pop-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

.iih-tooltip.iih-anim-pop,
.iih-tooltip.iih-anim-zoom,
.iih-tooltip.iih-anim-bounce {
	transform-origin: var(--iih-anim-origin-x, 50%) var(--iih-anim-origin-y, 50%);
}

/* Side panels already animate via transform (slide-in), so "animation"
   choice is expressed as a different transition easing instead of a
   second, conflicting transform animation. Overrides declared below the
   base .iih-panel rule via higher specificity. */
.iih-panel.iih-anim-bounce {
	transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.iih-panel.iih-anim-slide {
	transition: transform 0.35s ease-out;
}

/* ---------- Side panel ---------- */
.iih-panel {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 85%;
	max-width: 340px;
	background: #fff;
	box-shadow: 0 0 24px rgba(0, 0, 0, 0.25);
	padding: 20px;
	overflow-y: auto;
	z-index: 25;
	transition: transform 0.25s ease;
	box-sizing: border-box;
}

.iih-panel.iih-panel-left {
	left: 0;
	transform: translateX(-100%);
}

.iih-panel.iih-panel-right {
	right: 0;
	transform: translateX(100%);
}

.iih-panel.iih-panel-open {
	transform: translateX(0);
}

.iih-panel h4 {
	margin-top: 0;
	padding-right: 24px;
}

.iih-panel .iih-close {
	position: absolute;
	top: 12px;
	right: 12px;
	background: none;
	border: none;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: #333;
}

/* ---------- Lightbox ---------- */
.iih-lightbox-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 20px;
	box-sizing: border-box;
	animation: iih-fade-in 0.2s ease both;
}

.iih-lightbox-box {
	background: #fff;
	border-radius: 6px;
	max-width: 560px;
	width: 100%;
	max-height: 85vh;
	overflow-y: auto;
	padding: 28px;
	position: relative;
	box-sizing: border-box;
	transform-origin: var(--iih-anim-origin-x, 50%) var(--iih-anim-origin-y, 50%);
}

.iih-lightbox-box h4 {
	margin-top: 0;
	padding-right: 24px;
}

.iih-lightbox-box .iih-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #333;
}

@media (max-width: 480px) {
	.iih-panel {
		max-width: 100%;
	}
}
