/* =========================================================================
   MidiBro 2 — DAW setup guide pages (daw/*.html)
   Loaded after css/midibro2.css; reuses its tokens.
   Generated pages: documentation/DAW_Setup/build-daw-pages.sh
   ========================================================================= */

/* Guide pages run on a narrower measure than the marketing pages, so the
   diagram, the callout and the prose all share one column. Nav and footer
   keep the wide .container. */
.dg-w { max-width: 880px; }

/* -------------------------------------------------------------------------
   Breadcrumb + sibling switcher
   ------------------------------------------------------------------------- */
.dg-topbar {
  border-bottom: 1px solid var(--divider);
  background: var(--panel-2);
}
.dg-crumb {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .5px;
  color: var(--text-faint);
  padding: 18px 0 0;
}
.dg-crumb a { color: var(--text-dim); }
.dg-crumb a:hover { color: var(--accent); }
.dg-crumb .sep { color: var(--border); margin: 0 6px; }
.dg-crumb .cur { color: var(--text-mid); }

.dg-switch {
  display: flex;
  gap: 6px;
  padding: 14px 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dg-switch::-webkit-scrollbar { display: none; }
.dg-switch .pill {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .5px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-dark);
  color: var(--text-soft);
  white-space: nowrap;
  transition: border-color .15s ease, color .15s ease;
}
a.dg-p:hover { border-color: var(--accent-outline); color: var(--text); }
.dg-switch .is-active {
  background: var(--accent-tint);
  border-color: var(--accent-outline);
  color: var(--accent-light);
}

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */
.dg-hero {
  padding: 40px 0 30px;
  background: radial-gradient(ellipse 70% 70% at 20% 0%, #26201a 0%, var(--bg) 72%);
}
.dg-hero-row { display: flex; align-items: center; gap: 20px; }
.dg-hero-logo {
  width: 68px; height: 68px; flex: none;
  border-radius: 14px; object-fit: contain;
  background: var(--panel); border: 1px solid var(--border); padding: 10px;
}
.dg-hero h1 {
  font-size: 36px;
  letter-spacing: -.8px;
  margin: 0;
  line-height: 1.15;
}
.dg-hero-sub {
  color: var(--text-soft);
  font-size: 15px;
  margin: 6px 0 0;
}

.dg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.dg-chip {
  display: inline-flex; align-items: baseline; gap: 8px;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text-mid);
}
.dg-chip b { font-weight: 600; color: var(--text); }
.dg-chip .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-faint);
  text-transform: uppercase;
}
.dg-chip.is-verified { background: #16241a; border-color: #2f5c37; }
.dg-chip.is-verified b { color: #7ed08a; }
.dg-chip.is-provisional { background: var(--accent-tint); border-color: var(--accent-outline); }
.dg-chip.is-provisional b { color: var(--accent-light); }

/* -------------------------------------------------------------------------
   Status callout
   ------------------------------------------------------------------------- */
.dg-callout {
  display: flex; gap: 14px;
  margin: 26px 0 0;
  padding: 16px 18px;
  border-radius: 10px;
  background: var(--accent-tint);
  border: 1px solid var(--accent-outline);
  color: var(--accent-tint-text);
  font-size: 14px;
  line-height: 1.65;
}
.dg-callout .ci {
  font-family: var(--font-mono);
  color: var(--accent);
  flex: none;
  font-size: 15px;
}
.dg-callout strong { color: var(--accent-light); }
.dg-callout a { color: var(--accent-light); text-decoration: underline; }

/* -------------------------------------------------------------------------
   Signal-flow diagram
   ------------------------------------------------------------------------- */
.dg-diagram {
  margin: 34px 0 0;
  padding: 24px 20px 18px;
  background: var(--panel-dark);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.dg-diagram-head {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 14px;
}
/* Flow diagram: a CSS grid, not an image — it reflows to a vertical stack on
   phones instead of shrinking the type to nothing. */
.dg-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
}
/* the two-lane shape has one short lane and one stacked lane; stretching the
   short one just leaves a hole under its device chip */
.dg-flow.is-pair { grid-template-columns: 1fr auto 1fr; align-items: start; }

.dg-node { min-width: 0; display: flex; flex-direction: column; }
.dg-node-k {
  display: block; height: 14px; line-height: 14px; margin-bottom: 10px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.4px;
  color: var(--text-faint); text-transform: uppercase;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dg-lane {
  flex: 1;
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px 16px 16px; text-align: center;
}
.dg-dev {
  min-height: 58px;
  display: flex; align-items: center; justify-content: center;
  padding: 8px 12px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border);
  font-family: var(--font-head); font-weight: 600; font-size: 13px;
  color: var(--text); line-height: 1.3;
}
.dg-dev.is-mb { background: var(--accent-tint); border-color: var(--accent-outline); color: var(--accent-light); }
.dg-node-s { display: block; margin-top: auto; padding-top: 14px; font-size: 12.5px; color: var(--text-faint); }
.dg-down { height: 22px; position: relative; }
.dg-down::before {
  content: ""; position: absolute; left: 50%; top: 2px; height: 12px;
  border-left: 1.6px solid var(--accent);
}
.dg-down::after {
  content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--accent); border-bottom: 0;
}

/* connector column; the rule sits at the vertical centre of the first device
   chip: 14 (kicker) + 10 (gap) + 20 (lane padding) + 23 (half chip) = 67 */
.dg-link { position: relative; align-self: start; min-width: 132px; padding: 85px 10px 0; }
.dg-link::before {
  content: ""; position: absolute; left: 2px; right: 12px; top: 73px;
  border-top: 1.5px dashed var(--text-dim);
}
.dg-link.is-wire::before { border-top: 1.6px solid var(--accent); }
.dg-link.is-wire::after {
  content: ""; position: absolute; right: 0; top: 69px;
  border: 5px solid transparent; border-left-color: var(--accent); border-right: 0;
}
.dg-link-t {
  display: block; text-align: center;
  font-family: var(--font-mono); font-size: 10.5px; line-height: 1.6;
  color: var(--text-soft);
}
.dg-link.is-wire .dg-link-t { color: var(--accent); }

.dg-diagram-foot {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.6;
}

/* -------------------------------------------------------------------------
   Body prose (pandoc output)
   ------------------------------------------------------------------------- */
.dg-body { max-width: 780px; margin: 0 auto 0 0; padding: 6px 0 0; }
.dg-body h2 {
  font-size: 22px;
  letter-spacing: -.3px;
  margin: 46px 0 4px;
  padding-top: 26px;
  border-top: 1px solid var(--divider);
}
.dg-body h2:first-child { border-top: 0; padding-top: 0; margin-top: 34px; }
.dg-body h3 { font-size: 16px; margin: 26px 0 6px; }
.dg-body p { color: var(--text-mid); font-size: 15px; line-height: 1.75; margin: 14px 0; }
.dg-body strong { color: var(--text); font-weight: 600; }
.dg-body a { color: var(--accent); }
.dg-body a:hover { text-decoration: underline; }

.dg-body ul { list-style: none; margin: 14px 0; padding: 0; }
.dg-body ul li {
  position: relative;
  color: var(--text-mid);
  font-size: 15px;
  line-height: 1.7;
  padding: 3px 0 3px 20px;
}
.dg-body ul li::before {
  content: "";
  position: absolute; left: 2px; top: 15px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent-outline);
}
.dg-body ul ul { margin: 2px 0; }

