/* Package card – a panel with sharp edges, like the unit's casing.
   The top is a visual: a huge power number behind an oversized photo of the unit,
   cut by the panel edge. Each card sets its own crop with --photo-w / --photo-left / --photo-top
   (percent of the visual box), so the same unit shows from a different side on every card.

   .pkg              public or partner card (light aluminium)
   .pkg--special     chosen partner: dark glass with the LED line inside (add .led-frame and the light span)
   .pkg--compact     smaller version for a row of five */

.pkg {
  --pkg-pad: var(--space-6);
  --pkg-visual-h: clamp(220px, 17vw, 260px);
  --pkg-numeral: color-mix(in srgb, var(--fg) 12%, transparent);
  --pkg-radius: 3px;
  --photo-w: 150%;
  --photo-left: -6%;
  --photo-top: -4%;

  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: var(--space-5);
  padding: 0 var(--pkg-pad) var(--pkg-pad);
  --pkg-shadow: inset 0 0 0 1px var(--line);
  /* Hover: a soft LED backlight under the panel, the card itself stays put */
  --pkg-shadow-hover: inset 0 0 0 1px var(--line-strong), 0 26px 48px -26px rgb(49 187 238 / 0.42), 0 10px 22px -16px rgb(49 187 238 / 0.3);
  border-radius: var(--pkg-radius);
  background: linear-gradient(170deg, var(--bg-raised) 0%, color-mix(in srgb, var(--bg-raised) 88%, var(--line-strong)) 100%);
  box-shadow: var(--pkg-shadow);
  overflow: hidden;
  isolation: isolate;
  min-width: 0;
  transition: box-shadow var(--dur-slower) var(--ease-out);
}

@media (hover: hover) {
  .pkg:hover {
    box-shadow: var(--pkg-shadow-hover);
  }
}

/* Visual: number + photo, cut by a hairline */
.pkg__visual {
  position: relative;
  height: var(--pkg-visual-h);
  margin-inline: calc(var(--pkg-pad) * -1);
  overflow: hidden;
  border-bottom: 1px solid var(--line-strong);
}

/* The number sits on the cut line, so the panel edge slices it like the photo */
.pkg__kw {
  position: absolute;
  left: calc(var(--pkg-pad) - 0.06em);
  bottom: -0.2em;
  z-index: 0;
  margin: 0;
  font-size: clamp(6.5rem, 4rem + 5vw, 10rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.07em;
  color: var(--pkg-numeral);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  user-select: none;
}

.pkg__kw small {
  margin-left: 0.12em;
  font-size: 0.2em;
  font-weight: 600;
  letter-spacing: 0;
}

.pkg__photo {
  position: absolute;
  z-index: 1;
  left: var(--photo-left);
  top: var(--photo-top);
  width: var(--photo-w);
  max-width: none;
  height: auto;
  transform-origin: 50% 50%;
  transition: transform var(--dur-slow) var(--ease-out);
  /* Optional soft edge, set per card, e.g. --photo-mask: linear-gradient(90deg, transparent 18%, #000 36%) */
  -webkit-mask-image: var(--photo-mask, none);
  mask-image: var(--photo-mask, none);
}

/* For photos with a white background (not a cutout): the white disappears into a light card.
   Light cards only; the dark special card needs a cutout or a black-background frame instead. */
.pkg__photo--on-white {
  mix-blend-mode: multiply;
}

/* For frames with a black background (video stills) on the dark special card */
.pkg__photo--on-black {
  mix-blend-mode: screen;
}

/* Hover moves every photo by the same few pixels, whatever its crop size; the way back is quicker */
@media (hover: hover) {
  .pkg:hover .pkg__photo {
    transform: translate(-6px, -8px) scale(1.025);
    transition-duration: var(--dur-slower);
  }
}

/* Indoor unit of a package (the Control Box), a cut-out placed where the card names it:
   .pkg__head--cb   next to the package name
   .pkg__spec--cb   next to the "Vnitřní jednotka" line
   It has a motion of its own: on hover it lifts a little and a light sweeps over the glass
   (the picture itself is the mask of that light, so only the glass shines). */
.pkg__head--cb,
.pkg__spec--cb {
  position: relative;
  padding-right: 34%;
}

/* The lines under the name stay on one line each, so every card has the same number of them */
.pkg__head--cb .pkg__for {
  white-space: nowrap;
}

.pkg__cb {
  position: absolute;
  right: 0;
  width: 34%;
  max-width: 132px;
  transition: transform var(--dur-slow) var(--ease-out);
}

.pkg__cb--name {
  top: 50%;
  width: 32%;
  max-width: 130px;
  translate: 0 -50%;
}

.pkg__cb--spec {
  bottom: -2px;
  width: 30%;
  max-width: 112px;
}

.pkg__cb-img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 12px rgb(0 0 0 / 0.22)) drop-shadow(0 2px 3px rgb(0 0 0 / 0.2));
}

/* The black glass gets a place in space like the unit photos: a soft pool of light behind the box
   and its reflection on a glossy floor */
.pkg__cb::before {
  content: "";
  position: absolute;
  inset: -45% -30% -20%;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(255 255 255 / 0.26), rgb(255 255 255 / 0.08) 55%, transparent);
  pointer-events: none;
}

.pkg__cb-img {
  -webkit-box-reflect: below 3px linear-gradient(transparent 62%, rgb(255 255 255 / 0.22));
}

.pkg--special .pkg__cb-img {
  filter: drop-shadow(0 -1px 0 rgb(255 255 255 / 0.22)) drop-shadow(0 8px 10px rgb(0 0 0 / 0.5));
}

