/* Reading aids for the Analyze guides: layout (track list, reading column, on-page rail), progress bar,
   outcomes box, call-outs, deep dives and MariaDB versions. Colours come from the site tokens (site.css / brand.css),
   so dark and light themes both work. Phone: 16px gutters, nothing wider than the screen. */

/* ---- layout ----------------------------------------------------------- */
body .doc-wrap.guide-wrap { max-width: var(--maxw); padding: 24px 16px 90px; gap: 32px; grid-template-columns: 220px minmax(0, 1fr); }
body .doc-wrap.guide-wrap > .doc-body { max-width: var(--maxw-prose); width: 100%; justify-self: center; }
body .doc-wrap.guide-wrap .doc-side { font-size: .9rem; }
body .doc-wrap.guide-wrap .doc-guides > a, body .doc-wrap.guide-wrap .doc-guides > .doc-grp { display: block; }
.doc-all { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 4px; }
.doc-all > summary { cursor: pointer; font-weight: 650; padding: 6px 10px; color: var(--body); list-style: none; }
.doc-all > summary::-webkit-details-marker { display: none; }
.doc-all > summary::after { content: " \25BE"; color: var(--faint); }
.doc-all[open] > summary::after { content: " \25B4"; }
.doc-all a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--body); text-decoration: none; font-size: .88rem; }
.doc-all a:hover { background: var(--accent-soft); color: var(--ink); }
.doc-all a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }

/* the on-page list shown inside the article on narrower screens (the rail takes over from 1360px) */
.doc-on.doc-on-inline { margin: 0 0 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0; }
.doc-on.doc-on-inline > summary { cursor: pointer; font-weight: 650; padding: 12px 16px; list-style: none; font-size: var(--fs-sm); }
.doc-on.doc-on-inline > summary::-webkit-details-marker { display: none; }
.doc-on.doc-on-inline > summary::after { content: " \25BE"; color: var(--faint); }
.doc-on.doc-on-inline[open] > summary::after { content: " \25B4"; }
.doc-on.doc-on-inline nav { padding: 0 16px 12px; }
.doc-on.doc-on-inline ol { list-style: none; margin: 0; padding: 0; }
.doc-on.doc-on-inline a { display: block; padding: 6px 4px; color: var(--body); text-decoration: none; font-size: var(--fs-sm); border-top: 1px solid var(--line); }
.doc-on.doc-on-inline a:hover { color: var(--ink); }
.doc-on.doc-on-inline a[aria-current="location"] { color: var(--accent); font-weight: 600; }

.doc-rail { display: none; }
@media (min-width: 1360px) {
  body .doc-wrap.guide-wrap { grid-template-columns: 200px minmax(0, 1fr) 240px; gap: 32px; }
  .doc-on.doc-on-inline { display: none; }
  .doc-rail {
    display: flex; flex-direction: column; gap: 16px; align-self: start;
    position: sticky; top: calc(var(--header-h, 61px) + 16px);
    max-height: calc(100vh - var(--header-h, 61px) - 32px); overflow: auto; font-size: .88rem;
  }
  /* the Classes card keeps its own styling, but sits in the rail under the on-page list, not in a second sticky column */
  .doc-rail .cpx-rail { display: block; }
  .doc-rail .cpx-slot.side { position: static; top: auto; }
  .doc-rail .cpx-slot.side:empty { display: none; }
}
@media (min-width: 1700px) {
  body .doc-wrap.guide-wrap { grid-template-columns: 240px minmax(0, 1fr) 260px; }
  body .doc-wrap.guide-wrap > .doc-body { max-width: 1120px; }
}
@media (min-width: 2100px) {
  body .doc-wrap.guide-wrap { gap: 48px; }
  body .doc-wrap.guide-wrap > .doc-body { max-width: 1180px; }
}
@media (max-width: 900px) {
  body .doc-wrap.guide-wrap { padding: 16px 16px 60px; grid-template-columns: minmax(0, 1fr); gap: 14px; }
  body .doc-wrap.guide-wrap > * { min-width: 0; }
}

