/* Mapa del Misterio — CDM Atlas */

.cdm-atlas {
  --cdm-atlas-bg: #0d0d0d;
  --cdm-atlas-panel: rgba(13, 13, 13, 0.92);
  --cdm-atlas-border: rgba(139, 26, 26, 0.35);
  --cdm-atlas-text: #e5e5e5;
  --cdm-atlas-muted: #888;
  --cdm-atlas-accent: var(--cdm-red, #8b1a1a);
  --cdm-atlas-gold: var(--cdm-heading-h2, #d4a574);
  background: var(--cdm-atlas-bg);
  color: var(--cdm-atlas-text);
}

.cdm-atlas-hero {
  padding: 2.5rem 1.25rem 1.5rem;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.cdm-atlas-hero .cdm-breadcrumb {
  justify-content: center;
  margin-bottom: 1rem;
}

.cdm-atlas-hero h1 {
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  color: var(--cdm-atlas-gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
}

.cdm-atlas-hero p {
  color: var(--cdm-atlas-muted);
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 0;
  font-style: italic;
}

.cdm-atlas-map-shell {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

.cdm-atlas-map {
  width: 100%;
  height: 70vh;
  min-height: 480px;
  background: #0d0d0d;
  z-index: 1;
}

.cdm-atlas--shortcode .cdm-atlas-map {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--cdm-atlas-border);
}

.leaflet-container {
  background: #0d0d0d !important;
  font-family: inherit;
}

.leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.65) !important;
  color: #777 !important;
  font-size: 10px !important;
}

.leaflet-control-attribution a {
  color: #aaa !important;
}

.leaflet-popup-content-wrapper {
  background: rgba(13, 13, 13, 0.96) !important;
  border: 1px solid #333 !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.75) !important;
  color: var(--cdm-atlas-text) !important;
  padding: 0 !important;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0 !important;
  width: 240px !important;
}

.leaflet-popup-tip {
  background: rgba(13, 13, 13, 0.96) !important;
}

.leaflet-popup-close-button {
  color: #888 !important;
  font-size: 18px !important;
  top: 6px !important;
  right: 8px !important;
  z-index: 2;
}

.leaflet-popup-close-button:hover {
  color: var(--cdm-atlas-accent) !important;
}

.cdm-atlas-pin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.55), 0 0 12px rgba(139, 26, 26, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.cdm-atlas-pin:hover {
  transform: scale(1.15);
}

.cdm-atlas-popup {
  text-align: center;
}

.cdm-atlas-popup-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: #1a1a1a;
}

.cdm-atlas-popup-body {
  padding: 12px 14px 14px;
}

.cdm-atlas-popup-title {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.95rem;
  color: var(--cdm-atlas-gold);
  margin: 0 0 4px;
  line-height: 1.3;
}

.cdm-atlas-popup-region {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cdm-atlas-muted);
  margin-bottom: 8px;
}

.cdm-atlas-popup-excerpt {
  font-size: 0.8rem;
  color: #aaa;
  line-height: 1.45;
  margin: 0 0 12px;
}

.cdm-atlas-popup-btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  background: var(--cdm-atlas-accent);
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 4px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.2s ease, transform 0.15s ease;
}

.cdm-atlas-popup-btn:hover {
  background: #a32222;
  transform: translateY(-1px);
  color: #fff !important;
}

.cdm-atlas-filters {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 500;
  background: var(--cdm-atlas-panel);
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 14px 16px;
  min-width: 180px;
  backdrop-filter: blur(8px);
}

.cdm-atlas-filters-title {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cdm-atlas-muted);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #222;
}

.cdm-atlas-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.cdm-atlas-filter.is-off {
  opacity: 0.35;
}

.cdm-atlas-filter-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cdm-atlas-filter-label {
  font-size: 0.8rem;
  color: #ccc;
  flex: 1;
}

.cdm-atlas-filter-count {
  font-size: 0.7rem;
  color: #666;
  background: #1a1a1a;
  padding: 1px 7px;
  border-radius: 999px;
}

