/* Home page: a short front door. Detail lives on the product, configurator and support pages. */

/* Hero: what it is on the left, the board on the right.
   Phones reorder it: headline, board, buttons, then the rest, so the board is on the first screen. */
.home-hero { display: block; padding: calc(var(--header-h) + clamp(14px, 2vw, 24px)) 0 clamp(24px, 3vw, 40px); }
.home-hero__grid {
  display: grid; column-gap: clamp(32px, 4vw, 64px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  grid-template-rows: 1fr repeat(4, auto) 1fr;
  grid-template-areas:
    ".       fig"
    "title   fig"
    "lead    fig"
    "actions fig"
    "trust   fig"
    ".       fig";
}
.home-hero__title { grid-area: title; margin-bottom: 14px; }
.home-hero__lead { grid-area: lead; margin: 0; }
.home-hero__actions { grid-area: actions; margin-top: 22px; }
.home-hero__trust { grid-area: trust; margin: 16px 0 0; font-size: var(--fs-sm); color: var(--text-2); }
.home-hero__trust a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.home-hero__fig { grid-area: fig; margin: 0; align-self: center; --board-w: min(100%, 690px, max(320px, calc((100vh - 200px) * 1.03))); }

/* The board. Width follows the window height too, so the whole board stays on a short laptop screen. */
.hero-board { aspect-ratio: 947 / 919; width: var(--board-w); margin-inline: auto; }
.hero-board img { width: 100%; height: 100%; }
.hero-board__cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; width: var(--board-w); margin: 8px auto 0; font-size: var(--fs-sm); color: var(--text-2); }
.hero-board__name b { color: var(--text); font-size: var(--fs-md); margin-right: 4px; }
.hero-board__cap .link-arrow { margin-left: auto; }

@media (max-width: 960px) {
  .home-hero__grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "title" "fig" "actions" "lead" "trust";
  }
  .home-hero__fig { --board-w: min(100%, 560px); }
  .home-hero__actions { margin-top: 14px; }
  .home-hero__lead { margin-top: 18px; }
}
@media (max-width: 480px) { .home-hero__actions .btn { flex: 1 1 100%; } }

/* Boards and accessories: plain product cards in one row each */
.home-boards { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(20px, 3vw, 40px); }
.home-boards__group { display: grid; grid-template-rows: auto 1fr; gap: 12px; min-width: 0; }
.home-boards__group h3 { margin: 0 0 2px; }
.home-boards__group header p { margin: 0; color: var(--text-2); }
.home-cards { display: grid; gap: 14px; min-width: 0; }
.home-cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-cards--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.home-cards .pcard__media { aspect-ratio: 1 / 1; padding: 0; }
.home-cards .pcard__media img { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); max-height: none; object-fit: contain; }
@media (max-width: 1100px) {
  .home-boards { grid-template-columns: minmax(0, 1fr); }
  /* Five cards fill two rows: three, then two. */
  .home-cards--5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .home-cards--5 > * { grid-column: span 2; }
  .home-cards--5 > :nth-child(n + 4) { grid-column: span 3; }
}
@media (max-width: 640px) {
  /* Phones: the first card takes the full width, so no row is left half empty. */
  .home-cards--3, .home-cards--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-cards--5 > *, .home-cards--5 > :nth-child(n + 4) { grid-column: auto; }
  .home-cards--3 > :first-child, .home-cards--5 > :first-child { grid-column: 1 / -1; }
  .home-cards { gap: 10px; }
  .home-cards .pcard__foot { flex-wrap: wrap; gap: 4px 12px; }
}
.home-note { max-width: 78ch; margin: 16px 0 0; font-size: var(--fs-sm); color: var(--text-2); }
.home-note a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.home-links { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 20px 0 0; }

/* The explorer keeps its controls and picture. "How to select it" lives on the product pages. */
.home .mx__how, .home .mx__note { display: none; }
.home .mx__caption { grid-template-columns: minmax(0, 1fr); }
.home .mx__caption > p[data-cap] { grid-row: auto; max-width: 78ch; margin-bottom: 0; }

/* A photo beside a short list */
.home-split { align-items: center; }
.home-points { list-style: none; margin: 0; padding: 0; }
.home-points li { padding: 14px 0; border-top: 1px solid var(--line); }
.home-points li:last-child { padding-bottom: 0; }
.home-points h3 { margin: 0 0 4px; font-size: var(--fs-md); }
.home-points p { margin: 0 0 6px; color: var(--text-2); }
.home-points li > :last-child { margin-bottom: 0; }

.home-cards .pcard__media:has(img[src*='wiring-']) { background: #000; }
