/* Map shell, compose column, and the signed-out teaser.
   Tokens and shared cards live in app.css. */

body:has(#map-shell),
body:has(#teaser) {
  overflow: hidden;
}

#map-shell {
  display: flex;
  overflow: hidden;
  background: var(--surface);
}

#map-sidebar {
  display: flex;
  flex: none;
  flex-direction: column;
  width: 400px;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--hairline);
}

#map-sidebar-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 16px 24px;
  overflow: auto;
}

#map-stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  background: #e7e5e4;
}

#map,
#teaser-map {
  width: 100%;
  height: 100%;
  background: #e7e5e4;
}

#sheet-toggle {
  display: none;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 44px;
  padding: 6px 12px 4px;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

#sheet-toggle::before {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: #bdbdbd;
}

.sheet-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

#map-shell[data-mode="compose"] #map-sidebar:not(.is-expanded) .sheet-toggle-pill,
#map-shell[data-mode="compose-search"] #map-sidebar:not(.is-expanded) .sheet-toggle-pill {
  background: var(--blue);
  color: #fff;
}

#sheet-toggle .hero-chevron-up {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

#map-sidebar.is-expanded #sheet-toggle .hero-chevron-up {
  transform: rotate(180deg);
}

#map-sidebar .map-subject {
  position: static;
  display: block;
  width: auto;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

#map-sidebar h1 {
  margin: 2px 0 0;
  font-size: 20px;
}

#map-sidebar .search-pill .fieldset,
#map-sidebar .search-pill .mb-2 {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin: 0;
}

#map-sidebar .search-pill .fieldset > label {
  display: block;
  margin: 0;
}

#where-to-form,
#place-search-form {
  position: relative;
  margin-bottom: 8px;
}

#where-to-results {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

#where-to-results[hidden],
#marker-panel[hidden],
#place-panel[hidden],
#marker-card[hidden],
#place-suggestions[hidden],
#place-search-live-error[hidden],
#place-panel-address[hidden],
#area-empty[hidden],
#all-empty[hidden],
#list-older[hidden],
#review-photos-preview[hidden],
#review-photos-client-error[hidden],
#review-photos-count[hidden],
#review-circle-friends[hidden],
#marker-via-wrap[hidden],
#marker-private-wrap[hidden] {
  display: none !important;
}

.where-to-label {
  margin: 0;
  padding: 8px 12px 4px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.where-to-option {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.where-to-option.is-active,
.where-to-option:hover {
  background: var(--fill);
}

.where-to-option-title {
  display: block;
  font-weight: 600;
}

.where-to-option-meta,
#place-search-live-error {
  display: block;
  margin-top: 2px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 400;
}

.where-to-error,
.where-to-empty,
#place-search-live-error {
  margin: 0;
  padding: 10px 12px;
  color: var(--text-2);
  font-size: 13px;
}

#map-sidebar .people-row {
  margin-bottom: 4px;
}

.area-list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0 0;
}

.area-list-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  min-width: 0;
}

.area-list-toggles [role="group"] {
  display: flex;
  gap: 8px;
}

.area-list-toggles a {
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.area-list-toggles a[aria-pressed="true"] {
  background: var(--fill);
  color: var(--text);
}

.area-list-toggles a:hover {
  color: var(--text);
}

.area-list-toggles a:focus-visible,
#all-empty a:focus-visible,
#list-older:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.area-list-header h2,
.place-circle h2 {
  margin: 0;
  font-size: 14px;
}

#area-count {
  color: var(--text-2);
  font-size: 12px;
}

#area-empty,
#all-empty {
  margin: 8px 0;
  color: var(--text-2);
  font-size: 14px;
}

#all-empty p {
  margin: 0 0 8px;
}

.area-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.area-empty-actions a,
#list-older {
  color: var(--blue);
  font-weight: 600;
}

#list-older {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

#area-list-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

#area-list-items .review-card-compact,
#place-panel-reviews .review-card-compact {
  cursor: pointer;
}

#place-panel-reviews .review-card-compact:hover {
  background: var(--fill);
}

#area-list-items .sidebar-place-card {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#area-list-items .sidebar-place-card:hover {
  border-color: #b8b8b8;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.place-card-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 148px;
  padding: 14px 14px 12px;
  overflow: hidden;
  color: #fff;
  background: #1c1917;
}

.place-card-hero.has-no-photo {
  min-height: 104px;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.16) 0%, transparent 48%),
    linear-gradient(135deg, var(--place-accent, #0095f6) 0%, #18181b 92%);
}

.place-card-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.92) saturate(1.08);
  transition: transform 0.25s ease;
}

#area-list-items .sidebar-place-card:hover .place-card-hero-img {
  transform: scale(1.03);
}

.place-card-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(12, 12, 12, 0.08) 0%,
    rgba(12, 12, 12, 0.35) 45%,
    rgba(12, 12, 12, 0.82) 100%
  );
  pointer-events: none;
}

.place-card-photo-count {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.62);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.place-card-hero-emblem {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 1;
  color: rgba(255, 255, 255, 0.26);
}

.place-card-hero-emblem .hero-map-pin-solid {
  width: 28px;
  height: 28px;
}

