/* Hotel cards of list.php: the pictures of a hotel scroll sideways inside the card, a click on one opens the gallery (assets/js/list-gallery.js) */
.hcg-track { position: absolute; inset: 0; display: flex; direction: ltr; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.hcg-track::-webkit-scrollbar { display: none; }
.hcg-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; background: #f3f4f6; }
.hcg-slide img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; }
.hcg-on .hcg-track { cursor: zoom-in; }

.hcg-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; display: none; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 999px; background: rgba(255,255,255,.85); color: #1f2937; box-shadow: 0 2px 8px rgba(0,0,0,.25); cursor: pointer; opacity: 0; transition: opacity .2s, background .2s; }
.hcg-btn:hover { background: #fff; }
.hcg-btn:disabled { cursor: default; opacity: 0 !important; }
.hcg-prev { left: 8px; }
.hcg-next { right: 8px; }
.hcg-on .hcg-btn { display: flex; }
.hcg-on:hover .hcg-btn:not(:disabled), .hcg-on:focus-within .hcg-btn:not(:disabled) { opacity: 1; }
@media (hover: none) { .hcg-on .hcg-btn:not(:disabled) { opacity: 1; } } /* no hover on a phone: the buttons are always there */

.hcg-count { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 2; display: none; padding: 2px 10px; border-radius: 999px; background: rgba(0,0,0,.45); color: #fff; font-size: 12px; line-height: 20px; white-space: nowrap; pointer-events: none; backdrop-filter: blur(4px); }
.hcg-on .hcg-count { display: block; opacity: 0; transition: opacity .2s; }
.hcg-on:hover .hcg-count, .hcg-on:focus-within .hcg-count { opacity: 1; } /* the counter only shows while the pointer is on the pictures */
@media (hover: none) { .hcg-on .hcg-count { opacity: 1; } } /* a phone has no hover: it stays */

/* the gallery */
.hcg-lb { overscroll-behavior: contain; position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column; background: rgba(0,0,0,.92); color: #fff; direction: ltr; font-family: "IRANYekanXFaNum", "IRANYekan", sans-serif; }
.hcg-lb[hidden] { display: none; }
.hcg-lb__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; direction: rtl; }
.hcg-lb__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 15px; }
.hcg-lb__count { font-size: 13px; opacity: .85; white-space: nowrap; }
.hcg-lb__close, .hcg-lb__nav { display: flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; transition: background .2s; }
.hcg-lb__close:hover, .hcg-lb__nav:hover { background: rgba(255,255,255,.3); }
.hcg-lb__close { width: 38px; height: 38px; flex: none; }
.hcg-lb__stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 64px; touch-action: pan-y; }
.hcg-lb__img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; user-select: none; -webkit-user-drag: none; transition: opacity .2s; }
.hcg-lb__img.is-loading { opacity: .25; }
.hcg-lb__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; }
.hcg-lb__nav:disabled { opacity: .25; cursor: default; }
.hcg-lb__prev { left: 10px; }
.hcg-lb__next { right: 10px; }
.hcg-lb__thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px 14px; scrollbar-width: thin; }
.hcg-lb__thumb { flex: none; width: 84px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: #222; cursor: pointer; opacity: .6; transition: opacity .2s, border-color .2s; }
.hcg-lb__thumb:hover { opacity: 1; }
.hcg-lb__thumb.is-active { opacity: 1; border-color: #fff; }
.hcg-lb__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) {
    .hcg-lb__stage { padding: 0 8px; }
    .hcg-lb__nav { width: 38px; height: 38px; }
    .hcg-lb__thumb { width: 64px; height: 44px; }
}

.hcg-slide picture { display: contents; }
.hcg-dots, .hcg-total { display: none; }

/* phone: a taller picture, edge to edge in the card; swiping replaces the arrows, dots and the number of pictures replace the counter */
@media (max-width: 767px) {
    .hotel-card .hotel-card__imgwrap { height: auto; aspect-ratio: 39 / 28; isolation: isolate; /* keeps the card's rounded corners while the pictures scroll (Safari) */ }
    .hotel-card__imgwrap::after { content: ""; position: absolute; inset: auto 0 0; height: 72px; z-index: 1; background: linear-gradient(to top, rgba(0,0,0,.45), transparent); pointer-events: none; }
    .hotel-card__imgwrap .hcg-btn, .hotel-card__imgwrap .hcg-count { display: none; }

    .hcg-on .hcg-dots { display: flex; align-items: center; justify-content: center; gap: 5px; position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 2; direction: ltr; pointer-events: none; }
    .hcg-dots:empty { display: none; }
    .hcg-dots i { width: 6px; height: 6px; border-radius: 999px; background: rgba(255,255,255,.6); box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: width .2s, height .2s, background .2s; }
    .hcg-dots i.is-more { width: 4px; height: 4px; }
    .hcg-dots i.is-active { width: 18px; height: 6px; background: #fff; }

    .hcg-many .hcg-total { display: flex; align-items: center; gap: 5px; position: absolute; bottom: 8px; left: 10px; z-index: 2; height: 24px; padding: 0 9px; border-radius: 999px; background: rgba(0,0,0,.45); color: #fff; font-size: 12px; direction: ltr; pointer-events: none; backdrop-filter: blur(4px); }

    .hotel-card .hotel-card__stars { top: 10px; left: 10px; z-index: 2; gap: 2px; padding: 5px 9px; background: rgba(0,0,0,.45); box-shadow: none; }
    .hotel-card .hotel-card__stars svg { width: 12px; height: 12px; }
    .hotel-card .hotel-card__stars span { display: none; } /* the stars say it */
    .hotel-card .hotel-card__promo { top: 10px; right: 10px; left: auto; transform: none; z-index: 2; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
