/* Top-level studio sections: RCI Core | Advanced Atlas | Pathology */

.section-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line, #4a3d27);
  background: rgba(0, 0, 0, 0.22);
}

.section-switch .btn {
  background: transparent;
  border-color: transparent;
  color: var(--muted, #b9a894);
  padding: 6px 12px;
  font-size: 13px;
  min-height: 34px;
}

.section-switch .btn:hover {
  color: var(--text-2, #e8dcc8);
  background: rgba(255, 255, 255, 0.04);
}

.section-switch .btn.active {
  background: var(--panel-3, #2a2419);
  border-color: #4a3d27;
  color: var(--text, #f3ebe0);
}

body[data-studio-section="advanced"] .section-switch .btn[data-studio-section="advanced"],
body[data-studio-section="pathology"] .section-switch .btn[data-studio-section="pathology"],
body[data-studio-section="core"] .section-switch .btn[data-studio-section="core"] {
  /* active already handled */
}

.lib-hero { margin-bottom: 28px; }
.lib-hero h2 { max-width: 28ch; }

.lib-ban {
  display: inline-block;
  margin: 8px 0 14px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(226, 177, 90, 0.35);
  background: rgba(226, 177, 90, 0.08);
  color: #f0d9a8;
  font-size: 13px;
}

.lib-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 8px;
}

.lib-section {
  margin: 28px 0 36px;
  padding-top: 8px;
  border-top: 1px solid rgba(196, 168, 130, 0.18);
}

.lib-section-head h3 {
  font-family: var(--serif, Spectral, Georgia, serif);
  font-size: 22px;
  margin: 0;
}

.lib-section-blurb {
  color: var(--muted, #b9a894);
  font-size: 14px;
  line-height: 1.5;
  max-width: 70ch;
  margin: 8px 0 16px;
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.lib-card {
  border: 1px solid rgba(196, 168, 130, 0.28);
  border-radius: 14px;
  background: rgba(22, 18, 14, 0.72);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
}

.lib-card.is-placeholder {
  border-style: dashed;
  opacity: 0.92;
}

.lib-card h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  color: var(--text, #f3ebe0);
}

.lib-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted, #b9a894);
  line-height: 1.4;
}

.lib-meta span { color: #e2b15a; }

.lib-card > p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-2, #e8dcc8);
  line-height: 1.5;
}

.lib-structures {
  font-size: 13px;
  color: var(--text-2, #e8dcc8);
  margin: 0;
}

.lib-points {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-2, #e8dcc8);
  line-height: 1.45;
}

.lib-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.lib-actions .btn { font-size: 13px; min-height: 38px; }
.lib-pill {
  font-size: 12px;
  color: var(--muted, #b9a894);
  padding: 6px 0;
}

#advancedSubnav[hidden],
#pathologySubnav[hidden],
#moduleList[hidden],
#search[hidden] { display: none !important; }

.home-panel[hidden] { display: none !important; }

@media (max-width: 1040px) {
  .section-switch { order: 3; }
  .section-switch .btn { padding: 5px 9px; font-size: 12px; }
  .lib-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .top-actions .section-switch .btn .section-rest { display: none; }
}

/* Keep section switch visible on the compact top bar (studio.css hides other top-actions). */
@media (max-width: 1040px) {
  .top-actions > .section-switch {
    display: inline-flex !important;
    flex-wrap: wrap;
    max-width: min(100%, 280px);
  }
  .topbar {
    flex-wrap: wrap;
    row-gap: 8px;
  }
}

.section-rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0 16px;
}
