.mu-demo-card-link,
.mu-demo-collection-card-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.mu-demo-card,
.mu-demo-collection-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  background: #fff;
  padding: 12px;
  /* Admin > Nastavení portálu > Šablona > Karty > Stín karet */
  box-shadow: var(--card-shadow, 0 10px 26px rgba(32, 20, 10, 0.10));
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.mu-demo-card-link:hover .mu-demo-card,
.mu-demo-card-link:focus .mu-demo-card,
.mu-demo-card-link:focus-visible .mu-demo-card,
.mu-demo-collection-card-link:hover .mu-demo-collection-card,
.mu-demo-collection-card-link:focus .mu-demo-collection-card,
.mu-demo-collection-card-link:focus-visible .mu-demo-collection-card {
  transform: translateY(-6px);
  box-shadow: var(--card-shadow-hover, 0 18px 38px rgba(32, 20, 10, 0.16));
}

.mu-demo-card-image,
.mu-demo-collection-card-image {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: -12px -12px 14px -12px;
}

/* Admin > Nastavení portálu > Šablona > Karty > Výška obrázku v kartě */
.mu-demo-card-image {
  height: var(--card-image-height, 320px);
}

.mu-demo-collection-card-image {
  height: 380px;
}

/* The "no photo" fallback (portal logo, @listItem.latte) only — real item photos keep filling
   the card edge-to-edge via the plain rule below. Specificity (0,2,1) so it reliably wins over
   that rule's width/max-width/max-height regardless of source order. */
.mu-demo-card-image img.mu-demo-card-image__placeholder {
  width: calc(100% - 10px);
  max-width: calc(100% - 10px);
  max-height: calc(100% - 10px);
}

.mu-demo-card-image img,
.mu-demo-collection-card-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.mu-demo-card-body,
.mu-demo-collection-card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mu-demo-card-body {
  justify-content: flex-start;
}

/* Long titles (including a single very long unspaced "word", which -webkit-line-clamp alone
   won't wrap on its own) truncate to an ellipsis after 2 lines instead of overflowing past the
   card's edge into whatever sits next to it. word-break lets a too-long word itself break
   rather than forcing the line wider than the card. */
.mu-demo-card-title,
.mu-demo-collection-card-title {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.mu-demo-card-title {
  margin: 0;
  font-weight: 700;
  line-height: 1.35;
  min-height: 2.9em;
}

.mu-demo-collection-card-title {
  margin: 0;
  font-weight: 700;
  line-height: 1.35;
  min-height: 3.2em;
}

.mu-demo-card-meta {
  margin: 0;
  color: #6f655c;
  line-height: 1.45;
  min-height: 2.1em;
}

.mu-demo-collection-card-meta {
  margin: 0;
  color: #6f655c;
  line-height: 1.45;
  min-height: 2.2em;
}

.mu-demo-card-action,
.mu-demo-collection-card-action {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.mu-demo-card-link:hover .mu-demo-card-action,
.mu-demo-card-link:focus .mu-demo-card-action,
.mu-demo-card-link:focus-visible .mu-demo-card-action,
.mu-demo-collection-card-link:hover .mu-demo-collection-card-action,
.mu-demo-collection-card-link:focus .mu-demo-collection-card-action,
.mu-demo-collection-card-link:focus-visible .mu-demo-collection-card-action {
  opacity: 1;
  transform: translateY(0);
}

.mu-demo-card-action-label,
.mu-demo-collection-card-action-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  padding: 10px 16px;
  border: 0;
  background: #111;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.mu-demo-card-column,
.mu-demo-collection-card-column {
  display: flex;
  margin-bottom: 12px;
}

/* Admin > Nastavení portálu > Šablona > Mřížky a výpisy — počet sloupců předmětů/kolekcí,
   jen na widescreenu (992px = stejný breakpoint, kde sdílené portal/frontend/css/styles.css
   samo přechází z fixního 2sloupcového tabletového layoutu na svoje .col--N hodnoty; pod tím
   necháváme 1/2 sloupce beze změny, ať zůstane responzivní chování jako dřív).
   flex-basis:auto je nutné vedle width — jinak by pořád platila .col{flex:1 0 100%} základní
   hodnota (100%) místo width, stejně jako to řeší sdílené .col--N pravidlo, které přepisuje. */
@media (min-width: 992px) {
  .mu-demo-card-column {
    flex-basis: auto;
    width: calc(100% / var(--items-columns, 6));
  }

  .mu-demo-collection-card-column {
    flex-basis: auto;
    width: calc(100% / var(--collections-columns, 3));
  }

  /* Vyšší specificita (2 třídy) než .mu-demo-collection-card-column výše — homepage sekce
     "Kolekce" (@collections.latte) tak má vlastní počet sloupců nezávisle na obecném výpisu
     kolekcí (Collection.list.latte), který tenhle modifikátor nemá. */
  .mu-homepage-collections-column {
    flex-basis: auto;
    width: calc(100% / var(--homepage-collections-columns, 3));
  }
}