/* House-ad tiles in the search results grid (js/search-page.js).

   Loaded by search.html alone, which is the only page that draws them.
   Deliberately NOT in css/site.css: that file is referenced by every baked
   listing page, so a byte of it changes ~7,700 content-hash stamps and the
   next deploy re-uploads the lot (see the notes on data/listing-pages.json
   and feed/build_listing_pages.stamp).

   These replace the pd-promo-* tiles, which went blank in the field-guide
   redesign: `main .rcard .ph { background: var(--fg-paper-2) }` is 0-2-1 and
   outranked `.pd-promo .ph` at 0-2-0, so a dark tile's white heading sat on
   paper white. That was the THIRD specificity collision on this component —
   the first two are written up on .pd-promo in site.css.

   So every rule here is scoped `main .rcard.ck-tile ...`, 0-3-1 or deeper:
   one class further in than anything the theme sets on a card. Do not
   loosen a selector in this file. If a rule stops applying, the fix is more
   specificity here, never a looser selector.

   The tiles carry the same furniture as the sidebar checklist cards
   (css/ck-card.css, feed/build_checklist_cards.py): the cover, the red
   "Free checklist - PDF" eyebrow, a serif heading. They link to the
   checklist page rather than carrying a form — the form is on the page they
   land on, and a card-sized box has no room for one. */

main .rcard.ck-tile a,
main .rcard.ck-tile .ck-tile__btn {
  display: grid; gap: 6px; width: 100%; text-align: left;
  color: var(--ink); text-decoration: none !important;
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  transition: transform .3s cubic-bezier(.2, .7, .2, 1);
}
main .rcard.ck-tile a:hover,
main .rcard.ck-tile .ck-tile__btn:hover { transform: translateY(-2px); }
main .rcard.ck-tile .ck-tile__btn:focus-visible {
  outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 12px;
}

/* The 4:3 box a listing photo would fill. Paper ground with a hairline, so
   the tile reads as a printed thing among photographs rather than as an
   image that failed to load — which is exactly how the old near-white tile
   was reported. */
main .rcard.ck-tile .ph {
  position: relative;
  background: var(--fg-paper);
  box-shadow: inset 0 0 0 1px var(--grid, #e3ddd2);
  display: flex; flex-direction: column; justify-content: flex-start;
  align-items: stretch; gap: 0; padding: 0; overflow: hidden;
}

/* THE COVER IS THE PICTURE (Ryan, 2026-11-19: "the checklist images are too
   small"). A 52px thumbnail beside a heading read as an icon rather than as
   the thing being offered. The cover is now cropped across the top of the
   box the way a listing photo is, which puts the checklist's own red
   masthead and its real title at a readable size; the body type below it is
   texture at any size a card allows, so cropping it loses nothing. */
main .rcard.ck-tile .ck-tile__cover {
  height: 60%; width: 100%; flex: none;
  object-fit: cover; object-position: center top;
  background: #fff; border: 0; border-radius: 0;
  position: static; inset: auto; max-width: none;
}
main .rcard.ck-tile .ck-tile__under {
  flex: 1; align-content: center;
  padding: 12px 14px; display: grid; gap: 4px;
}
main .rcard.ck-tile .ck-tile__tag {
  font: 700 11px/1.3 var(--fg-text); letter-spacing: .06em; text-transform: uppercase;
  color: var(--red-text, #c8102e); margin: 0;
}
main .rcard.ck-tile .ck-tile__h {
  font: 500 1rem/1.22 var(--fg-display); letter-spacing: -.005em; margin: 0; color: inherit;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---- the assistant tile.

   Night ground, because it is not a checklist and should not dress as one,
   and because the one tile that opens something in place rather than
   navigating is worth telling apart at a glance. Same 4:3 frame. */
main .rcard.ck-tile--night .ph {
  background: var(--fg-night); box-shadow: none; color: var(--fg-on-night);
  justify-content: center; gap: 12px; padding: clamp(14px, 1.4vw, 18px);
}
main .rcard.ck-tile--night .ck-tile__top { display: flex; gap: 12px; align-items: flex-start; }
main .rcard.ck-tile--night .ck-tile__face {
  flex: none; width: 46px; height: 46px; border-radius: 50%; object-fit: cover;
  position: static; inset: auto; max-width: none;
}
main .rcard.ck-tile--night .ck-tile__tag { color: #ff8b93; margin: 1px 0 4px; }
main .rcard.ck-tile--night .ck-tile__h {
  font: 500 1.0625rem/1.22 var(--fg-display); -webkit-line-clamp: 3;
}
main .rcard.ck-tile--night .ck-tile__ticks {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 6px;
  font-size: .8125rem; line-height: 1.35; color: var(--fg-on-night-2);
}
main .rcard.ck-tile--night .ck-tile__ticks li { display: flex; gap: 9px; align-items: baseline; margin: 0; }
/* the same green check the sidebar checklist cards draw */
main .rcard.ck-tile--night .ck-tile__ticks li::before {
  content: ""; flex: none; width: 11px; height: 6px;
  border-left: 2px solid #7fc49a; border-bottom: 2px solid #7fc49a;
  transform: rotate(-45deg) translateY(-2px);
}

/* ---- the three lines under the box reuse the card's own .t/.m/.p slots, so
   a tile is exactly one card wide and tall and the grid rows stay level. */
main .rcard.ck-tile .t {
  white-space: normal; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Reserve the second line only where tiles sit beside each other. On a phone
   each card has the row to itself and a reserved line is just a gap. */
@media (min-width: 561px) { main .rcard.ck-tile .t { min-height: 2.5em; } }
main .rcard.ck-tile .ck-tile__cta { color: var(--red-text); font-weight: 700; font-size: .9375rem; }

@media (max-width: 560px) {
  main .rcard.ck-tile .ck-tile__h { font-size: 1.125rem; }
  main .rcard.ck-tile--night .ck-tile__h { font-size: 1.1875rem; -webkit-line-clamp: 4; }
  main .rcard.ck-tile--night .ck-tile__ticks { font-size: .875rem; gap: 8px; }
}

@media print { main .rcard.ck-tile { display: none !important; } }
