/* Shared styles for standalone project pages */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #fafafa;
  color: #383838;
  line-height: 1.8;
  min-height: 100vh;
}

a {
  color: rgba(212, 128, 170, 1);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #2bbc8a;
}

/* Navigation Bar */
.project-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.2rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fafafa;
}

.project-nav .back-link {
  font-size: 1.2rem;
  font-weight: 700;
  color: #383838;
}

.project-nav .back-link:hover {
  color: rgba(212, 128, 170, 1);
}

.project-nav .nav-links {
  display: flex;
  gap: 1.5rem;
}

.project-nav .nav-links a {
  font-size: 0.9rem;
  color: #8c8c8c;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.project-nav .nav-links a:hover {
  color: #383838;
  border-bottom-color: rgba(212, 128, 170, 1);
}

.project-nav .nav-links a.active {
  color: #383838;
  border-bottom-color: rgba(212, 128, 170, 1);
  font-weight: 600;
}

/* Page Header */
.page-header {
  text-align: center;
  padding: 2rem 1.5rem 1.5rem;
}

.page-header h1 {
  font-family: "Menlo", "Meslo LG", monospace;
  font-size: 1.6rem;
  font-weight: 700;
  color: #2bbc8a;
  margin-bottom: 0.3rem;
}

.page-header .subtitle {
  font-size: 0.85rem;
  color: #8c8c8c;
}

.page-header .watchlist-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #2bbc8a;
  text-decoration: none;
  border-bottom: 1px dashed #2bbc8a;
}

.page-header .watchlist-link:hover {
  color: #239a6e;
  border-bottom-style: solid;
}

/* Main Content Container */
.project-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* ============================
   Poster Grid (Books & Movies)
   ============================ */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.5rem;
}

.poster-item {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.poster-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.poster-item .poster-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: block;
  object-fit: cover;
  background: #e8e8e8;
}

/* Placeholder when no image */
.poster-item .poster-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8e8e8, #d4d4d4);
  font-size: 2.5rem;
  color: #aaa;
}

/* Poster overlay on hover */
.poster-item .poster-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.25s ease;
  text-align: center;
}

.poster-item:hover .poster-overlay {
  opacity: 1;
}

.poster-overlay .overlay-date {
  font-size: 0.8rem;
  color: #ccc;
  margin-bottom: 0.5rem;
}

.poster-overlay .overlay-type {
  font-size: 0.85rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.poster-overlay .overlay-review {
  font-size: 0.85rem;
  color: #fff;
  line-height: 1.5;
  max-width: 90%;
}

.poster-item .poster-info {
  padding: 0.5rem 0.6rem;
}

.poster-info .poster-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #383838;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poster-info .poster-rating {
  font-size: 0.75rem;
  color: #f5a623;
  margin-top: 0.1rem;
}

/* ============================
   Timeline (Travels)
   ============================ */
.timeline {
  position: relative;
  padding: 1rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e0e0e0;
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  width: 50%;
  padding: 0 2rem;
}

.timeline-item:nth-child(odd) {
  left: 0;
  text-align: right;
}

.timeline-item:nth-child(even) {
  left: 50%;
  text-align: left;
}

.timeline-item::before {
  content: '';
  position: absolute;
  top: 0.5rem;
  width: 12px;
  height: 12px;
  background: #2bbc8a;
  border: 3px solid #fafafa;
  border-radius: 50%;
  z-index: 1;
}

.timeline-item:nth-child(odd)::before {
  right: -6px;
}

.timeline-item:nth-child(even)::before {
  left: -6px;
}

.timeline-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.timeline-card .tl-location {
  font-size: 1.1rem;
  font-weight: 700;
  color: #383838;
  margin-bottom: 0.2rem;
}

.timeline-card .tl-date {
  font-size: 0.8rem;
  color: #8c8c8c;
  margin-bottom: 0.5rem;
}

.timeline-card .tl-desc {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.7;
}

.timeline-card .tl-photos {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

.timeline-card .tl-photos img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: #8c8c8c;
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: 1rem;
}

/* ============================
   Map (Travels)
   ============================ */
#map-container {
  position: relative;
  width: 90vw;
  height: 70vh;
  min-height: 350px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #eee;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  /* Center the 80vw map relative to parent */
  margin-left: 50%;
  transform: translateX(-50%);
}

#map {
  width: 100%;
  height: 100%;
}

/* Custom marker — SVG 图钉 */
.travel-marker {
  width: 36px;
  height: 50px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='50' viewBox='0 0 36 50'%3E%3Cpath d='M18 2C9.2 2 2 9.2 2 18c0 12.6 16 29 16 29s16-16.4 16-29C34 9.2 26.8 2 18 2z' fill='%232bbc8a' stroke='%23fff' stroke-width='2'/%3E%3Ccircle cx='18' cy='17' r='6' fill='%23fff'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  transition: filter 0.2s ease;
}

.travel-marker:hover {
  filter: brightness(1.2) drop-shadow(0 0 8px rgba(43,188,138,0.6));
}

/* Popup */
.travel-popup {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 0.85rem;
  color: #383838;
  line-height: 1.6;
  min-width: 180px;
}

.travel-popup .popup-trip {
  font-size: 1rem;
  font-weight: 700;
  color: #2bbc8a;
  margin-bottom: 0.2rem;
}

.travel-popup .popup-location {
  font-size: 0.9rem;
  font-weight: 600;
  color: #383838;
  margin-bottom: 0.15rem;
}

.travel-popup .popup-date {
  font-size: 0.78rem;
  color: #8c8c8c;
  margin-bottom: 0.4rem;
}

.travel-popup .popup-desc {
  font-size: 0.82rem;
  color: #666;
}

.travel-popup .popup-photos {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.travel-popup .popup-photos img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.travel-popup .popup-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: #2bbc8a;
  text-decoration: none;
  border-bottom: 1px dashed #2bbc8a;
}

.travel-popup .popup-link:hover {
  color: #239a6e;
  border-bottom-style: solid;
}

/* MapLibre popup overrides */
.maplibregl-popup-content {
  border-radius: 8px !important;
  box-shadow: 0 3px 14px rgba(0,0,0,0.12) !important;
  padding: 12px 16px !important;
}

.maplibregl-popup-tip {
  border-top-color: #fff !important;
}

.maplibregl-popup-close-button {
  font-size: 18px;
  font-weight: 300;
  color: #b0b0b0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 8px;
  position: absolute;
  right: 4px;
  top: 4px;
  line-height: 1.4;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.maplibregl-popup-close-button:hover {
  color: #383838;
  background: #f0f0f0;
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 768px) {
  .poster-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  #map-container {
    height: 50vh;
    min-height: 250px;
  }

  .timeline::before {
    left: 20px;
  }

  .timeline-item {
    width: 100%;
    padding: 0 0 0 3rem;
    left: 0 !important;
    text-align: left !important;
  }

  .timeline-item::before {
    left: 14px !important;
    right: auto !important;
  }
}

@media (max-width: 480px) {
  .poster-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .project-nav {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
  }

  .project-nav .nav-links {
    gap: 1rem;
  }

  .page-header h1 {
    font-size: 1.3rem;
  }
}