/* Blockquotes that survive the filter are real callouts, e.g. the Pro Tools
   requirements note. The provisional banner is handled by the template. */
.dg-body blockquote {
  margin: 22px 0;
  padding: 16px 18px;
  border-radius: 10px;
  background: var(--accent-tint);
  border: 1px solid var(--accent-outline);
}
.dg-body blockquote p { margin: 0; color: var(--accent-tint-text); font-size: 14px; }
.dg-body blockquote p + p { margin-top: 10px; }
.dg-body blockquote strong { color: var(--accent-light); }
.dg-body blockquote a { color: var(--accent-light); }

.dg-body code {
  font-family: var(--font-mono);
  font-size: .87em;
  background: var(--panel-dark);
  border: 1px solid var(--divider);
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--accent-tint-text);
  word-break: break-word;
}

/* Screenshots stay small on the page; the whole figure links to the full-size
   file so nobody has to squint at a mixer strip scaled to thumbnail width. */
.dg-body img {
  display: block;
  max-width: min(100%, 360px);
  max-height: 320px;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: border-color .15s ease;
}
.dg-body figure { margin: 26px 0; }
.dg-body figure a { display: block; cursor: zoom-in; }
.dg-body figure a:hover img { border-color: var(--accent-outline); }
.dg-body figcaption {
  max-width: 560px;
  margin: 10px auto 0;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-faint);
}
.dg-body figcaption::after {
  content: " (click to enlarge)";
  color: var(--text-dim);
}
/* ordered lists outside the Setup stepper (e.g. sub-steps) */
.dg-body ol:not(.dg-steps) { margin: 14px 0; padding-left: 22px; }
.dg-body ol:not(.dg-steps) li {
  color: var(--text-mid); font-size: 15px; line-height: 1.7; padding: 3px 0;
}
.dg-body ol:not(.dg-steps) li::marker { color: var(--accent-outline); font-weight: 600; }

