/* صفحه‌ی آب‌وهوا — گرافیک سه‌بعدیِ CSS، هم‌خانواده‌ی طراحی تیترکده */
:root{ --wx-ink:#16202E; --wx-gold:#E0A72A; --wx-gold2:#B97F12; --wx-paper:#F3F2EE; --wx-card:#FFFFFF; --wx-line:#E3E1DA; --wx-muted:#6B7480; }
body.wxp{ margin:0; background:var(--wx-paper); color:var(--wx-ink); font-family:Vazirmatn,Tahoma,sans-serif; min-height:100vh; -webkit-font-smoothing:antialiased; }
.wxp *{ box-sizing:border-box; }
.wxp-hdr{ position:sticky; top:0; z-index:20; display:flex; align-items:center; justify-content:space-between; padding:14px 16px; background:var(--wx-ink); color:#fff; }
.wxp-brand{ display:flex; align-items:center; gap:8px; color:#fff; text-decoration:none; font-weight:900; font-size:20px; }
.wxp-mark{ width:32px; height:32px; border-radius:11px; display:flex; align-items:center; justify-content:center; background:linear-gradient(160deg,#F2C14E,#D98E12); color:var(--wx-ink); box-shadow:0 3px 0 #9A6A10; }
.wxp-wrap{ max-width:1040px; margin:0 auto; padding:14px 16px 110px; }
.wxp-muted{ color:var(--wx-muted); font-size:13px; }

/* شهرها */
.wxp-cities{ display:flex; gap:8px; overflow-x:auto; padding:2px 0 12px; scrollbar-width:none; }
.wxp-cities::-webkit-scrollbar{ display:none; }
@media (hover:hover){ .wxp-cities{ scrollbar-width:thin; scrollbar-color:#C9C6BC transparent; padding-bottom:14px; cursor:grab; } .wxp-cities::-webkit-scrollbar{ display:block; height:6px; } .wxp-cities::-webkit-scrollbar-thumb{ background:#C9C6BC; border-radius:6px; } .wxp-cities.is-drag{ cursor:grabbing; user-select:none; } }
.wxp-city{ flex:0 0 auto; border:1px solid var(--wx-line); background:var(--wx-card); color:var(--wx-ink); border-radius:999px; padding:8px 14px; font:inherit; font-size:13px; font-weight:800; cursor:pointer; box-shadow:0 3px 0 var(--wx-line); }
.wxp-city[aria-pressed="true"]{ background:var(--wx-gold); border-color:var(--wx-gold); box-shadow:0 3px 0 var(--wx-gold2); }
.wxp-city:focus-visible{ outline:2px solid var(--wx-gold); outline-offset:2px; }

/* هیرو با صحنه‌ی سه‌بعدی */
.wxp-hero{ position:relative; overflow:hidden; border-radius:28px; padding:22px; color:#fff; min-height:250px; perspective:900px;
  background:radial-gradient(120% 90% at 85% 0%,#3A7BC8 0%,#1F4F8C 40%,#0E2B52 100%); box-shadow:0 22px 40px -18px rgba(14,43,82,.6), 0 4px 0 #0A1D38; }
.wxp-hero.is-night{ background:radial-gradient(120% 90% at 80% 0%,#2B3A66 0%,#162036 45%,#0A1020 100%); box-shadow:0 22px 40px -18px rgba(5,9,20,.7), 0 4px 0 #05090F; }
.wxp-hero-top{ position:relative; z-index:2; display:flex; justify-content:space-between; align-items:flex-start; gap:12px; min-height:200px; }
.wxp-city-name{ font-size:13px; font-weight:700; opacity:.9; }
.wxp-temp{ font-size:84px; font-weight:900; line-height:1; margin:10px 0 4px; text-shadow:0 8px 24px rgba(0,0,0,.25); }
.wxp-temp sup{ font-size:34px; vertical-align:top; margin-inline-start:2px; }
.wxp-cond{ font-size:17px; font-weight:800; }
.wxp-range{ font-size:13px; opacity:.88; margin-top:4px; }
.wxp-hero.is-error{ display:none; }

/* صحنه‌ی سه‌بعدی */
.wxp-scene{ position:absolute; inset-inline-end:-6px; top:-4px; width:190px; height:190px; transform-style:preserve-3d; pointer-events:none; }
.wxp-orb{ position:absolute; inset:40px; border-radius:50%; background:radial-gradient(circle at 36% 34%,#FFFBEA 0%,#FFE08A 34%,#F7B733 68%,#EE9A1E 100%); box-shadow:0 0 46px 14px rgba(255,190,70,.5), 0 0 100px 40px rgba(255,170,60,.18); transform:translateZ(20px); animation:wxp-pulse 6s ease-in-out infinite alternate; }
.wxp-ring{ position:absolute; inset:6px; border-radius:50%; background:repeating-conic-gradient(from 0deg, rgba(255,205,110,.9) 0deg 6deg, transparent 6deg 22.5deg); -webkit-mask:radial-gradient(closest-side, transparent 62%, #000 66%, #000 97%, transparent 100%); mask:radial-gradient(closest-side, transparent 62%, #000 66%, #000 97%, transparent 100%); transform:translateZ(10px); animation:wxp-rays 40s linear infinite; }
.is-moon .wxp-orb{ background:radial-gradient(circle at 30% 30%,#FFFFFF 0%,#E4E9F5 40%,#9AA6C2 100%); box-shadow:0 0 50px 10px rgba(200,215,255,.35), inset -12px -14px 26px rgba(30,40,70,.35); }
.is-moon .wxp-ring{ display:none; }
@keyframes wxp-pulse{ from{ transform:translateZ(20px) scale(1); } to{ transform:translateZ(20px) scale(1.035); } }
@keyframes wxp-rays{ from{ transform:translateZ(10px) rotate(0deg); } to{ transform:translateZ(10px) rotate(360deg); } }
@keyframes wxp-spin{ from{ transform:rotateX(18deg) rotateY(-24deg) translateZ(20px); } to{ transform:rotateX(10deg) rotateY(18deg) translateZ(20px); } }
.wxp-cloud{ position:absolute; inset-inline-end:10px; bottom:18px; width:170px; height:90px; transform:rotateX(58deg) rotateZ(-8deg); transform-style:preserve-3d; animation:wxp-drift 9s ease-in-out infinite alternate; }
.wxp-cloud i{ position:absolute; display:block; border-radius:999px; background:linear-gradient(180deg,#FFFFFF,#D7E6F7 70%,#B6CBE6); box-shadow:inset 0 -10px 16px rgba(20,60,110,.25), 0 14px 26px rgba(0,0,0,.25); }
.wxp-cloud i:nth-child(1){ left:0; top:26px; width:92px; height:52px; }
.wxp-cloud i:nth-child(2){ left:50px; top:6px; width:100px; height:74px; transform:translateZ(30px); }
.wxp-cloud i:nth-child(3){ left:120px; top:30px; width:72px; height:46px; transform:translateZ(-10px); }
.is-night .wxp-cloud i{ background:linear-gradient(180deg,#8D9BBE,#4B5878 70%,#34405F); }
@keyframes wxp-drift{ from{ transform:rotateX(58deg) rotateZ(-8deg) translateX(-6px); } to{ transform:rotateX(58deg) rotateZ(-8deg) translateX(10px); } }
.wxp-drops{ position:absolute; inset-inline-start:18px; bottom:-6px; width:84px; height:60px; }
.wxp-drops b{ position:absolute; top:0; width:3px; height:16px; border-radius:3px; background:linear-gradient(#CFE6FF,#5DA8F0); opacity:.9; animation:wxp-rain .9s linear infinite; }
.wxp-drops b:nth-child(1){ left:4%; animation-delay:-.1s; } .wxp-drops b:nth-child(2){ left:20%; animation-delay:-.5s; }
.wxp-drops b:nth-child(3){ left:36%; animation-delay:-.3s; } .wxp-drops b:nth-child(4){ left:52%; animation-delay:-.7s; }
.wxp-drops b:nth-child(5){ left:68%; animation-delay:-.2s; } .wxp-drops b:nth-child(6){ left:84%; animation-delay:-.6s; } .wxp-drops b:nth-child(7){ left:96%; animation-delay:-.4s; }
.wxp-drops b.flake{ width:7px; height:7px; border-radius:50%; background:#FFFFFF; animation-name:wxp-snow; animation-duration:2.6s; }
@keyframes wxp-rain{ from{ transform:translateY(-10px); opacity:0; } 20%{ opacity:.9; } to{ transform:translateY(60px); opacity:0; } }
@keyframes wxp-snow{ from{ transform:translateY(-10px) translateX(0); opacity:0; } 20%{ opacity:1; } to{ transform:translateY(60px) translateX(8px); opacity:0; } }
.wxp-flash{ position:absolute; inset:0; background:rgba(255,255,255,.0); animation:wxp-flash 4s steps(1) infinite; }
@keyframes wxp-flash{ 0%,88%{ background:transparent; } 90%{ background:rgba(255,255,255,.18); } 92%{ background:transparent; } 94%{ background:rgba(255,255,255,.12); } 96%{ background:transparent; } }

/* کارت‌های شاخص */
.wxp-stats{ display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:14px; }
.wxp-stat{ background:var(--wx-card); border-radius:20px; padding:14px; box-shadow:0 4px 0 var(--wx-line); border-top:3px solid var(--wx-accent,#7DB7F0); }
.wxp-stat.c1{ --wx-accent:#5B8DEF; } .wxp-stat.c2{ --wx-accent:#3FB6A8; } .wxp-stat.c3{ --wx-accent:#8C7BE0; }
.wxp-stat.c4{ --wx-accent:#5DA8F0; } .wxp-stat.c5{ --wx-accent:#F2B33D; } .wxp-stat.c6{ --wx-accent:#E07A3D; }
.wxp-k{ font-size:11px; color:var(--wx-muted); font-weight:800; }
.wxp-v{ font-size:20px; font-weight:900; margin-top:4px; direction:ltr; text-align:right; }
.wxp-s{ font-size:11px; color:var(--wx-muted); margin-top:3px; }

.wxp-sec{ margin-top:22px; }
.wxp-sec h2{ font-size:16px; font-weight:900; margin:0 0 10px; display:flex; align-items:center; gap:8px; }
.wxp-sec h2::before{ content:""; width:6px; height:18px; border-radius:4px; background:var(--wx-gold); }

.wxp-hours{ display:flex; gap:10px; overflow-x:auto; padding:4px 2px 10px; scrollbar-width:none; }
.wxp-hours::-webkit-scrollbar{ display:none; }
.wxp-hour{ flex:0 0 76px; background:var(--wx-card); border-radius:20px; padding:12px 8px; text-align:center; box-shadow:0 4px 0 var(--wx-line); }
.wxp-hour.now{ background:linear-gradient(170deg,#1F4F8C,#0E2B52); color:#fff; box-shadow:0 4px 0 #0A1D38; }
.wxp-h-t{ font-size:11px; font-weight:800; color:var(--wx-muted); }
.wxp-hour.now .wxp-h-t{ color:rgba(255,255,255,.85); }
.wxp-h-i{ font-size:22px; margin:8px 0 4px; }
.wxp-h-v{ font-size:18px; font-weight:900; }

.wxp-days{ background:var(--wx-card); border-radius:22px; box-shadow:0 4px 0 var(--wx-line); overflow:hidden; }
.wxp-day{ display:grid; grid-template-columns:120px 1fr 92px; align-items:center; gap:12px; padding:13px 16px; border-bottom:1px solid #F0EEE8; }
.wxp-day:last-child{ border-bottom:0; }
.wxp-day.today{ background:#FFF9EA; }
.wxp-d-n{ font-size:14px; font-weight:800; }
.wxp-d-main{ min-width:0; }
.wxp-d-i{ font-size:12px; color:var(--wx-muted); font-weight:700; margin-top:2px; }
.wxp-bar{ position:relative; height:8px; border-radius:999px; background:#ECEAE3; overflow:visible; }
.wxp-bar i{ position:absolute; top:0; bottom:0; border-radius:999px; background:linear-gradient(90deg,#7DB7F0,#E0A72A); }
.wxp-d-mm{ text-align:left; direction:ltr; font-size:13px; font-weight:800; }
.wxp-d-r{ grid-column:1 / -1; font-size:11px; color:#2F6FB0; font-weight:700; margin-top:-8px; }

.wxp-foot{ margin:18px 0 0; font-size:12px; color:var(--wx-muted); text-align:center; }
.wxp-err{ margin:16px 0; padding:16px; border-radius:18px; background:#FFF4E5; color:#7A4B00; font-size:14px; font-weight:700; text-align:center; }

/* نوار پایین گوشی (همان ttk-bottomnav) */
@media (max-width:720px){
  .wxp-temp{ font-size:72px; }
  .wxp-stats{ grid-template-columns:repeat(2,1fr); }
  .wxp-scene{ width:150px; height:150px; transform:scale(.66); transform-origin:0 50%; }
  .wxp-day{ grid-template-columns:96px 1fr 76px; gap:8px; }
}
@media (prefers-reduced-motion:reduce){
  .wxp *{ animation:none !important; }
}

/* bottom back card (same design as the other pages) */
.back-cta{ display:flex; align-items:center; gap:12px; margin-top:22px; text-decoration:none; background:linear-gradient(120deg,#1B2738,#24344A); border:1px solid rgba(224,167,42,.18); border-radius:18px; padding:16px 18px; box-shadow:0 10px 26px -12px rgba(0,0,0,.5); transition:transform .15s ease; }
.back-cta:active{ transform:scale(.98); }
.back-cta:focus-visible{ outline:2px solid #F3D98B; outline-offset:3px; }
.back-cta-icon{ flex-shrink:0; width:38px; height:38px; border-radius:11px; background:rgba(255,255,255,.1); display:flex; align-items:center; justify-content:center; }
.back-cta-icon svg{ width:18px; height:18px; color:#F3D98B; }
.back-cta-text{ flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.back-cta-title{ font-size:13.5px; font-weight:800; color:#fff; }
.back-cta-sub{ font-size:11.5px; color:rgba(255,255,255,.55); }
.back-cta-arrow{ flex-shrink:0; color:rgba(255,255,255,.5); }
.back-cta-arrow svg{ width:16px; height:16px; }

/* hover motion for tiles: only with a real pointer and when motion is allowed */
@media (hover:hover) and (prefers-reduced-motion:no-preference){
  .wxp-stat, .wxp-hour, .wxp-city{ transition:transform .22s cubic-bezier(.2,.7,.2,1), box-shadow .22s ease, background-color .22s ease; }
  .wxp-stat:hover, .wxp-hour:hover{ transform:translateY(-4px); box-shadow:0 9px 0 var(--wx-line), 0 16px 26px -14px rgba(22,32,46,.35); }
  .wxp-hour.now:hover{ box-shadow:0 9px 0 #0A1D38, 0 16px 26px -14px rgba(10,29,56,.6); }
  .wxp-city:hover{ transform:translateY(-2px); }
  .wxp-day{ transition:background-color .2s ease; }
  .wxp-day:hover{ background:#FBFAF6; }
  .wxp-day.today:hover{ background:#FFF3D6; }
  .wxp-stat:active, .wxp-hour:active, .wxp-city:active{ transform:translateY(1px); }
}

/* air quality card */
.wxp-aqi{ margin-top:22px; background:var(--wx-card); border-radius:22px; padding:18px; box-shadow:0 4px 0 var(--wx-line); }
.wxp-aqi-top{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.wxp-aqi h2{ margin:0; font-size:17px; font-weight:900; }
.wxp-aqi-scale{ font-size:12px; color:var(--wx-muted); }
.wxp-aqi-main{ display:flex; align-items:center; gap:16px; margin-top:12px; }
.wxp-aqi-num{ font-size:46px; font-weight:900; line-height:1; min-width:86px; }
.wxp-aqi-info{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.wxp-aqi-lbl{ font-size:15px; font-weight:800; }
.wxp-aqi-adv{ font-size:13px; color:var(--wx-muted); line-height:1.7; }
.wxp-aqi-bar{ position:relative; height:12px; margin-top:16px; border-radius:999px;
  background:linear-gradient(90deg,#2E9E5B 0 16.66%,#B8901A 16.66% 33.33%,#E07A22 33.33% 50%,#D9423A 50% 66.66%,#8E4AB8 66.66% 83.33%,#7E0023 83.33%); }
.wxp-aqi-mk{ position:absolute; top:-5px; width:6px; height:22px; margin-left:-3px; border-radius:3px; background:#fff; border:2px solid #16202E; box-shadow:0 2px 6px rgba(0,0,0,.25); }
.wxp-aqi-pols{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:16px; }
.wxp-aqi-p{ background:var(--wx-paper); border-radius:14px; padding:9px 10px; display:flex; flex-direction:column; gap:2px; min-width:0; }
.wxp-aqi-pn{ font-size:11.5px; color:var(--wx-muted); }
.wxp-aqi-p b{ font-size:16px; font-weight:900; }
.wxp-aqi-pu{ font-size:10.5px; color:var(--wx-muted); }
.wxp-aqi-note{ margin:12px 0 0; font-size:11px; color:var(--wx-muted); }
@media (min-width:720px){ .wxp-aqi-pols{ grid-template-columns:repeat(6,1fr); } }

/* کمی ابری: خورشید بزرگ پشت ابرِ کوچک ؛ نیمه‌ابری: خورشید کوچک‌تر پشت ابرِ بزرگ‌تر */
.is-partly .wxp-orb{ inset:auto; left:4px; top:-6px; width:124px; height:124px; }
.is-partly .wxp-cloud{ scale:.6; bottom:16px; inset-inline-end:6px; }
.is-mostly .wxp-orb{ inset:auto; left:-4px; top:-14px; width:86px; height:86px; }
.is-mostly .wxp-cloud{ scale:1.08; bottom:8px; inset-inline-end:-4px; }
/* خورشید پشت ابر قرار می‌گیرد (عمق سه‌بعدی) */
@keyframes wxp-pulse-back{ from{ transform:translateZ(-30px) scale(1); } to{ transform:translateZ(-30px) scale(1.035); } }
.is-partly .wxp-orb, .is-mostly .wxp-orb{ animation-name:wxp-pulse-back; }

.wxp-credit{ margin-top:4px; font-size:11px; }
