/*
 * Article and Simple templates (Phase 2): blog posts, Knowledge Center
 * articles, CAD-to-STL how-tos, FAQ pages, legal and one-off pages and the
 * Knowledge Center sub-hubs. Loaded before /styles/site.css, which supplies
 * the tokens (--dz-*), the display type classes and the buttons, so a rule
 * here that overrides a shared .dz-* class carries one more class.
 *
 * Calm rules (review/DESIGN-SPEC.md):
 *   - Text styles: h1 (.dz-display, smaller), prose h2 and h3 in the display
 *     face, body 16px, small 14px Steel, the 12px label (table heads and the
 *     two "related" kickers only), bold 16px, monospace for figures in tables.
 *   - One reading column (about 68ch) on a common left edge; white bands.
 *   - Orange only in the offer heading's underline. Links are Ink with a thin
 *     Ink-alpha underline.
 *   - No boxes, except the table's scroll box, which needs an edge.
 *
 * Mobile first: the base rules are the 320px layout.
 */

body.dz-article {
  margin: 0;
  background: var(--dz-white);
  color: var(--dz-ink);
  font-family: var(--dz-font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.ar {
  --ar-measure: 68ch;
  --ar-gap: clamp(28px, 3.2vw, 44px);
  --ar-band: clamp(44px, 5.5vw, 76px);
  padding-bottom: var(--ar-band);
}
.ar *,
.ar *::before,
.ar *::after {
  box-sizing: border-box;
}
.ar :focus-visible {
  outline: 2px solid var(--dz-ink);
  outline-offset: 2px;
}

/* The one column every block shares: same left edge, same width. */
.ar-col {
  width: 100%;
  max-width: calc(var(--ar-measure) + 2 * var(--dz-gutter));
  margin-inline: auto;
  padding-inline: var(--dz-gutter);
}

/* ---------- Head: breadcrumb, h1, date ---------- */

.ar-head {
  display: grid;
  gap: 16px;
  padding-top: clamp(32px, 5vw, 64px);
  padding-bottom: var(--ar-gap);
}
.ar .ar-title {
  max-width: 22ch;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}
.ar-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  column-gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ar-crumbs li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--dz-steel);
}
.ar-crumbs li:not(:last-child)::after {
  content: '/';
  color: var(--dz-steel-light);
}
.ar-crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--dz-steel);
  text-decoration: underline;
  text-decoration-color: var(--dz-link-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.ar-crumbs a:hover {
  color: var(--dz-ink);
  text-decoration-color: currentColor;
}
.ar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  color: var(--dz-steel);
}

.ar-lead {
  margin-top: 0;
  margin-bottom: var(--ar-gap);
}
.ar-lead img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--dz-radius-md);
}

/* ---------- Prose ---------- */

.ar-prose {
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: break-word;
}
.ar-prose > * {
  margin: 0;
}
.ar-prose > * + * {
  margin-top: 1.1em;
}
.ar-prose p {
  text-wrap: pretty;
}
.ar-prose a {
  color: var(--dz-ink);
  text-decoration: underline;
  text-decoration-color: var(--dz-link-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--dz-fast) var(--dz-ease);
}
.ar-prose a:hover {
  text-decoration-color: currentColor;
}
.ar-prose strong {
  font-weight: 700;
}

.ar-prose h2,
.ar-prose h3 {
  font-family: var(--dz-font-display);
  font-weight: 400;
  font-synthesis: none;
  text-wrap: balance;
  color: var(--dz-ink);
}
.ar-prose h2 {
  font-size: clamp(24px, 2.8vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.ar-prose h3 {
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.ar-prose h4,
.ar-prose h5,
.ar-prose h6 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}
.ar-prose > * + h2 {
  margin-top: 2.2em;
}
.ar-prose > * + h3 {
  margin-top: 1.8em;
}
.ar-prose > * + h4,
.ar-prose > * + h5,
.ar-prose > * + h6 {
  margin-top: 1.5em;
}
.ar-prose > :is(h2, h3, h4, h5, h6) + * {
  margin-top: 0.6em;
}

/* Lists: Steel markers, a little air between items. */
.ar-prose ul,
.ar-prose ol {
  padding-left: 1.35em;
}
.ar-prose li + li {
  margin-top: 0.4em;
}
.ar-prose li > :is(ul, ol) {
  margin-top: 0.4em;
}
.ar-prose li::marker {
  color: var(--dz-steel);
}
.ar-prose ol > li::marker {
  font-variant-numeric: tabular-nums;
}

.ar-prose blockquote {
  padding-left: 20px;
  border-left: 2px solid var(--dz-ink);
  color: var(--dz-graphite);
}
.ar-prose blockquote > * + * {
  margin-top: 0.8em;
}

/* Figures: full column width, explicit size kept by width/height. */
.ar-prose figure img,
.ar-prose > p img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--dz-radius-md);
}
.ar-prose figcaption {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--dz-steel);
}

