/*
==================================================
FRANKLIN MAP EMBED STYLES
==================================================
*/

/*
==================================================
ROOT CONTAINER
==================================================
*/

.map-container,
.franklin-map {
  position: relative;
  width: 100%;
  height: min(900px, 85vh);
  min-height: 620px;

  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  color: #1f2937;

  overflow: hidden;

  background: #f8fafc;

  border-radius: 24px;
}

/*
==================================================
SCOPED RESET
==================================================
*/

.map-container *,
.franklin-map * {
  box-sizing: border-box;
}

.map-container img,
.franklin-map img {
  display: block;
  max-width: 100%;
}

.map-container button,
.map-container input,
.map-container textarea,
.map-container select,
.franklin-map button,
.franklin-map input,
.franklin-map textarea,
.franklin-map select {
  font: inherit;
}

.map-container a,
.franklin-map a {
  color: inherit;
}

/*
==================================================
SIDEBAR
==================================================
*/

#sidebar {
  position: absolute;
  top: 0;
  left: 0;

  width: 420px;
  max-width: 38%;

  height: 100%;

  background: #ffffff;

  border-right: 1px solid #e5e7eb;

  z-index: 20;

  overflow: hidden;
}

#map {
  margin-left: 420px;

  width: calc(100% - 420px);
  height: 100%;
}

/*
==================================================
LIST + DETAILS WRAPPERS
==================================================
*/

#location-list-view,
#location-details-view {
  width: 100%;
  height: 100%;
}

/*
==================================================
LIST VIEW
==================================================
*/

#location-list-view {
  overflow-y: auto;
  background: #fff;
}

#location-list-view.hidden {
  display: none;
}

.sidebar-header {
  position: sticky;
  top: 0;

  z-index: 20;

  padding: 28px 24px 22px;

  background: rgba(255, 255, 255, 0.96);

  backdrop-filter: blur(14px);

  border-bottom: 1px solid #eceff3;
}

.sidebar-header h2 {
  margin: 0;

  font-size: 30px;
  font-weight: 750;

  letter-spacing: -0.04em;

  color: #111827;
}

#location-list {
  padding: 16px;
}

/*
==================================================
LOCATION CARD
==================================================
*/

.location-card {
  display: flex;
  align-items: stretch;

  gap: 16px;

  min-height: 132px;

  padding: 14px;
  margin-bottom: 14px;

  border-radius: 20px;
  border: 1px solid #eceff3;

  background: #fff;

  cursor: pointer;

  overflow: hidden;

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.location-card.hover-linked {
  transform: translateY(-2px);
  border-color: #2d6cdf;
  box-shadow: 0 14px 34px rgba(45, 108, 223, 0.18);
}

.location-card .location-card-image {
  width: 120px;
  min-width: 120px;
  height: 120px;

  object-fit: cover;

  border-radius: 16px;

  flex-shrink: 0;

  background: #f3f4f6;
}

.location-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.location-card-title {
  margin: 0 0 10px;

  font-size: 18px;
  line-height: 1.35;
  font-weight: 750;

  color: #111827;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;

  overflow: hidden;
}

.location-card-address {
  margin: 0;

  font-size: 14px;
  line-height: 1.65;

  color: #5b6472;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;

  overflow: hidden;
}

/*
==================================================
DETAILS VIEW
==================================================
*/

#location-details-view {
  display: none;

  overflow-y: auto;

  padding: 28px;

  background: #fff;
}

#location-details-view.active {
  display: block;
}

#back-to-list {
  border: none;
  background: none;

  padding: 0;

  margin-bottom: 28px;

  font-size: 16px;
  font-weight: 700;

  color: #374151;

  cursor: pointer;

  transition: opacity 0.18s ease;
}

#back-to-list:hover {
  opacity: 0.72;
}

#panel-image {
  width: 100%;
  max-height: 340px;

  object-fit: cover;

  border-radius: 24px;

  margin-bottom: 28px;

  display: none;

  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
}

