/* ============================================================
   EXPLORE — نقشه‌محور (الهام از دیوار، با دیزاین‌سیستم کانت‌این)
   Ported from design/explore.html (source of truth طراحی).
   فقط تغییر رنگ به‌عنوان فیدبک تعامل — بدون موشن hover
   ============================================================ */
.exp-root{ --exp-filters-w:300px; --exp-list-w:436px; --exp-bar-h:60px; }

/* صفحه‌ی کاری تمام‌قد زیر هدر دسکتاپ */
.exp-main{ padding:0; }
.exp-shell{
  display:flex; flex-direction:row;
  height:calc(100vh - 80px);
  background:var(--bg);
  overflow:hidden;
}

/* ستون فیلتر (راست در RTL) */
.exp-filters{
  width:var(--exp-filters-w); flex-shrink:0;
  background:var(--surface);
  border-inline-start:1px solid var(--line);
  overflow-y:auto; padding:20px;
  display:flex; flex-direction:column; gap:22px;
}
.exp-filters .filter-group-title{ margin-bottom:10px; }
.exp-filters-head{
  display:flex; align-items:center; justify-content:space-between;
  padding-bottom:14px; border-bottom:1px solid var(--line);
}
.exp-filters-head .ttl{ font-size:16px; font-weight:800; letter-spacing:-.01em; }
.exp-clear-all{
  font-size:12px; font-weight:600; color:var(--accent);
  background:none; border:none; cursor:pointer; padding:4px 6px; border-radius:8px;
}
.exp-clear-all:hover{ background:var(--accent-tint); }

/* لیست عمودی رادیو/چک‌باکس برای فیلترها */
.filter-group-title{
  font-size:13px; font-weight:800; color:var(--ink);
  margin-bottom:8px;
  display:flex; align-items:center; justify-content:space-between;
}
.filter-group-title .reset{
  font-size:11px; font-weight:600; color:var(--accent);
  background:none; border:none; cursor:pointer; padding:2px 6px; border-radius:6px;
}
.filter-options{
  display:flex; flex-direction:column; gap:2px;
}
.filter-option{
  display:flex; align-items:center; gap:10px;
  padding:8px 10px; border-radius:var(--r-md);
  cursor:pointer; font-size:13px; color:var(--ink-2);
  user-select:none;
  transition:background .12s;
}
.filter-option:hover{ background:var(--bg); }
.filter-option input{
  width:18px; height:18px; flex-shrink:0;
  accent-color:var(--accent); margin:0; cursor:pointer;
}
.filter-option .lbl{ flex:1; min-width:0; }
.filter-option.is-active{
  background:var(--accent-soft);
  color:var(--accent-deep); font-weight:700;
}
.filter-option .count{
  font-size:11px; color:var(--muted);
  font-variant-numeric:tabular-nums;
  flex-shrink:0;
}
.filter-option.is-active .count{ color:var(--accent-deep); }

/* گروه فیلتری که هنوز داده‌ی لازمش را ندارد (فاصله ← موقعیت کاربر).
   قفل است، نه پنهان: کاربر گزینه‌ها را می‌بیند و می‌داند چه چیزی لازم است. */
.filter-options.is-locked{ opacity:.5; }
.filter-options.is-locked .filter-option{ cursor:not-allowed; }
.filter-options.is-locked .filter-option:hover{ background:none; }
.filter-options.is-locked .filter-option input{ cursor:not-allowed; }
.exp-geo-enable{
  display:inline-flex; align-items:center; gap:6px; margin-top:8px;
  background:none; border:none; cursor:pointer; padding:4px 6px; border-radius:8px;
  font-size:12px; font-weight:700; color:var(--accent); font-family:inherit;
}
.exp-geo-enable svg{ width:14px; height:14px; }
.exp-geo-enable:hover{ background:var(--accent-tint); }
.exp-geo-note{
  margin:6px 6px 0; font-size:11px; line-height:1.9; color:var(--muted);
}
.exp-geo-note[hidden]{ display:none; }

