/* ── v6 walkthrough page-scoped styles ──
 *
 * Based on v5 styles. Adds hamburger-only overlay nav support
 * to the two-column sticky-demo layout.
 *
 * Loaded via page_css frontmatter in walkthrough-v6.html.
 */

/* ── Spacing scale (scoped to this page via body_class) ── */
.td-walkthrough-v6 {
  --v5-space-2xs: 2px;
  --v5-space-xs:  4px;
  --v5-space-sm:  8px;
  --v5-space-md:  16px;
  --v5-space-lg:  24px;
  --v5-space-xl:  32px;
  --v5-space-2xl: 48px;
  --v5-space-3xl: 64px;
}

/* ── Two-column split layout ── */
.v5-split {
  display: grid;
  grid-template-columns: 1fr 360px;
  column-gap: var(--v5-space-2xl);
  row-gap: var(--v5-space-lg);
  max-width: 1060px;
  margin: 0 auto;
  padding: var(--v5-space-lg) var(--v5-space-lg) var(--v5-space-xl) 120px;
  align-items: start;
}

.v5-split__content {
  min-width: 0;
}

.v5-split__demo {
  position: sticky;
  top: 20px;
}

.v5-split__demo .tw-demo {
  width: 360px;
  max-width: 360px;
}

.v5-split__demo .tw-demo-window {
  max-height: min(600px, 82vh);
  overflow-y: auto;
}

/* ── Opener spans both columns ── */
.v5-split__opener {
  grid-column: 1 / -1;
}
.v5-lede {
  margin: 0 0 var(--v5-space-md);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

/* v6: lede lives inside .v5-split__opener — same width as h2 / tw-section-intro */
.td-walkthrough-v6 .v5-lede {
  color: var(--berkeley-blue);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* Lede + opener info callout: span full grid row and center */
.td-walkthrough-v6 .v5-lede + .tw-info-box {
  grid-column: 1 / -1;
  justify-self: center;
  width: 100%;
  max-width: 660px;
}

/* Hero video */
.td-walkthrough-v6 .tw-hero-video-wrap {
  position: relative;
  max-width: 594px; /* 90% of prior 660px */
  margin: var(--v5-space-lg) auto var(--v5-space-xl);
  /* Nudge left to align with viewport-centered hero above;
     grid has asymmetric padding (120px L / --v5-space-lg R) */
  transform: translateX(calc((var(--v5-space-lg) - 120px) / 2));
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  line-height: 0;
}
.td-walkthrough-v6 .tw-hero-video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}
/* Hero video inside content column: fill available width, no centering nudge */
.v5-split__content .tw-hero-video-wrap {
  max-width: 100%;
  transform: none;
  margin-left: 0;
  margin-right: 0;
}
.td-walkthrough-v6 .tw-hero-video-pause-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #fff;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  letter-spacing: -0.1em;
}
.td-walkthrough-v6 .tw-hero-video-wrap.is-paused .tw-hero-video-pause-badge {
  opacity: 1;
}

/* ── Section blocks (inside split content column) ── */
.v5-section {
  padding: var(--v5-space-2xl) 0;
}
.v5-section:first-of-type {
  padding-top: 0;
}
.v5-section + .v5-section {
  border-top: 1px solid var(--border-color);
  margin-top: var(--v5-space-sm);
}

/* Tighter vertical rhythm between major sections (avoid 48px + 48px + info-box margin) */
.td-walkthrough-v6 .v5-section:not(:last-child) {
  padding-bottom: var(--v5-space-lg);
}
.td-walkthrough-v6 .v5-section + .v5-section {
  padding-top: var(--v5-space-lg);
}
.td-walkthrough-v6 .v5-section .tw-info-box:last-child {
  margin-bottom: 0;
}

.v5-section-head {
  display: grid;
  gap: var(--v5-space-sm);
  margin-bottom: var(--v5-space-lg);
}
.v5-section-head h2 {
  font-size: 1.75rem;
  margin-bottom: 0;
  color: var(--berkeley-blue);
  line-height: 1.2;
}
.v5-section-head p {
  margin: 0;
  color: var(--color-text-secondary);
  max-width: 60ch;
}

/* ── Feature blocks ── */
.v5-feature {
  padding: 0;
  margin-bottom: var(--v5-space-xl);
}
.v5-feature:last-child { margin-bottom: 0; }

.v5-feature h3 {
  font-size: 1.25rem;
  margin-top: 2em;
  margin-bottom: var(--v5-space-sm);
  border-left: 3px solid var(--heritage-gold);
  padding-left: var(--v5-space-sm);
  color: var(--berkeley-blue);
  line-height: 1.3;
}
.v5-feature:first-child h3 {
  margin-top: 0;
}
.v5-feature p {
  margin: 0 0 var(--v5-space-sm);
  color: var(--berkeley-blue);
  font-size: 0.95rem;
  line-height: 1.65;
}
.v5-feature p:last-child { margin-bottom: 0; }
.v5-feature ul {
  margin: var(--v5-space-sm) 0 0;
  padding-left: 1.4em;
  color: var(--berkeley-blue);
  font-size: 0.95rem;
  line-height: 1.65;
}
.v5-feature li { margin-bottom: var(--v5-space-xs); }