/* -------------------------------------------------------------------------
   Numbered setup steps
   ------------------------------------------------------------------------- */
ol.dg-steps { list-style: none; margin: 22px 0 0; padding: 0; }
ol.dg-steps > li {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 16px;
  padding: 0 0 24px 0;
  scroll-margin-top: 90px;
}
ol.dg-steps > li::before {
  content: "";
  position: absolute;
  left: 16px; top: 34px; bottom: 4px;
  width: 1px;
  background: var(--divider);
}
ol.dg-steps > li:last-child { padding-bottom: 0; }
ol.dg-steps > li:last-child::before { display: none; }
.dg-step-n {
  grid-column: 1;
  width: 33px; height: 33px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent-tint);
  border: 1px solid var(--accent-outline);
  color: var(--accent-light);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}
.dg-step-b { grid-column: 2; min-width: 0; padding-top: 3px; }
.dg-step-b > :first-child { margin-top: 0; }
.dg-step-b > :last-child { margin-bottom: 0; }
.dg-step-b p { margin: 0 0 8px; }
.dg-step-b img { margin-left: 0; }
/* Deep-linkable steps: the anchor stays invisible until the row is hovered,
   so support mails can point at daw/ableton.html#step-4 without the page
   looking like a wiki. Selector must out-specify `.dg-body a`. */
.dg-body a.dg-step-l {
  position: absolute;
  left: -22px; top: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: transparent;
  transition: color .15s ease;
}
ol.dg-steps > li:hover .dg-body a.dg-step-l,
.dg-body ol.dg-steps > li:hover a.dg-step-l { color: var(--text-faint); }
.dg-body a.dg-step-l:hover,
.dg-body a.dg-step-l:focus-visible { color: var(--accent); }

/* -------------------------------------------------------------------------
   Troubleshooting table
   ------------------------------------------------------------------------- */
.dg-table-wrap { overflow-x: auto; margin: 22px 0 0; }
.dg-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--panel-dark);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.dg-body thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
  padding: 12px 16px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.dg-body tbody td {
  padding: 13px 16px;
  color: var(--text-mid);
  line-height: 1.6;
  border-bottom: 1px solid var(--divider);
  vertical-align: top;
}
.dg-body tbody tr:last-child td { border-bottom: 0; }
.dg-body tbody td:first-child { color: var(--text); font-weight: 600; width: 38%; }

/* -------------------------------------------------------------------------
   Footer nav + help CTA
   ------------------------------------------------------------------------- */
.dg-help {
  max-width: 780px;
  margin: 52px auto 0 0;
  padding: 26px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.dg-help h3 { font-size: 19px; margin: 0; }
.dg-help p { color: var(--text-soft); font-size: 14px; margin: 8px 0 18px; }

.dg-pager {
  max-width: 780px;
  margin: 22px auto 0 0;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}
.dg-pager a {
  flex: 1 1 0;
  min-width: 0;
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--panel-dark);
  border: 1px solid var(--border);
  transition: border-color .15s ease;
}
.dg-pager a:hover { border-color: var(--accent-outline); }
.dg-pager .pk {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--text-faint);
}
.dg-pager .pn { display: block; font-weight: 600; font-size: 15px; margin-top: 4px; color: var(--text); }
.dg-pager .next { text-align: right; }
.dg-pager .spacer { flex: 1 1 0; }

.dg-updated {
  max-width: 780px;
  margin: 26px auto 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-faint);
  text-align: center;
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .dg-flow, .dg-flow.is-pair { grid-template-columns: 1fr; }
  .dg-link {
    min-width: 0; padding: 12px 0; align-self: stretch;
    display: flex; flex-direction: column; align-items: center;
  }
  .dg-link::before {
    position: static; left: auto; right: auto; top: auto;
    width: 0; height: 18px; border-top: 0;
    border-left: 1.5px dashed var(--text-dim);
  }
  .dg-link.is-wire::before { border-top: 0; border-left: 1.6px solid var(--accent); }
  .dg-link.is-wire::after {
    position: static; top: auto; margin-top: 8px; order: 3;
    border: 5px solid transparent; border-top-color: var(--accent); border-left-color: transparent; border-bottom: 0;
  }
  .dg-link-t { margin-top: 8px; }

  .dg-hero h1 { font-size: 26px; }
  .dg-hero-logo { width: 54px; height: 54px; }
  .dg-hero-row { gap: 14px; }
  .dg-body h2 { font-size: 20px; }
  .dg-pager { flex-direction: column; }
  .dg-pager .next { text-align: left; }
  .dg-pager .spacer { display: none; }
  ol.dg-steps > li { grid-template-columns: 28px 1fr; gap: 12px; }
  ol.dg-steps > li::before { left: 13px; top: 30px; }
  .dg-step-n { width: 27px; height: 27px; font-size: 12px; }
  .dg-step-l { display: none; }
  .dg-body tbody td:first-child { width: auto; }
}

