/* How-to section. Tokens, fonts, nav, atmosphere and .btn come from /styles.css.
   Kept deliberately plain: thin lines, no coloured stripes, no lift effects. */

html { color-scheme: dark; }

.ht-shell {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem);
  padding: 2.5rem var(--pad) 6rem;
}
.ht-toggle { display: none; }

/* Sidebar */
.ht-side {
  position: sticky; top: 100px; align-self: start;
  max-height: calc(100vh - 120px); overflow-y: auto;
  padding-right: 0.75rem;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}
.ht-list { display: grid; gap: 0.1rem; }
.ht-list--0 > li > details > summary,
.ht-list--0 > li > .ht-soon { font-family: var(--serif); font-size: 1.02rem; color: var(--text); }
.ht-list--1, .ht-list--2, .ht-list--3 {
  margin: 0.1rem 0 0.6rem 0.4rem; padding-left: 0.9rem; border-left: 1px solid var(--line);
}
.ht-group > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.4rem; color: var(--text-alt);
}
.ht-group > summary::-webkit-details-marker { display: none; }
.ht-group > summary::before {
  content: ""; width: 6px; height: 6px; flex: none;
  border-right: 1.5px solid var(--subtle); border-bottom: 1.5px solid var(--subtle);
  transform: rotate(-45deg); transition: transform var(--t-fast);
}
.ht-group[open] > summary::before { transform: rotate(45deg); }
.ht-group > summary:hover { color: var(--text); }
.ht-link { display: block; padding: 0.3rem 0.4rem; color: var(--muted); font-size: 0.94rem; line-height: 1.4; }
.ht-link:hover { color: var(--text); }
.ht-link.is-current { color: var(--text); box-shadow: -1px 0 0 var(--gold); }
.ht-soon {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.4rem 0.4rem 0.4rem 1.05rem; color: var(--subtle) !important;
}
.ht-soon em { font-style: normal; font-size: 0.72rem; color: var(--subtle); }

/* Article */
.ht-main { min-width: 0; max-width: 740px; }
.ht-crumbs { font-size: 0.86rem; color: var(--subtle); display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.6rem; }
.ht-crumbs a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.ht-crumbs a:hover { color: var(--text); text-decoration-color: var(--gold); }
.ht-sep { opacity: 0.5; }

.ht-article h1 {
  font-family: var(--serif); font-weight: 600; color: var(--text);
  font-size: clamp(2rem, 3.4vw + 0.8rem, 3rem); line-height: 1.12; letter-spacing: -0.01em;
}
.ht-lede { margin-top: 1rem; font-size: var(--fs-lede); color: var(--muted); line-height: 1.65; }
.ht-article h2 {
  font-family: var(--serif); font-weight: 600; color: var(--text);
  font-size: clamp(1.35rem, 1.2vw + 1rem, 1.75rem); margin: 2.8rem 0 0.7rem;
}
.ht-article h3 { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; color: var(--text); margin: 1.8rem 0 0.4rem; }
.ht-article p { margin: 0.9rem 0; line-height: 1.75; }
.ht-article a { color: var(--text); text-decoration: underline; text-decoration-color: var(--subtle); text-underline-offset: 3px; }
.ht-article a:hover { text-decoration-color: var(--gold); }
.ht-article strong { color: var(--text); font-weight: 600; }
.ht-article ul { margin: 0.8rem 0; display: grid; gap: 0.5rem; }
.ht-article ul > li { position: relative; padding-left: 1.2rem; line-height: 1.7; }
.ht-article ul > li::before {
  content: ""; position: absolute; left: 0.1rem; top: 0.8em; width: 5px; height: 1px; background: var(--subtle);
}
kbd {
  font-family: var(--mono); font-size: 0.85em; color: var(--text);
  border: 1px solid var(--line); border-radius: 4px; padding: 0.05em 0.4em;
}
.ui { color: var(--text); font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--line); }
.ui--page { display: inline-flex; align-items: center; gap: .3em; }
.ui__ico { flex: none; opacity: .85; position: relative; top: 1px; }
@media (max-width: 480px) { .ui { white-space: normal; overflow-wrap: anywhere; } }
a.ui--page:hover { border-bottom-color: var(--gold, currentColor); }

/* "What you will get": same eyebrow the landing uses */
.ht-goal { margin: 1.8rem 0; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.ht-goal > b {
  display: block; font-family: var(--mono); font-size: var(--fs-eyebrow); font-weight: 400;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-2); margin-bottom: 0.4rem;
}
.ht-goal p { margin: 0.2rem 0; color: var(--text); }

/* Numbered steps: plain numerals on a rule */
.ht-steps { counter-reset: step; display: grid; margin: 1.2rem 0; border-top: 1px solid var(--line); }
.ht-steps > li {
  counter-increment: step; position: relative;
  padding: 0.9rem 0 0.9rem 2.6rem; border-bottom: 1px solid var(--line); line-height: 1.7;
}
.ht-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0.8rem;
  font-family: var(--serif); font-size: 1.25rem; color: var(--gold-2); line-height: 1.5;
}

