/* Self-contained styles for the standalone park maps screen. */
.view-id-tpg_maps_view,
.view-id-tpg_maps_view .block-content,
.view-id-tpg_maps_view .view,
.view-id-tpg_maps_view .view-content,
.view-id-tpg_maps_view .view-content-wrap,
.view-id-tpg_maps_view .tpg-map-screen {
  width: 100% !important;
  max-width: 100% !important;
}

.view-id-tpg_maps_view .view-content-wrap > *,
.view-id-tpg_maps_view .view-content > * {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.view-id-tpg_maps_view .view-content-wrap > *:not(:last-child),
.view-id-tpg_maps_view .view-content > *:not(:last-child) {
  display: none !important;
}

.tpg-map-screen {
  --tpg-map-filter-bg: #ffffff;
  --tpg-map-filter-border: #dfe6f2;
  --tpg-map-filter-text: #183569;
  --tpg-map-filter-icon: #1d347f;
  --tpg-map-filter-focus: #1d347f;
  --tpg-map-filter-shadow: 0 4px 14px rgba(12, 31, 70, 0.07);
  color-scheme: light;
}

.tpg-map-screen__filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  margin: 10px 0 16px;
}

.tpg-map-screen__filter {
  position: relative;
  min-width: 0;
  isolation: isolate;
}

.tpg-map-screen__filter::before,
.tpg-map-screen__filter::after {
  content: "";
  position: absolute;
  top: 50%;
  z-index: 2;
  pointer-events: none;
  transform: translateY(-50%);
}

.tpg-map-screen__filter::before {
  left: 18px;
  width: 18px;
  height: 18px;
  background: var(--tpg-map-filter-icon);
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.tpg-map-screen__filter::after {
  right: 18px;
  width: 10px;
  height: 10px;
  border-color: var(--tpg-map-filter-icon);
  border-style: solid;
  border-width: 0 2px 2px 0;
  transform: translateY(-62%) rotate(45deg);
}

.tpg-map-screen__filter--type::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 5h16v2H4V5Zm0 6h16v2H4v-2Zm0 6h10v2H4v-2Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 5h16v2H4V5Zm0 6h16v2H4v-2Zm0 6h10v2H4v-2Z'/%3E%3C/svg%3E");
}

.tpg-map-screen__filter--park::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7Zm0 10.1A3.1 3.1 0 1 1 12 5.9a3.1 3.1 0 0 1 0 6.2Zm0-4.4a1.3 1.3 0 1 0 0 2.6 1.3 1.3 0 0 0 0-2.6Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7Zm0 10.1A3.1 3.1 0 1 1 12 5.9a3.1 3.1 0 0 1 0 6.2Zm0-4.4a1.3 1.3 0 1 0 0 2.6 1.3 1.3 0 0 0 0-2.6Z'/%3E%3C/svg%3E");
}

.tpg-map-screen__filter--year::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M7 2h2v3h6V2h2v3h3a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h3V2Zm13 8H4v10h16V10ZM4 8h16V7H4v1Zm3 5h3v3H7v-3Zm5 0h3v3h-3v-3Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M7 2h2v3h6V2h2v3h3a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h3V2Zm13 8H4v10h16V10ZM4 8h16V7H4v1Zm3 5h3v3H7v-3Zm5 0h3v3h-3v-3Z'/%3E%3C/svg%3E");
}

.tpg-map-screen__select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 44px 0 50px !important;
  border: 1px solid var(--tpg-map-filter-border) !important;
  border-radius: 8px !important;
  outline: none;
  background-color: var(--tpg-map-filter-bg) !important;
  background-image: none !important;
  color: var(--tpg-map-filter-text) !important;
  box-shadow: var(--tpg-map-filter-shadow);
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 48px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  cursor: pointer;
  -moz-appearance: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.tpg-map-screen__select:focus {
  border-color: var(--tpg-map-filter-focus) !important;
  box-shadow: 0 0 0 3px rgba(29, 52, 127, 0.13), var(--tpg-map-filter-shadow);
}

.tpg-map-screen__results {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  margin-top: 18px;
}