.cdm-atlas-search {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 500;
  width: min(280px, calc(100% - 32px));
}

.cdm-atlas-search-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--cdm-atlas-panel);
  border: 1px solid #333;
  border-radius: 8px;
  color: var(--cdm-atlas-text);
  font-size: 0.85rem;
  outline: none;
  backdrop-filter: blur(8px);
}

.cdm-atlas-search-input:focus {
  border-color: var(--cdm-atlas-accent);
  box-shadow: 0 0 0 1px rgba(139, 26, 26, 0.35);
}

.cdm-atlas-search-input::placeholder {
  color: #555;
}

.cdm-atlas-search-results {
  margin-top: 6px;
  background: rgba(13, 13, 13, 0.96);
  border: 1px solid #333;
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.cdm-atlas-search-item {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid #1a1a1a;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.cdm-atlas-search-item:last-child {
  border-bottom: 0;
}

.cdm-atlas-search-item:hover {
  background: #1a1a1a;
}

.cdm-atlas-search-item img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  background: #222;
  flex-shrink: 0;
}

.cdm-atlas-search-item-title {
  display: block;
  font-size: 0.8rem;
  color: #e0e0e0;
}

.cdm-atlas-search-item-meta {
  display: block;
  font-size: 0.65rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cdm-atlas-counter {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  background: var(--cdm-atlas-panel);
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 12px 18px;
  text-align: center;
  backdrop-filter: blur(8px);
}

.cdm-atlas-counter-num {
  display: block;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.85rem;
  color: var(--cdm-atlas-accent);
  line-height: 1;
  margin-bottom: 4px;
}

.cdm-atlas-counter-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cdm-atlas-muted);
}

.cdm-atlas-empty {
  padding: 3rem 1.25rem;
  text-align: center;
  color: var(--cdm-atlas-muted);
  max-width: 560px;
  margin: 0 auto;
}

.cdm-atlas-grid-wrap {
  padding: 3rem 1.25rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.cdm-atlas-grid-title {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.4rem;
  color: var(--cdm-atlas-gold);
  text-align: center;
  margin: 0 0 1.75rem;
  letter-spacing: 0.06em;
}

.cdm-atlas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.cdm-atlas-card {
  display: block;
  text-decoration: none !important;
  background: linear-gradient(145deg, #1a1a1a 0%, #222 100%);
  border: 1px solid rgba(139, 26, 26, 0.25);
  border-left: 3px solid var(--cdm-atlas-accent);
  border-radius: 10px;
  overflow: hidden;
  color: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.cdm-atlas-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 26, 26, 0.5);
}

.cdm-atlas-card.is-hidden {
  display: none;
}

.cdm-atlas-card-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: #1a1a1a;
  display: block;
}

.cdm-atlas-card-body {
  padding: 0.9rem 1rem 1.1rem;
}

.cdm-atlas-card-region {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cdm-atlas-accent);
  margin-bottom: 0.35rem;
}

.cdm-atlas-card-title {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1rem;
  color: var(--cdm-atlas-gold);
  margin: 0 0 0.4rem;
  line-height: 1.3;
}

.cdm-atlas-card:hover .cdm-atlas-card-title {
  color: #fff;
}

.cdm-atlas-card-excerpt {
  font-size: 0.85rem;
  color: #999;
  line-height: 1.45;
  margin: 0;
}

@media (max-width: 768px) {
  .cdm-atlas-map {
    height: 52vh;
    min-height: 360px;
  }

  .cdm-atlas-filters,
  .cdm-atlas-search,
  .cdm-atlas-counter {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    width: auto;
    margin: 0.75rem 1rem;
  }

  .cdm-atlas-map-shell {
    display: flex;
    flex-direction: column;
  }

  .cdm-atlas-map {
    order: 0;
  }

  .cdm-atlas-filters {
    order: 1;
  }

  .cdm-atlas-search {
    order: 2;
  }

  .cdm-atlas-counter {
    order: 3;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
  }
}