#panel-title {
  margin: 0 0 18px;

  font-size: 34px;
  line-height: 1.1;
  font-weight: 800;

  letter-spacing: -0.045em;

  color: #111827;
}

/*
==================================================
META
==================================================
*/

#panel-meta {
  display: flex;
  flex-direction: column;

  gap: 12px;

  margin-bottom: 28px;
}

#panel-meta:empty {
  display: none;
}

.panel-meta-pill {
  display: inline-flex;
  align-items: center;

  width: fit-content;

  padding: 8px 14px;

  border-radius: 999px;

  font-size: 12px;
  font-weight: 800;

  letter-spacing: 0.04em;

  text-transform: uppercase;

  border: 1px solid transparent;
}

/*
==================================================
SITE CATEGORY
==================================================
*/

.panel-meta-pill.sites {
  background: #e8f7ee;
  color: #1f7a45;
  border-color: #b7e4c7;
}

/*
==================================================
BUILDING CATEGORY
==================================================
*/

.panel-meta-pill.buildings {
  background: #eaf2ff;
  color: #2457b8;
  border-color: #c7dafc;
}

.panel-meta-address {
  font-size: 15px;
  line-height: 1.75;

  color: #4b5563;
}

/*
==================================================
DESCRIPTION
==================================================
*/

#panel-description {
  font-size: 16px;
  line-height: 1.9;

  color: #374151;
}

#panel-description:empty {
  display: none;
}

#panel-description p + p {
  margin-top: 18px;
}

#panel-description ul,
#panel-description ol {
  margin-top: 16px;
  padding-left: 20px;
}

#panel-description li + li {
  margin-top: 10px;
}

/*
==================================================
LINKS
==================================================
*/

#panel-links {
  display: flex;
  flex-wrap: wrap;

  gap: 12px;

  margin-top: 28px;
}

#panel-links:empty {
  display: none;
}

.panel-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 48px;

  padding: 0 18px;

  border-radius: 14px;

  background: #111827;

  color: #fff !important;

  text-decoration: none;

  font-size: 14px;
  font-weight: 700;

  transition:
    transform 0.18s ease,
    background 0.18s ease,
    opacity 0.18s ease;
}

.panel-link-btn:hover {
  transform: translateY(-1px);

  opacity: 0.95;
}

.panel-link-btn.secondary {
  background: #eef2f7;

  color: #1f2937 !important;
}

.panel-link-btn.secondary:hover {
  background: #e4e9f0;
}

/*
==================================================
VIDEOS
==================================================
*/

#panel-videos {
  display: flex;
  flex-direction: column;

  gap: 20px;

  margin-top: 28px;
}

#panel-videos:empty {
  display: none;
}

.location-video {
  overflow: hidden;

  border-radius: 22px;
}

#panel-videos iframe {
  width: 100%;

  aspect-ratio: 16 / 9;

  border: none;

  background: #000;

  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

/*
==================================================
MARKERS
==================================================
*/

.map-marker {
  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  user-select: none;

  will-change: transform;

  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.map-marker-icon {
  width: 48px;
  height: 48px;

  display: block;

  transform-origin: center bottom;

  transition:
    transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.18s ease;
}

.map-marker:hover {
  transform: translateY(-6px) scale(1.08);
}

.map-marker:hover .map-marker-icon {
  transform: scale(1.05);

  filter: drop-shadow(0px 10px 14px rgba(0, 0, 0, 0.28));
}

.active-marker {
  transform: translateY(-6px) scale(1.22);

  z-index: 9999;
}

.active-marker .map-marker-icon {
  transform: scale(1.08);

  filter: drop-shadow(0px 14px 22px rgba(0, 0, 0, 0.45));
}

/*
==================================================
SMALL DESKTOP / TABLET
==================================================
*/

@media (max-width: 1200px) {
  #sidebar {
    width: 360px;
  }

  #map {
    margin-left: 360px;
    width: calc(100% - 360px);
  }
}

