/* Pocket Austin — Track 3.5: Curated Discovery Layers & District Boundaries
 * Warm ligne claire parchment aesthetic matching viewer/index.html
 */

#pa-explore-dock {
  position: fixed;
  top: 108px;
  right: 14px;
  z-index: 32;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  max-width: min(720px, calc(100vw - 360px));
  pointer-events: none;
}

#pa-explore-dock > * {
  pointer-events: auto;
}

.pa-dock-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid #4a3b2c;
  background: rgba(251, 246, 234, 0.95);
  color: #2c221a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(20, 15, 10, 0.22);
  backdrop-filter: blur(8px);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  white-space: nowrap;
}

.pa-dock-btn:hover {
  background: #f2e8d2;
  transform: translateY(-1px);
}

.pa-dock-btn.is-open,
.pa-dock-btn.has-active {
  border-color: #c45735;
}

.pa-dock-btn.is-open {
  background: #c45735;
  color: #fbf6ea;
  border-color: #4a3b2c;
}

.pa-dock-btn .pa-btn-ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pa-dock-btn .pa-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c45735;
  color: #fbf6ea;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.pa-dock-btn.is-open .pa-count-pill {
  background: rgba(251, 246, 234, 0.24);
  color: #fbf6ea;
}

.pa-dock-btn .pa-count-pill:empty,
.pa-dock-btn .pa-count-pill.hidden {
  display: none;
}

/* Collapsible Explore Austin parchment popover */
#pa-explore-drawer {
  position: fixed;
  top: 148px;
  right: 14px;
  z-index: 36;
  width: 332px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 200px);
  display: none;
  flex-direction: column;
  background: rgba(251, 246, 234, 0.96);
  border: 1.5px solid #4a3b2c;
  border-radius: 11px;
  box-shadow: 0 10px 30px rgba(20, 15, 10, 0.30);
  backdrop-filter: blur(10px);
  color: #2c221a;
  overflow: hidden;
}

#pa-explore-drawer.open {
  display: flex;
  animation: paPopoverIn 0.16s ease-out;
}

@keyframes paPopoverIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pa-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 13px 9px;
  border-bottom: 1px solid rgba(74, 59, 44, 0.18);
  background: linear-gradient(180deg, rgba(255, 252, 244, 0.9), rgba(246, 238, 219, 0.55));
}

.pa-drawer-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 700;
  color: #2c221a;
  line-height: 1.15;
}

.pa-drawer-sub {
  margin-top: 2px;
  font-size: 11px;
  color: #665848;
}

.pa-drawer-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pa-link-btn {
  appearance: none;
  border: none;
  background: none;
  color: #c45735;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.pa-link-btn:hover {
  background: rgba(196, 87, 53, 0.10);
}

.pa-link-btn.hidden {
  display: none;
}

.pa-drawer-close {
  appearance: none;
  border: 1px solid rgba(74, 59, 44, 0.32);
  background: rgba(255, 251, 242, 0.85);
  color: #4a3b2c;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pa-drawer-close:hover {
  background: #efe4cc;
  color: #2c221a;
}

.pa-drawer-filter {
  padding: 8px 12px 7px;
  border-bottom: 1px solid rgba(74, 59, 44, 0.14);
}

.pa-drawer-filter input {
  width: 100%;
  border: 1.2px solid rgba(74, 59, 44, 0.42);
  border-radius: 7px;
  background: rgba(255, 252, 246, 0.96);
  color: #2c221a;
  font-size: 11.8px;
  padding: 5px 9px;
  outline: none;
  font-family: inherit;
}

.pa-drawer-filter input:focus {
  border-color: #c45735;
  box-shadow: 0 0 0 2px rgba(196, 87, 53, 0.15);
}

