/* =============================================================
   Sri Lanka Interactive Map — WordPress Plugin Stylesheet
   Scope: .slmap-wrap (prevents theme conflicts)
   ============================================================= */

/* ── Variables ──────────────────────────────────────────────── */
.slmap-wrap {
  --slmap-bg:          rgba(45, 40, 37, 0.96); /* Dark brownish-grey */
  --slmap-text-main:   #ffffff;
  --slmap-text-muted:  rgba(255, 255, 255, 0.75);
  --slmap-border:      rgba(255, 255, 255, 0.1);
  --slmap-ease:        0.3s cubic-bezier(0.4, 0, 0.2, 1);

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  box-sizing: border-box;
  line-height: 1.6;
  position: relative;
  background-color: #111;
  background-size: cover;
  background-position: center;
}

.slmap-wrap *,
.slmap-wrap *::before,
.slmap-wrap *::after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

/* ── Layout ─────────────────────────────────────────────────── */
.slmap-layout {
  display: grid;
  grid-template-columns: 50% 50%;
  min-height: 700px;
}

/* ── Left Panel ─────────────────────────────────────────────── */
.slmap-panel {
  background: var(--slmap-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  padding: 4rem 3rem 2rem 4rem;
}

.slmap-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── Heading ────────────────────────────────────────────────── */
.slmap-heading {
  font-family: 'Caveat', cursive;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--slmap-text-main);
  margin-bottom: 2.5rem;
  line-height: 1.1;
  flex-shrink: 0;
}

/* ── Content Area ───────────────────────────────────────────── */
.slmap-content-area {
  flex: 1 1 auto;
  position: relative;
  min-height: 200px;
}

.slmap-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--slmap-ease), transform var(--slmap-ease);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.slmap-content.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.slmap-content h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.8rem, 2.5vw, 2.4rem);
  font-weight: 400;
  color: var(--slmap-text-main);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.slmap-body p {
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--slmap-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-right: 1rem;
}

/* ── Region Navigation Links (Grid) ─────────────────────────── */
.slmap-links {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2rem;
  border-top: 1px solid var(--slmap-border);
}

.slmap-link {
  display: flex;
  align-items: center;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--slmap-border);
  text-decoration: none !important;
  transition: opacity var(--slmap-ease);
  cursor: pointer;
}

.slmap-link:hover,
.slmap-link.active {
  opacity: 1;
}

.slmap-link-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--slmap-text-muted);
  transition: color var(--slmap-ease);
  line-height: 1.4;
}

.slmap-link:hover .slmap-link-label,
.slmap-link.active .slmap-link-label {
  color: var(--slmap-text-main);
}

/* ── SVG Map Panel ──────────────────────────────────────────── */
.slmap-svg-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 2rem;
}

.slmap-svg {
  width: 90%;
  max-width: 500px;
  max-height: 85%;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}

/* ── SVG Regions ────────────────────────────────────────────── */
.slmap-region {
  cursor: pointer;
  outline: none;
  transition: filter var(--slmap-ease);
}

.slmap-region path {
  fill: transparent;
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 1px;
  transition: fill var(--slmap-ease), stroke var(--slmap-ease);
}

.slmap-region:hover path {
  fill: rgba(255, 255, 255, 0.5);
  stroke: rgba(255, 255, 255, 0.8);
}

.slmap-region.active path {
  fill: #ffffff;
  stroke: #ffffff;
}

.slmap-region:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* ── Tooltip ────────────────────────────────────────────────── */
.slmap-tooltip {
  position: absolute;
  background: var(--slmap-bg);
  color: var(--slmap-text-main);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  border: 1px solid var(--slmap-border);
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.slmap-tooltip.visible {
  opacity: 1;
  transform: translateY(-8px);
}

.slmap-tooltip::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom: none;
  border-top-color: var(--slmap-bg);
}

/* ── Entrance animation ─────────────────────────────────────── */
@keyframes slmap-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.slmap-panel  { animation: slmap-fade-in 0.55s ease both; }
.slmap-svg-wrap { animation: slmap-fade-in 0.55s 0.12s ease both; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  .slmap-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  
  .slmap-svg-wrap {
    min-height: 60vw;
  }
  
  .slmap-panel {
    padding: 3rem 2rem;
  }
}

@media (max-width: 680px) {
  .slmap-links {
    grid-template-columns: 1fr;
    column-gap: 0;
  }
}
