/* ============================================================
   CIRHT Interactive Partners Map — scoped to .cirht-map-container
   ============================================================ */

.cirht-map-container {
  position: relative;
  font-family: Arial, Helvetica, sans-serif;
  box-sizing: border-box;
}

.cirht-map-container *,
.cirht-map-container *::before,
.cirht-map-container *::after {
  box-sizing: border-box;
}

/* Layout */
.cirht-map-layout {
  display: flex;
  width: 100%;
}

.cirht-layout-below {
  flex-direction: column;
}

.cirht-layout-beside {
  flex-direction: row;
  gap: 24px;
  align-items: flex-start;
}

.cirht-layout-beside .cirht-map-svg-wrap {
  flex: 1 1 auto;
}

.cirht-layout-beside .cirht-map-legend {
  flex: 0 0 180px;
  padding-top: 8px;
}

/* SVG */
.cirht-map-svg-wrap {
  width: 100%;
  line-height: 0;
}

.cirht-map-svg-wrap svg {
  width: 100%;
  height: auto;
  display: block;
  touch-action: pan-x pan-y pinch-zoom;
}

/* Country paths */
.cirht-map-container svg path[data-iso],
.cirht-map-container svg circle[data-iso],
.cirht-map-container svg ellipse[data-iso] {
  stroke: #FFFFFF;
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: opacity 0.15s ease;
  outline: none !important;
}

.cirht-map-container svg path[data-iso]:hover,
.cirht-map-container svg circle[data-iso]:hover,
.cirht-map-container svg ellipse[data-iso]:hover {
  opacity: 0.85;
}

.cirht-map-container svg path[data-iso]:focus,
.cirht-map-container svg circle[data-iso]:focus,
.cirht-map-container svg ellipse[data-iso]:focus {
  outline: 2px solid #FFCB05;
  outline-offset: 1px;
}

/* ---- Tooltip ---- */
.cirht-tooltip {
  position: fixed;
  z-index: 99999;
  background: #F7F6F2;
  border: 1px solid #CCCCCC;
  border-radius: 3px;
  padding: 12px;
  max-width: 260px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  font-family: Arial, Helvetica, sans-serif;
}

.cirht-tooltip.visible {
  opacity: 1;
}

.cirht-tooltip-name {
  color: #00274C;
  font-weight: bold;
  font-size: 14px;
  line-height: 1.3;
  margin: 0 0 3px;
}

.cirht-tooltip-status {
  color: #0D6E6E;
  font-size: 12px;
  font-weight: normal;
  margin: 0 0 4px;
}

.cirht-tooltip-subline {
  color: #1A1A1A;
  font-size: 12px;
  font-style: italic;
  margin: 0 0 6px;
}

.cirht-tooltip-fields {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid #e0dfdb;
  padding-top: 6px;
  margin-top: 4px;
}

.cirht-tooltip-fields li {
  font-size: 11px;
  color: #1A1A1A;
  line-height: 1.4;
  margin-bottom: 3px;
}

.cirht-tooltip-fields li:last-child {
  margin-bottom: 0;
}

.cirht-tooltip-field-label {
  font-weight: bold;
}

.cirht-tooltip-field-value {
  font-weight: normal;
}

/* ---- Modal ---- */
.cirht-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(26, 26, 26, 0.6);
  align-items: center;
  justify-content: center;
}

.cirht-modal-overlay.open {
  display: flex;
}

.cirht-modal-container {
  background: #fff;
  max-width: 600px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  border-radius: 4px;
  padding: 32px;
  position: relative;
  font-family: Arial, Helvetica, sans-serif;
}

.cirht-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: #1A1A1A;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.cirht-modal-close:hover {
  color: #00274C;
}

.cirht-modal-body {
  color: #1A1A1A;
  font-size: 15px;
  line-height: 1.6;
}

.cirht-modal-body h2,
.cirht-modal-body h3 {
  color: #00274C;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 20px;
  margin-top: 0;
}

/* ---- Legend ---- */
.cirht-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 14px;
  padding: 0;
}

.cirht-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #1A1A1A;
  font-family: Arial, Helvetica, sans-serif;
}

.cirht-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 1px;
  flex-shrink: 0;
}

/* ---- Mobile ---- */
@media (max-width: 767px) {
  .cirht-layout-beside {
    flex-direction: column;
  }

  .cirht-layout-beside .cirht-map-legend {
    flex: none;
    width: 100%;
  }

  .cirht-tooltip {
    position: absolute !important;
    bottom: 16px;
    left: 50% !important;
    transform: translateX(-50%);
    top: auto !important;
    max-width: calc(100vw - 32px);
  }
}
