/*
 * Front page (front-page.php, template-parts/home/*). Loaded on the front
 * page only, by inc/home.php.
 */

/* ================= header over the hero =================
   See-through until the hero's search scrolls under the bar; home.js sets
   .is-solid. Only with JS (without it nothing could turn the bar back), and
   never while the hamburger panel is open. */
.js .trellis-home .site-header { transition: background-color .3s, border-color .3s, box-shadow .3s; }
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) { background: transparent; border-bottom-color: transparent; }
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) .brand,
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) .acct-link { color: #fff; }
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) .brand-latin { color: rgba(255,255,255,.6); }
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) .nav-menu > li > a { color: rgba(255,255,255,.88); }
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) .nav-menu > li > a:hover { background: rgba(255,255,255,.08); color: #fff; }
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) .nav-mega-toggle { color: rgba(255,255,255,.88); }
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) .nav-mega-toggle:hover,
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) .nav-mega-toggle[aria-expanded="true"] { background: rgba(255,255,255,.08); color: #fff; }
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) .nav-mega-toggle .caret { color: rgba(255,255,255,.7); }
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) .header-login,
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) .user-btn,
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) .nav-toggle,
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) .icon-btn { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) .header-login svg { color: rgba(255,255,255,.7); }
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) .nav-toggle span { background: #fff; }
.js .trellis-home .site-header.is-solid { box-shadow: 0 6px 20px color-mix(in srgb, var(--navy-800) 6%, transparent); }
/* One search box on screen at a time: the bar's copy waits for the hero's to leave. */
.js .trellis-home .site-finder { transition: opacity .3s, transform .3s, visibility .3s; }
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) .site-finder { opacity: 0; visibility: hidden; transform: translateY(-6px); pointer-events: none; }
.js:not(.nav-open) .trellis-home .site-header:not(.is-solid) .site-finder-toggle { display: none; }

/* ================= hero ================= */
/* No stacking context of its own: the rail (z 5) has to paint over the city
   but under the search's dropdowns (z 7). */
.hh {
	position: relative; display: flex; flex-direction: column;
	min-height: max(660px, min(100svh, 880px));
	background: var(--navy-900); color: #fff;
}
.js .trellis-home .hh { margin-top: calc(-1 * var(--header-h)); }
.hh-city, .hh-veil, .hh-pins { position: absolute; inset: 0; overflow: hidden; }
.hh-city { z-index: 0; }
.hh-city > svg, .hh-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.hh-photo { object-position: var(--fx, 50%) var(--fy, 100%); }
/* A phone sees about a quarter of a wide photo; the site picks which quarter. */
@media (max-width: 640px) { .hh-photo { object-position: var(--fx-m, var(--fx, 50%)) var(--fy, 100%); } }
.hh-veil {
	z-index: 1; pointer-events: none;
	background: linear-gradient(180deg, color-mix(in srgb, var(--brand-primary-deep) 62%, transparent) 0%, color-mix(in srgb, var(--brand-primary-deep) 30%, transparent) 40%, color-mix(in srgb, var(--brand-primary-deep) 0%, transparent) 62%, color-mix(in srgb, var(--brand-primary-deep) 50%, transparent) 100%);
}
.hh-pins { z-index: 2; pointer-events: none; }
/* A photo is lighter and busier than the drawn night city — often a daytime
   shot — so the white heading needs a deeper navy wash behind it, fading
   out over the rooftops the pins stand on. */
.hh--photo .hh-veil {
	background: linear-gradient(180deg, color-mix(in srgb, var(--brand-primary-deep) 84%, transparent) 0%, color-mix(in srgb, var(--brand-primary-deep) 70%, transparent) 34%, color-mix(in srgb, var(--brand-primary-deep) 38%, transparent) 56%, color-mix(in srgb, var(--brand-primary-deep) 14%, transparent) 74%, color-mix(in srgb, var(--brand-primary-deep) 50%, transparent) 100%);
}

