/* Help Center — list + article
   Operations-manual styling built on enhancements.css tokens. */

html {
  scroll-behavior: smooth;
}

/* ============================================
   Masthead (both pages)
   ============================================

   Help is a place people land because they are already stuck, so it gets a
   header rather than a hero — the td-hero cost 664px on the index and 413px
   on every article before the content started. */

/* Title, one line of context, then topics — the Linear/Vercel docs shape.
   No bottom rule either: the first category heading brings its own, and two
   hairlines a few pixels apart just read as noise. */
.help-masthead {
  padding: clamp(1rem, 2vw, 1.5rem) 0 0;
  margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem);
}

.help-masthead h1 {
  margin: 0 0 0.4rem;
  color: #fff;
  font-size: clamp(1.5rem, 2.6vw, 1.875rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.help-masthead p {
  max-width: 52rem;
  margin: 0;
  color: var(--td-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.help-page .breadcrumb {
  font-size: 0.8125rem;
}

.help-page .breadcrumb-item a {
  color: var(--td-text-secondary);
  text-decoration: none;
  transition: color var(--td-duration-fast);
}

.help-page .breadcrumb-item a:hover {
  color: var(--td-accent);
}

.help-page .breadcrumb-item.active,
.help-page .breadcrumb-item + .breadcrumb-item::before {
  color: var(--td-text-muted);
}

/* ============================================
   Page shell
   ============================================ */

.help-page {
  position: relative;
  background:
    radial-gradient(circle at 88% 4%, rgba(var(--td-accent-rgb), 0.06), transparent 26rem),
    var(--td-surface-1);
  padding-bottom: clamp(4rem, 8vw, 6rem);
}

.help-page .row > *,
.help-topic-card,
.help-article {
  min-width: 0;
}

/* ============================================
   Topic index (list page)
   ============================================ */

.help-category-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.5rem 0 1rem;
  color: var(--td-text-secondary);
  font-family: var(--td-font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.help-category-heading:first-child {
  margin-top: 0;
}

.help-category-rule {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--td-border-default), transparent);
}

/* Layout only — the lift, shadow and timing come from .td-interactive. */
.help-topic-card {
  position: relative;
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1.25rem 0.75rem 0.75rem;
  border: 1px solid var(--td-border-subtle);
  border-radius: var(--td-radius-lg);
  background: var(--td-surface-2);
}

.help-topic-card:hover {
  border-color: var(--td-border-emphasis);
  background: var(--td-surface-3);
}

/* 4:3 to match the processed screenshot frames. */
.help-topic-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--td-border-subtle);
  border-radius: var(--td-radius-md);
  background: var(--td-surface-1);
}

.help-topic-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--td-duration-slow) var(--td-ease-out);
}

.help-topic-card:hover .help-topic-thumb img {
  transform: scale(1.03);
}

