/* Resource hub extras on top of the shared editorial compare stylesheet. */

.resource-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  margin: 24px 0 8px;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .resource-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.resource-card {
  display: block;
  margin: 0;
  padding: 18px 18px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.resource-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-muted);
  text-decoration: none;
  color: inherit;
}

.resource-card h2 {
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  font-size: 1.15rem;
}

.resource-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.resource-card .card-meta {
  display: block;
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.version-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  border: 1px solid var(--border);
}

.version-list li {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.version-list li:last-child {
  border-bottom: 0;
}

.version-list button.version-row,
.version-list a.version-row {
  display: block;
  width: 100%;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.version-list button.version-row:hover,
.version-list a.version-row:hover {
  background: var(--bg-muted);
  text-decoration: none;
}

.version-list li.is-active button.version-row {
  background: var(--highlight);
}

.version-list .ver {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  display: block;
  margin-bottom: 2px;
}

.version-list .headline {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.version-list .empty,
.version-list .loading,
.version-list .error {
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.resource-section-label {
  margin: 36px 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Right release preview sidebar */
.notes-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(24, 24, 27, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.notes-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.notes-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(440px, 100vw);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.notes-sidebar.is-open {
  transform: translateX(0);
}

.notes-sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg);
}

.notes-sidebar-header h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 1.15rem;
  line-height: 1.3;
}

.notes-sidebar-sub {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.notes-sidebar-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.notes-sidebar-close:hover {
  background: var(--bg-muted);
}

.notes-sidebar-body {
  flex: 1;
  overflow: auto;
  padding: 18px;
  -webkit-overflow-scrolling: touch;
}

.notes-sidebar-body .notes-loading,
.notes-sidebar-body .notes-error {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Normalize Sparkle release-note HTML inside the sidebar */
.notes-preview {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
}

.notes-preview > div,
.notes-preview > div > div {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.notes-preview h1 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.25;
  margin: 0 0 12px;
  color: var(--text) !important;
}

.notes-preview p {
  margin: 0 0 12px;
  color: var(--text-secondary) !important;
  font-size: 0.95rem !important;
  line-height: 1.55 !important;
}

.notes-preview ul {
  margin: 0 0 12px;
  padding-left: 1.2em;
  color: var(--text) !important;
  font-size: 0.9375rem !important;
  line-height: 1.55 !important;
}

.notes-preview li {
  margin-bottom: 8px;
  color: var(--text) !important;
}

.notes-preview strong {
  color: var(--text) !important;
  font-weight: 600;
}

.notes-sidebar-footer {
  flex-shrink: 0;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg);
}

.notes-sidebar-footer .btn {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.875rem;
}

@media (max-width: 520px) {
  .notes-sidebar {
    width: 100vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notes-backdrop,
  .notes-sidebar {
    transition: none;
  }
}
