/* Shared project/section hub: cover, accordion, numbered lessons */

body.shared-project-page,
body.shared-section-page,
body.shared-hub-page {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--longread-text, #222);
  background: var(--longread-bg, #f4f4f4);
  min-height: 100vh;
}

.shared-hub-cover {
  width: 100%;
  min-height: clamp(160px, 28vw, 280px);
  /* Default cover; keep URL in sync with CONSTANTS.PROJECT_DEFAULT_COVER / shared-project.html */
  background-image: url('https://cdn.longread.agency/demo/project-cover.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.shared-hub-cover.has-image {
  background-color: var(--longread-bg, #f4f4f4);
}

.shared-hub-cover.has-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.38));
  pointer-events: none;
}

.shared-hub-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.shared-hub-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 0.75rem;
}

.shared-hub-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--longread-text, #222);
  flex: 1;
  min-width: 0;
}

.shared-hub-start {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--longread-accent, #1f3249);
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}

.shared-hub-start:hover {
  filter: brightness(1.08);
}

.shared-hub-start:active {
  transform: translateY(1px);
}

.shared-hub-description {
  margin: 0 0 1.75rem;
  font-size: 1rem;
  color: var(--longread-accent, #555);
  line-height: 1.5;
}

.shared-hub-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shared-hub-section {
  border: 1px solid var(--longread-accent-pale, rgba(0, 0, 0, 0.12));
  border-radius: 10px;
  background: var(--longread-surface, #fff);
  overflow: hidden;
}

.shared-hub-section > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}

.shared-hub-section > summary::-webkit-details-marker {
  display: none;
}

.shared-hub-section-title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--longread-text, #222);
}

.shared-hub-section-meta {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--longread-accent, #666);
}

.shared-hub-chevron {
  flex-shrink: 0;
  width: 1.25em;
  height: 1.25em;
  color: var(--longread-accent, #666);
  transition: transform 0.2s ease;
}

.shared-hub-section[open] > summary .shared-hub-chevron {
  transform: rotate(180deg);
}

.shared-hub-section-body {
  padding: 0 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shared-hub-lesson {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--longread-text, #222);
  transition: background 0.15s;
}

.shared-hub-lesson:hover {
  background: var(--longread-important-bg, rgba(0, 0, 0, 0.04));
}

.shared-hub-lesson-root {
  border: 1px solid var(--longread-accent-pale, rgba(0, 0, 0, 0.12));
  border-radius: 10px;
  background: var(--longread-surface, #fff);
  padding: 12px 14px;
}

.shared-hub-lesson-num {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: var(--longread-accent, #1f3249);
}

.shared-hub-lesson-title {
  flex: 1;
  min-width: 0;
  font-size: 0.98rem;
  font-weight: 500;
}

.shared-hub-empty {
  margin: 0;
  color: var(--longread-accent, #666);
}

.shared-hub-back {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.shared-hub-back a {
  color: var(--longread-accent, #1f3249);
  text-decoration: none;
}

.shared-hub-back a:hover {
  text-decoration: underline;
}

@media (max-width: 520px) {
  .shared-hub-title-row {
    flex-direction: column;
    align-items: stretch;
  }
  .shared-hub-start {
    align-self: flex-start;
  }
}
