/* === Collection detail page === */

.cd-wrap {
  position: relative;
  margin-top: -32px; /* compensate for content-area padding so banner reaches top */
}

.cd-banner {
  height: 200px;
  position: relative;
  overflow: hidden;
}
.cd-banner-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.18) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.12) 0%, transparent 60%);
}

.cd-content {
  margin-top: -64px; /* overlap header card onto banner */
  position: relative;
  max-width: 1200px;
  padding-bottom: 32px;
}

.cd-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.cd-crumb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: inherit;
  font-weight: 500;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}
.cd-crumb:hover { background: rgba(255,255,255,0.18); }

.cd-header.card {
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
}
.cd-header-top {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}
.cd-folder {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cd-folder .icon { width: 28px; height: 28px; }
.cd-header-stack {
  flex: 1;
  min-width: 0;
}
.cd-title {
  font-family: 'DM Sans', -apple-system, sans-serif;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 6px;
  color: var(--text-1);
}
.cd-meta {
  font-size: 13px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cd-meta strong { color: var(--text-2); font-weight: 600; }
.cd-meta-sep { color: var(--text-4); }

.cd-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cd-privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.cd-description {
  margin: 18px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  max-width: 720px;
}

/* Section heads */
.cd-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.cd-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}
.cd-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Children grid */
.cd-children-section { margin-bottom: 28px; }
.cd-children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}
.cd-child-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  font-family: inherit;
}
.cd-child-card:hover {
  border-color: var(--surface-4);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.cd-child-folder {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cd-child-stack {
  flex: 1;
  min-width: 0;
}
.cd-child-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-child-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 1px;
}
.cd-child-arrow {
  color: var(--text-4);
  flex-shrink: 0;
}

/* Bookmarks section */
.cd-bookmarks-section { margin-bottom: 24px; }

.cd-scope-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 2px;
  gap: 2px;
}
.cd-scope-toggle .vt-btn {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-3);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.cd-scope-toggle .vt-btn:hover { color: var(--text-2); }
.cd-scope-toggle .vt-btn.active {
  background: var(--surface-3);
  color: var(--text-1);
}

/* =====================================================
   COLLECTION DETAIL — MOBILE
   ===================================================== */

@media (max-width: 768px) {
  /* Banner and overlap adjustments for smaller main padding */
  .cd-wrap     { margin-top: -16px; }
  .cd-banner   { height: 130px; }
  .cd-content  { margin-top: -48px; padding-bottom: 16px; }

  /* Header card */
  .cd-header.card { padding: 16px; }

  .cd-header-top {
    flex-direction: column;
    gap: 12px;
  }

  /* Smaller folder icon */
  .cd-folder {
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }
  .cd-folder .icon { width: 22px; height: 22px; }

  /* Title and meta */
  .cd-title { font-size: 22px; margin-bottom: 6px; }
  .cd-meta  { font-size: 12px; gap: 4px; }

  /* Actions row: horizontal scroll instead of wrapping */
  .cd-header-actions {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .cd-header-actions::-webkit-scrollbar { display: none; }
  .cd-header-actions > * { flex-shrink: 0; }

  /* Breadcrumb */
  .cd-breadcrumb { font-size: 12px; margin-bottom: 8px; }

  /* Section head: stack on mobile */
  .cd-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .cd-section-actions {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .cd-section-actions::-webkit-scrollbar { display: none; }
  .cd-section-actions > * { flex-shrink: 0; }

  /* Children grid: single column */
  .cd-children-grid { grid-template-columns: 1fr; }
}
