/* ── Shared Nav (used on both pages) ── */
.index-nav {
  display: flex;
  justify-content: flex-end;
  padding: 8px 0 0;
  animation: fadeUp 0.6s ease both;
}
.nav-link-right {
  transform: none;
}
.nav-link-right:hover {
  transform: translateX(3px) !important;
}

/* ── Map Page Overrides ── */

body.is-map-page {
  height: 100%;
  overflow: hidden;
}

.map-page {
  max-width: 100%;
  width: 100%;
  padding: 0;
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* ── Nav ── */
.site-nav {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  animation: fadeUp 0.6s ease both;
}
.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--accent-light);
  border-radius: 100px;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}
.nav-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateX(-3px);
}

/* ── Map Hero ── */
.map-hero {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 0;
  margin: 0;
}
.map-hero h1 {
  font-size: 32px;
  margin: 0;
}

/* ── Map Legend ── */
.map-legend {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 10;
  background: rgb(250, 249, 249);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(12px);
  font-family: var(--font-body);
  min-width: flex;
  user-select: none;
}

.legend-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 6px;
  cursor: grab;
  border-bottom: 1px solid var(--card-border);
  position: relative;
}

.legend-handle:active {
  cursor: grabbing;
}

.legend-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.legend-drag-hint {
  font-size: 11px;
  color: var(--ink-soft);
  opacity: 0.45;
  line-height: 1;
}

.legend-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 0;
}

.legend-filter-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: normal;
  flex-shrink: 0;
  width: 72px;
  line-height: 1.3;
}

.legend-toggle {
  display: block;
  width: calc(100% - 24px);
  margin: 10px 12px 8px 10px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(201, 125, 78, 0.08);
  border: 1px solid var(--accent-light);
  border-radius: 100px;
  padding: 5px 8px;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
  text-align: center;
}

.legend-filter-row .legend-toggle {
  display: inline-block;
  width: auto;
  margin: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}

.legend-toggle:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.legend-toggle.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.legend-agencies {
  border-top: 1px solid var(--card-border);
  margin-top: 8px;
}

.legend-agencies-title {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  padding: 8px 12px 2px;
  text-align: center;
}

.legend-items {
  list-style: none;
  margin: 0;
  padding: 4px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--ink-soft);
}

.legend-icon-img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.legend-icon-img.dimmed {
  opacity: 0.4;
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.legend-dot.mon-visited {
  background: #c97d4e;
  border: 1.5px solid #0c0c0c;
}

.legend-dot.mon-unvisited {
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid #c97d4e;
}

/* ── Map Card ── */
.map-card {
  padding: 60px 15px 15px 15px;
  margin: 0;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  flex: 1;
  display: flex;
  flex-direction: row-reverse;
  animation-delay: 0.15s;
}

.map-intro {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.75;
  margin-bottom: 20px;
}

/* ── OpenLayers Map ── */
#map {
  width: 100%;
  flex: 1;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

/* Style the OL attribution text */
.ol-attribution {
  font-family: var(--font-body) !important;
  font-size: 10px !important;
}
.ol-attribution a { color: var(--accent) !important; }

/* ── Marianas Attribution (full-width) ── */
#marianas-inset .ol-attribution {
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  border-radius: 0 !important;
  justify-content: right !important;
  font-size: 9px !important;
}
#marianas-inset .ol-attribution ul {
  margin: 0 auto !important;
  font-size: 9px !important;
}

/* Zoom controls */
.ol-zoom {
  top: 12px !important;
  left: 12px !important;
  background-color: rgba(255, 255, 255, 0) !important;
}
.ol-zoom .ol-zoom-in,
.ol-zoom .ol-zoom-out,
.ol-reset-extent {
  background: rgba(255,255,255,0.92) !important;
  color: var(--ink-soft) !important;
  border: 1px solid var(--card-border) !important;
  border-radius: 8px !important;
  font-size: 18px !important;
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  margin-bottom: 4px !important;
  transition: background 0.2s !important;
}
.ol-zoom .ol-zoom-in:hover,
.ol-zoom .ol-zoom-out:hover,
.ol-reset-extent:hover {
  background: var(--accent) !important;
  color: #fff !important;
}

/* ── Stats Row ── */
.map-stats {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
  margin-top: 20px;
  padding: 16px 8px;
  background: rgba(201,125,78,0.05);
  border: 1px solid var(--card-border);
  border-radius: 12px;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.stat-val {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.5px;
}
.stat-key {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.6;
}
.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--accent-light);
  opacity: 0.6;
}

/* ── Highlights ── */
.highlights-card { animation-delay: 0.25s; }

.highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 4px;
}
.highlight {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.highlight-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.highlight-text strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}
.highlight-text p {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
  opacity: 0.85;
}

/* ── Marker Pulse ── */
.map-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(201,125,78,0.5);
  position: relative;
}
.map-marker::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(201,125,78,0.4);
  animation: pulse 20s ease-in-out infinite;
}
@keyframes pulse {
  0%   { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ── Inset Map Zoom Buttons (50% smaller) ── */
#alaska-inset .ol-zoom,
#hawaii-inset .ol-zoom,
#samoa-inset .ol-zoom,
#marianas-inset .ol-zoom,
#virgin-islands-inset .ol-zoom {
  top: 6px !important;
  left: 6px !important;
}

#hawaii-inset .ol-zoom .ol-zoom-in,
#hawaii-inset .ol-zoom .ol-zoom-out,
#hawaii-inset .ol-reset-extent,
#samoa-inset .ol-zoom .ol-zoom-in,
#samoa-inset .ol-zoom .ol-zoom-out,
#samoa-inset .ol-reset-extent,
#marianas-inset .ol-zoom .ol-zoom-in,
#marianas-inset .ol-zoom .ol-zoom-out,
#marianas-inset .ol-reset-extent,
#virgin-islands-inset .ol-zoom .ol-zoom-in,
#virgin-islands-inset .ol-zoom .ol-zoom-out,
#virgin-islands-inset .ol-reset-extent {
  font-size: 9px !important;
  width: 16px !important;
  height: 16px !important;
  line-height: 16px !important;
  margin-bottom: 2px !important;
  border-radius: 4px !important;
}

#alaska-inset .ol-zoom .ol-zoom-in,
#alaska-inset .ol-zoom .ol-zoom-out,
#alaska-inset .ol-reset-extent {
  font-size: 9px !important;
  width: 24px !important;
  height: 24px !important;
  line-height: 16px !important;
  margin-bottom: 2px !important;
  border-radius: 4px !important;
}

/* ── Responsive ── */
@media (max-width: 560px) {
  #map { height: 300px; }
  .highlights { grid-template-columns: 1fr; gap: 16px; }
  .map-stats { flex-wrap: wrap; gap: 12px; }
  .stat-divider { display: none; }
  .map-card { padding: 24px 18px 20px; }
}