/* on-page list in the rail */
.doc-toc { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 14px 14px 10px; }
.doc-toc-h { margin: 0 0 8px; font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.doc-toc ol { list-style: none; margin: 0; padding: 0; }
.doc-toc li { margin: 0; }
.doc-toc a { display: block; padding: 6px 8px 6px 10px; border-left: 2px solid var(--line); color: var(--body); text-decoration: none; line-height: 1.35; }
.doc-toc a:hover { color: var(--ink); border-left-color: var(--line-strong); }
.doc-toc a[aria-current="location"] { color: var(--ink); font-weight: 650; border-left-color: var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; }
.gr-meter { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.gr-track { flex: 1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.gr-track > span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left center; transform: scaleX(0); }

/* thin progress bar, stuck under the site header while the article is on screen */
.gr-prog { position: sticky; top: var(--header-h, 61px); z-index: 4; height: 3px; margin: 0 0 14px; background: var(--line); border-radius: 3px; }
.gr-prog > span { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 3px; transform-origin: left center; transform: scaleX(0); }

/* ---- outcomes box ----------------------------------------------------- */
.gread-out { margin: 0 0 28px; padding: 14px 18px 12px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; background: var(--surface); }
.gread-out-h { margin: 0 0 6px; font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.prose .gread-out ul { margin: 0; padding-left: 20px; }
.prose .gread-out li { margin: 4px 0; line-height: 1.5; font-size: .96rem; color: var(--ink); }
.prose .gread-out li code { font-size: .88em; }

/* ---- call-outs -------------------------------------------------------- */
.gcall { --cc: var(--accent); margin: 20px 0; padding: 12px 16px 12px 14px; border: 1px solid color-mix(in srgb, var(--cc) 45%, var(--line)); border-left: 4px solid var(--cc); border-radius: 12px; background: color-mix(in srgb, var(--cc) 8%, var(--surface)); break-inside: avoid; }
.gcall-h { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.gcall-ic { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--cc); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gcall-l { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--cc); }
.gcall-b > :first-child { margin-top: 0; }
.gcall-b > :last-child { margin-bottom: 0; }
.prose .gcall-b p { margin: 6px 0; }
.gcall-b p:empty { display: none; }
.gcall-watch, .gcall-warning { --cc: var(--warn); }
.gcall-warning { --cc: var(--danger); }
.gcall-accounting, .gcall-tip { --cc: var(--ok); }
.gcall-audit { --cc: var(--accent2); }
.gcall-note { --cc: var(--accent); }

/* ---- deep dives ------------------------------------------------------- */
details.gdeep { margin: 24px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
details.gdeep > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
details.gdeep > summary::-webkit-details-marker { display: none; }
details.gdeep > summary::after { content: "+"; flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
details.gdeep[open] > summary::after { content: "\2212"; }
details.gdeep > summary .gdeep-h { margin: 0; font-size: 1.05rem; flex: 1; min-width: 0; scroll-margin-top: 80px; }
.gdeep-body { padding: 0 18px 14px; }
.gdeep-body > :first-child { margin-top: 0; }
.gdeep-body > :last-child { margin-bottom: 0; }

/* ---- MariaDB versions ------------------------------------------------- */
details.gvariant { margin: 4px 0 18px; }
details.gvariant > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--body); font-size: var(--fs-xs); font-weight: 650; }
details.gvariant > summary::-webkit-details-marker { display: none; }
details.gvariant > summary::before { content: "\25B8"; color: var(--accent); }
details.gvariant[open] > summary::before { content: "\25BE"; }
details.gvariant[open] > summary { margin-bottom: 8px; }
details.gvariant > summary:hover { border-color: var(--accent); color: var(--ink); }

/* ---- phone ------------------------------------------------------------ */
@media (max-width: 900px) {
  body .doc-wrap.guide-wrap .doc-side { margin-bottom: 4px; }
  .gcall { padding: 12px 14px; }
  .gr-prog { top: var(--header-h, 61px); }
}
@media (max-width: 480px) {
  details.gdeep > summary .gdeep-h { font-size: 1rem; }
  .gdeep-body { padding: 0 14px 12px; }
}
@media print {
  .gr-prog, .doc-rail, .doc-side, .doc-on.doc-on-inline { display: none !important; }
  details.gdeep, details.gvariant { display: block; }
  details.gdeep > summary { display: block; }
  details.gvariant > summary { display: none; }
}