/* ستون لیست (وسط) */
.exp-list{
  width:var(--exp-list-w); flex-shrink:0;
  background:var(--bg);
  border-inline-start:1px solid var(--line);
  display:flex; flex-direction:column; min-width:0;
}
.exp-list-top{
  background:var(--surface); border-bottom:1px solid var(--line);
  padding:16px 20px 0;
}
.exp-list-head{ margin-bottom:14px; }
.exp-list-head h1{ font-size:18px; font-weight:800; letter-spacing:-.01em; margin:0 0 4px; }
.exp-list-head p{ font-size:12px; color:var(--muted); margin:0; }
.exp-count-row{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 0; border-top:1px solid var(--line);
}
.exp-count{ font-size:13px; font-weight:700; }
.exp-count b{ color:var(--accent-deep); }
.exp-scroll{ overflow-y:auto; padding:12px 16px; flex:1; }

/* بنر تورنمنت‌های فعال */
.exp-tour{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; margin:8px 0;
  background:linear-gradient(135deg, var(--ink), #2E3133);
  color:#fff; border-radius:10px; text-decoration:none;
}
.exp-tour .ic{
  width:32px; height:32px; border-radius:8px; flex-shrink:0;
  background:rgba(31,184,122,.18); color:#7FE6B7;
  display:grid; place-items:center;
}
.exp-tour .tt{ flex:1; min-width:0; }
.exp-tour .tt .a{ font-size:12px; font-weight:800; }
.exp-tour .tt .b{ font-size:10px; opacity:.75; margin-top:1px; }
.exp-tour .chev{ opacity:.7; }

/* کارت افقی ردیفی (سبک دیوار) */
.exp-card{
  display:flex; gap:14px; align-items:stretch;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  padding:12px;
  color:inherit; cursor:pointer;
  margin-bottom:10px;
  text-decoration:none;
}
.exp-card.is-active{ border-color:var(--accent); box-shadow:0 0 0 1px var(--accent) inset; }
.exp-card .thumb{
  width:104px; height:104px; flex-shrink:0;
  border-radius:var(--r-md); overflow:hidden; position:relative;
}
.exp-card .thumb .photo{ border-radius:var(--r-md); width:100%; height:100%; }
.exp-card .thumb.no-photo{
  background:var(--bg); border:1px solid var(--line);
  display:grid; place-items:center; color:var(--line-strong);
}
.exp-card .thumb.no-photo svg{ width:28px; height:28px; }
.exp-card .body{ flex:1; min-width:0; display:flex; flex-direction:column; }
.exp-card .body .meta{
  display:flex; align-items:center; gap:6px;
  font-size:11px; color:var(--muted); margin-bottom:5px;
}
.exp-card .body h3{
  font-size:15px; font-weight:700; line-height:1.5; margin:0 0 8px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.exp-card .body .pr{ font-size:13px; font-weight:700; margin-bottom:2px; }
.exp-card .body .pr .lbl{ color:var(--muted); font-weight:500; }
.exp-card .body .pr .free{ color:var(--accent-deep); }
.exp-card .body .foot{
  margin-top:auto; display:flex; align-items:center; gap:8px;
  padding-top:8px;
}
.exp-card .body .foot .nm{ font-size:11px; color:var(--muted); }
.exp-card .body .foot .rt{ font-size:11px; color:var(--ink-2); font-weight:700; flex:1; font-variant-numeric:tabular-nums; }
.exp-card .body .foot .where{ font-size:11px; color:var(--accent-deep); font-weight:600; }
/* رویدادی که میزبان موقعیتش را ثبت نکرده: در فهرست می‌ماند ولی روی نقشه
   نیست، و کارت خودش این را می‌گوید تا نبودِ پین گیج‌کننده نباشد. */
.exp-card .body .exp-noloc{
  margin-top:6px; font-size:11px; color:var(--muted);
  display:inline-flex; align-items:center; gap:4px;
}
.exp-card .body .exp-noloc::before{
  content:""; width:5px; height:5px; border-radius:50%;
  background:var(--line-strong); flex-shrink:0;
}
.exp-noloc-note{
  margin:0; padding:0 0 12px;
  font-size:11px; line-height:1.9; color:var(--muted);
}
.exp-empty{
  text-align:center; padding:48px 20px; color:var(--muted); font-size:13px;
}
.exp-empty svg{ width:40px; height:40px; color:var(--line-strong); margin:0 auto 12px; }

/* ستون نقشه (چپ در RTL) — کانواسِ ارائه‌دهنده‌ی نقشه.
   توکن‌های --exp-map-* را map-neshan.js با getComputedStyle می‌خواند و به
   لایه‌های نقشه می‌دهد، تا رنگ‌ها فقط یک منبع (همین دیزاین‌سیستم) داشته
   باشند و در JS تکرار نشوند. */
.exp-map{
  flex:1; min-width:0; position:relative; overflow:hidden;
  background:var(--bg);
  --exp-map-marker:var(--surface);
  --exp-map-marker-stroke:var(--accent-deep);
  --exp-map-label:var(--accent-deep);
  --exp-map-label-halo:#FFFFFF;
  --exp-map-cluster:var(--accent);
  --exp-map-cluster-text:#FFFFFF;
  --exp-map-active:var(--accent);
  --exp-map-highlight:var(--accent);
  --exp-map-user:var(--ink);
}
.exp-map .exp-map-canvas{
  /* استایل خود mapbox (.mapboxgl-map) lazy لود می‌شود و بعد از این فایل
     می‌آید؛ با یک کلاس، position:relative آن بر ما غلبه می‌کرد و کانتینر
     ارتفاعش صفر می‌شد. دو کلاس یعنی همیشه برنده‌ایم. */
  position:absolute; inset:0;
}

/* حالت‌های نقشه: در حال بارگذاری، خطا، و «هیچ رویدادی مختصات ندارد» */
.exp-map-state{
  position:absolute; inset:0; z-index:5;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:6px; padding:32px 28px; text-align:center;
  background:var(--bg); color:var(--muted);
}
.exp-map-state[hidden]{ display:none; }
.exp-map-state svg{ width:42px; height:42px; color:var(--line-strong); margin-bottom:6px; }
.exp-map-state .tt{ font-size:14px; font-weight:800; color:var(--ink); }
.exp-map-state .ds{ font-size:12px; line-height:1.9; max-width:34ch; }

/* «جستجو در این محدوده» — فقط بعد از جابه‌جایی نقشه توسط کاربر */
.exp-map-top{
  position:absolute; top:16px; left:50%; transform:translateX(-50%);
  z-index:8;
}
.exp-map-top .exp-pillbtn[hidden]{ display:none; }

/* کنترل‌های نقشه */
.exp-map-tools{
  position:absolute; inset-inline-start:16px; top:50%; transform:translateY(-50%);
  display:flex; flex-direction:column; gap:8px; z-index:8;
}
.exp-mt{
  width:40px; height:40px; border-radius:var(--r-md);
  background:var(--surface); border:1px solid var(--line);
  display:grid; place-items:center; color:var(--ink);
  cursor:pointer; box-shadow:var(--shadow-sm);
}
.exp-mt svg{ width:18px; height:18px; }
.exp-mt:hover{ background:var(--bg); }
/* بدون نقشه، کنترل‌های نقشه کاری برای انجام‌دادن ندارند */
.exp-mt:disabled{ opacity:.45; cursor:not-allowed; }
.exp-mt:disabled:hover{ background:var(--surface); }
.exp-mt-group{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-md); box-shadow:var(--shadow-sm); overflow:hidden;
}
.exp-mt-group .exp-mt{ border:none; border-radius:0; box-shadow:none; }
.exp-mt-group .exp-mt+.exp-mt{ border-top:1px solid var(--line); }

.exp-pillbtn{
  display:inline-flex; align-items:center; gap:7px;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-pill); padding:9px 16px;
  font-size:12px; font-weight:700; color:var(--ink);
  cursor:pointer; box-shadow:var(--shadow-md);
}
.exp-pillbtn svg{ width:14px; height:14px; }
.exp-map-bottom{
  position:absolute; bottom:18px; left:50%; transform:translateX(-50%);
  z-index:8;
}