/* Notes: quiet block, no coloured stripe */
.ht-tip, .ht-warn, .ht-example {
  margin: 1.6rem 0; padding: 1rem 1.2rem; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line-soft);
}
.ht-tip > b, .ht-warn > b, .ht-example > b {
  display: block; font-family: var(--serif); font-size: 1.02rem; font-weight: 600; color: var(--text); margin-bottom: 0.2rem;
}
.ht-tip p, .ht-warn p, .ht-example p { margin: 0.3rem 0; }
.ht-say { margin: 0.7rem 0; padding-left: 1rem; border-left: 1px solid var(--line); font-style: italic; color: var(--text); }

/* Tables */
.ht-table-wrap { overflow-x: auto; margin: 1.2rem 0; }
.ht-article table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.ht-article th, .ht-article td { text-align: left; padding: 0.65rem 0.8rem 0.65rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.ht-article th { color: var(--subtle); font-weight: 500; font-size: 0.82rem; }

/* Pager + meta */
.ht-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.ht-pager__item { display: grid; gap: 0.15rem; padding: 0.4rem 0; }
.ht-pager__item small { font-size: 0.8rem; color: var(--subtle); }
.ht-pager__item span { color: var(--text); font-family: var(--serif); font-size: 1.1rem; }
.ht-pager__item:hover span { color: var(--gold-2); }
.ht-pager__item--next { grid-column: 2; text-align: right; }
.ht-pager__item--previous { grid-column: 1; }
.ht-meta { margin-top: 2rem; font-size: 0.82rem; color: var(--subtle); }

/* Section home */
.ht-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.ht-card {
  display: grid; gap: 0.4rem; padding: 1.3rem 1.3rem; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--panel); text-decoration: none !important;
  transition: border-color var(--t-fast);
}
.ht-card:hover { border-color: rgba(255, 255, 255, 0.2); }
.ht-card b { font-family: var(--serif); font-size: 1.2rem; color: var(--text); font-weight: 600; }
.ht-card span { color: var(--muted); font-size: 0.93rem; line-height: 1.55; }

@media (max-width: 880px) {
  .ht-shell { grid-template-columns: 1fr; padding-top: 1.2rem; gap: 1.2rem; }
  .ht-toggle {
    display: block; width: 100%; text-align: left; background: none; cursor: pointer;
    border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text); padding: 0.7rem 1rem; font: inherit;
  }
  .ht-side { display: none; position: static; max-height: none; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: var(--r-sm); }
  .ht-side.is-open { display: block; }
  .ht-pager { grid-template-columns: 1fr; }
  .ht-pager__item--next, .ht-pager__item--previous { grid-column: 1; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .ht-card, .ht-group > summary::before { transition: none; }
}

/* Language picker */
.ht-lang {
  width: 100%; margin: 0 0 1rem; padding: 0.45rem 0.6rem; color: var(--text);
  background: transparent; border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit; font-size: 0.9rem;
}
.ht-lang option { background: #14161f; color: #f2efe6; }

/* Right-to-left (Arabic): mirror everything that was written with physical left/right */
[dir="rtl"] .ht-side { padding-right: 0; padding-left: 0.75rem; }
[dir="rtl"] .ht-list--1, [dir="rtl"] .ht-list--2, [dir="rtl"] .ht-list--3 { margin: 0.1rem 0.4rem 0.6rem 0; padding-left: 0; padding-right: 0.9rem; border-left: 0; border-right: 1px solid var(--line); }
[dir="rtl"] .ht-group > summary::before { transform: rotate(135deg); }
[dir="rtl"] .ht-group[open] > summary::before { transform: rotate(45deg); }
[dir="rtl"] .ht-link.is-current { box-shadow: 1px 0 0 var(--gold); }
[dir="rtl"] .ht-soon { padding: 0.4rem 1.05rem 0.4rem 0.4rem; }
[dir="rtl"] .ht-article ul > li { padding-left: 0; padding-right: 1.2rem; }
[dir="rtl"] .ht-article ul > li::before { left: auto; right: 0.1rem; }
[dir="rtl"] .ht-steps > li { padding: 0.9rem 2.6rem 0.9rem 0; }
[dir="rtl"] .ht-steps > li::before { left: auto; right: 0; }
[dir="rtl"] .ht-say { padding-left: 0; padding-right: 1rem; border-left: 0; border-right: 1px solid var(--line); }
[dir="rtl"] .ht-article th, [dir="rtl"] .ht-article td { text-align: right; padding: 0.65rem 0 0.65rem 0.8rem; }
[dir="rtl"] .ht-pager__item--next { text-align: left; }
[dir="rtl"] .ht-toggle { text-align: right; }
[dir="rtl"] kbd, [dir="rtl"] code { direction: ltr; unicode-bidi: isolate; }
@media (max-width: 880px) {
  [dir="rtl"] .ht-pager__item--next, [dir="rtl"] .ht-pager__item--previous { text-align: right; }
}