/*
==================================================
MOBILE
==================================================
*/

#mobile-view-toggle {
  display: none;
}

#close-mobile-panel {
  display: none;
}

@media (max-width: 900px) {
  .map-container,
  .franklin-map {
    height: 78vh;
    min-height: 620px;
    border-radius: 0;
  }

  #map {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    margin-left: 0;

    z-index: 1;
  }

  #sidebar {
    position: absolute;
    inset: 0;

    width: 100%;
    max-width: 100%;
    height: 100%;

    border-right: none;

    background: transparent;

    z-index: 20;

    pointer-events: none;
  }

  body.mobile-list-view #sidebar {
    pointer-events: auto;
  }

  #location-list-view {
    height: 100%;
    background: #fff;
  }

  body.mobile-map-view #location-list-view {
    display: none;
  }

  /*
  ==========================================
  MOBILE SHEET
  ==========================================
  */

  #location-details-view {
    display: flex;
    flex-direction: column;

    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    height: 68%;
    max-height: 92%;

    padding: 0;

    background: #fff;

    border-radius: 26px 26px 0 0;

    z-index: 999;

    overflow: hidden;

    pointer-events: auto;

    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.24);

    transform: translate3d(0, 100%, 0);

    transition:
      transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
      height 0.28s ease;

    will-change: transform;
  }

  #location-details-view.active {
    display: flex;
  }

  #location-details-view.open {
    transform: translate3d(0, 0, 0);
  }

  #location-details-view.expanded {
    height: 92%;
  }

  .panel-handle-wrap {
    position: sticky;
    top: 0;

    z-index: 30;

    flex-shrink: 0;

    padding-top: 12px;
    padding-bottom: 14px;

    background: rgba(255, 255, 255, 0.96);

    backdrop-filter: blur(12px);
  }

  .panel-handle {
    width: 54px;
    height: 6px;

    margin: 0 auto;

    border-radius: 999px;

    background: #d1d5db;
  }

  .panel-scroll {
    flex: 1;

    overflow-y: auto;

    overscroll-behavior: contain;

    -webkit-overflow-scrolling: touch;

    padding: 0 22px 120px;
  }

  #back-to-list {
    padding-bottom: 24px;
    margin: 0;
  }

  #panel-title {
    font-size: 28px;
  }

  #panel-image {
    max-height: 240px;
  }

  /*
  ==========================================
  MOBILE LIST CARDS
  ==========================================
  */

  .location-card {
    min-height: 112px;
  }

  .location-card .location-card-image {
    width: 108px;
    min-width: 108px;
    height: 108px;
  }

  .location-card-title {
    font-size: 17px;
  }

  /*
  ==========================================
  TOGGLE
  ==========================================
  */

  #mobile-view-toggle {
    position: absolute;

    left: 50%;
    bottom: 20px;

    transform: translateX(-50%);

    display: flex;

    gap: 8px;

    padding: 8px;

    border-radius: 999px;

    background: rgba(255, 255, 255, 0.96);

    backdrop-filter: blur(14px);

    z-index: 9999;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  }

  .mobile-toggle-btn {
    border: none;
    background: transparent;

    padding: 12px 18px;

    border-radius: 999px;

    cursor: pointer;

    font-size: 14px;
    font-weight: 700;

    transition:
      background 0.18s ease,
      color 0.18s ease;
  }

  .mobile-toggle-btn.active {
    background: #111827;
    color: #fff;
  }

  #location-list {
    padding-bottom: 120px;
  }
}

.site-search-btn {
  padding: 0.42rem;
  font-size: 0.83rem;
  font-weight: 800;
  line-height: 1.4;
  text-decoration: none !important;
  color: #fff;
  background-color: #61b3df;
  border-radius: 0.38rem;
}
