/* ─────────────────────────────────────────
   projects.css
───────────────────────────────────────── */

.page-hero {
  background: var(--pale);
  border-bottom: 1px solid var(--border);
  padding: 3rem 0 2.5rem;
}
.page-hero h1 { font-size: clamp(1.6rem, 3vw, 2rem); margin-bottom: 0.5rem; }
.page-hero-sub { font-size: 0.9rem; color: var(--muted); max-width: 600px; line-height: 1.7; margin: 0; }

.projects-body {
  display: grid;
  grid-template-columns: 1fr 600px;
  height: calc(100vh - 220px);
  min-height: 500px;
  max-height: 780px;
}

.map-wrap { position: relative; overflow: hidden; }
#map { width: 100%; height: 100%; z-index: 1; }

/* Detail panel */
.detail-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-top: 2px solid var(--mid);
  display: flex;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  z-index: 400;
  max-height: 220px;
}
.detail-panel.open { transform: translateY(0); }

.dp-photo {
  width: 32%;
  flex-shrink: 0;
  background: var(--pale);
  border-right: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
}
.dp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dp-photo.empty { flex-direction: column; gap: 4px; font-size: 0.75rem; color: var(--muted); }
.dp-photo-hint { font-size: 0.65rem; color: var(--muted); opacity: 0.6; }

.dp-content { padding: 0.85rem 1rem; flex: 1; overflow-y: auto; position: relative; }
.dp-close {
  position: absolute; top: 0.5rem; right: 0.6rem;
  background: none; border: none; font-size: 0.85rem;
  color: var(--muted); cursor: pointer; padding: 2px 4px;
  transition: color var(--transition);
}
.dp-close:hover { color: var(--navy); }

.dp-tag {
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--mid);
  background: rgba(4,88,114,0.08); border-radius: 3px;
  padding: 2px 7px; display: inline-block; margin-bottom: 0.4rem;
}
.dp-title { font-size: 0.9rem; font-weight: 700; color: var(--navy); line-height: 1.3; margin-bottom: 0.15rem; padding-right: 1.5rem; }
.dp-country { font-size: 0.75rem; color: var(--mid); font-weight: 500; margin-bottom: 0.5rem; }
.dp-desc { font-size: 0.78rem; color: var(--text); line-height: 1.65; margin-bottom: 0.5rem; }
.dp-link {
  font-size: 0.78rem; font-weight: 600; color: var(--mid);
  text-decoration: none; display: inline-flex; align-items: center;
  gap: 5px; transition: opacity var(--transition);
}
.dp-link:hover { opacity: 0.7; }
.dp-link i { font-size: 0.65rem; }

/* Sidebar */
.sidebar {
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden; background: var(--white);
}

.sb-filters { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.filter-group { margin-bottom: 0.5rem; }
.filter-group:last-child { margin-bottom: 0; }

.filter-group-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem;
  display: flex; align-items: center; gap: 5px;
}
.filter-group-label::after { content: ''; flex: 1; height: 0.5px; background: var(--border); }

.filter-pills { display: flex; flex-wrap: wrap; gap: 2px; }

.f-btn {
  font-family: var(--font); font-size: 0.75rem; font-weight: 500;
  padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border-mid);
  color: var(--muted); background: var(--white); cursor: pointer;
  line-height: 1.7; transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 4px;
}
.f-btn i { font-size: 0.6rem; }
.f-btn:hover { border-color: var(--mid); color: var(--mid); }
.f-btn.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.f-btn--region.active { background: var(--mid); border-color: var(--mid); }

.sb-count { font-size: 0.8rem; color: var(--muted); padding: 0.4rem 0.7rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }

.project-list {
  overflow-y: auto; flex: 1;
  scrollbar-width: thin; scrollbar-color: var(--border-mid) transparent;
}
.project-list::-webkit-scrollbar { width: 3px; }
.project-list::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 2px; }

.project-item { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--transition); }
.project-item:hover, .project-item.active { background: var(--pale); }
.project-item.active { border-left: 3px solid var(--mid); padding-left: calc(0.7rem - 2px); }

.pi-title { font-size: 0.9rem; font-weight: 700; color: var(--navy); line-height: 1.3; margin-bottom: 0.2rem; }
.pi-bottom { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.pi-country { font-size: 0.8rem; color: var(--mid); font-weight: 500; }
.pi-year { font-size: 0.78rem; color: var(--muted); flex-shrink: 0; }
.pi-tags { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 0.25rem; }
.pi-tag { font-size: 0.72rem; color: var(--mid); background: rgba(4,88,114,0.07); border: 1px solid rgba(4,88,114,0.12); border-radius: 2px; padding: 1px 5px; display: inline-flex; align-items: center; gap: 3px; }
.pi-tag i { font-size: 0.65rem; }

@media (max-width: 700px) {
  .projects-body { grid-template-columns: 1fr; grid-template-rows: 400px auto; height: auto; max-height: none; }
  .sidebar { border-left: none; border-top: 1px solid var(--border); max-height: 400px; }
}
