/* ==========================================================================
   Magic Product Video for WooCommerce — documentation page
   Loaded after site.css: reuses its tokens, header, footer, buttons, .code,
   .step and .faq__*. Only what a long reference page needs lives here.
   ========================================================================== */

.site-nav a[aria-current="page"] { color: var(--ink); background: var(--lilac-soft); }

/* ---------- Hero ---------- */

.doc-hero {
  padding: clamp(36px, 5vw, 64px) 0 clamp(28px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
}
.doc-hero__title { margin-top: 16px; font-size: clamp(40px, 5.6vw, 72px); }
.doc-hero__lede { margin-top: 20px; max-width: 38em; }
.doc-hero__req { margin-top: 20px; color: var(--muted); }

/* ---------- Layout: sticky contents + reading column ---------- */

.doc-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-bottom: clamp(56px, 7vw, 96px);
}
.doc { max-width: 780px; min-width: 0; }

.doc-aside {
  position: sticky;
  top: 68px;
  max-height: calc(100vh - 68px);
  overflow-y: auto;
  padding: 36px 4px 24px 0;
  scrollbar-width: thin;
}
.toc__toggle { display: none; }
.toc__title { margin: 0 0 12px 12px; color: var(--muted); }
.toc__nav ul { display: flex; flex-direction: column; gap: 1px; }
.toc__nav a {
  display: block;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.4;
  text-decoration: none;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.toc__sub a { padding-left: 26px; font-size: 14px; }
.toc__nav a:hover { color: var(--ink); background: var(--lilac-soft); }
.toc__nav a[aria-current] {
  color: var(--violet-deep);
  background: var(--lilac-soft);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--violet);
}

/* ---------- Reading column ---------- */

.doc-sec { padding-top: clamp(40px, 5vw, 56px); }
.doc-sec + .doc-sec { margin-top: clamp(16px, 2vw, 24px); border-top: 1px solid var(--line); }
.doc h2 {
  font-family: var(--f-display);
  font-size: clamp(26px, 2.8vw, 34px);
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.12;
  text-wrap: balance;
}
.doc h3 {
  margin-top: 40px;
  font-family: var(--f-display);
  font-size: clamp(19px, 1.8vw, 22px);
  font-weight: 650;
  letter-spacing: -.015em;
  line-height: 1.25;
}
.doc h4 { margin: 28px 0 0; font-size: 17px; font-weight: 600; }
.doc h2 + p, .doc h3 + p, .doc h4 + p { margin-top: 14px; }
.doc p + p { margin-top: 12px; }
.doc-sec > p, .doc-sec > .doc-table, .doc-sec > .note, .doc-sec > .snippet,
.doc-sec > ul, .doc-sec > ol, .doc-sec > div { margin-top: 16px; }
.doc h4 + .doc-table, .doc h4 + .snippet { margin-top: 12px; }
.doc p { line-height: 1.7; }
.doc strong { font-weight: 600; }
.doc-small { font-size: 15px; }
.doc-muted { color: var(--muted); }

.doc :not(pre) > code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--lilac-soft);
  color: var(--ink);
  font-size: .84em;
  overflow-wrap: anywhere;
}

/* Lists: square violet bullets like the landing's feature list, mono numbers for steps. */
.doc-ul, .doc-ol { display: flex; flex-direction: column; gap: 10px; }
.doc-ul li { position: relative; padding-left: 22px; line-height: 1.6; }
.doc-ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--violet);
}
.doc-ol { counter-reset: li; }
.doc-ol li { position: relative; padding-left: 36px; line-height: 1.6; counter-increment: li; }
.doc-ol li::before {
  content: counter(li);
  position: absolute;
  left: 0;
  top: .1em;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--lilac-soft);
  color: var(--violet-deep);
  font: 600 12px/1 var(--f-mono);
}

/* ---------- Tables ---------- */

