/* ============================================================
   weather.css - Widget thời tiết & cảnh báo mùa vụ (trang chủ)
   Prefix: home-weather. Đồng bộ tông màu/spacing với home.css,
   dùng lại token từ common.css. Nạp riêng qua block extra_css.
   ============================================================ */

.home-weather {
  margin-top: 3rem;
}

.home-weather__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.home-weather__panel {
  background: #fff;
  border: 1px solid #e2e8d9;
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 4px 16px rgba(21, 59, 36, .06);
}

/* ===== Cột thời tiết ===== */
.home-weather__region-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.1rem;
}

.home-weather__region {
  display: inline-block;
  padding: .35rem .85rem;
  border-radius: 999px;
  border: 1px solid #cfe3c4;
  background: var(--forest-light, #f2f7f3);
  color: var(--forest-mid, #235336);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
}

.home-weather__region:hover {
  border-color: var(--brand-500, #43a047);
  background: var(--brand-100, #e8f5e9);
}

.home-weather__region.is-active {
  background: var(--forest, #153b24);
  border-color: var(--forest, #153b24);
  color: #fff;
}

.home-weather__current {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed #dce8d2;
}

.home-weather__temp {
  font-family: var(--sans);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--forest, #153b24);
}

.home-weather__label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ocean-mid, #365314);
}

.home-weather__stats {
  flex-basis: 100%;
  list-style: none;
  margin: .6rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.4rem;
  font-size: .9rem;
  color: #4b5563;
}

.home-weather__stats span {
  margin-right: .35rem;
  color: #6b7280;
}

.home-weather__stats strong {
  color: var(--ink, #18241d);
  font-weight: 700;
}

.home-weather__daily {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
  margin-top: 1rem;
}

.home-weather__day {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .65rem .6rem;
  border-radius: 10px;
  background: var(--forest-light, #f2f7f3);
  border: 1px solid #e2e8d9;
  font-size: .82rem;
  text-align: center;
}

.home-weather__day-date {
  font-weight: 700;
  color: var(--forest, #153b24);
}

.home-weather__day-label {
  color: var(--ocean-mid, #365314);
  font-size: .78rem;
}

.home-weather__day-temps {
  font-weight: 700;
  color: var(--ink, #18241d);
}

.home-weather__day-rain {
  color: #2563eb;
  font-size: .78rem;
}

/* ===== Cột cảnh báo mùa vụ ===== */
.home-weather__alerts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}

.home-weather__alert {
  padding: .85rem 1rem;
  border-radius: 10px;
  border: 1px solid #e2e8d9;
  border-left: 4px solid var(--brand-500, #43a047);
  background: linear-gradient(180deg, #fbfef9 0%, #fff 100%);
}

.home-weather__alert-title {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 .35rem;
  line-height: 1.4;
  color: var(--forest, #153b24);
}

.home-weather__alert-title a {
  color: inherit;
  text-decoration: none;
}

.home-weather__alert-title a:hover {
  color: var(--brand-600, #1b5e20);
  text-decoration: underline;
}

.home-weather__chip {
  display: inline-block;
  padding: .15rem .7rem;
  margin-bottom: .4rem;
  border-radius: 999px;
  background: var(--brand-100, #e8f5e9);
  color: var(--brand-700, #184c22);
  font-size: .75rem;
  font-weight: 700;
}

.home-weather__alert-body {
  margin: 0 0 .55rem;
  font-size: .9rem;
  line-height: 1.6;
  color: #374151;
}

.home-weather__alert-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
}

.home-weather__reason {
  font-size: .78rem;
  color: #6b7280;
  font-style: italic;
}

.home-weather__alert-link {
  font-size: .82rem;
  font-weight: 700;
  color: var(--brand-600, #1b5e20);
  text-decoration: none;
}

.home-weather__alert-link:hover {
  text-decoration: underline;
}

.home-weather__empty {
  margin: .4rem 0;
  font-size: .95rem;
  color: #6b7280;
}

/* ===== Mobile: stack 1 cột, ẩn bớt chi tiết cho gọn ===== */
@media (max-width: 768px) {
  .home-weather__grid {
    grid-template-columns: 1fr;
  }

  .home-weather__temp {
    font-size: 2.1rem;
  }

  /* Chỉ hiện 2 pill vùng đầu, phần còn lại cuộn ngang */
  .home-weather__region-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: .25rem;
    -webkit-overflow-scrolling: touch;
  }

  .home-weather__region {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Ẩn thống kê phụ (gió, lượng mưa) trên mobile */
  .home-weather__stats li:nth-child(2),
  .home-weather__stats li:nth-child(3) {
    display: none;
  }

  .home-weather__daily {
    gap: .45rem;
  }

  .home-weather__day-label {
    display: none;
  }

  .home-weather__alert-foot {
    justify-content: flex-start;
  }
}

/* Dong ghi thoi diem quan trac + attribution + disclaimer (yeu cau WeatherAPI.com) */
.home-weather__observed {
  margin: .55rem 0 0;
  font-size: .78rem;
  color: #7a8b74;
  font-family: var(--sans);
}
.home-weather__attribution {
  margin: .85rem 0 0;
  font-size: .78rem;
  color: #7a8b74;
  font-family: var(--sans);
}
.home-weather__attribution a {
  color: var(--forest, #2e5a27);
  font-weight: 600;
  text-decoration: underline;
}
.home-weather__disclaimer {
  margin: 1.15rem 0 0;
  font-size: .72rem;
  line-height: 1.55;
  color: #8a9b84;
  font-family: var(--sans);
}
.home-weather__disclaimer--en {
  margin-top: .35rem;
  font-style: italic;
}
