/* Propozycja "6 kafli jako hero" (kh-). Loaded after assets/css/carpoint.css and uses its tokens only,
   so it follows the site's light / dark / high-contrast themes. Tiles: the live site's photo tiles,
   redrawn in the new site's style (rounded, Nunito Sans 800, price pill like .card__tag, red accent bar). */

/* ---------- Hero shell: light band (theme tokens), title row on top, lede + phones, tiles, full-bleed facts stripe ---------- */
/* Light grey (--bg-subtle) sets the hero apart from the white header; tokens make it dark in the dark theme, black in HC. */
.kh-hero { background: var(--bg-subtle); color: var(--text); padding-top: clamp(2rem, 4vw, 3.5rem); }
/* Wide hero: content spans 90vw (old site: 100%), capped at 110rem (1760px) so 4K/ultrawide rows stay scannable;
   never narrower than the site container. Gutter added on top so the visible content itself is 90vw.
   Below ~1355px 90vw < 1220px, so max() keeps the normal container; phones keep the normal gutter. */
.kh-hero > .container { max-width: max(var(--container), calc(min(90vw, 110rem) + 2 * var(--gutter))); }
.kh-hero__top { display: grid; gap: var(--sp-5); align-items: end; margin-bottom: var(--sp-6); }
.kh-hero__title { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); line-height: var(--lh-tight); letter-spacing: var(--tr-tighter); color: var(--text); margin: 0 0 var(--sp-3); }
.kh-hero__title em { font-style: normal; color: var(--brand-deep); }
.kh-hero__lede { font-size: var(--fs-lg); color: var(--text); margin: 0; max-width: 34rem; }
.kh-hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.kh-hero__facts b { font-weight: 800; }

/* Google rating badge: white pill, big score, gold stars (decorative; the link's aria-label carries the text). */
.kh-rating { justify-self: start; align-self: center; display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4); background: var(--bg-elevated); color: var(--text); text-decoration: none;
  border: 1px solid var(--border); border-radius: var(--radius-full); box-shadow: var(--shadow-sm); white-space: nowrap;
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.kh-rating:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.kh-rating__score { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lg); line-height: 1; font-variant-numeric: tabular-nums; }
.kh-rating__stars { color: #e8a200; letter-spacing: 1px; font-size: var(--fs-md); line-height: 1; }
.kh-rating__count { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; }
[data-theme="hc"] .kh-rating { border: 2px solid #ffffff; box-shadow: none; }
[data-theme="hc"] .kh-rating__stars { color: #ffd400; }

/* Phones (<48rem): H1 + lede + phone buttons above the tiles, facts as a full-bleed red stripe under them.
   The stripe sits inside .container, so negative gutter margins stretch it to the viewport edges.
   Brand red + --on-brand text = 5.0:1 (AA); HC swaps both tokens. ul.* beats the site's ul[class] reset. */
@media (max-width: 47.99rem) {
  ul.kh-hero__facts { list-style: none; margin: clamp(2rem, 4vw, 3rem) calc(-1 * var(--gutter)) 0; padding: var(--sp-2) var(--gutter);
    display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-1) var(--sp-6);
    background: var(--brand-strong); color: var(--on-brand); font-size: var(--fs-sm); line-height: 1.4; text-align: center; }
}

/* Tablet + desktop (≥48rem): tiles first, then one row: facts (left) · phone buttons (right). No lede, no stripe.
   .kh-hero__top becomes display:contents so its children join the container grid; the H1 stays in the DOM
   (SEO, screen readers) but is visually hidden, as in the approved screenshot. */
@media (min-width: 48rem) {
  .kh-hero > .container { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--sp-6); row-gap: var(--sp-6);
    align-items: center; padding-bottom: clamp(2rem, 4vw, 3.5rem); }
  .kh-hero__top { display: contents; }
  .kh-hero__title { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .kh-hero__lede { display: none; }
  .kh-hero > .container { grid-template-columns: auto minmax(0, 1fr) auto; }
  .kh-tiles { grid-column: 1 / -1; grid-row: 1; }
  .kh-rating { grid-column: 1; grid-row: 2; }
  ul.kh-hero__facts { grid-column: 2; grid-row: 2; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-4); font-size: var(--fs-sm); color: var(--text-muted); }
  .kh-hero__facts li { white-space: nowrap; }
  .kh-hero__facts b { color: var(--text); }
  .kh-hero__facts li + li { padding-left: var(--sp-4); border-left: 1px solid var(--border-strong); }
  .kh-hero__actions { grid-column: 3; grid-row: 2; justify-content: flex-end; }
  /* Slimmer side padding so badge, facts and both buttons share one row. */
  .kh-hero__actions .btn { padding-inline: var(--sp-5); font-size: var(--fs-md); }

}
/* Tablet + desktop: the 3 facts as small columns (title on top, text below), thin dividers between them. */
@media (min-width: 48rem) {
  ul.kh-hero__facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: var(--sp-4); line-height: 1.35; }
  .kh-hero__facts li { display: flex; flex-direction: column; gap: 2px; white-space: normal; }
  .kh-hero__facts span { white-space: nowrap; }
}
/* Phones: the stripe stays one line per fact ("Bez zapisów: w kolejności przyjazdu"). */
@media (max-width: 47.99rem) { .kh-hero__facts b::after { content: ":"; } }
/* Wide (≥75rem, one row with facts + buttons): badge on two lines (score + stars, then the count) to save width. */
@media (min-width: 75rem) {
  .kh-rating { flex-wrap: wrap; width: min-content; column-gap: var(--sp-2); row-gap: 2px; padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-lg); }
  .kh-rating__count { flex-basis: 100%; }
}
/* Tablet: buttons drop under the facts when the row would be too tight. */
@media (min-width: 48rem) and (max-width: 74.99rem) {
  .kh-hero > .container { grid-template-columns: minmax(0, 1fr); }
  .kh-rating { grid-column: 1; grid-row: 2; }
  ul.kh-hero__facts { grid-column: 1; grid-row: 3; }
  .kh-hero__actions { grid-column: 1; grid-row: 4; justify-content: flex-start; }
}

