/* ثمرات — أنماط صفحة الطقس وشريط الطقس في صفحات المحاصيل
   مبنية على نفس متغيرات نظام التصميم (--th-*) */

/* ---------- الأيقونات ---------- */
.wx-ic { width: 1.35em; height: 1.35em; display: inline-block; vertical-align: -0.3em; flex: none; }
.wx-ic.wx-ic-lg { width: 58px; height: 58px; }
.wx-ic.wx-ic-md { width: 26px; height: 26px; }
.wx-ic.wx-ic-sm { width: 15px; height: 15px; vertical-align: -0.2em; }

/* ---------- اختيار المنطقة (صفحة الطقس) ---------- */
.wxr {
  background: linear-gradient(168deg, var(--th-g700), var(--th-g900));
  border: 1px solid #123f2b; border-bottom: 3px solid var(--th-gold);
  border-radius: var(--th-r-md); padding: 12px 14px; margin: 0 0 14px;
  color: #f4efe0;
}
.wxr-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.wxr-title { font-weight: 800; font-size: 15px; color: #fff; display: inline-flex; align-items: center; gap: 6px; }
.wxr-title .wx-ic { color: var(--th-gold); }
.wxr-hint { font-size: 11.5px; color: #d8d2be; font-weight: 600; }
.wxr-field { margin: 10px 0 2px; }
.wxr-field label { color: #d8d2be; }
.wxr-field .th-select { border-color: rgba(201, 162, 74, .55); font-weight: 700; }
.wxr-field .th-select:focus-visible { outline: 2px solid var(--th-gold); outline-offset: 1px; }

.wx-card.wx-mine { border-top-color: var(--th-gold); box-shadow: 0 0 0 1px var(--th-gold), 0 4px 14px rgba(10, 46, 29, .1); }
.wx-mine-chip {
  display: inline-block; background: var(--th-gold); color: #3a2c00; border-radius: 999px;
  padding: 1px 9px; font-size: 11px; font-weight: 800; vertical-align: 2px;
}

/* ---------- صفحة الطقس ---------- */
.wx-note { font-size: 13px; color: var(--th-ink2); margin: 0 0 10px; }
.wx-areas { display: grid; gap: 14px; margin: 12px 0 18px; }

.wx-card {
  background: var(--th-surface); border: 1px solid var(--th-line);
  border-top: 3px solid var(--th-g800); border-radius: var(--th-r-md);
  padding: 14px 14px 12px; box-shadow: 0 3px 10px rgba(10, 46, 29, .05);
}
.wx-card.wx-down { border-top-color: var(--th-line); box-shadow: none; }
.wx-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.wx-head h3 { margin: 0; color: var(--th-g800); font-size: 17px; }
.wx-upd { font-size: 11.5px; color: var(--th-ink2); }
.wx-upd.wx-stale { color: #8a5a00; font-weight: 700; }

/* بلوك الحالة الحالية */
.wx-now { display: flex; align-items: center; gap: 14px; margin: 10px 0 4px; }
.wx-now .wx-ic-lg { color: var(--th-gold); }
.wx-now-main { display: flex; flex-direction: column; }
.wx-temp { font-size: 40px; font-weight: 800; color: var(--th-g800); line-height: 1.05; font-variant-numeric: tabular-nums; }
.wx-cond { color: var(--th-ink); font-size: 14.5px; font-weight: 700; }
.wx-minmax { color: var(--th-ink2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wx-minmax b { color: var(--th-ink); font-weight: 800; }

/* سطور الرطوبة والرياح والمطر */
.wx-rows { display: grid; gap: 2px; margin: 8px 0 4px; }
.wx-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--th-ink); font-weight: 600; }
.wx-row .wx-ic { color: var(--th-g700); }
.wx-row b { font-weight: 800; font-variant-numeric: tabular-nums; }
.wx-row small { color: var(--th-ink2); font-weight: 600; }

/* المنحنى */
.wx-spark { margin: 10px 0 2px; background: var(--th-cream); border: 1px solid var(--th-line); border-radius: 12px; padding: 10px 10px 6px; }
.wx-spark svg { display: block; width: 100%; height: auto; }
.wx-spark-title { font-size: 11.5px; color: var(--th-ink2); font-weight: 700; margin: 0 0 4px; }

/* كروت الأيام الثلاثة */
.wx-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 4px; }
.wx-day {
  border: 1px solid var(--th-line); border-radius: 12px; padding: 10px 6px 8px;
  text-align: center; background: #fff; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.wx-day b { color: var(--th-g800); font-size: 13px; font-weight: 800; }
.wx-day .wx-ic-md { color: var(--th-gold); margin: 2px 0; }
.wx-day .wx-mm { font-size: 15px; font-weight: 800; color: var(--th-ink); font-variant-numeric: tabular-nums; }
.wx-day .wx-mm span { color: var(--th-ink2); font-weight: 700; font-size: 12.5px; }
.wx-day small { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--th-ink2); font-weight: 700; }
.wx-day small .wx-ic { width: 12px; height: 12px; vertical-align: -0.15em; }

/* التنبيهات: شيبس ملوّنة بأيقونة لكل نوع */
.wx-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wx-flag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 800; border-radius: 999px; padding: 5px 12px; line-height: 1.7;
  border: 1px solid transparent;
}
.wx-flag .wx-ic { width: 14px; height: 14px; vertical-align: -0.2em; }
.wx-flag.wx-f-frost  { background: #e3effd; color: #1d4ed8; border-color: #bfdbfe; }
.wx-flag.wx-f-frost.wx-severe { background: #dbeafe; color: #1e3a8a; border-color: #93c5fd; }
.wx-flag.wx-f-heat   { background: #fdeaea; color: #b91c1c; border-color: #f3c2c2; }
.wx-flag.wx-f-heat.wx-severe { background: #fbdcdc; color: #7f1d1d; border-color: #ef9a9a; }
.wx-flag.wx-f-wind   { background: #eceff1; color: #455a64; border-color: #cfd8dc; }
.wx-flag.wx-f-fungal { background: #f3e8fd; color: #7e22ce; border-color: #e3ccf8; }
.wx-flag.wx-f-rain   { background: #dcebf7; color: #0b5394; border-color: #bcd7ee; }
.wx-flag.wx-ok { background: var(--th-g50); color: var(--th-g700); border-color: #cfe0d5; }

.wx-fail { font-size: 13.5px; color: var(--th-ink2); padding: 6px 0; }

.wx-thresh { font-size: 13.5px; line-height: 1.9; }
.wx-thresh li { margin: 2px 0; }
.wx-src { font-size: 12px; color: var(--th-ink2); margin-top: 10px; }
.wx-src a { color: var(--th-g700); }

@media (max-width: 560px) {
  .wx-temp { font-size: 36px; }
  .wx-now .wx-ic-lg { width: 50px; height: 50px; }
}

/* ---------- شريط الطقس في صفحات المحاصيل ---------- */
.wx-strip {
  background: var(--th-cream); border: 1px solid var(--th-gold-soft);
  border-radius: var(--th-r-sm); padding: 10px 12px; margin: 0 0 12px;
  font-size: 13.5px; line-height: 1.8;
}
.wx-strip .wxs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.wx-strip .wxs-title { font-weight: 800; color: var(--th-g800); font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.wx-strip .wxs-title .wx-ic { color: var(--th-gold); }
.wx-strip .wxs-areas { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 4px; }
.wx-strip .wxs-area {
  font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--th-line); background: #fff; color: var(--th-ink2);
  border-radius: 999px; padding: 2px 10px; min-height: 28px;
}
.wx-strip .wxs-area.on { background: var(--th-g800); color: #fff; border-color: var(--th-g800); }
.wx-strip .wxs-line { color: var(--th-ink); margin: 4px 0 0; font-weight: 600; }
.wx-strip .wxs-line b { font-weight: 800; font-variant-numeric: tabular-nums; }
.wx-strip .wxs-adv { color: var(--th-ink); margin: 2px 0 0; }
.wx-strip .wxs-link { color: var(--th-g700); font-weight: 800; font-size: 12.5px; text-decoration: none; }
.wx-strip .wxs-link:hover { text-decoration: underline; }
.wx-strip .wxs-meta { font-size: 11px; color: var(--th-ink2); margin-top: 4px; }
.wx-strip .wxs-gen {
  font-size: 12px; color: #6b5619; background: #fdf6e3; border: 1px solid var(--th-gold-soft);
  border-radius: 8px; padding: 6px 10px; margin: 6px 0 0; line-height: 1.7;
}
.wx-strip .wxs-regnote-live {
  font-size: 12.5px; color: var(--th-g800); background: var(--th-g50); border: 1px solid #cfe0d5;
  border-radius: 8px; padding: 6px 10px; margin: 6px 0 0; line-height: 1.7;
}
.wx-strip .wxs-flag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 2px 9px; margin-inline-end: 4px;
  border: 1px solid transparent;
}
.wx-strip .wxs-flag .wx-ic { width: 12px; height: 12px; vertical-align: -0.15em; }
.wx-strip .wxs-flag.wx-f-frost  { background: #e3effd; color: #1d4ed8; border-color: #bfdbfe; }
.wx-strip .wxs-flag.wx-f-heat   { background: #fdeaea; color: #b91c1c; border-color: #f3c2c2; }
.wx-strip .wxs-flag.wx-f-wind   { background: #eceff1; color: #455a64; border-color: #cfd8dc; }
.wx-strip .wxs-flag.wx-f-fungal { background: #f3e8fd; color: #7e22ce; border-color: #e3ccf8; }
.wx-strip .wxs-flag.wx-f-rain   { background: #dcebf7; color: #0b5394; border-color: #bcd7ee; }