.help-topic-category {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--td-accent);
  font-family: var(--td-font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.help-topic-card h2 {
  margin-bottom: 0.35rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.help-topic-card h2 a {
  color: var(--td-text-primary);
  text-decoration: none;
}

.help-topic-card:hover h2 a {
  color: var(--td-accent);
}

.help-topic-card p {
  margin-bottom: 0;
  max-width: 52rem;
  color: var(--td-text-secondary);
  font-size: 0.875rem;
  line-height: 1.55;
}

.help-topic-arrow {
  color: var(--td-text-muted);
  transition:
    color var(--td-duration-base),
    transform var(--td-duration-base) var(--td-ease-out);
}

.help-topic-card:hover .help-topic-arrow {
  color: var(--td-accent);
  transform: translateX(3px);
}

/* ============================================
   Sidebars
   ============================================ */

.help-aside {
  position: sticky;
  top: 6.5rem;
  overflow: hidden;
  border: 1px solid var(--td-border-subtle);
  border-radius: var(--td-radius-lg);
  background: var(--td-surface-2);
  box-shadow: var(--td-shadow-sm);
}

.help-aside-heading {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1rem 1.125rem;
  border-bottom: 1px solid var(--td-border-subtle);
  color: var(--td-text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
}

.help-aside-heading i {
  color: var(--td-accent);
}

.help-aside-body {
  padding: 1.125rem;
}

.help-aside-body p {
  margin-bottom: 1rem;
  color: var(--td-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.55;
}

/* Topic nav (article page) */
.help-nav {
  max-height: calc(100vh - 9rem);
  overflow-y: auto;
  padding: 0.5rem;
  scrollbar-width: thin;
}

.help-nav-group {
  padding: 0.75rem 0.75rem 0.35rem;
  color: var(--td-text-muted);
  font-family: var(--td-font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.help-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--td-radius-sm);
  color: var(--td-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.35;
  text-decoration: none;
  transition:
    color var(--td-duration-fast),
    background-color var(--td-duration-fast),
    transform var(--td-duration-fast);
}

.help-nav a:hover {
  color: var(--td-text-primary);
  background: var(--td-surface-3);
  transform: translateX(2px);
}

.help-nav a.is-current {
  color: var(--td-accent);
  background: var(--td-accent-subtle);
  font-weight: 600;
}

/* ============================================
   Article
   ============================================ */

.help-article {
  padding: clamp(1.5rem, 3vw, 2.75rem);
  border: 1px solid var(--td-border-subtle);
  border-radius: var(--td-radius-lg);
  background: var(--td-surface-2);
  box-shadow: var(--td-shadow-sm);
}

.help-content {
  color: var(--td-text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

.help-content > *:first-child {
  margin-top: 0;
}

.help-content h2 {
  margin: 2.75rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--td-border-subtle);
  color: var(--td-text-primary);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.help-content > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.help-content h3 {
  margin: 2rem 0 0.75rem;
  color: var(--td-text-primary);
  font-size: 1.0625rem;
  font-weight: 600;
}

.help-content h4 {
  margin: 1.5rem 0 0.5rem;
  color: var(--td-text-primary);
  font-size: 0.9375rem;
  font-weight: 600;
}

.help-content p,
.help-content li {
  color: var(--td-text-secondary);
}

.help-content strong {
  color: var(--td-text-primary);
  font-weight: 600;
}

.help-content a:not(.gallery-item) {
  color: var(--td-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--td-accent-rgb), 0.3);
  transition: border-color var(--td-duration-fast);
}

.help-content a:not(.gallery-item):hover {
  border-bottom-color: var(--td-accent);
}

.help-content ul,
.help-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.35rem;
}

.help-content li + li {
  margin-top: 0.35rem;
}

.help-content ol > li::marker {
  color: var(--td-accent);
  font-family: var(--td-font-mono);
  font-size: 0.875em;
  font-weight: 600;
}

.help-content hr {
  margin: 2.5rem 0;
  border-color: var(--td-border-subtle);
  opacity: 1;
}

/* Figures — the screenshot frames carry their own padding, so the border
   stays hairline and the caption does the explaining. */
.help-content figure {
  margin: 1.75rem 0;
}

.help-content figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--td-border-subtle);
  border-radius: var(--td-radius-md);
  box-shadow: var(--td-shadow-md);
}

.help-content .gallery-item {
  display: block;
  border-radius: var(--td-radius-md);
  transition: transform var(--td-duration-base) var(--td-ease-out);
}

.help-content .gallery-item:hover {
  transform: translateY(-2px);
}

.help-content figcaption {
  margin-top: 0.75rem;
  padding-left: 0.85rem;
  border-left: 2px solid rgba(var(--td-accent-rgb), 0.35);
  color: var(--td-text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Tables — enhancements.css §11 already handles the transparent background,
   cell padding, borders and the uppercase muted thead. Only the mono header
   and the row-label emphasis are help-specific. */
.help-content .table {
  margin-bottom: 0;
  font-size: 0.875rem;
}

.help-content .table > thead th {
  font-family: var(--td-font-mono);
  font-size: 0.6875rem;
}

.help-content .table > tbody th {
  color: var(--td-text-primary);
  font-weight: 600;
}

.help-content .table-responsive {
  border: 1px solid var(--td-border-subtle);
  border-radius: var(--td-radius-md);
  background: var(--td-surface-1);
  padding: 0.35rem 0.85rem;
}

/* Inline keys and code get the mono treatment from enhancements.css; this
   just keeps them from crowding the line. */
.help-content code {
  white-space: nowrap;
}

/* ============================================
   Article footer
   ============================================ */

.help-article-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--td-border-subtle);
}

.help-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* The pager and back links are .td-btn-secondary in the markup; this only
   takes them down to the smaller footer scale. */
.help-article-footer .td-btn-secondary {
  padding: 0.5rem 0.85rem;
  font-size: 0.8125rem;
}

/* ============================================
   Support cards
   ============================================ */

.help-support {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.help-support-card {
  padding: 1.25rem;
  border: 1px solid var(--td-border-subtle);
  border-radius: var(--td-radius-lg);
  background: var(--td-surface-2);
}

.help-support-card:hover {
  border-color: var(--td-border-emphasis);
}

.help-support-card i {
  color: var(--td-accent);
  font-size: 1.125rem;
}

.help-support-card h3 {
  margin: 0.75rem 0 0.35rem;
  color: var(--td-text-primary);
  font-size: 0.9375rem;
  font-weight: 600;
}

.help-support-card p {
  margin-bottom: 0.9rem;
  color: var(--td-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 991.98px) {
  .help-aside {
    position: static;
  }
}

@media (max-width: 767.98px) {
  .help-topic-card {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 1.1rem;
  }

  .help-topic-thumb {
    display: none;
  }

  .help-article {
    padding: 1.25rem;
  }
}
