/* Scoped corrections after visual QA. */

/* --------------------------------------------------------------------------
   Facts grid (/vite-ze): empty .image collapses absolute .info overlays
   -------------------------------------------------------------------------- */
.facts.list .items {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.facts.list .items::after {
  content: none;
}

.facts.list .item {
  float: none;
  width: calc(25% - 9px);
  margin-right: 0;
  margin-bottom: 0;
  box-sizing: border-box;
  background: #2f2f2f;
}

.facts.list .item a {
  display: block;
  position: relative;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
}

.facts.list .item .image {
  display: block;
  float: none;
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  background-color: #3d3d3d;
  background-size: cover;
  background-position: center;
}

.facts.list .item .image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  vertical-align: top;
}

.facts.list .item .image:before {
  z-index: 1;
  background: rgba(0, 0, 0, 0.45);
}

.facts.list .item .info {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  height: auto;
  padding: 16px;
  box-sizing: border-box;
  text-align: center;
  color: #fff;
  z-index: 2;
}

.facts.list .item .info:before {
  display: none;
}

.facts.list .item .info .inner {
  display: block;
  width: 100%;
  vertical-align: initial;
}

.facts.list .item .info .label {
  display: inline-block;
  color: #fff;
  font-size: 1.25em;
  font-weight: 300;
  background: #e59904;
  width: auto;
  min-width: 3.2em;
  padding: 4px 10px;
  margin-bottom: 10px;
}

.facts.list .item .info .title {
  color: #fff;
  font-size: 1em;
  font-weight: 400;
  line-height: 1.35;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.facts.list .item:hover .info {
  opacity: 1;
}

.facts.list .item:hover .image:before {
  background: rgba(0, 0, 0, 0.25);
}

/* --------------------------------------------------------------------------
   Equipments grid (/profi-vybava-galerie): empty .image breaks 2-col row
   -------------------------------------------------------------------------- */
.equipments.list .items {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.equipments.list .item {
  float: none;
  width: calc(50% - 6px);
  margin-right: 0;
  margin-bottom: 0;
  box-sizing: border-box;
  display: flex;
}

.equipments.list .item a {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  min-height: 150px;
  box-sizing: border-box;
}

.equipments.list .item .image {
  float: none;
  flex: 0 0 42%;
  width: 42%;
  min-height: 150px;
  background-color: #f0f0f0;
  background-size: cover;
  background-position: center;
  position: relative;
}

.equipments.list .item .image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.equipments.list .item .info {
  float: none;
  flex: 1 1 auto;
  width: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  position: relative;
  padding: 16px;
}

.equipments.list .item .info .buttons {
  position: static;
  width: auto;
  margin-top: 12px;
}

/* Responsive overrides for the flex grids */
@media all and (max-width: 1200px) {
  .facts.list .item {
    width: calc(33.333% - 8px);
  }
}

@media all and (max-width: 900px) {
  .facts.list .item {
    width: calc(50% - 6px);
  }

  .equipments.list .item {
    width: 100%;
  }
}

@media all and (max-width: 600px) {
  .facts.list .item {
    width: 100%;
  }

  .equipments.list .item a {
    flex-direction: column;
  }

  .equipments.list .item .image {
    flex: 0 0 auto;
    width: 100%;
    min-height: 160px;
    padding-bottom: 56%;
    height: 0;
  }
}

/* --------------------------------------------------------------------------
   Missing / empty image tiles — keep card layout readable
   -------------------------------------------------------------------------- */
.image.img-missing,
.post.img-missing > a > .image,
.item.img-missing .image,
.image:empty {
  background-color: #4a4a4a !important;
  background-image:
    linear-gradient(135deg, rgba(229, 153, 4, 0.35), rgba(47, 47, 47, 0.9)),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 8px,
      rgba(255, 255, 255, 0.04) 8px,
      rgba(255, 255, 255, 0.04) 16px
    ) !important;
  background-size: cover !important;
}

.posts .post .image.img-missing,
.posts .post .image:empty {
  min-height: 160px;
}

.posts .post[style*="background-image"].img-missing,
.posts .post.first.img-missing {
  background-color: #3a3a3a !important;
}

.mainImage.img-missing {
  min-height: 280px;
  background-color: #3a3a3a;
}
