/* «محبوب‌ترین شهرهای ایران» of the home page (layouts/home_destinations.php): photo tabs over a sideways row of hotel cards. Everything is .hd-*. */

.hd {
    --hd-bg: var(--ds-bg, #f5f7fa); --hd-card: var(--ds-surface-2, #eef2f7); --hd-text: var(--ds-secondary, #14365c); --hd-muted: var(--ds-muted, #596579); --hd-line: var(--ds-border, #e1e7ef); --hd-accent: var(--ds-primary-text, #007a52); --hd-gold: var(--ds-primary, #00ab6c);
    background: var(--hd-bg); color: var(--hd-text); padding: 56px 0 44px;
}
.hd [hidden] { display: none !important; }
.hd-wrap { max-width: 1320px; margin: 0 auto; }
.hd-title { margin: 0; padding: 0 24px; font-size: 34px; font-weight: 700; line-height: 1.5; }
.hd-sub { margin: 2px 0 22px; padding: 0 24px; font-size: 17px; color: var(--hd-muted); }
.hd a { color: inherit; text-decoration: none; }
.hd button { font: inherit; cursor: pointer; border: 0; padding: 0; color: inherit; }
.hd button:focus-visible, .hd a:focus-visible { outline: 3px solid var(--ds-secondary, #14365c); outline-offset: 2px; }

.hd-tabs, .hd-rail { display: flex; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hd-tabs::-webkit-scrollbar, .hd-rail::-webkit-scrollbar { display: none; }

/* a mouse drags the rows (home-destinations.js) */
@media (hover: hover) and (pointer: fine) {
    .hd-tabs, .hd-rail { cursor: grab; user-select: none; }
}
.hd .hd-dragging, .hd .hd-dragging * { cursor: grabbing; }
.hd .hd-rail.hd-dragging, .hd .hd-rail.hd-settling { scroll-snap-type: none; }
.hd .hd-dragging .hd-card:hover { transform: none; }

.hd-tabs { gap: 12px; padding: 4px 24px 18px; }
.hd-tab { flex: 1 0 140px; max-width: 220px; background: none; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hd-photo { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; outline: 3px solid transparent; outline-offset: 1px; background: var(--hd-card); opacity: .72; transition: opacity .2s; }
.hd-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hd-over { color: #fff; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 4px 8px; text-align: center; font-size: 19px; line-height: 1.5; background: color-mix(in srgb, var(--ds-secondary-hover, #0f2a49) 45%, transparent); text-shadow: 0 2px 8px rgba(0, 0, 0, .8); }
.hd-count { font-size: 12px; color: var(--hd-muted); }
.hd-tab:hover .hd-photo { opacity: .9; }
.hd-tab[aria-pressed="true"] .hd-photo { opacity: 1; outline-color: var(--hd-gold); }
.hd-tab[aria-pressed="true"] .hd-count { color: var(--hd-accent); font-weight: 700; }

.hd-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px 16px; border-top: 1px solid var(--hd-line); }
.hd-bar p { margin: 0; font-size: 14px; color: var(--hd-muted); }
.hd-bar p b { font-size: 19px; color: var(--hd-text); }
.hd-tools { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.hd .hd-all { margin-left: 8px; font-size: 13px; font-weight: 700; color: var(--hd-accent); }
.hd .hd-arrow { width: 40px; height: 40px; border-radius: 50%; background: var(--hd-card); font-size: 17px; }
.hd .hd-arrow:hover { background: var(--hd-gold); color: #fff; }

.hd-rail { gap: 16px; scroll-snap-type: x mandatory; scroll-padding-inline: 24px; padding: 6px 24px 20px; }
.hd .hd-card { flex: 0 0 300px; scroll-snap-align: start; display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; background: var(--hd-card); color: var(--hd-text); transition: transform .2s; }
.hd .hd-card:hover { transform: translateY(-5px); }
.hd-shot { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--ds-border, #e1e7ef); }
/* the watermark of the thumbnails sits in the bottom right corner: keep that corner when the photo is cropped */
.hd-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 100% 100%; }
.hd-off, .hd-stars { position: absolute; top: 12px; border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 700; }
.hd-off { right: 12px; background: var(--ds-accent, #cc4420); color: #fff; }
.hd-stars { left: 12px; background: color-mix(in srgb, var(--ds-secondary-hover, #0f2a49) 72%, transparent); color: var(--ds-accent-bright, #ff8a66); letter-spacing: 1px; direction: ltr; }
.hd-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; }
.hd-name { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-price { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; margin-top: auto; }
.hd-price small { font-size: 11px; color: var(--hd-muted); }
.hd-price > small { padding-bottom: 6px; }
.hd-price > span { text-align: left; }
.hd-price del { display: block; font-size: 12px; color: var(--hd-muted); }
.hd-price strong { font-size: 20px; color: var(--hd-text); }

.hd .hd-card.hd-more { position: relative; min-height: 300px; }
.hd-more img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .2; filter: blur(10px); transform: scale(1.2); }
.hd-go { position: relative; margin: auto; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; font-size: 16px; font-weight: 700; }
.hd-go i { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--hd-gold); color: #fff; font-style: normal; font-size: 22px; }

/* the اقامتگاه rows (layouts/home_stay_rows.php): a title of their own over each row instead of the photo tabs. Dark, to stand apart from the hotels above */
.hd.hd-stay { --hd-bg: var(--ds-secondary, #14365c); --hd-card: var(--ds-secondary-hover, #0f2a49); --hd-text: #fff; --hd-muted: var(--ds-border, #e1e7ef); --hd-accent: var(--ds-accent-bright, #ff8a66); }
.hd-stay .hd-shot { background: var(--ds-secondary-hover, #0f2a49); }
.hd.hd-stay button:focus-visible, .hd.hd-stay a:focus-visible { outline-color: var(--hd-gold); }
.hd-stay.hd-js .hd-shot:not(.hd-ready)::before { background-image: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .18) 50%, transparent 70%); }
.hd-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-left: 24px; }
.hd-head .hd-sub { margin-bottom: 14px; }
.hd-head .hd-tools { padding-bottom: 14px; }
.hd-panel + .hd-panel { margin-top: 28px; }
.hd-stay .hd-shot img { object-position: 50% 50%; }
.hd-stay .hd-name { display: block; }
.hd-place { display: block; font-size: 13px; color: var(--hd-muted); }
.hd-type { position: absolute; top: 12px; right: 12px; border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--ds-secondary, #14365c) 90%, transparent); color: #fff; }
/* Otaghak's discount on a stay card: the badge goes under the type of the room (both sit on the right). The price is .hd-amount: the number, with the
   price before the discount on its own line right above it (struck through in the accent), then «تومان» */
.hd-amount { display: inline-flex; align-items: flex-end; gap: 5px; white-space: nowrap; vertical-align: bottom; }
.hd-amount > small { padding-bottom: 3px; }
.hd-amount__num { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
/* struck through with a thin accent line slanted 12 degrees, not line-through: a Persian zero (۰) is a dot at mid-height, which any straight line hides (۳۰,۰۰۰ reads ۳-,---) */
.hd-amount__num del, .hd-price .hd-amount__num del {
    position: relative; display: block; margin-bottom: 2px; padding: 0 3px; font-size: 14px; font-weight: 500; line-height: 1.35;
    color: color-mix(in srgb, currentColor 66%, transparent); text-decoration: none;
}
.hd-amount__num del::after {
    content: ""; position: absolute; inset-inline: 0; top: 50%; height: 1.5px; margin-top: -1px; border-radius: 2px;
    background: var(--ds-accent, #cc4420); transform: rotate(-12deg); pointer-events: none;
}
.hd-stay .hd-type ~ .hd-off { top: 44px; }
.hd-stay .hd-off { z-index: 1; color: var(--ds-on-accent, #fff); }

/* the flights row (layouts/home_flight_row.php): a card per source city. The city on green, then one large row per destination; three rows show and the
   list scrolls to the others. Text is big on purpose, for older visitors */
.hd-flights .hd-rail { padding-bottom: 28px; }
.hd .hd-card.hd-flight { --hd-row: 76px; display: flex; flex-direction: column; flex-basis: 360px; background: #fff; border-radius: 24px; box-shadow: 0 6px 20px color-mix(in srgb, var(--ds-secondary, #14365c) 12%, transparent); }
.hd-origin { display: flex; align-items: center; gap: 12px; padding: 20px 18px; color: #fff; background: linear-gradient(135deg, var(--ds-primary, #00ab6c), var(--ds-primary-text, #007a52)); }
.hd-origin svg { flex: none; width: 36px; height: 36px; padding: 5px; border-radius: 50%; fill: var(--ds-primary-text, #007a52); background: #fff; transform: rotate(-90deg); } /* flies from right to left */
.hd-origin h3 { flex: 1; min-width: 0; margin: 0; font-size: 24px; font-weight: 700; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-origin h3 small { font-size: 15px; font-weight: 400; opacity: .9; }
.hd-code { font-size: 13px; letter-spacing: 2px; opacity: .85; direction: ltr; }
/* exactly three rows: their heights, the two gaps between them and the space above */
.hd-dests { display: flex; flex-direction: column; gap: 8px; box-sizing: content-box; max-height: calc(5 * var(--hd-row) + 32px); margin: 12px 0; padding: 0 12px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #b9bacd transparent; }
.hd .hd-dest { flex: none; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: var(--hd-row); padding: 0 14px; border-radius: 14px; background: var(--ds-surface-2, #eef2f7); transition: background-color .2s; }
.hd .hd-dest:hover { background: var(--ds-primary-soft, #e6f7f0); }
.hd .hd-dest:focus-visible { outline-offset: -3px; }
.hd-to { display: flex; flex-direction: column; min-width: 0; }
.hd-to > b { font-size: 19px; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-to small { font-size: 13px; color: var(--hd-muted); white-space: nowrap; }
.hd-from { flex: none; white-space: nowrap; }
.hd-from b { font-size: 21px; color: var(--ds-primary-text, #007a52); }
.hd-from small { font-size: 12px; color: var(--hd-muted); }
.hd-scroll-note { margin: auto 0 0; padding: 0 12px 14px; font-size: 13px; text-align: center; color: var(--hd-muted); }
.hd-note { margin: 0; padding: 0 24px; font-size: 13px; text-align: center; color: var(--hd-muted); }

@media (max-width: 640px) {
    .hd { padding: 34px 0 24px; }
    .hd-title { padding: 0 16px; font-size: 23px; }
    .hd-sub { padding: 0 16px; margin-bottom: 14px; font-size: 14px; }
    .hd-tabs { gap: 10px; padding: 4px 16px 14px; }
    .hd-head { padding-left: 16px; }
    .hd-tab { flex: 0 0 112px; }
    .hd-over { font-size: 15px; }
    .hd-bar { padding: 12px 16px; }
    .hd-bar p { font-size: 12px; }
    .hd-bar p b { display: block; margin-bottom: 3px; font-size: 16px; }
    .hd .hd-arrow, .hd-dot { display: none; }
    .hd-rail { gap: 12px; scroll-padding-inline: 16px; padding: 6px 16px 16px; }
    .hd .hd-card { flex-basis: 74%; }
    .hd .hd-card.hd-more { min-height: 260px; }
    .hd .hd-card.hd-flight { flex-basis: 86%; }
    .hd-origin { padding: 16px 14px; }
    .hd-origin h3 { font-size: 21px; }
    .hd-to > b { font-size: 17px; }
    .hd-from b { font-size: 18px; }
    .hd .hd-dest { padding: 0 12px; }
}

/* the narrowest phones: a destination and its price do not fit side by side, the price goes under it */
@media (max-width: 359px) {
    .hd .hd-card.hd-flight { flex-basis: 92%; --hd-row: 88px; }
    .hd .hd-dest { flex-direction: column; justify-content: center; gap: 0; }
    .hd-to { align-items: center; max-width: 100%; }
}

/* a photo on its way: a light sweeps over its place, then the photo fades in (.hd-js: without the script the photos just show) */
.hd-js .hd-shot img { opacity: 0; transition: opacity .35s ease; }
.hd-js .hd-shot.hd-ready img { opacity: 1; }
.hd-js .hd-shot:not(.hd-ready)::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .75) 50%, transparent 70%) 0 0 / 250% 100%; animation: hd-shimmer 1.3s linear infinite; }
@keyframes hd-shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* a row appears: the cards rise in one after the other. Up and down only: the row snaps to where a card is drawn, so a sideways move (or a smaller card)
   would scroll the row under the animation. «backwards», so the hover lift works again afterwards */
.hd-panel.hd-wait .hd-card { opacity: 0; }
.hd-panel.hd-enter .hd-card { animation: hd-in .5s cubic-bezier(.2, .75, .25, 1) backwards; animation-delay: calc(var(--hd-i, 0) * 70ms); }
.hd-panel.hd-enter .hd-bar p { animation: hd-in .4s ease backwards; }
@keyframes hd-in { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
    .hd .hd-card, .hd-photo, .hd-js .hd-shot img { transition: none; }
    .hd-panel.hd-enter .hd-card, .hd-panel.hd-enter .hd-bar p, .hd-js .hd-shot:not(.hd-ready)::before { animation: none; }
}

/* the popular stay cities (layouts/home_stay_cities.php): arched windows onto a room of each city, over a row of tall picture cards. Not the shapes of the
   hotels above, on purpose */
.sc .hd-panel { margin-top: 0; }
.sc + .hd-panel { margin-top: 36px; }
.sc .hd-bar { border-top-color: rgba(255, 255, 255, .14); }
.hd .sc-arches { gap: 14px; padding: 14px 24px 22px; }
.hd .sc-arch { flex: 1 0 128px; max-width: 168px; background: none; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sc-window { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; padding: 5px; border: 2px solid rgba(255, 255, 255, .22); border-radius: 50% 50% 22px 22px / 37.5% 37.5% 22px 22px; transition: transform .25s, border-color .25s; }
.sc-window .hd-shot { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 50% 50% 16px 16px / 37% 37% 16px 16px; overflow: hidden; }
.sc-window .hd-shot::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, color-mix(in srgb, var(--ds-secondary-hover, #0f2a49) 88%, transparent), color-mix(in srgb, var(--ds-secondary-hover, #0f2a49) 35%, transparent) 32%, transparent 55%); }
.sc-city { position: absolute; right: 9px; left: 9px; bottom: 14px; color: #fff; text-align: center; font-size: 17px; line-height: 1.6; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }
.sc-count { font-size: 12px; color: var(--hd-muted); border-radius: 999px; padding: 2px 12px; transition: background-color .25s, color .25s; }
.sc-arch:hover .sc-window { transform: translateY(-4px); border-color: rgba(255, 255, 255, .55); }
.sc-arch[aria-pressed="true"] .sc-window { transform: translateY(-8px); border-color: var(--hd-gold); }
.sc-arch[aria-pressed="true"] .sc-count { background: var(--hd-gold); color: #fff; font-weight: 700; }

.hd .hd-card.sc-poster { position: relative; flex-basis: 270px; aspect-ratio: 4 / 5; }
.sc-poster .hd-shot { position: absolute; inset: 0; aspect-ratio: auto; }
.sc-poster .hd-shot::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, color-mix(in srgb, var(--ds-secondary-hover, #0f2a49) 92%, transparent), color-mix(in srgb, var(--ds-secondary-hover, #0f2a49) 60%, transparent) 24%, transparent 52%); }
.sc-poster .hd-type, .sc-poster .hd-stars { z-index: 1; }
.sc-info { position: absolute; right: 0; left: 0; bottom: 0; display: flex; flex-direction: column; gap: 8px; padding: 16px; color: #fff; }
/* capacity on the right, the price on the left; a price that does not fit beside the capacity goes under it instead of out of the card */
.sc-facts { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 4px 8px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .25); font-size: 13px; white-space: nowrap; }
.sc-facts > span:first-child { padding-bottom: 2px; }
.sc-facts small { font-size: 11px; opacity: .8; }
.sc-facts strong { font-size: 19px; color: var(--hd-accent); }
.sc-price { display: inline-flex; align-items: flex-end; gap: 5px; margin-inline-start: auto; }
.sc-price > small { padding-bottom: 3px; }
.hd .hd-card.sc-more { border: 2px dashed rgba(255, 255, 255, .3); background: transparent; }

@media (max-width: 640px) {
    .hd .sc-arches { gap: 10px; padding: 12px 16px 16px; }
    .hd .sc-arch { flex: 0 0 100px; }
    .sc-window { padding: 4px; }
    .sc-city { bottom: 9px; font-size: 14px; }
    .sc-count { font-size: 11px; padding: 1px 8px; }
    .hd .hd-card.sc-poster { flex-basis: 72%; }
}

@media (prefers-reduced-motion: reduce) {
    .sc-window, .sc-count { transition: none; }
}
