/* Guide page styles
   ==================
   Layout and ToC only - typography inherits from main.css
*/

/* ===========================================
   Guide Layout with Sidebar ToC
   =========================================== */

.guide-layout {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 30px;
  position: relative;
}

.guide-layout .guide-content {
  min-width: 0;
}

/* Sidebar - positioned in left margin, sticky on scroll */
.guide-sidebar {
  position: sticky;
  top: 100px;
  float: left;
  width: 200px;
  margin-left: -220px;
  height: 0;
  overflow: visible;
}

.guide-sidebar .guide-toc {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 1rem 0;
}

.guide-toc-title,
.guide-toc-subtitle {
  font-family: var(--typeface-sans);
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem 0;
}

.guide-toc-subtitle {
  margin-top: 1.5rem;
}

.guide-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.guide-toc-list li {
  margin-bottom: 0.4rem;
}

.guide-toc-list a {
  font-size: var(--font-sm);
  color: var(--text-bright);
  text-decoration: none;
  display: block;
  padding: 0.2rem 0;
  padding-left: 0.75rem;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.guide-toc-list li.guide-toc-h2 a {
  color: var(--text-secondary);
  font-weight: 400;
  padding-left: 1.5rem; /* Extra indent for h2 text, border stays aligned */
}

.guide-toc-list a:hover,
.guide-toc-list a.active,
.guide-toc-list li.guide-toc-h2 a:hover,
.guide-toc-list li.guide-toc-h2 a.active {
  color: var(--text-highlight);
}

.guide-toc-list a.active {
  border-left-color: var(--text-highlight);
  font-weight: 600;
}

.guide-toc-list li.guide-toc-h2 a.active {
  font-weight: 500;
}

.guide-toc-download {
  display: block;
  margin-top: 0.75rem;
  padding-left: 0.75rem;
}

.guide-toc-download img {
  max-width: 140px;
}

/* ===========================================
   Mobile ToC (collapsible header)
   =========================================== */

.guide-layout > .guide-toc-mobile-header {
  display: none;
}

.guide-toc-mobile-header {
  position: sticky;
  top: 80px;
  z-index: 50;
  background: var(--light-beige);
  border-bottom: 1px solid rgba(var(--black-rgb), 0.1);
  margin: 0 -30px;
  padding: 0 30px;
}

/* Extend background upward to clip content scrolling under site header */
.guide-toc-mobile-header::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 80px;
  background: var(--light-beige);
}

.guide-toc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 0;
  background: none;
  border: none;
  font-family: var(--typeface-sans);
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-bright);
  cursor: pointer;
}

.guide-toc-toggle:hover {
  color: var(--text-highlight);
}

.guide-toc-chevron {
  transition: transform 0.2s ease;
}

.guide-toc-mobile-header.is-open .guide-toc-chevron {
  transform: rotate(180deg);
}

.guide-toc-mobile {
  display: none;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.5rem 0 1rem 0;
  background: var(--light-beige);
  border-bottom: 1px solid rgba(var(--black-rgb), 0.1);
  position: relative;
  z-index: 49;
}

.guide-toc-mobile-header.is-open .guide-toc-mobile {
  display: block;
}

.guide-toc-mobile .guide-toc-list {
  margin: 0;
  padding: 0;
}

/* ===========================================
   Guide Content Adjustments
   =========================================== */

/* Scroll offset for anchor links (accounts for sticky header) */
.guide-content h1[id],
.guide-content h2[id] {
  scroll-margin-top: 100px;
}

/* Section separators */
.guide-content hr {
  margin: 3vw auto 9vw auto;
}

/* Constrain images and videos */
.guide-content img,
.guide-content video {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Two-column layout for side-by-side content */
.guide-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 1.5rem 0;
}

.guide-columns > div h3 {
  margin-top: 0;
}

/* Breadcrumb navigation */
.guide-breadcrumb {
  font-size: var(--font-sm);
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.guide-breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
}

.guide-breadcrumb a:hover {
  text-decoration: underline;
}

.guide-breadcrumb .separator {
  margin: 0 0.5rem;
}

/* Section navigation (prev/next) */
.guide-section-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(var(--black-rgb), 0.1);
}

.guide-section-nav a {
  color: var(--text-dim);
  text-decoration: none;
}

.guide-section-nav a:hover {
  text-decoration: underline;
}

/* Section list (for index pages) */
.guide-section-list {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(var(--black-rgb), 0.1);
}

.guide-section-list h3 {
  font-size: var(--font-base);
  font-weight: 600;
  margin-bottom: 1rem;
}

.guide-section-list ul {
  list-style: none;
  padding: 0;
}

.guide-section-list a {
  text-decoration: none;
  color: var(--text-bright);
}

.guide-section-list a:hover {
  text-decoration: underline;
}

/* ===========================================
   Quick Start Section
   =========================================== */

.quick-start-steps {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 2rem 0;
  counter-reset: step-counter;
}

.quick-start-steps > li {
  position: relative;
  padding: 1.25rem 1.5rem 1.25rem 4rem;
  margin-bottom: 1rem;
  background: rgba(var(--black-rgb), 0.03);
  border-radius: 8px;
  counter-increment: step-counter;
}

.quick-start-steps > li::before {
  content: counter(step-counter);
  position: absolute;
  left: 1.25rem;
  top: 1.25rem;
  width: 2rem;
  height: 2rem;
  background: var(--text-highlight);
  color: var(--light-beige);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--font-sm);
}

.quick-start-steps strong {
  font-size: 1.1em;
  margin-bottom: 0.5rem;
  color: var(--text-bright);
}

.quick-start-steps p {
  margin: 0.5rem 0;
}

.quick-start-steps ul {
  margin: 0.75rem 0 0.5rem 0;
  padding-left: 1.25rem;
}

.quick-start-steps ul li {
  margin-bottom: 0.25rem;
}

/* Power Features - horizontal card layout */
.power-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 1.5rem 0 2rem 0;
}

.power-features > div {
  padding: 1.25rem;
  background: rgba(var(--black-rgb), 0.03);
  border-radius: 8px;
}

.power-features strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-bright);
}

.power-features p {
  margin: 0;
  font-size: var(--font-sm);
}

/* Help Links - clean list */
.help-links {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.help-links li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(var(--black-rgb), 0.08);
}

.help-links li:last-child {
  border-bottom: none;
}

.help-links strong {
  color: var(--text-bright);
}

@media (max-width: 800px) {
  .power-features {
    grid-template-columns: 1fr;
  }
}

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

/* Medium screens: shift content right to keep sidebar visible */
@media (max-width: 1400px) and (min-width: 1201px) {
  .guide-layout {
    margin-left: 250px;
    margin-right: 30px;
  }
}

/* Narrow screens: hide sidebar, show mobile ToC */
@media (max-width: 1200px) {
  .guide-sidebar {
    display: none;
  }

  .guide-layout > .guide-toc-mobile-header {
    display: block;
  }
}

@media (max-width: 600px) {
  .guide-columns {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Taller header at narrow widths (stacked nav) */
@media (max-width: 850px) {
  .guide-toc-mobile-header {
    top: 120px;
  }

  .guide-toc-mobile-header::before {
    height: 120px;
  }
}