.pkg__cb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgb(255 255 255 / 0.32) 50%, transparent 62%) no-repeat;
  background-size: 260% 100%;
  background-position: 130% 0;
  -webkit-mask: var(--cb-mask) center / 100% 100% no-repeat;
  mask: var(--cb-mask) center / 100% 100% no-repeat;
  pointer-events: none;
  transition: background-position 1100ms var(--ease-out);
}

@media (hover: hover) {
  .pkg:hover .pkg__cb {
    transform: translateY(-3px);
  }

  .pkg:hover .pkg__cb::after {
    background-position: -30% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pkg__cb,
  .pkg__cb::after {
    transition: none;
  }
}

/* Text */
.pkg__head {
  display: grid;
  gap: var(--space-1);
}

.pkg__name {
  margin: 0;
  font-size: var(--text-h3);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.pkg__for {
  margin: 0;
  color: var(--fg-muted);
}

.pkg__specs {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  align-content: start;
}

.pkg__spec {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: var(--space-3);
  align-items: baseline;
}

.pkg__spec dt {
  font-size: var(--text-small);
  color: var(--fg-muted);
}

.pkg__spec dd {
  margin: 0;
  font-weight: 500;
  min-width: 0;
}

/* Price */
.pkg__price {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}

/* The parts never break inside; on a narrow card "· omezený počet" moves to the next line as a whole */
.pkg__tag {
  --tag-color: var(--fg-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 0.5em;
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--fg);
}

.pkg__tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tag-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tag-color) 18%, transparent);
}

.pkg__tag--intro {
  --tag-color: var(--tier-intro);
}

.pkg__tag--special {
  --tag-color: var(--tier-special);
}

.pkg__tag > span {
  white-space: nowrap;
}

.pkg__tag-note {
  font-weight: 400;
  color: var(--fg-muted);
}

.pkg__amount {
  font-size: clamp(2rem, 1.6rem + 1.4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pkg__fine {
  font-size: var(--text-small);
  color: var(--fg-muted);
}

.pkg__was {
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

.pkg__cta .btn {
  width: 100%;
}

/* Special: dark glass front with the LED line inside, like the unit itself */
.pkg--special {
  --pkg-numeral: color-mix(in srgb, var(--led-500) 16%, transparent);
  --led-inset: 7px;
  --led-radius: 10px;
  --led-width: 2px;
  --pkg-shadow: inset 0 0 0 1px #2c3137, 0 40px 70px -40px rgb(0 0 0 / 0.7);
  --pkg-shadow-hover: inset 0 0 0 1px #3a414a, 0 40px 70px -40px rgb(0 0 0 / 0.7), 0 30px 56px -26px rgb(49 187 238 / 0.5);
  background: linear-gradient(160deg, #262a2f 0%, #15181b 45%, #0c0e10 100%);
}

/* The picture stays inside the LED line (line inset + its width), not out to the glass edge */
.pkg--special .pkg__visual {
  --pkg-led-edge: calc(var(--led-inset) + var(--led-width));
  margin: var(--pkg-led-edge) calc(var(--pkg-pad) * -1 + var(--pkg-led-edge)) 0;
  border-radius: calc(var(--led-radius) - var(--pkg-led-edge)) calc(var(--led-radius) - var(--pkg-led-edge)) 0 0;
  border-bottom-color: #2c3137;
}

/* The LED line inside the glass lights up only on hover or keyboard focus */
.pkg--special .led-frame__light {
  opacity: 0;
}

.pkg--special:focus-within .led-frame__light {
  opacity: 1;
}

@media (hover: hover) {
  .pkg--special:hover .led-frame__light {
    opacity: 1;
  }
}

.pkg--special .pkg__price {
  border-top-color: #2c3137;
}

/* Compact, for a row of five */
.pkg--compact {
  --pkg-pad: var(--space-4);
  --pkg-visual-h: 180px;
  gap: var(--space-4);
}

.pkg--compact .pkg__kw {
  font-size: 5.5rem;
}

.pkg--compact .pkg__name {
  font-size: 1.25rem;
}

.pkg--compact .pkg__spec {
  grid-template-columns: 1fr;
  gap: 0;
}

/* Why a reservation was refused, under the button */
.pkg__msg {
  margin: var(--space-3) 0 0;
  font-size: var(--text-small);
  line-height: 1.4;
  color: var(--red-600, #c9262f);
}
.pkg--special .pkg__msg {
  color: #ff8a8f;
}

/* Ribbon: a short stock note pinned to the top-left of the picture ("Skladem", "Skladem 12/2026").
   Set per card with data-ribbon on the article; site.js renders it. A text with a date is "soon" (amber),
   a plain one is "now" (LED blue). Light glass on light cards, dark glass on the price cards. */
.pkg__ribbon {
  --ribbon-dot: var(--led-500);
  position: absolute;
  top: 14px;
  left: calc(var(--pkg-pad) - 2px);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--fg);
  background: rgb(255 255 255 / 0.78);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.7), 0 6px 16px -10px rgb(0 0 0 / 0.45);
}
.pkg__ribbon::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ribbon-dot);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ribbon-dot) 22%, transparent), 0 0 10px var(--ribbon-dot);
}
.pkg__ribbon[data-tone="soon"] {
  --ribbon-dot: var(--amber-500);
}
.pkg--special .pkg__ribbon {
  color: #f6f7f9;
  background: rgb(22 26 31 / 0.72);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.12), inset 0 0 0 1px rgb(255 255 255 / 0.08), 0 8px 18px -10px rgb(0 0 0 / 0.7);
}
