/* ───────────────────────────────────────────────────
   SINGLE PLACE — local styles (inherits main.css vars)
   ─────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroPan {
  0%   { background-position: center 48%; }
  100% { background-position: center 52%; }
}

/* ── BACK LINK ── */
.sp-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 40px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text-muted);
  font-size: 13px;
  transition: all .2s;
  margin-top: 24px;
}
.sp-back:hover { background: rgba(255,255,255,.1); color: var(--text); }

/* ══════════════════════════════════════════════════
   AIRBNB-STYLE PHOTO GALLERY — flat grid, no nesting
   ══════════════════════════════════════════════════ */
.sp-gallery-wrap {
  position: relative;
  margin-top: 20px;
  animation: fadeUp .5s ease both;
}

/*
  Dùng grid 3 cột × 2 hàng làm base cho 4-5 ảnh.
  Mỗi layout override lại columns/rows + vị trí cell.
  Không dùng sub-grid lồng nhau — tất cả cell là direct children.
*/
.sp-gallery {
  display: grid;
  gap: 6px;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

/* ──────────────────────────────────────────────
   1 ảnh: 1 cột × 1 hàng, full width
   ────────────────────────────────────────────── */
.sp-gallery.count-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 480px;
}

/* ──────────────────────────────────────────────
   2 ảnh: trái lớn | phải 1
   [  0  ][  1  ]
   ────────────────────────────────────────────── */
.sp-gallery.count-2 {
  grid-template-columns: 1.45fr 1fr;
  grid-template-rows: 460px;
}

/* ──────────────────────────────────────────────
   3 ảnh: trái lớn | phải trên + phải dưới
   [  0  ][ 1 ]
   [  0  ][ 2 ]
   ────────────────────────────────────────────── */
.sp-gallery.count-3 {
  grid-template-columns: 1.45fr 1fr;
  grid-template-rows: 232px 228px;
}
.sp-gallery.count-3 .cell-0 {
  grid-column: 1; grid-row: 1 / 3;
}
.sp-gallery.count-3 .cell-1 { grid-column: 2; grid-row: 1; }
.sp-gallery.count-3 .cell-2 { grid-column: 2; grid-row: 2; }

/* ──────────────────────────────────────────────
   4 ảnh: trái lớn | phải: 1 trên, 2 dưới ngang
   [  0  ][ 1  ]
   [  0  ][ 2 ][ 3 ]  ← 3 cột
   ────────────────────────────────────────────── */
.sp-gallery.count-4 {
  grid-template-columns: 1.45fr 1fr 1fr;
  grid-template-rows: 232px 228px;
}
.sp-gallery.count-4 .cell-0 {
  grid-column: 1; grid-row: 1 / 3;
}
.sp-gallery.count-4 .cell-1 { grid-column: 2 / 4; grid-row: 1; }
.sp-gallery.count-4 .cell-2 { grid-column: 2;     grid-row: 2; }
.sp-gallery.count-4 .cell-3 { grid-column: 3;     grid-row: 2; }

/* ──────────────────────────────────────────────
   5 ảnh: chuẩn Airbnb
   [    0    ][ 1 ][ 2 ]
   [    0    ][ 3 ][ 4 ]
   ────────────────────────────────────────────── */
.sp-gallery.count-5 {
  grid-template-columns: 1.45fr 1fr 1fr;
  grid-template-rows: 232px 228px;
}
.sp-gallery.count-5 .cell-0 {
  grid-column: 1; grid-row: 1 / 3;
}
.sp-gallery.count-5 .cell-1 { grid-column: 2; grid-row: 1; }
.sp-gallery.count-5 .cell-2 { grid-column: 3; grid-row: 1; }
.sp-gallery.count-5 .cell-3 { grid-column: 2; grid-row: 2; }
.sp-gallery.count-5 .cell-4 { grid-column: 3; grid-row: 2; }

/* ── Cell cơ bản ── */
.sp-gallery-cell {
  position: relative;
  overflow: hidden;
  background: var(--bg-card-2);
  cursor: pointer;
  /* Đảm bảo img fill đúng khi cell bị grid stretch */
  min-height: 0;
  min-width: 0;
}
.sp-gallery-cell img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .5s ease;
}
.sp-gallery-cell:hover img { transform: scale(1.04); }