.doc-table {
  overflow-x: auto;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.doc-table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
.doc-table th, .doc-table td { padding: 13px 18px; text-align: left; vertical-align: top; }
.doc-table tr + tr > * { border-top: 1px solid var(--line); }
.doc-table thead th {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--lilac-soft) 60%, transparent);
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-stretch: 87.5%;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--violet-deep);
}
.doc-table tbody th {
  width: 28%;
  background: color-mix(in srgb, var(--lilac-soft) 45%, transparent);
  font-weight: 600;
}
.doc-table td.mono { color: var(--violet-deep); white-space: nowrap; }
.doc-table .is-warn { color: #b8441a; font-weight: 500; }

/* ---------- Callouts ---------- */

.note {
  padding: 16px 20px;
  border-radius: var(--r-md);
  background: var(--lilac-soft);
  box-shadow: inset 3px 0 0 var(--violet);
  font-size: 15.5px;
}
.note p { line-height: 1.6; }
.note p + p { margin-top: 6px; }
.note--tip { background: color-mix(in srgb, var(--lilac-soft) 70%, #fff); }
.note--warn {
  background: #fff1e9;
  box-shadow: inset 3px 0 0 var(--flame);
}
.note--warn code { background: #ffe2d2 !important; }

/* ---------- Code snippets: site.css .code with a file-name bar ---------- */

.snippet {
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--night);
  box-shadow: var(--shadow);
}
.snippet__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: color-mix(in srgb, var(--lilac) 70%, transparent);
}
.snippet__bar::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--flame);
}
.snippet .code {
  padding: 18px 20px 20px;
  border-radius: 0;
  box-shadow: none;
  font-size: 13px;
  line-height: 1.7;
  tab-size: 2;
}
.code .v { color: #c8affa; }
.code .n { color: #9fe0c9; }

/* ---------- Quick start: the landing's .step cards, three across ---------- */

.doc-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  counter-reset: step;
}
.doc-steps .step::after { display: none; }
.doc .doc-steps h3 { margin-top: 0; font-size: 18px; }
.doc .doc-steps p { margin-top: 0; font-size: 15px; line-height: 1.55; }

/* ---------- Conversion methods ---------- */

.methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.method {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 20px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.method--soon { background: transparent; box-shadow: none; outline: 1.5px dashed var(--line); outline-offset: -1.5px; }
.doc .method h3 { margin-top: 2px; font-size: 19px; }
.doc .method p { margin-top: 0; font-size: 15px; line-height: 1.55; }
.doc .method .method__foot { margin-top: auto; padding-top: 4px; color: var(--muted); font-size: 13.5px; }
.tag {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-stretch: 87.5%;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.tag--flame { background: var(--flame); }
.tag--soft { background: var(--lilac-soft); color: var(--violet-deep); }

/* Speed bars */
.bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.bar__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 8px;
  font-size: 15px;
}
.bar__name { font-weight: 600; }
.bar__val { color: var(--muted); }
.bar__track { height: 10px; border-radius: 999px; background: var(--lilac-soft); overflow: hidden; }
.bar__fill { display: block; height: 100%; border-radius: 999px; background: var(--violet); }
.bar__fill--flame { background: var(--flame); }
.bar__fill--planned {
  background: repeating-linear-gradient(-45deg, var(--lilac) 0 6px, transparent 6px 12px);
  box-shadow: inset 0 0 0 1px var(--lilac);
}
.doc .bars__note { margin-top: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }

/* Shortcode cards */
.sc-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sc-card {
  padding: 20px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.doc .sc-card p { font-size: 15px; line-height: 1.6; }
.doc .sc-card .sc-card__name { color: var(--violet-deep); font-size: 13.5px; font-weight: 500; }
.doc .sc-card .sc-card__name + p { margin-top: 10px; }

/* Troubleshooting */
.issues { border-top: 1px solid var(--line); }
.issue { padding: 18px 0; border-bottom: 1px solid var(--line); }
.issue dt { font-weight: 600; font-size: 17px; }
.issue dd { margin: 6px 0 0; color: var(--muted); font-size: 15.5px; line-height: 1.65; }

/* FAQ: site.css .faq__* inside the reading column */
.doc .faq__list { max-width: none; margin-top: 20px; }
.doc .faq__item summary { font-size: 17px; }
.doc .faq__item p { margin: 0; font-size: 16px; }

/* Support */
.doc-help {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  margin-top: clamp(48px, 6vw, 72px);
  padding: 22px 24px;
  border-radius: var(--r-md);
  background: var(--lilac-soft);
}
.doc-help__title { font-family: var(--f-display); font-size: 18px; font-weight: 650; }
.doc .doc-help__title + p { margin-top: 4px; font-size: 15.5px; }

/* ---------- Responsive ---------- */

@media (max-width: 1040px) {
  html { scroll-padding-top: 132px; } /* header + the sticky contents bar */
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .doc { max-width: none; }

  /* Contents collapse into an "On this page" panel under the header. */
  .doc-aside {
    position: sticky;
    top: 68px;
    z-index: 40;
    max-height: none;
    overflow: visible;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0;
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--line);
  }
  .toc__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px var(--gutter);
    font-weight: 600;
    font-size: 15px;
    list-style: none;
    cursor: pointer;
  }
  .toc__toggle::-webkit-details-marker { display: none; }
  .toc__toggle::after {
    content: "";
    width: 8px;
    height: 8px;
    margin-right: 4px;
    border-right: 2px solid var(--violet);
    border-bottom: 2px solid var(--violet);
    transform: rotate(45deg) translateY(-2px);
    transition: transform .2s var(--ease);
  }
  .toc[open] .toc__toggle::after { transform: rotate(-135deg) translateY(-2px); }
  .doc-aside:has(.toc[open]) { background: var(--paper); box-shadow: 0 24px 40px -24px rgba(32, 17, 61, .35); }
  .toc__title { display: none; }
  .toc__nav {
    max-height: min(60vh, calc(100vh - 68px - 48px - 24px));
    overflow-y: auto;
    padding: 0 calc(var(--gutter) - 12px) 14px;
  }
}

@media (max-width: 860px) {
  .methods, .doc-steps { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .sc-cards { grid-template-columns: minmax(0, 1fr); }
  .doc-table table { font-size: 14px; }
  .doc-table th, .doc-table td { padding: 11px 12px; }
  .doc-table tbody th { width: 34%; }
  .snippet .code { font-size: 12px; padding: 16px; }
  .note { padding: 14px 16px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .toc__toggle::after { transition: none; }
}