.pa-drawer-body {
  overflow-y: auto;
  padding: 8px 11px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pa-section-heading {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #665848;
  margin: 4px 2px 1px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Layer accordion card */
.pa-layer-card {
  border: 1px solid rgba(74, 59, 44, 0.22);
  border-radius: 8px;
  background: rgba(255, 252, 245, 0.72);
  overflow: hidden;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.pa-layer-card.active {
  border-color: rgba(74, 59, 44, 0.52);
  background: rgba(255, 252, 245, 0.96);
}

.pa-layer-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
}

.pa-layer-check-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  user-select: none;
}

.pa-layer-check-wrap input[type="checkbox"] {
  accent-color: #c45735;
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.pa-layer-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.4px solid #2c221a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fbf6ea;
}

.pa-layer-swatch svg {
  width: 12px;
  height: 12px;
  display: block;
}

.pa-layer-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pa-layer-name {
  font-size: 12.2px;
  font-weight: 700;
  color: #2c221a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pa-layer-tagline {
  font-size: 10px;
  color: #665848;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pa-layer-right {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.pa-item-count {
  font-size: 10px;
  font-weight: 800;
  padding: 1.5px 6px;
  border-radius: 999px;
  background: rgba(74, 59, 44, 0.10);
  color: #4a3b2c;
  border: 1px solid rgba(74, 59, 44, 0.18);
}

.pa-layer-card.active .pa-item-count {
  background: rgba(196, 87, 53, 0.14);
  color: #9e3d1f;
  border-color: rgba(196, 87, 53, 0.35);
}

.pa-expand-btn {
  appearance: none;
  border: 1px solid rgba(74, 59, 44, 0.25);
  background: rgba(251, 246, 234, 0.85);
  color: #4a3b2c;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s ease, background 0.14s ease;
}

.pa-expand-btn:hover {
  background: #ede1c6;
}

.pa-layer-card.expanded .pa-expand-btn {
  transform: rotate(90deg);
  background: #ede1c6;
}

/* Clickable curated spot list */
.pa-spot-list {
  display: none;
  border-top: 1px dashed rgba(74, 59, 44, 0.20);
  background: rgba(248, 241, 226, 0.65);
  max-height: 196px;
  overflow-y: auto;
}

.pa-layer-card.expanded .pa-spot-list {
  display: block;
}

.pa-spot-item {
  width: 100%;
  appearance: none;
  border: none;
  border-bottom: 1px solid rgba(74, 59, 44, 0.10);
  background: transparent;
  color: #2c221a;
  text-align: left;
  padding: 6px 10px 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease;
}

.pa-spot-item:last-child {
  border-bottom: none;
}

.pa-spot-item:hover,
.pa-spot-item.selected {
  background: rgba(196, 87, 53, 0.13);
}

.pa-spot-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pa-spot-title {
  font-size: 11.6px;
  font-weight: 700;
  color: #2c221a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pa-spot-sub {
  font-size: 10px;
  color: #665848;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pa-spot-go {
  font-size: 10px;
  font-weight: 700;
  color: #c45735;
  flex-shrink: 0;
  opacity: 0.8;
}

.pa-spot-item:hover .pa-spot-go {
  opacity: 1;
}

/* District borders card */
.pa-district-card {
  border: 1px dashed rgba(74, 59, 44, 0.42);
  border-radius: 8px;
  background: rgba(246, 238, 219, 0.65);
  overflow: hidden;
}

.pa-district-card.active {
  border-style: solid;
  border-color: #4c8e88;
  background: rgba(226, 242, 239, 0.52);
}

.pa-district-chips {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  padding: 7px 9px 9px;
  border-top: 1px dashed rgba(74, 59, 44, 0.22);
  background: rgba(251, 246, 234, 0.72);
}

.pa-district-card.expanded .pa-district-chips {
  display: flex;
}

.pa-district-chip {
  appearance: none;
  border: 1px solid rgba(74, 59, 44, 0.34);
  background: rgba(255, 252, 245, 0.92);
  color: #2c221a;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10.4px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.pa-district-chip:hover {
  background: #efe3c9;
  border-color: #4c8e88;
}

/* Inspector extra block for discovery spots */
.pa-insp-discovery-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(74, 59, 44, 0.065);
  border: 1px solid rgba(74, 59, 44, 0.16);
  font-size: 11px;
  color: #4a3b2c;
}

.pa-insp-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: #2c221a;
}

.pa-insp-cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid #2c221a;
  display: inline-block;
}

.pa-empty-note {
  padding: 10px 10px;
  font-size: 11px;
  font-style: italic;
  color: #665848;
  text-align: center;
}

@media (max-width: 760px) {
  #pa-explore-dock {
    top: 60px;
    right: 10px;
    gap: 5px;
  }
  .pa-dock-btn {
    padding: 5px 10px;
    font-size: 11.5px;
  }
  #pa-explore-drawer {
    top: 98px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 230px);
  }
}