/* Overlay "+X ảnh" ô cuối */
.sp-gallery-more-btn {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.52);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
  transition: background .2s;
}
.sp-gallery-more-btn:hover { background: rgba(0,0,0,.36); }
.sp-gallery-more-btn span {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.28);
  color: #fff; font-size: 13px; font-weight: 700;
  padding: 8px 18px; border-radius: 30px;
  backdrop-filter: blur(8px);
}

/* Nút "Hiển thị tất cả ảnh" — góc phải dưới, style Airbnb */
.sp-gallery-all-btn {
  position: absolute;
  bottom: 16px; right: 16px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.12);
  color: #111; font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: background .2s;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.sp-gallery-all-btn:hover { background: #fff; color: #000; }

/* Lightbox overlay */
.sp-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.95);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  flex-direction: column;
  gap: 16px;
}
.sp-lightbox.active { display: flex; }
.sp-lightbox-img {
  max-width: 90vw;
  max-height: 75vh;
  border-radius: 12px;
  object-fit: contain;
}
.sp-lightbox-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.sp-lb-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.sp-lb-btn:hover { background: rgba(255,255,255,.22); }
.sp-lb-counter { font-size: 14px; color: rgba(255,255,255,.6); min-width: 60px; text-align: center; }
.sp-lb-close {
  position: absolute;
  top: 20px; right: 24px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff; font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* HERO — giữ nguyên nhưng chỉ dùng khi không có gallery */
.sp-hero {
  position: relative;
  height: 420px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-top: 24px;
  background-image: url('<?php echo esc_url($image_url); ?>');
  background-size: cover;
  background-position: center;
  animation: heroPan 8s ease-in-out infinite alternate;
}
.sp-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(11,13,20,.95) 0%, rgba(11,13,20,.3) 60%, transparent 100%);
}
.sp-hero-content {
  position: absolute;
  bottom: 28px; left: 32px; right: 32px;
}
.sp-hero-content .tag-trending { margin-bottom: 10px; display: inline-block; }
.sp-hero-title {
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 800;
  margin: 0 0 12px;
  line-height: 1.2;
  text-shadow: 0 2px 20px rgba(0,0,0,.6);
}
.sp-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Badge */
.sp-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.1);
}
.sp-badge.is-open   { color: #4ade80; border-color: rgba(74,222,128,.3);  background: rgba(74,222,128,.12); }
.sp-badge.is-closed { color: #ff4757; border-color: rgba(255,71,87,.3);   background: rgba(255,71,87,.12); }
.sp-badge.area      { color: var(--primary-blue); }
.sp-badge.svc       { color: var(--primary-pink); }

/* Title block dưới gallery (Airbnb style) */
.sp-title-block {
  padding: 20px 0 4px;
  animation: fadeUp .5s .05s ease both;
}
.sp-title-block h1 {
  font-size: clamp(22px, 3.5vw, 36px);
  font-weight: 800; margin: 0 0 10px; line-height: 1.2;
}
.sp-meta-inline {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px; font-size: 13px; color: var(--text-muted);
}
.sp-meta-inline .sep { opacity: .3; }
.sp-meta-inline .status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.sp-meta-inline .status-pill.is-open   { color: #4ade80; background: rgba(74,222,128,.12); border: 1px solid rgba(74,222,128,.25); }
.sp-meta-inline .status-pill.is-closed { color: #ff4757; background: rgba(255,71,87,.12);  border: 1px solid rgba(255,71,87,.25); }

/* LAYOUT */
.sp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 28px;
  margin: 28px 0 80px;
  align-items: start;
  animation: fadeUp .5s .1s ease both;
}

.sp-sidebar,
.sp-right {
  position: sticky;
  top: 24px;
}

/* GLASS CARD */
.sp-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.sp-card:last-child { margin-bottom: 0; }

.sp-card-title {
  font-size: 13px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--primary-blue);
  margin: 0 0 16px;
  display: flex; align-items: center; gap: 8px;
}
.sp-card-title::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(255,255,255,.07);
}

/* INFO ROWS */
.sp-info-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: 14px;
}
.sp-info-row:last-child { border-bottom: 0; padding-bottom: 0; }
.sp-info-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.sp-info-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.sp-info-value { color: var(--text); font-weight: 500; line-height: 1.4; }