.hh-copy {
	position: relative; z-index: 7; width: 100%; max-width: 860px; margin-inline: auto; text-align: center;
	padding-top: calc(var(--header-h) + clamp(28px, 6vh, 64px));
	/* The rooftops the pins rise from, plus the rail's overlap. */
	padding-bottom: clamp(250px, 36vh, 330px);
}
.hh-badge {
	display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
	font-size: 13px; font-weight: var(--fw-semibold); color: var(--accent-light, #F6CF85);
	background: color-mix(in srgb, var(--navy-900) 50%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.hh-badge i { width: 7px; height: 7px; border-radius: 50%; background: #3DDC97; animation: hh-live 2s infinite; }
@keyframes hh-live { 0% { box-shadow: 0 0 0 0 rgba(61,220,151,.6); } 70%, 100% { box-shadow: 0 0 0 8px rgba(61,220,151,0); } }
.hh-title {
	margin: 16px 0 0; font-size: clamp(28px, 4.2vw, 52px); line-height: 1.35; font-weight: var(--fw-black);
	color: #fff; text-wrap: balance; text-shadow: 0 2px 24px rgba(5,12,24,.55);
}
.hh-title em { font-style: normal; color: var(--accent-on-dark, var(--brand-accent, var(--accent))); }
.hh-sub { margin: 12px auto 0; max-width: 640px; font-size: 17px; line-height: 1.9; color: #D2DCE8; text-wrap: balance; text-shadow: 0 1px 12px rgba(5,12,24,.6); }

.hh-finder { position: relative; max-width: 720px; margin: 26px auto 0; text-align: start; color: var(--text); }
.site-search--hero .site-search-field {
	height: 64px; padding: 6px; border: 0; border-radius: 12px;
	box-shadow: 0 24px 60px -12px rgba(3,10,20,.55), 0 0 0 1px rgba(255,255,255,.1);
}
.site-search--hero .site-search-field:focus-within { box-shadow: 0 24px 60px -12px rgba(3,10,20,.55), 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); }
.site-search--hero .site-search-input { font-size: 16px; font-weight: var(--fw-semibold); }
.site-search--hero .site-search-kbd { display: none; }
.site-search--hero .site-search-submit { width: 52px; height: 52px; border-radius: 8px; background: var(--brand-accent, var(--accent)); color: var(--on-accent, var(--navy-900)); }
.site-search--hero .site-search-submit:hover { background: var(--accent-bright, #FFB21F); }
.hh-finder .city-pop { top: calc(100% + 10px); }

.hh-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.hh-chips span { align-self: center; font-size: 13px; color: #A9B9CD; }
.hh-chips a {
	padding: 6px 14px; border-radius: 999px; font-size: 13.5px; font-weight: var(--fw-semibold);
	color: #E2EAF3; background: color-mix(in srgb, var(--navy-900) 45%, transparent); border: 1px solid rgba(255,255,255,.18);
}
.hh-chips a:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: #fff; }

/* ---------- pins ---------- */
.hh-pin { position: absolute; left: 0; top: 0; }
.hh-base { position: absolute; left: -7px; top: -4px; width: 14px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px 4px color-mix(in srgb, var(--accent) 55%, transparent); }
.hh-base::after { content: ""; position: absolute; inset: -6px -12px; border-radius: 50%; border: 1.5px solid var(--accent); opacity: 0; animation: hh-ring 2.4s ease-out infinite; }
@keyframes hh-ring { 0% { opacity: .9; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.4); } }
.hh-beam { position: absolute; left: -1px; bottom: 0; width: 2px; height: var(--beam, 60px); background: linear-gradient(0deg, color-mix(in srgb, var(--accent) 95%, transparent), color-mix(in srgb, var(--accent) 15%, transparent)); transform-origin: bottom; animation: hh-beam .6s cubic-bezier(.22,1,.36,1) both; }
@keyframes hh-beam { from { transform: scaleY(0); } }
.hh-card {
	display: flex; align-items: center; gap: 9px; padding: 7px 12px 7px 9px; border-radius: 10px; white-space: nowrap;
	background: rgba(255,255,255,.97); color: var(--text); box-shadow: 0 14px 34px -8px rgba(3,10,20,.6);
}
.hh-pin .hh-card {
	position: absolute; left: 0; bottom: calc(var(--beam, 60px) + 8px); transform: translateX(-50%);
	pointer-events: auto; animation: hh-card .55s .28s cubic-bezier(.34,1.56,.64,1) both; transition: transform .25s, box-shadow .25s;
}
.hh-pin .hh-card::after { content: ""; position: absolute; left: 50%; top: 100%; width: 10px; height: 10px; background: inherit; transform: translate(-50%,-55%) rotate(45deg); border-radius: 2px; }
.hh-pin .hh-card:hover { transform: translateX(-50%) translateY(-4px); }
@keyframes hh-card { from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.8); } }
.hh-ic { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-accent, var(--navy-800)); }
.hh-ic svg { width: 17px; height: 17px; }
.hh-ic.is-count { background: var(--navy-700); color: var(--accent-on-dark, var(--accent)); font-weight: var(--fw-black); font-size: 13px; }
.hh-txt { display: flex; flex-direction: column; line-height: 1.35; text-align: start; }
.hh-txt b { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: var(--fw-black); }
.hh-txt b svg { width: 14px; height: 14px; color: var(--verified); }
/* A capped name keeps every card within the width home.js plans for (rules().half). */
.hh-name, .hh-txt small { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hh-txt small { display: block; }
.hh-txt small { font-size: 11.5px; color: var(--muted); }
.hh-star { color: #C27E00; font-weight: var(--fw-black); margin-inline-end: 5px; }
.hh-pin.is-out .hh-card { animation: hh-out .35s forwards; }
.hh-pin.is-out .hh-beam, .hh-pin.is-out .hh-base { animation: hh-fade .4s .1s forwards; }
@keyframes hh-out { to { opacity: 0; transform: translateX(-50%) translateY(8px) scale(.85); } }
@keyframes hh-fade { to { opacity: 0; } }

/* ================= category rail ================= */
.hr-wrap { position: relative; z-index: 5; padding-top: 16px; }
.hr-wrap--rail { margin-top: -64px; padding-top: 0; }
.hr-rail {
	display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; padding: 18px;
	background: var(--white); border-radius: 14px; box-shadow: 0 24px 50px -18px color-mix(in srgb, var(--navy-800) 28%, transparent), 0 0 0 1px var(--line);
}
.hr-cat { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 12px; border-radius: 10px; text-align: center; color: var(--text); transition: background .2s, transform .2s; }
.hr-cat:hover { background: var(--surface); transform: translateY(-2px); }
.hr-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--fill); color: var(--navy-700); transition: background .2s, color .2s; }
.hr-ic svg { width: 26px; height: 26px; }
.hr-cat:hover .hr-ic { background: var(--accent); color: var(--on-accent, var(--navy-800)); }
.hr-cat b { font-size: 13.5px; font-weight: var(--fw-bold); line-height: 1.5; }
.hr-cat small { margin-top: -6px; font-size: 12px; color: var(--muted); }
.hr-all .hr-ic { background: var(--navy-800); color: var(--accent-on-dark, var(--accent)); }
.hr-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 26px; margin: 16px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.hr-trust li { display: inline-flex; align-items: center; gap: 7px; }
.hr-trust svg { color: var(--verified); }

.home-more { display: inline-flex; align-items: center; gap: 6px; font-weight: var(--fw-bold); min-height: var(--tap); }

/* ================= explore: list + map ================= */
.hx-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; }
.hx-list { display: flex; flex-direction: column; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.hx-tabs { display: flex; gap: 6px; padding: 14px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.hx-tabs::-webkit-scrollbar { display: none; }
.hx-tabs button { flex: none; min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font: inherit; font-size: 13.5px; font-weight: var(--fw-semibold); color: var(--text-soft); cursor: pointer; }
.hx-tabs button.is-on { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.hx-items { flex: 1; margin: 0; padding: 6px; list-style: none; }
.hx-item a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; color: var(--text); }
.hx-item.is-hot a, .hx-item a:hover { background: var(--surface); }
.hx-num { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--fill); color: var(--navy-700); font-weight: var(--fw-black); font-size: 13px; }
.hx-item.is-hot .hx-num { background: var(--accent); color: var(--on-accent, var(--navy-800)); }
.hx-body { flex: 1; min-width: 0; }
.hx-body b { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.hx-ver { display: inline-flex; color: var(--verified); }
.hx-body small { display: block; overflow: hidden; font-size: 12.5px; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.hx-rate { display: flex; align-items: center; gap: 4px; flex: none; font-size: 13px; font-weight: var(--fw-black); }
.hx-rate span { color: var(--rating); }
.hx-foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.hx-map { position: relative; isolation: isolate; min-height: 460px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.hx-canvas { position: absolute; inset: 0; }
.hx-canvas.is-ready .trellis-geo__loading { display: none; }
.hx-near {
	position: absolute; bottom: 14px; right: 14px; z-index: 500; display: inline-flex; align-items: center; gap: 8px;
	padding: 8px 14px 8px 10px; border: 0; border-radius: 999px; background: #fff; font: inherit; font-size: 13.5px; font-weight: var(--fw-bold);
	color: var(--text); box-shadow: 0 8px 20px color-mix(in srgb, var(--navy-900) 15%, transparent); cursor: pointer;
}
.hx-near.is-on { background: var(--navy-800); color: #fff; }
.hx-msg { position: absolute; bottom: 64px; right: 14px; left: 14px; z-index: 500; margin: 0; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--navy-900) 88%, transparent); color: #fff; font-size: 13px; text-align: center; }
.hx-mk { background: none; border: 0; }
.hx-mk span {
	display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
	background: var(--navy-700); box-shadow: 0 6px 14px color-mix(in srgb, var(--navy-900) 35%, transparent); transition: background .2s, transform .2s;
}
.hx-mk span i { transform: rotate(45deg); font-style: normal; font-weight: 800; font-size: 13px; color: #fff; font-family: var(--font); }
.hx-mk.is-hot { z-index: 1000 !important; }
.hx-mk.is-hot span { background: var(--accent); transform: rotate(-45deg) scale(1.18); }
.hx-mk.is-hot span i { color: var(--navy-800); }
.hx-you { width: 16px !important; height: 16px !important; border-radius: 50%; background: #2F80ED; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47,128,237,.25); }

/* ================= places ================= */
.hp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; gap: 14px; }
.hp-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hp-tile {
	position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
	min-height: 150px; padding: 18px; border-radius: 12px; color: #fff; transition: transform .25s;
	background: linear-gradient(160deg, #1C3256 0%, #0B1626 70%);
}
.hp-tile:hover { transform: translateY(-3px); color: #fff; }
.hp-tile svg { position: absolute; inset: auto 0 0; z-index: -1; width: 100%; height: 70%; opacity: .9; }
.hp-tile b { font-size: 19px; font-weight: var(--fw-black); }
.hp-tile small { font-size: 13px; color: #C7D3E1; }
.hp-count { position: absolute; top: 14px; inset-inline-start: 14px; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--on-accent, var(--navy-800)); font-size: 12px; font-weight: var(--fw-black); }
.hp-tile.is-big { grid-column: span 2; grid-row: span 2; min-height: 314px; }
.hp-tile.is-big b { font-size: 28px; }

/* ================= how it works ================= */
.home-how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; counter-reset: hs; }
.home-how-step { position: relative; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.home-how-step::before { counter-increment: hs; content: counter(hs, persian); position: absolute; top: 18px; inset-inline-end: 20px; font-size: 56px; font-weight: 900; line-height: 1; color: var(--fill); }
.home-how-ic { position: relative; display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.home-how-step h3 { position: relative; margin: 0 0 6px; font-size: 17px; font-weight: var(--fw-black); }
.home-how-step p { position: relative; margin: 0; font-size: 14px; line-height: 1.9; color: var(--muted); }

/* ================= owner band ================= */
.ho {
	position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 30px; align-items: center;
	padding: 44px 48px; border-radius: 16px; background: var(--navy-900); color: #fff;
}
.ho::after { content: ""; position: absolute; z-index: -1; left: -120px; bottom: -260px; width: 520px; height: 520px; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 28%, transparent), transparent); }
.ho h2 { margin: 8px 0 10px; font-size: 30px; font-weight: var(--fw-black); line-height: 1.45; color: #fff; }
.ho p { margin: 0; max-width: 520px; font-size: 15.5px; line-height: 1.95; color: var(--on-dark-muted); }
.ho ul { display: flex; flex-direction: column; gap: 8px; margin: 18px 0 24px; padding: 0; list-style: none; font-size: 14.5px; color: #D4DEEA; }
.ho li { display: flex; align-items: center; gap: 8px; }
.ho li svg { color: var(--accent-on-dark, var(--accent)); }
.ho-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.ho-btn-ghost { border-color: rgba(255,255,255,.3); color: #fff; }
.ho-btn-ghost:hover { border-color: rgba(255,255,255,.6); color: #fff; }
.ho-vis { position: relative; height: 300px; }
.ho-vis > svg { position: absolute; inset: auto 0 0; width: 100%; height: auto; }
.ho-pin { position: absolute; left: 50%; bottom: 118px; display: flex; flex-direction: column; align-items: center; transform: translateX(-50%); }
.ho-pin .hh-card { animation: ho-float 5s ease-in-out infinite; }
.ho-beam { width: 2px; height: 70px; background: linear-gradient(0deg, var(--accent), color-mix(in srgb, var(--accent) 10%, transparent)); }
.ho-pin .hh-base { position: relative; left: auto; top: auto; }
@keyframes ho-float { 50% { transform: translateY(-8px); } }

/* ================= responsive ================= */
@media (max-width: 1100px) {
	.hp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
	.hh { min-height: 0; }
	.hh-copy { padding-bottom: 320px; }
	.hh-sub { font-size: 15px; }
	.hh-chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
	.hh-chips::-webkit-scrollbar { display: none; }
	.hh-chips a, .hh-chips span { flex: none; }
	.hr-rail { display: flex; overflow-x: auto; padding: 12px; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.hr-rail::-webkit-scrollbar { display: none; }
	.hr-cat { flex: 0 0 96px; scroll-snap-align: start; }
	.hx-grid { grid-template-columns: minmax(0, 1fr); }
	.hx-map { order: -1; min-height: 340px; }
	.home-featured-grid { display: flex; overflow-x: auto; gap: 16px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-snap-type: x mandatory; scrollbar-width: none; }
	.home-featured-grid::-webkit-scrollbar { display: none; }
	.home-featured-grid > * { flex: 0 0 84%; scroll-snap-align: center; }
	.home-how { grid-template-columns: minmax(0, 1fr); }
	.ho { grid-template-columns: minmax(0, 1fr); padding: 30px 22px; }
	.ho h2 { font-size: 24px; }
	.ho-vis { height: 230px; }
}
@media (max-width: 640px) {
	.hp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.hp-tile.is-big { grid-row: auto; min-height: 190px; }
	.hh-txt small { display: none; }
	.hh-card { gap: 6px; padding: 5px 9px 5px 6px; }
	.hh-ic { width: 24px; height: 24px; border-radius: 6px; }
	.hh-ic svg { width: 14px; height: 14px; }
	.hh-txt b { font-size: 12px; }
	.hh-name { max-width: 78px; }
	.hr-trust { gap: 4px 14px; font-size: 12px; }
	.site-search--hero .site-search-field { height: 58px; }
	.site-search--hero .site-search-submit { width: 46px; height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
	.hh *, .ho * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
