/**
 * BLU-D Construction — Projects map panel
 * Add as css/components/project-map.css
 */

/* ============================================================
   MAP TOGGLE BUTTON — sits right of sector pills
   ============================================================ */

.blud-map-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-big-blu);
  color: var(--color-white);
  border: 2px solid var(--color-big-blu);
  border-radius: var(--border-radius);
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: background var(--transition-speed), border-color var(--transition-speed);
  white-space: nowrap;
  flex-shrink: 0;
}

.blud-map-toggle:hover {
  background: var(--color-old-pitch);
  border-color: var(--color-old-pitch);
}

.blud-map-toggle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Active state */
.map-panel-open .blud-map-toggle {
  background: var(--color-old-pitch);
  border-color: var(--color-old-pitch);
}

/* ============================================================
   OVERLAY — dims the page behind the panel
   ============================================================ */

#blud-map-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#blud-map-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   MAP PANEL — slides in from right
   ============================================================ */

#blud-map-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 95vw;
  height: 100vh;
  background: var(--color-white);
  z-index: 500;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
}

#blud-map-panel.is-open {
  transform: translateX(0);
}

/* Panel header */
.blud-map-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--color-big-blu);
  color: var(--color-white);
  flex-shrink: 0;
}

.blud-map-panel__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-white);
  margin: 0;
}

.blud-map-panel__subtitle {
  font-size: 0.75rem;
  color: var(--color-blu-sky);
  margin: 0.1rem 0 0;
}

#blud-map-panel-close {
  background: transparent;
  border: none;
  color: var(--color-white);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius);
  transition: background var(--transition-speed);
}

#blud-map-panel-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

#blud-map-panel-close svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Panel map container */
.blud-map-panel__map {
  position: relative;
  overflow: hidden;
  height: calc(100vh - 110px);
}

/* Kill flex on view-content inside the panel — it covers the map */
.blud-map-panel__map .view-content {
  display: block !important;
  height: 100% !important;
  position: relative;
}

/* Let views and geolocation wrapper fill the space */
.blud-map-panel__map .views-element-container,
.blud-map-panel__map .view,
.blud-map-panel__map .geolocation-map-wrapper {
  height: 100% !important;
}

/* Override Geolocation's inline height: 400px */
.blud-map-panel__map .geolocation-map-container {
  height: calc(100vh - 110px) !important;
  width: 100% !important;
}

/* Hide the hidden location divs — they don't need space */
.blud-map-panel__map .geolocation-location {
  display: none !important;
}

/* Panel footer */
.blud-map-panel__footer {
  padding: 0.75rem 1.25rem;
  background: var(--color-chalk);
  border-top: 1px solid var(--color-light-gray);
  font-size: 0.8rem;
  color: var(--color-mid-gray);
  flex-shrink: 0;
  text-align: center;
}

/* ============================================================
   PREVENT BODY SCROLL WHEN PANEL IS OPEN
   ============================================================ */

body.map-panel-open {
  overflow: hidden;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  #blud-map-panel {
    width: 100vw;
    max-width: 100vw;
  }
}

/* ============================================================
   PROJECT FILTER PILLS
   ============================================================ */

.blud-project-filter {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.blud-project-filter__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
}

.blud-pill {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 2rem;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-decoration: none;
  border: 2px solid var(--color-light-gray);
  color: var(--color-warm-charcoal);
  background: var(--color-white);
  transition: all var(--transition-speed);
  white-space: nowrap;
}

.blud-pill:link,
.blud-pill:visited {
  color: var(--color-warm-charcoal);
  background: var(--color-white);
  border-color: var(--color-light-gray);
}

.blud-pill:hover,
.blud-pill:focus {
  border-color: var(--color-big-blu);
  color: var(--color-big-blu);
  background: var(--color-white);
  text-decoration: none;
}

.blud-pill--active,
.blud-pill--active:link,
.blud-pill--active:visited {
  background: var(--color-big-blu);
  color: var(--color-white) !important;
  border-color: var(--color-big-blu);
}

.blud-pill--active:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}



/* Fix panel header visibility */
.blud-map-panel__header {
  position: relative;
  z-index: 510;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--color-big-blu);
  color: var(--color-white);
  flex-shrink: 0;
  min-height: 60px;
}

.blud-map-panel__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-white);
  margin: 0;
}

.blud-map-panel__subtitle {
  font-size: 0.75rem;
  color: var(--color-blu-sky);
  margin: 0.1rem 0 0;
}

#blud-map-panel-close {
  background: transparent;
  border: none;
  color: var(--color-white);
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius);
  transition: background var(--transition-speed);
  flex-shrink: 0;
}

#blud-map-panel-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

#blud-map-panel-close svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Push contextual links below header */
#blud-map-panel .contextual {
  z-index: 505;
}


/* Push panel below Gin toolbar when logged in */
.adminimal-admin-toolbar #blud-map-panel,
.gin--vertical-toolbar #blud-map-panel {
  top: var(--drupal-displace-offset-top, 0px);
  height: calc(100vh - var(--drupal-displace-offset-top, 0px));
}