/* STARS ROW */
.sp-stars-row  { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.sp-rating-num { font-size: 28px; font-weight: 800; color: #f1c40f; line-height: 1; }
.sp-rating-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* MAP BUTTON */
.btn-maps {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px; border-radius: 12px;
  background: linear-gradient(90deg, #d63384, #8e44ad);
  color: #fff; font-weight: 700; font-size: 14px;
  text-decoration: none; margin-top: 6px;
  transition: opacity .2s, transform .2s;
  box-shadow: 0 4px 20px rgba(214,51,132,.25);
}
.btn-maps:hover { opacity: .9; transform: translateY(-1px); }

.btn-maps-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px; border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text-muted); font-size: 13px;
  text-decoration: none; margin-top: 8px;
  transition: background .2s, color .2s;
}
.btn-maps-secondary:hover { background: rgba(255,255,255,.1); color: var(--text); }

/* CONTENT */
.sp-post-content {
  font-size: 15px; line-height: 1.85;
  color: #cbd5e1; font-weight: 300;
}
.sp-post-content p   { margin: 0 0 16px; }
.sp-post-content img { max-width: 100%; border-radius: var(--radius-md); margin: 12px 0; }
.sp-post-content h2,
.sp-post-content h3  { color: var(--text); font-weight: 700; margin: 24px 0 10px; }
.sp-post-content a   { color: var(--primary-blue); text-decoration: underline; }

/* EMPTY */
.sp-empty-content {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 40px 20px;
  color: var(--text-muted); text-align: center; gap: 10px;
}
.sp-empty-content span { font-size: 36px; }
.sp-empty-content p    { font-size: 14px; margin: 0; font-weight: 300; }

/* TAXONOMY TAGS */
.sp-tax-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.sp-tax-tag {
  padding: 5px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text-muted); text-decoration: none;
  transition: all .2s;
}
.sp-tax-tag:hover { background: rgba(255,255,255,.12); color: var(--text); }
.sp-tax-tag.area  { border-color: rgba(45,170,225,.3); color: var(--primary-blue); }
.sp-tax-tag.svc   { border-color: rgba(244,114,182,.3); color: var(--primary-pink); }

/* DIVIDER */
.sp-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,.08), transparent);
  margin: 24px 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sp-layout { grid-template-columns: 1fr; gap: 0; }
  /* Thu nhỏ chiều cao các hàng */
  .sp-gallery.count-1 { grid-template-rows: 320px; }
  .sp-gallery.count-2 { grid-template-rows: 280px; }
  .sp-gallery.count-3,
  .sp-gallery.count-4,
  .sp-gallery.count-5 { grid-template-rows: 190px 170px; }
}

@media (max-width: 640px) {
  /* Mobile: chỉ hiện ảnh chính full width */
  .sp-gallery {
    grid-template-columns: 1fr !important;
    grid-template-rows: 260px !important;
  }
  .sp-gallery > .sp-gallery-cell:not(.cell-0) { display: none !important; }
  .sp-gallery .cell-0 {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }
  .sp-gallery-all-btn { bottom: 10px; right: 10px; font-size: 12px; padding: 6px 12px; }
}
@media (max-width: 480px) {
  .sp-gallery { grid-template-rows: 220px; }
  .sp-card    { padding: 18px; }
  .sp-rating-num { font-size: 22px; }
}


.hosp-fave-btn{
  position: absolute; /* Essential for top/right to work */
  top: 0.75rem;       /* top-3 (3 * 0.25rem) */
  right: 0.75rem;     /* right-3 (3 * 0.25rem) */
  z-index: 20;        /* z-20 */

  /* Spacing & Shape */
  padding: 0.5rem;    /* p-2 (2 * 0.25rem) */
  border-radius: 9999px; /* rounded-full */

  /* Visuals & Effects */
  transition-all: all 150ms cubic-bezier(0.4, 0, 0.2, 1); /* transition-all default */
  border: 1px solid;  /* border */
  backdrop-filter: blur(12px); /* backdrop-blur-md */
  border-color: rgba(255, 255, 255, 0.1); /* border-white/10 */
}