/* نوار بالای موبایل/تبلت (سرچ + شهر + چیپ فیلتر) */
.exp-mbar{ display:none; }
.exp-chips-bar{ display:none; }

/* دکمه‌ی شناور نمایش/مخفی نقشه (موبایل) */
.exp-mapfab{ display:none; }

/* حالت بسته‌ی نقشه (دسکتاپ): نقشه جمع، لیست تمام‌عرض */
.exp-shell.map-collapsed .exp-map{ flex:0 0 0; }
.exp-shell.map-collapsed .exp-list{ flex:1; width:auto; }

/* ===================== تبلت ===================== */
/* ستون فیلتر فقط از ۱۰۲۴ به بالا وجود دارد، پس زیر آن تنها راه فیلترکردن نوار
   بالا (سرچ + شهر) و دکمه‌ی «فیلترها» است. این نوار پیش‌تر فقط زیر ۷۶۸px روشن
   می‌شد و بازه‌ی ۷۶۸–۱۰۲۳ هیچ راه فیلتری نداشت. */
@media (max-width:1023px){
  /* دو نوار بالا بیرون از .exp-shell رندر می‌شوند (۶۳px + ۵۳px)، پس باید از
     ارتفاع آن کم شوند وگرنه صفحه به‌اندازه‌ی همان‌ها اسکرول می‌گیرد. */
  .exp-root{ --exp-list-w:380px; --exp-bars-h:116px; }
  .exp-filters{ display:none; }
  .exp-shell{ height:calc(100vh - 80px - var(--exp-bars-h)); }

  .exp-mbar{
    display:flex; align-items:center; gap:8px;
    position:sticky; top:0; z-index:25;
    background:var(--bg); padding:10px 16px 8px;
  }
  .exp-mbar .input-with-icon{ flex:1; margin:0; }
  .exp-mbar .input{ padding-block:10px; }
  .exp-city{
    display:inline-flex; align-items:center; gap:6px; flex-shrink:0;
    background:var(--surface); border:1px solid var(--line);
    border-radius:var(--r-md); padding:10px 14px;
    font-size:13px; font-weight:700; color:var(--ink); cursor:pointer;
  }
  .exp-city svg{ width:15px; height:15px; color:var(--muted); }
  .exp-chips-bar{
    display:flex; gap:8px; overflow-x:auto;
    padding:4px 16px 12px; background:var(--bg);
    position:sticky; top:54px; z-index:24;
    scrollbar-width:none;
  }
  .exp-chips-bar::-webkit-scrollbar{ display:none; }
  .exp-chip{
    display:inline-flex; align-items:center; gap:6px; flex-shrink:0;
    padding:8px 14px; border-radius:var(--r-pill);
    font-size:12px; font-weight:600; cursor:pointer;
    background:var(--surface); border:1px solid var(--line); color:var(--ink-2);
  }
  .exp-chip.primary{ background:var(--ink); color:#fff; border-color:var(--ink); }

  /* Opens the filter sheet — the only way to filter on a phone. */
  .exp-chip{ min-height:44px; box-sizing:border-box; }
  .exp-chip .x{ display:inline-flex; color:var(--muted-2); }
  .exp-chip .x svg{ width:12px; height:12px; }
  .exp-chip .ct{
    background:var(--accent); color:#fff; font-size:10px; font-weight:800;
    border-radius:var(--r-pill); padding:1px 6px;
  }
}

/* ===================== موبایل ===================== */
@media (max-width:767px){
  .exp-shell{
    flex-direction:column; height:auto; overflow:visible;
    padding-bottom:calc(var(--tabbar-h) + 16px);
  }
  /* نوار بالا و چیپ‌ها در بلوک تبلت بالا تعریف شده‌اند و همان‌جا اعمال می‌شوند. */
  .exp-filters{ display:none; }
  .exp-map{
    order:-1; height:248px; flex:none;
    border-radius:0; border-bottom:1px solid var(--line);
  }
  .exp-map-tools{ inset-inline-start:12px; top:auto; bottom:14px; transform:none; flex-direction:column; }
  .exp-map-bottom{ display:none; }
  .exp-map-top{ top:10px; }
  .exp-map-top .exp-pillbtn{ font-size:11px; padding:7px 13px; }
  .exp-map-state{ padding:20px 18px; }
  .exp-map-state svg{ width:32px; height:32px; margin-bottom:2px; }
  .exp-map-state .ds{ font-size:11px; }
  .exp-list{
    width:auto; flex:none; border:none; background:var(--bg);
  }
  .exp-list-top{ padding:14px 16px 0; }
  .exp-scroll{ overflow:visible; padding:12px 16px 4px; flex:none; }

  /* حالت نقشه‌ی تمام‌صفحه روی موبایل — روی body سوییچ می‌شود چون
     mobile-header و tabbar بیرون از .exp-root توسط layout رندر می‌شوند */
  body.exp-map-full .exp-map{
    position:fixed; inset:0; top:0; height:100dvh; z-index:70;
    order:0; border:none;
  }
  body.exp-map-full .exp-map-bottom{ display:block; }
  body.exp-map-full .exp-mbar,
  body.exp-map-full .exp-chips-bar,
  body.exp-map-full .exp-list,
  body.exp-map-full .mobile-header,
  body.exp-map-full .tabbar{ display:none; }

  .exp-mapfab{
    display:inline-flex; align-items:center; gap:7px;
    position:fixed; bottom:calc(var(--tabbar-h) + 18px); left:50%;
    transform:translateX(-50%); z-index:45;
    background:var(--ink); color:#fff;
    border:none; border-radius:var(--r-pill);
    padding:11px 20px; font-size:13px; font-weight:700;
    cursor:pointer; box-shadow:var(--shadow-lg); font-family:inherit;
  }
  .exp-mapfab svg{ width:16px; height:16px; }
  body.exp-map-full .exp-mapfab{ display:none; }
}
@media (min-width:768px){ .exp-mapfab{ display:none !important; } }

/* پاپ‌آپ «چند رویداد در یک نقطه» — وقتی چند رویداد دقیقاً یک مختصات دارند،
   هیچ zoomی جدایشان نمی‌کند، پس فهرستشان همین‌جا انتخاب‌شدنی می‌شود. */
.exp-stack{ min-width:200px; }
.exp-stack-h{
  font-size:11px; font-weight:800; color:var(--muted);
  padding:2px 2px 8px; border-bottom:1px solid var(--line); margin-bottom:4px;
}
.exp-stack-item{
  display:block; width:100%; text-align:start;
  background:none; border:none; cursor:pointer; font-family:inherit;
  padding:7px 6px; border-radius:8px;
}
.exp-stack-item:hover{ background:var(--accent-soft); }
.exp-stack-item .t{ display:block; font-size:12px; font-weight:700; color:var(--ink); line-height:1.6; }
.exp-stack-item .m{ display:block; font-size:11px; color:var(--muted); margin-top:2px; }
/* پاپ‌آپ خودِ mapbox: با دیزاین‌سیستم هم‌خوان شود */
.exp-map .mapboxgl-popup-content{
  border-radius:var(--r-md); padding:10px; box-shadow:var(--shadow-lg);
  font-family:inherit; direction:rtl;
}
.exp-map .mapboxgl-popup-close-button{ font-size:16px; color:var(--muted); padding:2px 6px; }
