/* ============================================================
   Product listing page — the datasheet-forward layout applied to a catalogue level.

   Loads on top of technical.css, which holds the hero shell, the key-figure strip, the sticky
   section nav, the section headings, the feature and link cards, the FAQ accordion and the
   downloads list. What remains here is listing-only: the hero collage, the series/group/plain
   cards and the single-child featured panel.

   Attached automatically to pages of type `category-technical` by TYPE_ASSETS in layout.mjs.
   Every colour, radius and shadow comes from the tokens already defined in site.css.
   ============================================================ */

/* ---------- hero ---------- */

/* The source site's two-part strapline: "Engineered for" above a colour-accented phrase. It is
   Enclove's own copy and carried the emphasis on the old centred hero, so it keeps it here. */
.cat-hero__lead {
  font-size: clamp(17px, 1.7vw, 21px); font-weight: 600; letter-spacing: -.02em;
  color: var(--ink-70); line-height: 1.25; margin-bottom: 18px;
}
.cat-hero__accent { display: block; color: var(--blue); font-weight: 700; }

/* The hero art is the children's own photography — a listing page has no image of its own, and
   picking one product to stand for the whole range would misrepresent it. */
.cat-collage {
  display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cat-collage[data-count='1'] { grid-template-columns: minmax(0, 1fr); }
/* Three tiles: the first spans the full width so the row below is not left with a gap. */
.cat-collage[data-count='3'] .cat-collage__tile:first-child { grid-column: 1 / -1; }
.cat-collage__tile {
  background: #fff; border: 1px solid var(--ptx-rule); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 16px;
  display: flex; align-items: center; justify-content: center; min-height: 128px;
}
.cat-collage[data-count='1'] .cat-collage__tile { min-height: 280px; padding: 26px; }
.cat-collage__tile img { max-height: 150px; width: auto; object-fit: contain; }
.cat-collage[data-count='1'] .cat-collage__tile img { max-height: 340px; }
.cat-collage[data-count='3'] .cat-collage__tile:first-child img { max-height: 180px; }

/* ---------- the range ---------- */

.cat-cards {
  list-style: none; display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  /* Every card the same height, across rows as well as within one. Grid rows are auto-sized
     independently by default, so a second row of shorter cards would not match the first. */
  grid-auto-rows: 1fr;
}
/* auto-fit packs as many columns as will fit, which leaves an orphan row whenever the card count
   is not a multiple of that number — six cards land 4 + 2. Set the count explicitly instead so
   every row is full, and stop a lone card from stretching the width of the page. */
@media (min-width: 1040px) {
  .cat-cards[data-count='1'] { grid-template-columns: minmax(0, 400px); }
  .cat-cards[data-count='2'] { grid-template-columns: repeat(2, 1fr); }
  .cat-cards[data-count='3'] { grid-template-columns: repeat(3, 1fr); }
  .cat-cards[data-count='4'] { grid-template-columns: repeat(4, 1fr); }
  .cat-cards[data-count='5'],
  .cat-cards[data-count='6'] { grid-template-columns: repeat(3, 1fr); }
}

.cat-card {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--ptx-rule); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(1, 164, 241, .35); }

.cat-card__media {
  display: flex; align-items: center; justify-content: center;
  padding: 26px 22px 6px; min-height: 190px; background: #fff;
}
.cat-card__media img { max-height: 175px; width: auto; object-fit: contain; }

.cat-card__body { display: flex; flex-direction: column; flex: 1 1 auto; padding: 20px 22px 22px; }
.cat-card__family {
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--blue-600); margin-bottom: 7px;
}
.cat-card__title { font-size: 18px; font-weight: 700; letter-spacing: -.02em; color: var(--navy); line-height: 1.25; }
.cat-card__title a { color: inherit; }
.cat-card__title a:hover { color: var(--blue-600); }
/* The series card has exactly one destination, so the whole card is its hit area. Group cards are
   a list of destinations and deliberately do NOT get this. */
.cat-card--series .cat-card__title a::after { content: ''; position: absolute; inset: 0; }
.cat-card__tagline { font-size: 13.5px; line-height: 1.55; color: var(--ink-70); margin-top: 7px; }

.cat-card__specs {
  display: grid; gap: 8px; margin-top: 16px;
  border-top: 1px solid var(--ptx-rule); padding-top: 14px;
}
.cat-card__specs > div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.cat-card__specs dt { font-size: 12.5px; color: var(--grey-500); }
.cat-card__specs dd { font-size: 13.5px; font-weight: 700; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }

.cat-card__badges { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.cat-card__badges li {
  font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--navy);
  background: var(--blue-50); border-radius: var(--radius-pill); padding: 5px 10px;
}

/* The series inside a sub-category, surfaced on the parent page so the catalogue is one click
   shallower than it was. */