/* ---------- The 6 tiles (also usable outside the hero: see kafelki.html) ---------- */
.kh-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
@media (min-width: 40rem) { .kh-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62rem) { .kh-tiles { grid-template-columns: repeat(3, 1fr); } }

.kh-tile { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: 15rem; margin: 0;
  border-radius: var(--radius-lg); overflow: hidden; background: #1e1e1d; color: #fff;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease); }
/* Desktop: tile ≈30vw wide, so 15vw height keeps the photo near 2:1 as the hero widens (264px floor, 320px cap). */
@media (min-width: 62rem) { .kh-tile { min-height: clamp(16.5rem, 15vw, 20rem); } }
.kh-tile img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-out); }
/* Scrim: light at the top so the photo reads, dark at the bottom where the text sits (white text ≥ 7:1). */
.kh-tile::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(20, 20, 19, .15) 0%, rgba(20, 20, 19, .55) 45%, rgba(20, 20, 19, .92) 100%); }

.kh-tile__tag { position: absolute; top: var(--sp-3); left: var(--sp-3); margin: 0; padding: var(--sp-1) var(--sp-3);
  background: var(--brand-strong); color: var(--on-brand); border-radius: var(--radius-full); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em; }
.kh-tile__body { width: 100%; padding: var(--sp-5); padding-right: 4rem; }
/* Red bar = the old site's red square, in the new site's eyebrow form. */
.kh-tile__body::before { content: ""; display: block; width: 28px; height: 3px; margin-bottom: var(--sp-3); background: var(--brand-on-dark); }
.kh-tile__title { margin: 0 0 var(--sp-1); font-size: var(--fs-xl); font-weight: 800; line-height: var(--lh-snug); letter-spacing: var(--tr-tight); color: #fff; }
.kh-tile__title a { color: inherit; text-decoration: none; }
.kh-tile__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }   /* whole tile is the link */
.kh-tile__text { margin: 0; font-size: var(--fs-sm); line-height: 1.5; color: #ececeb; }

/* Arrow button bottom-right; fills red on hover/focus. */
.kh-tile::after { content: ""; position: absolute; right: var(--sp-4); bottom: var(--sp-5); width: 2.5rem; height: 2.5rem; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .5);
  background: no-repeat center / 18px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.kh-tile:hover, .kh-tile:focus-within { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kh-tile:hover img, .kh-tile:focus-within img { transform: scale(1.05); }
.kh-tile:hover::after, .kh-tile:focus-within::after { background-color: var(--brand-strong); border-color: var(--brand-strong); }
.kh-tile__title a:focus-visible { outline: none; }
.kh-tile:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .kh-tile, .kh-tile img, .kh-tile::after { transition: none; }
  .kh-tile:hover, .kh-tile:focus-within, .kh-tile:hover img, .kh-tile:focus-within img { transform: none; }
}

/* Phone: shorter tiles so more than one fits on screen. */
@media (max-width: 39.99rem) { .kh-tile { min-height: 11rem; } .kh-tile__body { padding: var(--sp-4); padding-right: 3.75rem; } }

/* High contrast theme: no photos, plain black tiles with a white border. */
[data-theme="hc"] .kh-hero { background: #000; }
[data-theme="hc"] .kh-tile { background: #000; border: 2px solid #fff; }
[data-theme="hc"] .kh-tile img, [data-theme="hc"] .kh-tile::before { display: none; }