/* Feature image header */
.v5-feature-img {
  margin-bottom: var(--v5-space-md);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  width: fit-content;
}
.v5-feature-img img {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
}

/* Side-by-side image row */
.v5-img-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--v5-space-md);
  margin: var(--v5-space-lg) 0;
  align-items: start;
}
.v5-img-row img {
  display: block;
  flex: 1 1 200px;
  min-width: 0;
  height: auto;
  border-radius: 6px;
  max-width: min(100%, 392px);
}

/* Settings screenshot */
.v5-settings-img {
  margin: var(--v5-space-md) 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  width: fit-content;
}
.v5-settings-img img {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
}

/* ── Inline toolbar-echo button in body text ── */
.v5-inline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  vertical-align: middle;
  background: var(--berkeley-blue);
  border-radius: 6px;
  border: 1.5px solid #fdb515;
  color: rgba(255, 255, 255, 0.85);
}
.v5-inline-btn svg {
  width: 18px;
  height: 18px;
  fill: rgba(255, 255, 255, 0.85);
  color: rgba(255, 255, 255, 0.85);
}

/* ── Inline toggle — mirrors .tw-view-selector ── */
.v5-inline-toggle {
  display: inline-flex;
  vertical-align: middle;
  border-radius: 5px;
  padding: 2px;
  background: var(--berkeley-blue);
  border: 1.5px solid #fdb515;
}
.v5-inline-toggle__seg {
  padding: 3px 8px;
  border: none;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: rgba(255, 255, 255, 0.55);
  background: transparent;
  cursor: pointer;
}
.v5-inline-toggle__seg--active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}


/* ── Footnotes ── */
.v5-footnotes {
  margin-top: var(--v5-space-sm);
  padding: 0;
}
.v5-footnotes p {
  margin: 0 0 var(--v5-space-xs);
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.v5-footnotes p:last-child { margin-bottom: 0; }
sup.v5-fn { font-size: 0.75em; color: var(--berkeley-blue); font-weight: 600; }
.v5-section-head h2 sup.v5-fn { font-size: 0.45em; vertical-align: super; }
sup.v5-fn a { color: inherit; text-decoration: none; }
sup.v5-fn a:hover { text-decoration: underline; }

/* ── Keyboard shortcuts table ── */
.v5-shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--v5-space-md) 0;
  border-top: 1px solid var(--border-color);
  font-size: 0.88rem;
}
.v5-shortcuts-table th,
.v5-shortcuts-table td {
  padding: 10px var(--v5-space-md);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: normal;
  color: var(--berkeley-blue);
}
.v5-shortcuts-table th {
  background: var(--gray-light);
  font-weight: 600;
  font-size: 0.84rem;
}
.v5-shortcuts-table tr:last-child td {
  border-bottom: none;
}

/* ── Mobile: hide the sticky demo column ── */
.v5-mobile-demo {
  display: none;
  margin: var(--v5-space-lg) 0 var(--v5-space-md);
}
.v5-mobile-demo .tw-demo {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}
.v5-mobile-demo .tw-demo-window {
  max-height: min(500px, 70vh);
  overflow-y: auto;
}

.v5-desktop-arrow {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.22em;
  fill: currentColor;
  margin-left: 0.2em;
}

@media (max-width: 900px) {
  .v5-split {
    grid-template-columns: 1fr;
    max-width: 100%;
    padding-left: var(--v5-space-lg);
    padding-right: var(--v5-space-lg);
  }
  .td-walkthrough-v6 .tw-hero-video-wrap {
    transform: none; /* padding is symmetric at mobile */
  }
  .v5-split__demo,
  .v5-desktop-arrow {
    display: none;
  }
  .v5-mobile-demo {
    display: block;
  }
}

/* ═══════════════════════════════════════════════
   v6 ADDITIONS: Nav overlay support
   ═══════════════════════════════════════════════ */

/* No margin-lock needed: v6 nav JS does not add tw-nav-open to <html>,
 * so tw-nav.css's content-shift rules never fire. */

/* Scroll-to offset for anchored sections (clears fixed hamburger area) */
.td-walkthrough-v6 .v5-section[id],
.td-walkthrough-v6 .v5-feature[id],
.td-walkthrough-v6 .tw-contact-section[id],
.td-walkthrough-v6 .v5-section-head {
  scroll-margin-top: 56px;
}
