/* ------------------------------------------------------------------ *
 *  Image galleries (home trending cards, dashboard destinations,
 *  and the admin location image manager)
 * ------------------------------------------------------------------ */

/* ---------- media wrapper (home) ---------- */
.dest-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #eef1f5;
}

/* ---------- slides ---------- */
.dest-slides {
  position: absolute;
  inset: 0;
}
.dest-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease;
}
.dest-slide.is-active {
  opacity: 1;
  visibility: visible;
}

/* neutralise the base card hover zoom so only the active slide scales */
.dest-card:hover .dest-slide,
.loc-card:hover .dest-slide {
  transform: none;
}
.dest-card:hover .dest-slide.is-active {
  transform: scale(1.05);
}
.loc-card:hover .dest-slide.is-active {
  transform: scale(1.06);
}

/* ---------- arrows ---------- */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  color: #0d1936;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease, transform 0.18s ease;
  box-shadow: 0 2px 8px rgba(13, 25, 54, 0.22);
  -webkit-user-select: none;
  user-select: none;
}
.dest-card:hover .gallery-arrow,
.loc-card:hover .gallery-arrow,
.gallery-arrow:focus-visible {
  opacity: 1;
}
.gallery-arrow--prev { left: 10px; }
.gallery-arrow--next { right: 10px; }
.gallery-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.08);
}
@media (hover: none) {
  .gallery-arrow { opacity: 1; }
}

/* ---------- dots ---------- */
.gallery-dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(13, 25, 54, 0.35);
}
.gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: width 0.18s ease, background 0.18s ease;
}
.gallery-dot.is-active {
  width: 18px;
  border-radius: 999px;
  background: #fff;
}

/* ---------- counter ---------- */
.gallery-count {
  position: absolute;
  right: 12px;
  bottom: 14px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(13, 25, 54, 0.45);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

/* ---------- admin image manager ---------- */
.img-manager {
  border: 1px solid var(--border, #e1e6ef);
  border-radius: 14px;
  background: #fafbfd;
  padding: 14px;
}
.img-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 0;
}
.img-tile {
  position: relative;
  width: 96px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #eef1f6;
  cursor: grab;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.img-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}
.img-tile.is-primary {
  border-color: var(--primary, #1668e3);
  box-shadow: 0 0 0 3px rgba(22, 104, 227, 0.18);
}
.img-tile.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}
.img-tile-remove,
.img-tile-star {
  position: absolute;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.img-tile:hover .img-tile-remove,
.img-tile:hover .img-tile-star,
.img-tile.is-primary .img-tile-star {
  opacity: 1;
}
.img-tile-remove {
  top: 5px;
  right: 5px;
  background: #d92d20;
  color: #fff;
  font-size: 15px;
  line-height: 1;
}
.img-tile-remove:hover { background: #b42318; transform: scale(1.1); }
.img-tile-star {
  bottom: 5px;
  left: 5px;
  background: rgba(255, 255, 255, 0.95);
  color: #b9c0cd;
}
.img-tile-star:hover { color: #f5b301; }
.img-tile.is-primary .img-tile-star { color: #f5b301; }

.img-dropzone {
  margin-top: 12px;
  border: 2px dashed #cdd4e0;
  border-radius: 12px;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  color: var(--muted, #6b7488);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.img-dropzone strong {
  color: var(--ink, #0d1936);
  font-size: 13.5px;
}
.img-dropzone span {
  font-size: 12px;
}
.img-dropzone svg {
  color: var(--primary, #1668e3);
  margin-bottom: 2px;
}
.img-dropzone:hover,
.img-dropzone.is-dragover {
  border-color: var(--primary, #1668e3);
  background: rgba(22, 104, 227, 0.05);
}
.img-dropzone:focus-visible {
  outline: none;
  border-color: var(--primary, #1668e3);
}

/* ---------- destination detail page (location.php) ---------- */
.loc-detail {
  padding: 28px 0 8px;
}
.loc-detail-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 13px;
}
.loc-detail-crumb a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--primary, #1668e3);
  font-weight: 600;
  text-decoration: none;
}
.loc-detail-crumb a:hover { text-decoration: underline; }
.loc-detail-crumb-sep { color: var(--muted, #6b7488); }
.loc-detail-crumb-current { color: var(--muted, #6b7488); }

.loc-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 28px;
  align-items: start;
}
.loc-detail-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 20px;
  background: #eef1f5;
  box-shadow: 0 14px 34px rgba(13, 25, 54, 0.12);
}
.loc-detail-gallery { min-width: 0; }
.loc-detail-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.loc-detail-thumb {
  position: relative;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #eef1f5;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.loc-detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.loc-detail-thumb:hover { transform: translateY(-1px); }
.loc-detail-thumb.is-active {
  border-color: var(--primary, #1668e3);
  box-shadow: 0 0 0 3px rgba(22, 104, 227, 0.2);
}
.loc-detail-fallback {
  position: absolute;
  inset: 0;
  display: block;
  background: linear-gradient(135deg, var(--navy, #0d1936) 0%, var(--primary, #1668e3) 100%);
}

.loc-detail-info {
  padding: 10px 4px;
}
.loc-detail-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.loc-detail-badges .loc-type-badge,
.loc-detail-badges .loc-rate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.loc-detail-badges .loc-type-badge {
  background: rgba(22, 104, 227, 0.1);
  color: var(--primary, #1668e3);
}
.loc-detail-badges .loc-rate-badge {
  background: rgba(245, 179, 1, 0.14);
  color: #a97d02;
}
.loc-detail-title {
  margin: 14px 0 4px;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.12;
  color: var(--ink, #0d1936);
}
.loc-detail-region {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  color: var(--muted, #6b7488);
  font-size: 14px;
}
.loc-detail-desc {
  margin: 0 0 20px;
  color: #3d4657;
  font-size: 14.5px;
  line-height: 1.65;
}
.loc-detail-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 14px 0;
  border-top: 1px solid var(--border, #e1e6ef);
  border-bottom: 1px solid var(--border, #e1e6ef);
}
.loc-detail-price small { color: var(--muted, #6b7488); font-size: 13px; }
.loc-detail-price strong {
  color: var(--ink, #0d1936);
  font-size: 24px;
  letter-spacing: -0.3px;
}
.loc-detail-price em { color: var(--muted, #6b7488); font-style: normal; font-size: 13px; }
.loc-detail-book {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 13px 26px;
  border-radius: 13px;
  background: var(--primary, #1668e3);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(22, 104, 227, 0.3);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.loc-detail-book:hover {
  background: var(--primary-dark, #0f54b8);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(22, 104, 227, 0.34);
}
.loc-detail-book svg { transition: transform 0.15s; }
.loc-detail-book:hover svg { transform: translateX(3px); }
.loc-detail-hint {
  margin: 12px 0 0;
  max-width: 340px;
  color: var(--muted, #6b7488);
  font-size: 12.5px;
  line-height: 1.5;
}

.loc-detail-related {
  padding-top: 34px;
  padding-bottom: 56px;
}

/* not-found state reuses the loc-empty block from the member pages */
.loc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 20px;
  gap: 4px;
}
.loc-empty-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(22, 104, 227, 0.08);
  color: var(--primary, #1668e3);
  margin-bottom: 10px;
}
.loc-empty h3 { margin: 0 0 4px; color: var(--ink, #0d1936); }
.loc-empty p { margin: 0 0 16px; color: var(--muted, #6b7488); }

@media (max-width: 860px) {
  .loc-detail-grid { grid-template-columns: 1fr; }
  .loc-detail-media { aspect-ratio: 16 / 11; }
}
