/**
 * Travel Posts Grid Block
 * Desktop: Grid 3-4 columnas
 * Mobile: Swiper 1-2 slides
 */

/* =========================================================
   DESKTOP GRID
========================================================= */

.travel-posts-grid-block {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
}

.tpg-grid {
  display: grid;
  grid-template-columns: repeat(var(--desktop-columns, 3), 1fr);
  gap: 24px;
  width: 100%;
}

@media (min-width: 1024px) {
  .tpg-grid {
    display: grid !important;
  }
}

/* =========================================================
   CARD STYLES
========================================================= */

.tpg-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #f5f5f5;
  transition: transform 0.3s ease;
}

.tpg-card:hover {
  transform: translateY(-5px);
}

.tpg-card__thumb {
  position: relative;
  width: 100%;
  height: 270px;
  overflow: hidden;
}

.tpg-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.tpg-card:hover .tpg-card__thumb img {
  transform: scale(1.05);
}

/* Badge (Category) */
.tpg-card__badge {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(49, 26, 66, 0.65);
  color: #fff;
  padding: 4.5px 7px;
  border-radius: 22px;
  font-size: 12px;
  font-weight: 600;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Favorite Button */
.tpg-favorite-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: all 0.3s ease;
}

.tpg-favorite-btn:hover {
  background: #fff;
  transform: scale(1.1);
}

.tpg-favorite-btn svg {
  width: 16px;
  height: 15px;
}

.tpg-favorite-btn svg path {
  fill: transparent;
  stroke: #000;
  stroke-width: 1.2;
  transition: all 0.3s ease;
}

.tpg-favorite-btn:hover svg path,
.tpg-favorite-btn.is-active svg path {
  fill: #E78C85;
  stroke: #E78C85;
}

/* Overlay Content */
.tpg-card__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 70%, transparent 100%);
  color: #fff;
  padding: 20px;
  z-index: 2;
}

.tpg-card__title {
  font-size: 19px;
  font-weight: 900;
  margin: 0 0 20px 0;
  line-height: 19px;
  color: #fff;
  position: relative;
  display: block;
  text-align: left;
}

.tpg-card__title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 140px;
  padding: 0.1px;
  background: #fff;
}

.tpg-card__meta {
  margin-bottom: 6px;
}

.tpg-card__location {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

.tpg-card__location svg {
  width: 13px;
  height: 18px;
  flex-shrink: 0;
}

/* Bottom Row: Days + Button */
.tpg-card__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tpg-card__days {
  font-size: 19px;
  font-weight: 600;
  color: #fff;
}

.tpg-card__button {
  background: #E78C85;
  color: #fff;
  padding: 10px 24px;
  border-radius: 25px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-block;
}

.tpg-card__button:hover {
  background: #d97a74;
  color: #fff;
  text-decoration: none;
  transform: translateX(5px);
}

/* =========================================================
   MOBILE SWIPER
========================================================= */

.tpg-swiper-mobile {
  padding: 30px 20px 60px;
}

.tpg-swiper-mobile .tpg-card__thumb {
  height: 260px;
}

/* Desktop/Mobile visibility */
.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

@media (max-width: 1023px) {
  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: block;
  }

  /* Slides per view basado en data attribute */

  .tpg-card__thumb {
    height: 270px;
  }

  .tpg-card__title {
    font-size: 18px;
  }

  .tpg-card__button {
    padding: 8px 18px;
    font-size: 14px;
  }

  .tpg-card__days {
    font-size: 14px;
  }

  .tpg-card__badge {
    font-size: 12px;
    padding: 6px 12px;
  }
}

@media (max-width: 768px) {
  .tpg-card__thumb {
    height: 350px;
  }

  .tpg-card__overlay {
    padding: 20px;
  }

  .tpg-card__title {
    font-size: 18px;
  }

  .tpg-favorite-btn {
    width: 35px;
    height: 35px;
  }
}