/*
 * Terroirs et Territoires — Carte.
 */

.tet-map-page {
  width: 100%;
  max-width: none;
}

.tet-map-page__header {
  margin-bottom: 1.4rem;
}

.tet-map-page__intro {
  margin: 0;
  max-width: 760px;
  font-size: 1.06rem;
  line-height: 1.6;
}

.tet-map {
  position: relative;
  width: 100%;
  height: clamp(600px, 72vh, 860px);
  min-height: 600px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.035);
  z-index: 0;
}

.tet-map__loading,
.tet-map__message,
.tet-map__empty {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 600;
  transform: translate(-50%, -50%);
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 3px;
  text-align: center;
  pointer-events: none;
}

.tet-map.leaflet-container .tet-map__loading {
  display: none;
}

.tet-map-page__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.65rem;
  font-size: 0.9rem;
  opacity: 0.62;
}

.tet-map-popup {
  font-family: inherit;
}

.tet-map-popup__image-link {
  display: block;
  margin: -1px -1px 0.75rem;
  overflow: hidden;
}

.tet-map-popup__image {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.tet-map-popup__title {
  margin: 0 0 0.55rem;
  font-size: 1.15rem;
  line-height: 1.22;
}

.tet-map-popup__title a {
  color: inherit;
  text-decoration: none;
}

.tet-map-popup__title a:hover,
.tet-map-popup__title a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tet-map-popup__excerpt {
  margin: 0 0 0.7rem;
  line-height: 1.45;
}

.tet-map-popup__more {
  color: inherit;
  font-weight: 600;
  text-underline-offset: 3px;
}

.tet-map .marker-cluster-small,
.tet-map .marker-cluster-medium,
.tet-map .marker-cluster-large {
  background: rgba(255, 255, 255, 0.74);
}

.tet-map .marker-cluster-small div,
.tet-map .marker-cluster-medium div,
.tet-map .marker-cluster-large div {
  background: rgba(40, 40, 40, 0.88);
  color: #fff;
  font-family: inherit;
}

@media (max-width: 720px) {
  .tet-map {
    height: 66vh;
    min-height: 460px;
    border-radius: 0;
  }

  .tet-map-page__footer {
    justify-content: flex-start;
  }
}


/*
 * Full-width layout for the map route only.
 * These selectors cover the most common Drupal theme wrappers. They are
 * intentionally scoped to .tet-map-route so the rest of the site is untouched.
 */
.tet-map-route .layout-sidebar-first,
.tet-map-route .layout-sidebar-second,
.tet-map-route #sidebar-first,
.tet-map-route #sidebar-second,
.tet-map-route .sidebar-first,
.tet-map-route .sidebar-second,
.tet-map-route .region-sidebar-first,
.tet-map-route .region-sidebar-second {
  display: none !important;
}

.tet-map-route main,
.tet-map-route .main-content,
.tet-map-route .layout-content,
.tet-map-route .region-content {
  width: 100%;
  max-width: none;
  flex: 1 1 100%;
}

/* If the theme uses a two-column grid, collapse it on /carte. */
.tet-map-route .layout-container,
.tet-map-route .main-wrapper,
.tet-map-route .page-content {
  grid-template-columns: minmax(0, 1fr);
}
