/* How to: the card grid, category list and article pages. Loaded after homepage.css (tokens, header, footer). */

.ht {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 56px;
  padding-top: 72px;
  padding-bottom: 120px;
  align-items: start;
}
.ht:focus {
  outline: none;
}
.ht-main {
  min-width: 0;
}

/* ── Top ── */
.ht-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font: 500 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ht-eyebrow__icon {
  width: 15px;
  height: 15px;
}
.ht-title {
  margin-top: 22px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
}
.ht-lede {
  margin-top: 18px;
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.ht-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 32px;
  max-width: 560px;
}
.ht-search__icon {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.ht-search input {
  width: 100%;
  height: 50px;
  padding: 0 48px 0 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
}
.ht-search input::placeholder {
  color: var(--muted);
}
.ht-search input:focus {
  outline: none;
  border-color: var(--gold);
}
.ht-search kbd {
  position: absolute;
  right: 14px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.ht-jump {
  display: none;
}
.ht-empty {
  margin-top: 40px;
  color: var(--muted);
}
.ht-empty a,
.ht-help a,
.ht-prose a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Sections and cards ── */
.ht-section {
  margin-top: 64px;
  scroll-margin-top: 110px;
}
.ht-section[hidden] {
  display: none;
}
.ht-section__title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.ht-section__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--gold);
}
.ht-icon {
  width: 20px;
  height: 20px;
}
.ht-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}
.ht-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 26px 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.ht-card[hidden] {
  display: none;
}
.ht-card:hover,
.ht-card:focus-visible {
  border-color: var(--gold);
  outline: none;
}
.ht-card__title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--text);
}
.ht-card__link {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  color: var(--muted);
}
.ht-card:hover .ht-card__link {
  color: var(--gold);
}
.ht-card__summary {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ht-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ht-chip {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font: 500 11px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ht-chip--solid {
  border-color: transparent;
  background: rgba(221, 191, 124, 0.14);
  color: var(--gold-soft);
}
.ht-chip--solid::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 6px 2px 0;
  border-radius: 50%;
  background: var(--gold);
  vertical-align: middle;
}

/* ── Category list ── */
.ht-aside {
  position: sticky;
  top: 110px;
  padding-left: 28px;
  border-left: 1px solid var(--line);
}
.ht-aside__head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font: 500 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ht-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}
.ht-aside__list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.ht-aside__cat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  color: var(--muted);
  font-size: 15px;
}
.ht-aside__cat:hover,
.ht-aside__cat.is-on {
  color: var(--text);
}
.ht-aside__count {
  font: 12px/1.9 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
}
.ht-aside__articles {
  margin: 2px 0 10px;
  padding: 0 0 0 12px;
  list-style: none;
  border-left: 1px solid var(--line);
}
.ht-aside__articles a {
  display: block;
  padding: 6px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}
.ht-aside__articles a:hover,
.ht-aside__articles a[aria-current="page"] {
  color: var(--gold-soft);
}
.ht-aside__app {
  display: inline-block;
  margin-top: 26px;
  color: var(--gold);
  font-size: 14px;
}

/* ── Article ── */
.ht-crumbs {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 14px;
}
.ht-crumbs a:hover {
  color: var(--text);
}
.ht-article__title {
  margin-top: 18px;
  font-size: clamp(32px, 4.6vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.ht-where {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  margin-top: 22px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font-size: 15px;
}
.ht-where span {
  color: var(--gold);
  font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ht-prose {
  max-width: 740px;
  margin-top: 36px;
  font-size: 17px;
  line-height: 1.75;
}
.ht-prose h2 {
  margin: 44px 0 12px;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
  scroll-margin-top: 110px;
}
.ht-prose h3 {
  margin: 30px 0 8px;
  font-size: 19px;
  font-weight: 600;
}
.ht-prose p {
  margin: 0 0 16px;
  color: #dcd9d0;
}
.ht-prose ul,
.ht-prose ol {
  margin: 0 0 18px;
  padding-left: 24px;
  color: #dcd9d0;
}
.ht-prose li {
  margin: 6px 0;
}
.ht-prose li::marker {
  color: var(--gold);
}
.ht-prose strong {
  color: var(--text);
  font-weight: 600;
}
.ht-prose code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--panel);
  font-size: 0.88em;
  word-break: break-word;
}
.ht-figure {
  margin: 26px 0 30px;
}
.ht-figure img {
  width: auto;
  max-width: 100%;
  max-height: 640px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.ht-figure figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}
.ht-note {
  margin: 28px 0 0 !important;
  padding: 14px 18px;
  border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0;
  background: var(--panel);
  color: var(--muted) !important;
  font-size: 15px;
}
.ht-more {
  margin-top: 72px;
}
.ht-help {
  margin-top: 48px;
  color: var(--muted);
}

/* ── Narrow screens: the category list becomes a row of chips ── */
@media (max-width: 1050px) {
  .ht {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .ht-aside {
    display: none;
  }
  .ht-jump {
    display: flex;
    gap: 8px;
    margin: 22px -16px 0;
    padding: 0 16px 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .ht-jump::-webkit-scrollbar {
    display: none;
  }
  .ht-jump a {
    flex: none;
    padding: 7px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
  }
}
@media (max-width: 760px) {
  .ht {
    padding-top: 40px;
    padding-bottom: 80px;
  }
  .ht-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ht-section {
    margin-top: 48px;
  }
  .ht-card {
    padding: 20px;
  }
  .ht-prose {
    font-size: 16px;
  }
}

/* ?embed=1: inside an app's web view, no site header or footer. */
body.is-embed .site-header,
body.is-embed .site-footer,
body.is-embed .skip-link,
body.is-embed .ht-aside__app {
  display: none;
}
