.publitas__container {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
}

/* Featured catalog section */
.publitas__featured {
  margin-bottom: 20px;
  max-width: 450px;
  max-height: calc(100vh - 400px);
  margin-left: auto;
  margin-right: auto;
  flex-shrink: 1;
  min-height: 250px;
  display: flex;
}

.publitas__featured-link {
  display: flex;
  flex-direction: column;
  background: #fff;
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.publitas__featured-link:hover {
  opacity: 0.9;
}

.publitas__featured-link img {
  width: 100%;
  flex-shrink: 1;
  object-fit: contain;
  display: block;
  min-height: 0;
}

.publitas__featured-link .publitas__catalog-title {
  flex-shrink: 0;
}

.publitas__catalog-title {
  text-align: center;
  margin-top: 7px;
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

/* Thumbnails section */
.publitas__thumbnails {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  flex-shrink: 0;
  padding: 20px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
}

.publitas__thumbnail-item {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.publitas__thumbnail-item:hover {
  opacity: 0.9;
}

.publitas__thumbnail-item .publitas__catalog-title {
  font-size: 12px;
  width: 120px;
}

.publitas__thumbnail-box {
  width: 120px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  position: relative;
  overflow: hidden;
}

.publitas__thumbnail-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.publitas__thumbnail-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.publitas__thumbnail-placeholder .publitas__thumbnail-box {
  background: #e9ecef;
}

/* Stacked embeds for mobile */
.publitas__embeds {
  display: none;
}

/* Modal Overlay */
.publitas__modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.publitas__modal.active {
  display: block;
  opacity: 1;
}

.publitas__modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.publitas__modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  font-size: 36px;
  line-height: 1;
  color: #333;
  cursor: pointer;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

@media (max-width: 576px) {
  .publitas__modal-close {
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    font-size: 32px;
  }
}

@media (max-width: 992px) {
  .publitas__container {
    margin: 20px;
    max-height: none;
  }
  
  /* Hide featured and thumbnails on mobile */
  .publitas__featured,
  .publitas__thumbnails {
    display: none;
  }
  
  /* Show stacked embeds on mobile */
  .publitas__embeds {
    display: flex;
    flex-direction: column;
    justify-content:center;
    gap: 20px;
    padding: 0 90px;
  }
  
  .publitas__embeds > div {
    max-width: 250px;
  }
  
  /* Hide desktop modal on mobile */
  .publitas__modal {
    display: none !important;
  }
  
  .publitas__featured {
    display: none;
  }
  
  .publitas__thumbnails {
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: transparent;
    border: none;
    padding: 0;
  }
  
  .publitas__thumbnail-item {
    width: 100%;
    max-width: 250px;
  }
  
  .publitas__thumbnail-box {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    overflow: hidden;
  }
  
  .publitas__thumbnail-item .publitas__catalog-title {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .publitas__thumbnail-item {
    max-width: 200px;
  }
  
  .publitas__thumbnails {
    gap: 12px;
  }
  
  .publitas__thumbnail-label {
    font-size: 12px;
    padding: 4px 10px;
  }
}
