/*** For NYSSA embed map ***/

:root {
  --embed-header-h: 80px; /* mobile sidebar header height */
  --embed-filter-h: 44px; /* mobile region filter row height */
}
@media (max-width: 399px) {
  :root {
    --embed-header-h: 72px;
  }
}

.main.is-embed .map-wrapper {
  top: 0;
  left: 320px;
  display: flex;
  align-items: stretch;
}
@media (max-width: 1399px) {
  .main.is-embed .map-wrapper {
    left: 300px;
  }
}
@media (max-width: 1023px) {
  .main.is-embed .map-wrapper {
    left: 240px;
  }
}
@media (max-width: 768px) {
  .main.is-embed .map-wrapper {
    top: 80px;
    left: 0;
  }
}

.embed-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  overflow-y: auto;
  padding: 16px 16px;
  background: #eee;
  z-index: 1;
}
@media (max-width: 1399px) {
  .embed-sidebar {
    width: 300px;
    padding: 16px 12px;
  }
}
@media (max-width: 1023px) {
  .embed-sidebar {
    width: 240px;
  }
}
@media (max-width: 768px) {
  .embed-sidebar {
    width: 100%;
    bottom: auto;
    height: var(--embed-header-h);
    padding: 8px 8px;
    overflow: visible;
  }
}

.embed-sidebar .sidebar-h {
}

@media (max-width: 768px) {
  .embed-sidebar .sidebar-h {
    display: flex;
    align-items: center;
  }
}

.embed-sidebar .sidebar-logo {
  line-height: 0;
  margin-bottom: 10px;
  display: block;
}
@media (max-width: 768px) {
  .embed-sidebar .sidebar-logo {
    margin: 0 10px 0 0;
  }
}
.embed-sidebar .sidebar-logo img {
  max-width: 100%;
}
@media (max-width: 768px) {
  .embed-sidebar .sidebar-logo img {
    max-height: 64px;
  }
}
@media (max-width: 399px) {
  .embed-sidebar .sidebar-logo img {
    max-height: 56px;
  }
}

.embed-sidebar .desc {
  font-size: 12px;
  margin: 0 0 10px;
}
@media (max-width: 768px) {
  .embed-sidebar .desc {
    margin: 0 0 0 auto;
    font-size: 14px;
  }
}
@media (max-width: 768px) {
  .embed-sidebar .desc span {
    display: none;
  }
}
.embed-sidebar .desc a {
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.embed-sidebar .desc a:hover {
  color: var(--primary-hover);
}
@media (max-width: 768px) {
  .embed-sidebar .desc a {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-weight: bold;
    padding: 6px 12px;
    margin-left: auto;
    border-radius: 16px;
  }
}
.embed-sidebar .desc a i {
  width: 20px;
  height: 20px;
}

/* Hidden: trail-map.js still mounts the geocoder here and expects .map-search to exist */
.embed-search-mount {
  display: none;
}

.club-search-wrapper {
  max-height: calc(100dvh - 190px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
@media (max-width: 768px) {
  .club-search-wrapper {
    position: absolute;
    top: 90px;
    right: 75px;
    left: 10px;
    background: #fff;
    border-radius: 16px;
    transition: all 0.2s;
  }
}

@media (max-width: 768px) {
  .club-search-wrapper:not(.is-expanded) > * {
    display: none !important;
  }
  .club-search-wrapper:not(.is-expanded) .club-search {
    display: flex !important;
  }
}

.embed-sidebar .club-search {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--grey-light);
  height: 36px;
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}
@media (max-width: 768px) {
  .embed-sidebar .club-search {
    margin: 0;
  }
}

.club-search-wrapper .search-btn,
.club-search-wrapper .clear-btn {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: all 0.2s;
}

.club-search-wrapper .clear-btn[hidden] {
  opacity: 0;
  visibility: hidden;
}

.embed-sidebar .club-search .ti {
}
.embed-sidebar .club-search .club-search-input {
  padding: 6px 8px;
  background: none;
  border: none;
  outline: none;
  flex: 1;
}
@media (max-width: 1023px) {
  .embed-sidebar .club-search .club-search-input {
    width: 140px;
  }
}

/*** Regions ***/

.embed-sidebar .search-regions-h {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: bold;
}
@media (max-width: 768px) {
  .embed-sidebar .search-regions-h {
    padding: 8px;
    margin: 0;
    font-size: 13px;
    display: none;
  }
}
.embed-sidebar .search-regions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 12px;
}
@media (max-width: 768px) {
  .embed-sidebar .search-regions {
    padding: 8px;
    background: #f5f5f5;
    margin: 4px 0 0;
  }
}

.embed-sidebar .search-region {
  flex: 0 1 auto;
  max-width: 100%;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 16px;
  cursor: pointer;
  user-select: none;
  outline: none;
  transition:
    background 0.15s,
    color 0.15s;
}
@media (max-width: 768px) {
  .embed-sidebar .search-region {
    font-size: 14px;
  }
}

.embed-sidebar .search-region:hover {
  background: #f7f7f7;
}
.embed-sidebar .search-region.is-active {
  font-weight: 500;
  color: #fff;
  background: var(--primary, #1e6fd9);
  border-color: var(--primary, #1e6fd9);
}

/* Mobile: regions become a horizontally scrollable row under the header */
@media (max-width: 768px) {
  .embed-sidebar .search-region {
    flex: 0 0 auto;
    max-width: none;
    border-radius: 16px;
  }
}

/*** Club list ***/

.embed-sidebar .search-results-h {
  padding: 8px;
  font-size: 14px;
  font-weight: 700;
}
@media (max-width: 768px) {
  .embed-sidebar .search-results-h {
    margin: 0;
    font-size: 13px;
    padding: 8px;
  }
}

.embed-sidebar .search-results-list {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  scrollbar-width: thin;
  min-height: 0;
}

.embed-sidebar .result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  cursor: pointer;
  position: relative;
}
.embed-sidebar .result-item:not(:last-child):after {
  content: "";
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: #eee;
}
.embed-sidebar .result-item:hover {
  background: #f5f5f5;
}

.embed-sidebar .item-img {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  line-height: 0;
}
.embed-sidebar .item-img img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.embed-sidebar .item-info {
  min-width: 0;
}
.embed-sidebar .item-title {
  font-size: 14px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.embed-sidebar .item-details {
  font-size: 12px;
  line-height: 1.2;
  color: #aaa;
}

.embed-sidebar .result-message {
  padding: 8px 0;
  font-size: 13px;
  opacity: 0.6;
}
@media (max-width: 768px) {
  .embed-sidebar .result-message {
    padding: 8px;
  }
}

.embed-sidebar .search-results {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}
/*
.embed-sidebar .search-block {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #f5f5f5;
}
.embed-sidebar .form-control {
  width: 100%;
  border: none;
  border-radius: 4px 4px 0 0;
  outline: none;
  padding: 4px 16px;
  transition: all 0.2s;
}
.embed-sidebar .form-control::placeholder {
  color: #000;
  opacity: 0.5;
  .embed-sidebar .form-control:focus::placeholder {
    opacity: 0.3;
  }
} */
