/* o nás fotky */
.f1-history-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 34px 0;
}

.f1-history-photo {
    width: calc((100% - 40px) / 3);
    height: 180px;
    margin: 0;
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(20, 55, 85, 0.12);
}

.f1-history-photo:nth-child(4),
.f1-history-photo:nth-child(5) {
    width: calc((100% - 20px) / 2);
    height: 220px;
}

.f1-history-photo a {
    display: block;
    width: 100%;
    height: 100%;
}

.f1-history-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.f1-history-photo:nth-child(4) img {
    object-position: center 30%;
}

@media (max-width: 800px) {
    .f1-history-photo,
    .f1-history-photo:nth-child(4),
    .f1-history-photo:nth-child(5) {
        width: calc((100% - 20px) / 2);
        height: 190px;
    }
}

@media (max-width: 520px) {
    .f1-history-photo,
    .f1-history-photo:nth-child(4),
    .f1-history-photo:nth-child(5) {
        width: 100%;
        height: 220px;
    }
}

.f1-references {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 16px;
}

.f1-references h1 {
  margin: 0 0 32px;
  text-align: center;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.2;
  color: #222;
}

.f1-reference-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.f1-reference-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: #222;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.f1-reference-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.1);
}

.f1-reference-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #f4f4f4;
}

.f1-reference-card span {
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500;
}

@media (max-width: 900px) {
  .f1-reference-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .f1-reference-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .f1-references {
    padding: 28px 12px;
  }
}

/* VIDEA */

.f1-reference-videos {
    margin-top: 60px;
}

.f1-reference-videos h2 {
    text-align: center;
    margin-bottom: 30px;
}

.f1-video-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.f1-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

.f1-video iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.f1-history-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.f1-history-gallery--two {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 34px;
}

.f1-hp-1,
.f1-hp-2,
.f1-hp-3,
.f1-hp-4,
.f1-hp-5 {
    height: 260px;
    border-radius: 22px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 18px 45px rgba(20, 55, 85, 0.12);
    transition: transform 0.35s ease;
}

.f1-hp-1 { background-image: url('/user/documents/upload/design-files/o-nas/budova_stara.jpg'); }
.f1-hp-2 { background-image: url('/user/documents/upload/design-files/o-nas/fotka_budovy_3.jpg'); }
.f1-hp-3 { background-image: url('/user/documents/upload/design-files/o-nas/budova1.jpg'); }
.f1-hp-4 { background-image: url('/user/documents/upload/design-files/o-nas/budova2.jpg'); }
.f1-hp-5 { background-image: url('/user/documents/upload/design-files/o-nas/F1_na_web3.jpg'); }

.f1-hp-1:hover,
.f1-hp-2:hover,
.f1-hp-3:hover,
.f1-hp-4:hover,
.f1-hp-5:hover {
    transform: scale(1.02);
}

@media (max-width: 768px) {
    .f1-history-gallery,
    .f1-history-gallery--two {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .f1-history-gallery,
    .f1-history-gallery--two {
        grid-template-columns: 1fr;
    }
}