.tpg-map-screen__card {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 132px;
  gap: 14px;
  align-items: stretch;
  width: calc(50% - 8px);
  min-height: 152px;
  margin: 0;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: transparent;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.tpg-map-screen__card[hidden],
.tpg-map-screen__lightbox[hidden],
.tpg-map-screen__empty[hidden] {
  display: none !important;
}

.tpg-map-screen__results--single .tpg-map-screen__card {
  width: 100%;
}

.tpg-map-screen__preview {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 120px;
  padding: 10px 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px 0 0 10px;
}

.tpg-map-screen__preview img,
.tpg-map-screen__thumbnail img {
  width: 100%;
  height: auto;
  max-height: 150px;
  object-fit: contain;
}

.tpg-map-screen__thumbnail {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.tpg-map-screen__file-fallback {
  padding: 8px;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.tpg-map-screen__details {
  min-width: 0;
  text-align: left;
}

.tpg-map-screen__details h4 {
  min-height: 2.6em;
  height: auto !important;
  margin: 0 0 6px;
  overflow: visible !important;
  color: #111827 !important;
  font-size: 20px;
  line-height: 1.3;
  text-align: left;
  word-break: break-word;
}

.tpg-map-screen__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  margin-top: 8px;
}

.tpg-map-screen__badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.tpg-map-screen__badge--type,
.tpg-map-screen__badge--year {
  border-color: #d1d5db;
  background: #f3f4f6;
  color: #374151;
}

.tpg-map-screen__actions {
  box-sizing: border-box;
  display: flex;
  min-width: 132px;
  padding-right: 6px;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: stretch;
  justify-content: center;
}

.tpg-map-screen .tpg-map-screen__action {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 9px 14px;
  border: 1px solid #183569;
  border-radius: 999px;
  background: #ffffff;
  color: #183569;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.4px;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tpg-map-screen .tpg-map-screen__action:hover,
.tpg-map-screen .tpg-map-screen__action:focus-visible {
  border-color: #183569;
  background: #183569;
  color: #ffffff;
}

.tpg-map-screen .tpg-map-screen__action--disabled,
.tpg-map-screen .tpg-map-screen__action--disabled:hover,
.tpg-map-screen .tpg-map-screen__action--disabled:focus-visible {
  border-color: #b8c4d8;
  background: #f2f4f8;
  color: #8793a7;
  cursor: not-allowed;
}

.tpg-map-screen__empty {
  width: 100%;
  margin: 18px 0;
  padding: 20px;
  color: #374151;
  text-align: center;
}

.dark-mode .tpg-map-screen,
[data-theme="dark"] .tpg-map-screen {
  --tpg-map-filter-bg: #101a2e;
  --tpg-map-filter-border: #26334a;
  --tpg-map-filter-text: #e8eefc;
  --tpg-map-filter-icon: #e8eefc;
  --tpg-map-filter-shadow: 0 5px 14px rgba(0, 0, 0, 0.24);
  color-scheme: dark;
}

.dark-mode .tpg-map-screen__card,
[data-theme="dark"] .tpg-map-screen__card {
  border-color: #2f3d55;
  background: #1a202b;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.38);
}

.dark-mode .tpg-map-screen__preview,
[data-theme="dark"] .tpg-map-screen__preview {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.dark-mode .tpg-map-screen__file-fallback,
[data-theme="dark"] .tpg-map-screen__file-fallback {
  color: #dce9ff;
}

.dark-mode .tpg-map-screen__details h4,
[data-theme="dark"] .tpg-map-screen__details h4 {
  color: #f5f9ff !important;
}

.dark-mode .tpg-map-screen__badge--type,
.dark-mode .tpg-map-screen__badge--year,
[data-theme="dark"] .tpg-map-screen__badge--type,
[data-theme="dark"] .tpg-map-screen__badge--year {
  border-color: #3a4f73;
  background: #111b2a;
  color: #e7efff;
}

.dark-mode .tpg-map-screen .tpg-map-screen__action,
[data-theme="dark"] .tpg-map-screen .tpg-map-screen__action {
  border-color: #3a4f73;
  background: #111b2a;
  color: #e7efff;
}

.dark-mode .tpg-map-screen .tpg-map-screen__action:hover,
.dark-mode .tpg-map-screen .tpg-map-screen__action:focus-visible,
[data-theme="dark"] .tpg-map-screen .tpg-map-screen__action:hover,
[data-theme="dark"] .tpg-map-screen .tpg-map-screen__action:focus-visible {
  border-color: #7ea2e6;
  background: #1a2e4f;
  color: #ffffff;
}

.dark-mode .tpg-map-screen .tpg-map-screen__action--disabled,
.dark-mode .tpg-map-screen .tpg-map-screen__action--disabled:hover,
.dark-mode .tpg-map-screen .tpg-map-screen__action--disabled:focus-visible,
[data-theme="dark"] .tpg-map-screen .tpg-map-screen__action--disabled,
[data-theme="dark"] .tpg-map-screen .tpg-map-screen__action--disabled:hover,
[data-theme="dark"] .tpg-map-screen .tpg-map-screen__action--disabled:focus-visible {
  border-color: #3a4a66;
  background: #2a3548;
  color: #8fa3c6;
}

.dark-mode .tpg-map-screen__empty,
[data-theme="dark"] .tpg-map-screen__empty {
  color: #dce9ff;
}

@media (max-width: 900px) {
  .tpg-map-screen__card,
  .tpg-map-screen__results--single .tpg-map-screen__card {
    width: 100%;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px;
  }

  .tpg-map-screen__actions {
    grid-column: 1 / -1;
    min-width: 0;
    padding-top: 4px;
    padding-right: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }

  .tpg-map-screen .tpg-map-screen__action {
    width: auto;
    flex: 1 1 0;
  }
}

@media (max-width: 700px) {
  .tpg-map-screen__filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .tpg-map-screen__preview {
    min-height: 108px;
  }

  .tpg-map-screen__details h4 {
    font-size: 18px;
  }
}
