/* Location layout shared by the pin page, My Added Locations and Requests
   (markup from location-card.js). Wide screens: picture + video on the left,
   description + map on the right (kept in view while scrolling). Phones: one
   column in reading order — description, picture, video, map. */

/* Pages that list locations get the same width as the pin page. */
#myPinsRoot,
#requestsRoot {
  max-width: 1120px;
}

.pin-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* In a list each location is its own card. */
.location-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  animation: fadeUp var(--medium) var(--ease);
}

.location-card .pin-page-panel {
  background: var(--panel-2);
  box-shadow: none;
}

.location-card .pin-page-title {
  font-size: 22px;
}

.location-card .pin-page-title a {
  color: inherit;
  text-decoration: none;
}

.location-card .pin-page-title a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.location-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.pin-page-title {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.pin-page-meta {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-dim);
}

.pin-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pin-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
}

.pin-page-grid.no-media {
  grid-template-columns: minmax(0, 1fr);
}

.pin-page-media {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pin-page-image,
.pin-page-video {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.pin-page-image img {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  background: #10121c;
  cursor: zoom-in;
  transition: transform 400ms var(--ease);
}

.pin-page-image:hover img {
  transform: scale(1.015);
}

.pin-page-video {
  aspect-ratio: 16 / 9;
}

.pin-page-video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.pin-page-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: calc(var(--topbar-h, 59px) + 18px);
}

.pin-page-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.pin-page-panel h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.pin-page-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pin-page-map {
  height: 260px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.pin-page-gmaps {
  width: 100%;
  margin-top: 10px;
}

/* A notice between the header and the content, e.g. why it was rejected. */
.pin-page-notice {
  font-size: 14px;
  background: var(--danger-soft);
  border: 1px solid rgba(224, 62, 82, 0.3);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.pin-page-notice strong {
  color: var(--danger);
}

@media (max-width: 860px) {
  .pin-page-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  /* Let the children of both columns be ordered together. */
  .pin-page-media,
  .pin-page-side {
    display: contents;
  }

  .pin-page-about { order: 1; }
  .pin-page-image { order: 2; }
  .pin-page-video { order: 3; }
  .pin-page-location { order: 4; }

  .pin-page-title,
  .location-card .pin-page-title {
    font-size: 22px;
  }

  .location-card {
    padding: 14px;
  }

  .pin-page-map {
    height: 240px;
  }
}
