/*****************************************************
LEAFLET MAP POPUP STYLES
*****************************************************/

/* Override Leaflet's default max-width constraint */
.leaflet-popup {
  /* Box Model */
  max-width: none !important;
}

/* Reset Leaflet popup padding */
.leaflet-popup-content-wrapper {
  /* Box Model */
  padding: 0;
  
  /* Visual */
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
  /* Box Model */
  margin: 0;
  padding: 0;
  width: auto !important;
  max-width: none !important;
}

.leaflet-popup-content p {
  margin: 0 !important
}

/* Horizontal card-style layout for popups */
.popup-wrapper {
  /* Display */
  display: flex;
  flex-direction: row;
  
  /* Box Model */
  width: 500px;
  max-height: 200px;
  
  /* Typography */
  font-family: var(--font-body);
  
  /* Visual */
  background: white;
  overflow: hidden;
}

/* Image container on the left - fixed size */
.popup-wrapper img {
  /* Box Model */
  flex: 0 0 200px;
  width: 200px;
  height: 200px;
  margin-right: 1rem;
  
  /* Visual */
  object-fit: cover;
  object-position: center;
}

/* Text content on the right */
.popup-text {
  /* Display */
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  
  /* Box Model */
  gap: 0.25rem;
  overflow: auto;
  
  /* Typography */
  line-height: 1.4;
}

.popup-title {
  /* Box Model */
  margin: 0 0 0.25rem 0;
  
  /* Typography */
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.popup-title a {
  /* Typography */
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
}

.popup-title a:hover {
  /* Typography */
  color: var(--text-link);
  text-decoration: underline;
}

.popup-placename {
  /* Box Model */
  margin: 0 0 0.5rem 0;
  
  /* Typography */
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.2;
}

.popup-summary {
  /* Box Model */
  margin: 0;
  
  /* Typography */
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.3;
}

/* Responsive: vertical on small screens */
@media (max-width: 768px) {
  .popup-wrapper {
    /* Display */
    flex-direction: column;
    
    /* Box Model */
    min-width: 280px;
    max-width: 320px;
  }

  .popup-wrapper img {
    /* Box Model */
    flex: 0 0 auto;
    width: 100%;
    height: 180px;
  }
}