/* YouTube, 16:9 at any width. */
.ar-video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--dz-snow);
  border-radius: var(--dz-radius-md);
  overflow: hidden;
}
.ar-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Tables scroll inside their own box, never the page. */
.ar-table {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--dz-line-strong);
  border-radius: var(--dz-radius-md);
  -webkit-overflow-scrolling: touch;
}
.ar-table table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
}
.ar-table caption {
  padding: 12px 16px 0;
  text-align: left;
  font-weight: 700;
}
.ar-table th,
.ar-table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--dz-line);
}
.ar-table tr:last-child > * {
  border-bottom: 0;
}
.ar-table thead th,
.ar-table th[scope='row'] {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dz-steel);
}
.ar-table thead th {
  border-bottom: 1px solid var(--dz-line-strong);
}
.ar-table th[scope='row'] {
  width: 40%;
}
.ar-table .num {
  font-family: var(--dz-font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* FAQ: one question per row, a hairline between rows. */
.ar-prose details {
  border-top: 1px solid var(--dz-line-strong);
}
.ar-prose details:last-of-type {
  border-bottom: 1px solid var(--dz-line-strong);
}
.ar-prose details + details {
  margin-top: 0;
}
.ar-prose summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 14px 0;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}
.ar-prose summary::-webkit-details-marker {
  display: none;
}
.ar-prose summary::after {
  content: '';
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2px solid var(--dz-steel);
  border-bottom: 2px solid var(--dz-steel);
  transform: translateY(-3px) rotate(45deg);
  transition: transform var(--dz-base) var(--dz-ease);
}
.ar-prose details[open] > summary::after {
  transform: translateY(2px) rotate(-135deg);
}
.ar-prose summary:hover {
  text-decoration: underline;
  text-decoration-color: var(--dz-link-line);
  text-underline-offset: 4px;
}
.ar-prose details > :not(summary) {
  margin: 0 0 1em;
}
.ar-prose details > ul,
.ar-prose details > ol {
  padding-left: 1.35em;
}

/* ---------- Hub: child links, one line each ---------- */

.ar-hub {
  display: grid;
  gap: 0;
  margin-top: var(--ar-gap);
  list-style: none;
}
.ar-hub li {
  display: grid;
  gap: 6px;
  padding: 18px 0 20px;
  border-top: 1px solid var(--dz-line-strong);
}
.ar-hub li:last-child {
  border-bottom: 1px solid var(--dz-line-strong);
}
.ar-hub .dz-h3 a,
.ar-related .dz-h3 a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--dz-link-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color var(--dz-fast) var(--dz-ease);
}
.ar-hub .dz-h3 a:hover,
.ar-related .dz-h3 a:hover {
  text-decoration-color: currentColor;
}
.ar-hub + .ar-prose,
.ar-prose + .ar-hub {
  margin-top: var(--ar-gap);
}
.ar-small {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--dz-steel);
  text-wrap: pretty;
}

/* ---------- After the article: machine and customer result ---------- */

.ar-related {
  display: grid;
  gap: var(--ar-gap);
  margin-top: var(--ar-band);
  padding-top: var(--ar-gap);
  border-top: 1px solid var(--dz-line-strong);
}
.ar-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dz-steel);
}
.ar-machine {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 20px;
  align-items: end;
}
/* Drawn to scale: the widest machine fills the slot, the rest in proportion. */
.ar-machine-photo {
  display: block;
  justify-self: center;
  width: calc(var(--rel, 1) * 100%);
  min-width: 40px;
  height: auto;
}
.ar-machine-copy {
  display: grid;
  gap: 6px;
}
.ar-spec {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 4px 0 0;
}
.ar-spec dt {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dz-steel);
}
.ar-spec dd {
  margin: 0;
  font-size: 15px;
}
.ar-story {
  display: grid;
  gap: 6px;
}
.ar-story .dz-h3 {
  max-width: 32ch;
}
@media (min-width: 560px) {
  .ar-machine {
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 28px;
  }
}

/* ---------- The offer, once ---------- */

.ar-offer {
  display: grid;
  justify-items: start;
  gap: 16px;
  margin-top: var(--ar-band);
  padding-top: var(--ar-band);
  border-top: 1px solid var(--dz-line-strong);
}
.ar .ar-offer .dz-h2 {
  max-width: 18ch;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.02;
}
.ar-offer-line {
  max-width: 58ch;
  margin: 0;
  color: var(--dz-steel);
  text-wrap: pretty;
}
.ar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-top: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .ar *,
  .ar *::before,
  .ar *::after {
    transition: none !important;
  }
}

/* A machine the article names that DBZ no longer sells. */
.ar-retired {
  margin-bottom: 24px;
  padding: 12px 16px;
  border-left: 3px solid var(--dz-ink);
  background: var(--dz-snow);
  font-size: 15px;
}
.ar-retired a {
  color: var(--dz-ink);
  text-decoration: underline;
  text-decoration-color: var(--dz-link-line);
}
