/* ============================================================================
   Download — page components (dl-)

   Page-specific layout for the download hub and the install/run guide. Builds
   on css/wm-dark.css (tokens, bands, wm- primitives), loaded first by
   wm_header() via wm_theme('dark'). A dl- component that turns out useful
   elsewhere should be promoted to css/wm-dark.css and renamed wm-.

   Loaded with a cache-busting query (controllers/download.php passes
   css/download-dark.css?v=N) — bump N when editing this file.
   ============================================================================ */

/* ---- Download split: primary download (left) + highlights (right) ---- */
.dl-split {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 48px;
  align-items: start;
}

/* ---- Primary download column ---- */
.dl-getit { position: sticky; top: 96px; }
.dl-art {
  display: block;
  width: 100%;
  /* see the note on .wm-carousel__img in wm-dark.css: the img now carries
     width/height attributes, and a rule that sets only width leaves the
     height presentational hint in force. */
  height: auto;
  border-radius: 6px;
  margin-bottom: 20px;
}
.dl-form { max-width: none; gap: 16px; }
.dl-form__intro {
  font-size: 14px;
  color: var(--wm-earth-200);
  margin: 0;
}
.dl-field { display: flex; flex-direction: column; gap: 6px; }
.dl-help { font-size: 12px; color: var(--wm-earth-400); }

/* The download button should read as the loud primary action. */
.dl-form .wm-btn--primary { margin-top: 4px; }
.dl-form .wm-btn--primary.disabled { opacity: 0.55; pointer-events: none; }

/* Platform split control: primary button for the visitor's own OS plus a
   CSS-only caret dropdown of the other available platforms (the Update
   Center's ucd-dl pattern, recast for the solid red primary and <button>
   submits). The BAR carries the single red fill and radius; both segments
   are transparent panes over it so they read as one button, and the caret's
   left border is the divider. */
.dl-plat { position: relative; }
.dl-plat__cb {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.dl-plat__bar {
  position: relative;            /* anchor for the absolutely-filled caret */
  display: flex;
  margin-top: 4px;
  padding-right: 54px;           /* reserve the caret's column */
  background: var(--wm-terra-red);
  border-radius: 8px;
  overflow: hidden;
}
.wm-page .dl-plat__primary,
.wm-page .dl-plat__more {
  background: transparent;
  border: none;
  border-radius: 0;
  margin: 0;
}
.wm-page .dl-plat__primary { flex: 1 1 auto; min-width: 0; }
.wm-page .dl-plat__primary:hover,
.wm-page .dl-plat__more:hover { background: var(--wm-terra-red-soft); }
/* The caret fills its column top-to-bottom via absolute insets so its height
   (and hover fill) always matches the primary's. */
.wm-page .dl-plat__more {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 54px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid rgba(14, 11, 7, 0.35);
  cursor: pointer;
}
.dl-plat__more .wm-btn-icon { transition: transform 150ms; }
.dl-plat__cb:checked ~ .dl-plat__bar .dl-plat__more .wm-btn-icon { transform: rotate(180deg); }
.dl-plat__cb:focus-visible ~ .dl-plat__bar .dl-plat__more { outline: 1px dotted var(--wm-earth-400); outline-offset: -3px; }
.dl-plat__menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  z-index: 5;
  background: var(--wm-earth-800);
  border: 1px solid var(--wm-earth-700);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(14, 11, 7, 0.45);
  overflow: hidden;
}
.dl-plat__cb:checked ~ .dl-plat__menu { display: block; }
.dl-plat__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 18px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--wm-earth-700);
  font-family: var(--wm-font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  color: var(--wm-earth-200);
  cursor: pointer;
}
.dl-plat__item:last-child { border-bottom: none; }
.dl-plat__item:hover { background: rgba(201, 167, 90, 0.12); color: var(--wm-earth-50); }
.dl-plat__item.disabled { opacity: 0.55; pointer-events: none; }

.dl-direct {
  margin-top: 14px;
  font-size: 14px;
  color: var(--wm-success);
  font-weight: 600;
}
.dl-installnote { margin-top: 16px; }

/* ---- Highlights ---- */
.dl-highlights .wm-head { margin-bottom: 20px; }
/* Cap the highlights at 2 columns — the wide right slot otherwise fits an
   awkward 3. 1-up while the split's right column is narrow; 2-up once it has
   room, and 2-up again when the split has collapsed to full width. */
.dl-highlights .wm-card-grid { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1080px) { .dl-highlights .wm-card-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) and (min-width: 600px) { .dl-highlights .wm-card-grid { grid-template-columns: repeat(2, 1fr); } }
/* "Go Further" gets the wide slot at the foot of the grid. */
.dl-card--span { grid-column: 1 / -1; }
.dl-golist { margin-top: 8px; }
.dl-golist li { color: var(--wm-earth-300); font-size: 14px; }

/* Lists inside the highlight cards match the card paragraph type size -- a
   bare .wm-list inherits the page base size, which reads oversized at card
   scale. The label rule out-specifies .wm-card p { margin: 0 }, which would
   otherwise flatten .dl-reqs__label's separation between the two lists. */
.wm-card .wm-list { margin-top: 6px; }
.wm-card .wm-list li { color: var(--wm-earth-300); font-size: 14px; margin-bottom: 4px; }
.wm-card .dl-reqs__label { margin: 14px 0 6px; }

/* ---- Install / run guide ---- */
.dl-narrow { max-width: 820px; }

.dl-steps {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.dl-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
}
.dl-step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--wm-terra-red-deep);
  border: 1px solid var(--wm-terra-red);
  color: var(--wm-sand-cream);
  font-family: var(--wm-font-display);
  font-weight: 700;
  font-size: 18px;
}
.dl-step__body p { color: var(--wm-earth-200); margin-top: 6px; }
.dl-step__body .wm-h3 { font-size: 22px; }

.dl-reqs,
.dl-getstarted { margin-top: 40px; }
.dl-reqs p { color: var(--wm-earth-200); }
.dl-reqs__label {
  font-family: var(--wm-font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 14px;
  color: var(--wm-earth-100);
  margin: 18px 0 8px;
}
.dl-getstarted p { color: var(--wm-earth-200); }
.dl-getstarted .wm-btn--primary { margin-top: 8px; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .dl-split { grid-template-columns: 1fr; gap: 40px; }
  .dl-getit { position: static; max-width: 460px; }
}