.place-card-hero-overlay {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.place-card-hero-overlay .place-card-title {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.place-card-hero-overlay .place-card-title:hover {
  color: #fff;
  text-decoration: underline;
}

.place-card-hero-overlay .place-card-title .review-card-pin {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.92);
}

.place-card-address {
  margin: 3px 0 0 22px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.place-card-content {
  padding: 10px 14px 12px;
}

.place-card-content .review-card-header {
  align-items: center;
  gap: 8px;
}

.place-card-content .review-card-header > .avatar-ring {
  margin-top: 0;
  --avatar-size: 24px;
  --avatar-font: 11px;
}

.place-card-content .review-card-name,
.place-card-content .review-card-dot,
.place-card-content .review-card-time,
.place-card-content .review-card-via {
  font-size: 13px;
}

.review-card-edit {
  margin-left: auto;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.review-card-edit:hover {
  color: var(--blue-hover);
  text-decoration: underline;
}

.place-card-content .review-card-body {
  margin-top: 6px;
  font-size: 14px;
}

.place-card-content .review-photos {
  margin-top: 8px;
}

.place-card-content .review-photos img,
.place-card-content .review-photos video {
  max-height: 72px;
  border-radius: 8px;
}

button.place-card-photo-count {
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

button.place-card-photo-count:hover {
  background: rgba(12, 12, 12, 0.85);
}

.compose-head {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 12px;
}

#compose-back {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: -6px;
  color: var(--text);
}

#compose-back .hero-chevron-left {
  width: 22px;
  height: 22px;
}

.compose-subtitle {
  margin: 2px 0 0;
  color: var(--text-2);
}

.compose-place-name {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin: 2px 0 0;
  font-weight: 600;
}

#review-place-address {
  margin: 2px 0 0;
}

.place-circle {
  margin-bottom: 8px;
}

.place-circle h2 {
  margin: 4px 0 0;
}

#review-form .review-caption {
  display: block;
  width: 100%;
  min-height: 120px;
  margin: 0;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  box-shadow: none;
  resize: vertical;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
}

#review-form .review-caption:focus,
#review-form .review-caption:focus-visible {
  border: 0;
  outline: none;
  box-shadow: none;
}

#review-submit {
  width: 100%;
  margin-top: 8px;
}

#write-here-button {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow);
}

#write-here-button:hover {
  background: var(--blue-hover);
  color: #fff;
}

#write-here-button .hero-plus {
  width: 18px;
  height: 18px;
}

#marker-panel {
  position: absolute;
  z-index: 2;
  bottom: 22px;
  left: 12px;
  width: min(320px, calc(100% - 168px));
  max-height: min(46vh, 360px);
  margin: 0;
  padding: 12px 12px 8px;
  overflow: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

#marker-close {
  position: absolute;
  z-index: 1;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

#marker-close:hover {
  background: var(--fill);
}

#marker-close .hero-x-mark {
  width: 16px;
  height: 16px;
}

#marker-panel .review-card-compact {
  border-bottom: 0;
  padding-right: 24px;
}

#place-panel-name {
  margin: 0 28px 4px 0;
  font-size: 16px;
}

#place-panel-address {
  margin: 0 0 8px;
}

#place-panel-write {
  width: 100%;
  margin: 8px 0 4px;
}

#map-credit {
  position: absolute;
  z-index: 1;
  bottom: 2px;
  left: 8px;
  margin: 0;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.2;
  pointer-events: none;
}

#teaser {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25)),
    var(--ig-gradient);
}

#teaser-map {
  filter: blur(6px) saturate(1.15);
}

.teaser-veil {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

#teaser-card {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: min(400px, calc(100% - 32px));
  padding: 32px 28px 28px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(16px);
}

#teaser-card .wordmark {
  margin: 0;
}

#teaser-card h1 {
  margin: 12px 0 8px;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.teaser-sub {
  margin: 0 0 20px;
  color: var(--text-2);
  font-size: 15px;
}

#teaser-card .btn {
  width: 100%;
}

.teaser-note {
  margin: 16px 0 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 767px) {
  #map-shell {
    flex-direction: column;
  }

  #map-stage {
    order: 1;
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0 !important;
  }

  #map-sidebar {
    order: 2;
    width: 100%;
    height: 196px;
    border-top: 1px solid var(--hairline);
    border-right: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: height 0.2s ease;
  }

  #map-sidebar.is-expanded {
    height: 78%;
  }

  #map-shell[data-mode="compose"] #map-sidebar.is-expanded,
  #map-shell[data-mode="compose-search"] #map-sidebar.is-expanded {
    height: 84%;
  }

  #sheet-toggle {
    display: flex;
  }

  #map-sidebar-body {
    padding: 8px 12px 16px;
    overflow: hidden;
  }

  #map-sidebar.is-expanded #map-sidebar-body {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  #map-sidebar .people-row {
    margin-bottom: 0;
    padding-top: 4px;
    padding-bottom: 0;
  }

  #marker-panel {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-height: 48%;
    z-index: 3;
  }

  #map-stage:has(#marker-panel:not([hidden])) #write-here-button {
    display: none;
  }

  #write-here-button {
    bottom: 16px;
  }

  #review-form .review-caption {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #sheet-toggle .hero-chevron-up {
    transition: none;
  }
}
