/* Native Image Hotspots (H5P Image Hotspots replacement) */

.ih {
  margin: 0 0 1.25rem;
  max-width: 100%;
}

.ih-stage {
  position: relative;
  display: block;
  width: 100%;
  line-height: 0;
  background: #f4f4f4;
}

.ih-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.ih-hotspot {
  position: absolute;
  z-index: 2;
  width: 1.65rem;
  height: 1.65rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  background: var(--ih-color, #fff300);
  box-shadow:
    0 0 0 3px rgba(255, 243, 0, 0.35),
    0 0 12px 2px rgba(255, 243, 0, 0.55),
    0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ih-hotspot::before,
.ih-hotspot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #222;
  border-radius: 1px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ih-hotspot::before {
  width: 55%;
  height: 2px;
}

.ih-hotspot::after {
  width: 2px;
  height: 55%;
}

.ih-hotspot:hover,
.ih-hotspot:focus-visible,
.ih-hotspot[aria-expanded="true"] {
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow:
    0 0 0 4px rgba(255, 243, 0, 0.45),
    0 0 16px 4px rgba(255, 243, 0, 0.7),
    0 2px 6px rgba(0, 0, 0, 0.3);
  outline: none;
}

.ih-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 20, 20, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.ih-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.ih-popup {
  position: fixed;
  z-index: 1001;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(560px, calc(100vw - 2rem));
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #2a2a2a;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.ih-popup.is-open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.ih-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e6e6e6;
  background: #fafafa;
}

.ih-popup-title {
  margin: 0;
  font-family: "Quattrocento Sans", "Lato", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: #111;
}

.ih-popup-close {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: #ececec;
  color: #333;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.ih-popup-close:hover,
.ih-popup-close:focus-visible {
  background: #ddd;
  outline: none;
}

.ih-popup-body {
  padding: 1rem 1.1rem 1.25rem;
  overflow: auto;
  font-family: "Quattrocento Sans", "Lato", sans-serif;
  font-size: 0.95rem;
  line-height: 1.55;
}

.ih-popup-body p {
  margin: 0 0 0.75em;
}

.ih-popup-body p:last-child {
  margin-bottom: 0;
}

.ih-popup-body ul,
.ih-popup-body ol {
  margin: 0 0 0.75em;
  padding-left: 1.25em;
}

.ih-popup-body a {
  color: #336699;
  text-decoration: underline;
}

.ih-popup-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.5rem 0;
}

.ih-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 2rem;
  background: #f0f0f0;
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}
