/* Shared article navigation; generated markup comes from render_help_navigation.mjs. */
:root {
  --section-offset: 7.75rem;
}

/* Keep the shared smooth scrolling and its reduced-motion override. */
.article-main { overflow-anchor: none; }

[hidden] { display: none !important; }

.article-layout {
  display: grid;
  gap: 1.75rem;
  margin-top: 1.75rem;
}

.article-sections { min-width: 0; }
.article-sections .concept-body { margin-top: 0; }

.article-main,
.article-sections [id],
#rest-timers-for-supersets {
  scroll-margin-top: var(--section-offset);
}

/* Reserve each screenshot's full frame even before its lazy image loads. */
.article-sections .workflow-strip { width: 100%; }
.article-sections .phone-screen {
  aspect-ratio: var(--capture-ratio);
}
.article-sections .phone-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.section-nav {
  width: min(100%, var(--copy-width));
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.section-nav__title {
  margin: 0;
  padding: 0.9rem 1rem 0.3rem;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
}

.section-nav__toggle {
  display: flex;
  width: 100%;
  min-height: 3.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.section-nav__toggle:hover { background: #eef3f8; }
.section-nav__toggle:focus-visible { outline-offset: -4px; }
.section-nav__toggle svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; }
.section-nav__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.section-nav__panel { padding: 0.25rem 0.75rem 0.85rem; }
.section-nav__links { margin: 0; padding: 0; list-style: none; }
.section-nav__links li { margin: 0; }

.section-nav__links a {
  display: block;
  padding: 0.65rem 0.875rem;
  border-left: 2px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9375rem;
  /* Keep text metrics stable when the current section changes. */
  font-weight: 400;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: normal;
}

.section-nav__links a:hover {
  background: #edf3f9;
  color: var(--blue-dark);
  text-decoration: underline;
}

.section-nav__links a[aria-current="location"] {
  border-left-color: var(--blue-dark);
  background: #eaf3fc;
  color: var(--blue-dark);
}

.section-heading {
  color: inherit;
  text-decoration: none;
}

.section-heading__tail {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.section-heading__icon {
  display: inline-block;
  margin-left: 0.4rem;
  color: #798899;
  vertical-align: -0.05em;
}

.section-heading__icon svg {
  width: 0.8em;
  height: 0.8em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-heading:hover { color: var(--ink); text-decoration: underline; }
.section-heading:hover .section-heading__icon,
.section-heading:focus-visible .section-heading__icon { color: var(--blue-dark); }
.concept-section h2:focus { outline: none; }
.concept-section h2:focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; border-radius: 2px; }

@media (max-width: 760px) {
  :root { --section-offset: 10.5rem; }
}

@media (min-width: 75rem) {
  .article-main { width: min(100%, 72rem); }
  [data-section-navigation] article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 15rem);
    column-gap: 4rem;
    row-gap: 1.75rem;
  }
  .article-intro { grid-column: 1; grid-row: 1; }
  .article-layout { display: contents; }
  .article-sections { grid-column: 1; grid-row: 2; }
  .section-nav {
    position: sticky;
    top: var(--section-offset);
    grid-column: 2;
    grid-row: 1 / span 2;
    max-height: calc(100svh - var(--section-offset) - 1.5rem);
    overflow: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .section-nav__title { padding: 0.25rem 0 0.9rem 0.875rem; }
  .section-nav__panel { padding: 0 0.25rem 0.25rem 0; }
  .section-nav__links a { padding: 0.4375rem 0.875rem; font-size: 0.875rem; }
}

/* At high zoom or in short windows, leave the full viewport for reading. */
@media (max-height: 32rem) {
  .help-header { position: static; }
  .section-nav { position: static; max-height: none; }
}

@media print {
  .help-header, .section-nav, .section-heading__icon { display: none; }
  [data-section-navigation] article, .article-layout { display: block; }
  .article-main { padding: 0; }
}