/* -------------------------------------------------------------------------
   Screenshot lightbox (js/daw-guide.js)
   ------------------------------------------------------------------------- */
html.dg-lb-open { overflow: hidden; }
.dg-lb {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 56px 68px;
  background: rgba(6, 6, 6, .96);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease;
}
.dg-lb.is-open { opacity: 1; pointer-events: auto; }
.dg-lb-fig {
  margin: 0; max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.dg-lb-fig img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  width: auto; height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.dg-lb-fig figcaption {
  max-width: 620px; text-align: center;
  font-size: 13px; line-height: 1.65; color: var(--text-soft);
}
.dg-lb button {
  position: absolute;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px; cursor: pointer;
  font-family: var(--font-mono); line-height: 1;
  transition: border-color .15s ease, color .15s ease;
}
.dg-lb button:hover { border-color: var(--accent-outline); color: var(--accent); }
.dg-lb button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dg-lb-x { top: 18px; right: 20px; width: 38px; height: 38px; font-size: 20px; }
.dg-lb-nav { top: 50%; transform: translateY(-50%); width: 40px; height: 58px; font-size: 26px; }
.dg-lb-prev { left: 14px; }
.dg-lb-next { right: 14px; }

@media (max-width: 720px) {
  .dg-lb { padding: 56px 12px 76px; }
  .dg-lb-fig img { max-height: calc(100vh - 210px); }
  .dg-lb-nav { top: auto; bottom: 14px; transform: none; width: 52px; height: 40px; font-size: 22px; }
  .dg-lb-prev { left: 50%; margin-left: -58px; }
  .dg-lb-next { right: 50%; margin-right: -58px; }
}
@media (prefers-reduced-motion: reduce) {
  .dg-lb { transition: none; }
}

/* -------------------------------------------------------------------------
   Print — replaces the old downloadable PDFs (Cmd+P / Ctrl+P)
   ------------------------------------------------------------------------- */
@media print {
  .navbar, .dg-topbar, .dg-pager, .dg-help, .footer,
  .dg-step-l, .dg-updated, .dg-lb { display: none !important; }
  body { background: #fff !important; color: #111 !important; }
  .dg-hero { background: none !important; padding: 0 0 12px; }
  .dg-hero h1, .dg-body h2, .dg-body h3 { color: #111 !important; }
  .dg-hero-sub, .dg-diagram-foot, .dg-node-k, .dg-node-s, .dg-link-t,
  .dg-chip .k, .dg-body thead th { color: #555 !important; }
  .dg-body, .dg-body p, .dg-body ul li, .dg-body tbody td { color: #222 !important; }
  .dg-body strong, .dg-step-b strong, .dg-chip b { color: #000 !important; }
  /* every dark surface has to be repainted, not just the outer ones */
  .dg-chip, .dg-diagram, .dg-body table, .dg-body img, .dg-body thead th,
  .dg-body code, .dg-lane, .dg-dev, .dg-hero-logo {
    border-color: #ccc !important; background: #fff !important;
  }
  .dg-body code { color: #333 !important; }
  .dg-dev { color: #000 !important; }
  .dg-dev.is-mb, .dg-step-n { color: #7a4b06 !important; border-color: #d99a3d !important; }
  .dg-chip.is-provisional { background: #fff8ee !important; border-color: #d99a3d !important; }
  .dg-chip.is-provisional b { color: #7a4b06 !important; }
  .dg-chip.is-verified { background: #f2faf3 !important; border-color: #7fae87 !important; }
  .dg-chip.is-verified b { color: #2f5c37 !important; }
  .dg-diagram-head { color: #7a4b06 !important; }
  .dg-callout { background: #fff8ee !important; border-color: #d99a3d !important; color: #7a4b06 !important; }
  .dg-body h2 { border-color: #ddd !important; page-break-after: avoid; }
  ol.dg-steps > li { page-break-inside: avoid; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 10px; color: #666; }
}