.cat-card__kids { list-style: none; display: grid; gap: 2px; margin-top: 16px; }
.cat-card__kids li { border-top: 1px solid var(--ptx-rule); }
.cat-card__kids a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 9px 0; font-size: 13.5px; font-weight: 600; color: var(--navy);
}
.cat-card__kids a:hover { color: var(--blue-600); }
.cat-card__kid { min-width: 0; }
.cat-card__kidspec {
  font-size: 12px; font-weight: 600; color: var(--grey-500); white-space: nowrap;
  font-variant-numeric: tabular-nums; flex: none;
}

.cat-card__points { list-style: none; display: grid; gap: 9px; margin-top: 16px; }
.cat-card__points li { display: flex; gap: 9px; font-size: 13px; line-height: 1.5; color: var(--ink-70); }
.cat-card__points svg { width: 16px; height: 16px; flex: none; stroke: var(--blue); margin-top: 1px; }

.cat-card__foot {
  margin-top: auto; padding-top: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.cat-card__models {
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--grey-500);
}
.cat-card__more, .cat-card__doc {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--blue-600);
}
/* Raised above the stretched title link so the datasheet stays independently clickable. */
.cat-card__doc { position: relative; z-index: 1; }
.cat-card__more svg, .cat-card__doc svg { width: 15px; height: 15px; transition: transform .18s; }
.cat-card__more:hover svg { transform: translateX(4px); }

/* ---------- featured (single child) ---------- */

.cat-featured {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 3.5vw, 52px); align-items: center;
  background: #fff; border: 1px solid var(--ptx-rule); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: clamp(24px, 3vw, 40px);
}
.cat-featured__media {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
  border: 1px solid var(--ptx-rule); border-radius: var(--radius-md);
  padding: 26px; min-height: 300px;
}
.cat-featured__media img { max-height: 340px; width: auto; object-fit: contain; }
.cat-featured__title { font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; letter-spacing: -.03em; color: var(--navy); line-height: 1.15; }
.cat-featured__title a { color: inherit; }
.cat-featured__title a:hover { color: var(--blue-600); }
.cat-featured__tagline { font-size: 16px; font-weight: 600; color: var(--ink-70); margin-top: 10px; line-height: 1.5; }
.cat-featured__intro { font-size: 14.5px; color: var(--ink-70); line-height: 1.72; margin-top: 14px; max-width: 62ch; }
.cat-featured__badges { margin-top: 18px; }
.cat-featured__specs { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 28px; }
.cat-featured__actions { margin-top: 24px; }
.cat-featured__models {
  margin-top: 14px; font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--grey-500);
}

/* The products under a single sub-category, listed below its panel. */
.cat-subhead {
  font-size: clamp(19px, 1.9vw, 23px); font-weight: 700; letter-spacing: -.02em;
  color: var(--navy); margin: clamp(34px, 4vw, 48px) 0 20px;
}

/* ---------- applications ---------- */

/* auto-fill rather than the shared auto-fit: a page with two sectors would otherwise have those
   two cards absorb the whole row and sit half a page apart. auto-fill keeps the empty tracks, so
   the cards stay their natural size and pack from the left however many there are. */
.cat-applications { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cat-applications > li { max-width: none; }

/* ---------- prose ---------- */

.cat-prose { max-width: 70ch; }
.cat-prose p { color: var(--ink-70); line-height: 1.78; margin-top: 16px; }

/* ---------- datasheet rows ---------- */

.ptx-download__name a { color: inherit; }
.ptx-download__name a:hover { color: var(--blue-600); }
/* The rating, not the name, is what distinguishes two series that share one. */
.cat-download__rating {
  font-size: 12px; font-weight: 700; color: var(--blue-600);
  background: var(--blue-50); border-radius: var(--radius-pill); padding: 3px 9px;
  margin-left: 8px; white-space: nowrap; font-variant-numeric: tabular-nums;
}

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .cat-featured { grid-template-columns: 1fr; }
  .cat-featured__media { order: -1; min-height: 220px; }
  .cat-featured__media img { max-height: 250px; }
}

@media (max-width: 720px) {
  .cat-collage__tile { min-height: 96px; padding: 12px; }
  .cat-collage__tile img { max-height: 104px; }
  .cat-collage[data-count='1'] .cat-collage__tile { min-height: 200px; }
  .cat-collage[data-count='1'] .cat-collage__tile img { max-height: 220px; }
  .cat-card__media { min-height: 150px; padding: 20px 18px 4px; }
  .cat-card__media img { max-height: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  .cat-card, .cat-card__more svg, .cat-card__doc svg { transition: none; }
  .cat-card:hover { transform: none; }
}

@media print {
  .cat-featured__actions, .cat-card__foot { display: none; }
  .cat-card, .cat-featured { box-shadow: none; break-inside: avoid; }
}
