/* ==========================================================================
   DCE V2 — homepage (inc/v2/home-view.php)
   Same tokens, type and cards as the store; one photo hero, then plain ruled
   sections. Loaded only on the front page, after site.css + shop.css.
   ========================================================================== */

.dx-home { overflow-x: clip; }
.dx-home-strip { position: relative; }
/* The last band is navy and runs straight into the navy footer. */
body:has(.dx-home) .dx-footer { margin-top: 0; }
.dx-home h2 { font-size: clamp(2rem, 1.45rem + 1.9vw, 3rem); font-weight: 700; line-height: 1.02; }
.dx-home-sec { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.dx-home-sec--paper { background: var(--dx-bg-2); }
.dx-home-sec--navy { background: var(--dx-navy-deep); color: #e6ecf5; }
.dx-home-sec--navy h2 { color: #fff; }
.dx-home-sec--navy :focus-visible { outline-color: #ffd27a; }

/* Sections below the first screen skip rendering until they get close. */
.dx-home-sec { content-visibility: auto; contain-intrinsic-size: auto none auto 900px; }

.dx-home-head { display: grid; gap: 0.75rem; margin-bottom: clamp(1.25rem, 3vw, 2rem); max-width: 60rem; }
.dx-home-head--split { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; max-width: none; }
.dx-home-lede { margin: 0; max-width: 46rem; font-size: 1.125rem; line-height: 1.5; color: var(--dx-ink-2); }
.dx-home-sec--navy .dx-home-lede { color: #cfdcf2; }
.dx-home-sec--navy .dx-home-lede a, .dx-home-sec--navy .dx-home-lede strong { color: #fff; }

/* ---------- Hero ---------- */
.dx-home-hero { position: relative; isolation: isolate; display: grid; background: var(--dx-navy-deep); color: #fff; }
.dx-home-hero__img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.dx-home-hero__in { padding-block: clamp(1.75rem, 5vw, 4.5rem); }
.dx-home-hero__eyebrow { margin: 0 0 0.75rem; font-size: 0.875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #cfdcf2; }
.dx-home .dx-home-hero__title { max-width: 12ch; font-size: clamp(2.75rem, 1.5rem + 4.8vw, 5.5rem); font-weight: 700; line-height: 0.95; color: #fff; text-wrap: balance; }
.dx-home-hero__title span { display: block; color: #e3ecf9; }
.dx-home-hero__lede { max-width: 36rem; margin: 1rem 0 0; font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); line-height: 1.5; color: #e6ecf5; }
.dx-home-hero__ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.dx-home-hero__quote, .dx-home-hero__call { background: transparent; color: #fff; border-color: rgb(255 255 255 / 0.75); }
.dx-home-hero__quote:hover, .dx-home-hero__call:hover { background: #fff; color: var(--dx-navy-deep); }
.dx-home-hero :focus-visible { outline-color: #ffd27a; }

.dx-home-stats { margin-top: clamp(1.5rem, 3vw, 2.25rem); padding-top: 1rem; border-top: 1px solid rgb(255 255 255 / 0.3); max-width: 36rem; }
.dx-home-stats__lead { margin: 0 0 0.35rem; font-size: 0.9375rem; color: #cfdcf2; }
.dx-home-stats dl { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; }
.dx-home-stats dl > div { display: flex; flex-direction: column-reverse; }
.dx-home-stats dt { font-size: 0.9375rem; color: #e6ecf5; }
.dx-home-stats dd { font: 700 2.25rem/1 var(--dx-display); color: #fff; font-variant-numeric: tabular-nums; }
.dx-home-stats__foot { margin: 0.6rem 0 0; font-size: 0.875rem; color: #cfdcf2; }

/* Phones: photo on top, text on solid navy (no text over a busy photo). */
@media (max-width: 759.98px) {
  .dx-home-hero__img { aspect-ratio: 16 / 10; height: auto; }
}
/* Hero buttons below 1200px: one full-width button per row (Browse, Get a quote, Call a store). The rows never
   depend on text width, so a web font arriving late (font-display: swap) cannot re-wrap them and shift the hero.
   Over the photo (760px+) the column is capped at 22rem: the darkening fades to the right, and a single row there
   put the third button over the light part of the photo (white text under 4.5:1). */
@media (max-width: 1199.98px) {
  .dx-home-hero__ctas > .dx-btn { flex: 1 1 100%; }
}
@media (min-width: 760px) and (max-width: 1199.98px) {
  .dx-home-hero__ctas { max-width: 22rem; }
}
/* Wider: text over the photo, darkened on the reading side only. */
@media (min-width: 760px) {
  .dx-home-hero.has-photo { min-height: min(68svh, 620px); align-items: center; }
  .dx-home-hero.has-photo > * { grid-area: 1 / 1; }
  .dx-home-hero.has-photo .dx-home-hero__img { position: absolute; inset: 0; z-index: -2; }
  .dx-home-hero.has-photo::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgb(10 22 42 / 0.9) 0%, rgb(10 22 42 / 0.78) 42%, rgb(10 22 42 / 0.25) 75%, rgb(10 22 42 / 0.1) 100%); }
}

/* ---------- Category tiles ---------- */
.dx-home-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: clamp(1.25rem, 2.5vw, 2rem) clamp(1rem, 2vw, 1.5rem); }
.dx-home-cat { position: relative; display: flex; flex-direction: column; border-top: 3px solid var(--dx-navy); padding-top: 0.75rem; }
.dx-home-cat__img, .dx-home-cat > .dx-nophoto { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--dx-well); border-radius: 2px; }
.dx-home-cat > .dx-nophoto { display: grid; }
.dx-home-cat__body { display: flex; flex-direction: column; flex: 1; padding-top: 0.75rem; }
.dx-home-cat__label { margin: 0 0 0.2rem !important; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dx-ink-3); }
.dx-home .dx-home-cat__title { font-size: 1.5rem; font-weight: 700; line-height: 1.05; }
.dx-home-cat__title a { color: var(--dx-ink); text-decoration: none; }
.dx-home-cat__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.dx-home-cat:hover .dx-home-cat__title a { color: var(--dx-blue); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.15em; }
.dx-home-cat__title a:focus-visible { outline: none; }
.dx-home-cat:has(a:focus-visible) { outline: var(--dx-focus); outline-offset: 4px; }
.dx-home-cat__sub { margin: 0.3rem 0 0 !important; color: var(--dx-ink-2); }
.dx-home-cat__list { margin-top: 0.6rem !important; font-size: 0.9375rem; color: var(--dx-ink-2); }
.dx-home-cat__list li { padding-block: 0.2rem; border-top: 1px solid var(--dx-line-2); }
.dx-home-cat__go { display: inline-flex; align-items: center; gap: 0.15rem; margin: auto 0 0 !important; padding-top: 0.75rem; font-weight: 600; color: var(--dx-blue); }
.dx-home-brands { margin: clamp(1.5rem, 3vw, 2.25rem) 0 0; padding-top: 1rem; border-top: 1px solid var(--dx-line); color: var(--dx-ink-2); }
.dx-home-brands span { font-weight: 600; color: var(--dx-ink); }

@media (max-width: 639.98px) {
  /* Two across with just photo + name, so eight categories fit in a couple of screens. */
  .dx-home-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 0.875rem; }
  .dx-home .dx-home-cat__title { font-size: 1.2rem; }
  .dx-home-cat__list, .dx-home-cat__go { display: none; }
  .dx-home-cat__sub { font-size: 0.9375rem; }
}

/* ---------- Featured equipment (cards come from the store: shop.css) ---------- */
.dx-home-feat .dx-grid { border-top-color: var(--dx-ink); }

/* ---------- Stores ---------- */
.dx-home-stores { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.dx-home-stores__media { display: grid; gap: 0; align-content: start; }
.dx-home-stores__img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 2px; background: var(--dx-well); }
.dx-home-quote { margin: 0; padding: 1rem 0 0 1rem; border-left: 3px solid var(--dx-red); }
.dx-home-quote p { margin: 0 0 0.5rem; font-size: 1.125rem; line-height: 1.5; }
.dx-home-quote footer { font-size: 0.9375rem; color: var(--dx-ink-2); }
.dx-home-quote strong { color: var(--dx-ink); }
.dx-home-stores__list { display: grid; align-content: start; }
.dx-home-store { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.15rem 1.5rem; padding-block: 1rem; border-top: 1px solid var(--dx-line); }
.dx-home-store:first-child { border-top: 3px solid var(--dx-ink); }
.dx-home .dx-home-store__town { font-size: 1.75rem; font-weight: 700; }
.dx-home-store p { margin: 0; }
.dx-home-store__name { font-weight: 600; }
.dx-home-store__addr, .dx-home-store__hours { color: var(--dx-ink-2); }
.dx-home-store__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.6rem; }
.dx-home-store__tel { font-variant-numeric: tabular-nums; }
@media (min-width: 640px) {
  .dx-home-store { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dx-home-store__town, .dx-home-store__name { grid-column: 1 / -1; }
  .dx-home-store__acts { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .dx-home-stores.has-photo { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
  .dx-home-stores:not(.has-photo) .dx-home-stores__list { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 1.5rem; }
  .dx-home-stores:not(.has-photo) .dx-home-store { border-top: 3px solid var(--dx-ink); grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Service + financing ---------- */
.dx-home-help { display: grid; gap: clamp(2rem, 4vw, 3rem); }
@media (min-width: 820px) { .dx-home-help { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dx-home-help__item { padding-top: 1rem; border-top: 3px solid var(--dx-ink); }
.dx-home .dx-home-help__item h2 { font-size: clamp(1.75rem, 1.4rem + 1.1vw, 2.375rem); margin-bottom: 0.75rem; }
.dx-home-help__item p { max-width: 38rem; color: var(--dx-ink-2); font-size: 1.0625rem; }
.dx-home-help__acts { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.25rem; }

/* ---------- Customer posts strip ---------- */
.dx-home-strip__nav:not([hidden]) { display: flex; gap: 0.5rem; }
.dx-home-strip__nav .dx-iconbtn--solid { border-color: transparent; }
.dx-home-strip {
  display: flex; gap: 1rem; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--dx-gutter);
  margin-inline: calc(var(--dx-gutter) * -1); padding: 0.25rem var(--dx-gutter) 1rem;
  scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / 0.4) transparent;
}
@media (prefers-reduced-motion: no-preference) { .dx-home-strip { scroll-behavior: smooth; } }
.dx-home-strip:focus-visible { outline: 3px solid #ffd27a; outline-offset: -3px; }
.dx-home-post { position: relative; flex: 0 0 min(78vw, 18.75rem); scroll-snap-align: start; display: flex; flex-direction: column; background: #fff; color: var(--dx-ink); border-radius: var(--dx-r); overflow: hidden; }
.dx-home-post__img, .dx-home-post > .dx-nophoto { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--dx-well); }
.dx-home-post > .dx-nophoto { display: grid; }
.dx-home-post__body { display: flex; flex-direction: column; flex: 1; gap: 0.6rem; padding: 0.875rem 1rem 1rem; }
.dx-home-post__cap { margin: 0; font-size: 0.9375rem; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.dx-home-post__link { display: inline-flex; align-items: center; min-height: var(--dx-target); margin-top: auto; font-weight: 600; }

/* Phones: four featured machines is plenty before "See all equipment". */
@media (max-width: 559.98px) {
  .dx-home-feat .dx-grid > li:nth-child(n + 5) { display: none; }
}
