/* ==========================================================================
   TRANG CHỦ — .home-hero · .chip · .place-grid/.place-card · .leaderboard · .home-section-head
   Chỉ nạp ở trang chủ Việt Nam (functions.php).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Banner: tìm kiếm, vị trí của tôi, tỉnh phổ biến | thẻ Hà Nội
   -------------------------------------------------------------------------- */

.home-hero .row {
  --gutter-x: 48px;
  --gutter-y: 32px;
}

.home-hero__search {
  margin-top: 24px;
}

.home-hero__search .site-search__box {
  height: 54px;
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(8, 30, 60, 0.25);
}

.home-hero__search .site-search__results {
  z-index: 50;
}

.home-hero__actions {
  margin-top: 14px;
}

.home-hero__locate {
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.home-hero__locate:hover {
  background: rgba(255, 255, 255, 0.24);
}

.home-hero__locate:disabled {
  opacity: 0.7;
  cursor: progress;
}

.home-hero__locate-msg {
  font-size: 13.5px;
  opacity: 0.9;
}

.home-hero__popular {
  margin-top: 18px;
}

/* 3 ngày tới trong thẻ Hà Nội */
.home-hero__days {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.home-hero__day-name {
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0.9;
}

.home-hero__day img {
  display: block;
  margin: 4px auto;
}

.home-hero__day-temp {
  font-size: 15px;
}

.home-hero__day-temp strong {
  font-weight: 700;
}

.home-hero__day-pop {
  font-size: 12.5px;
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   Chip — liên kết dạng viên thuốc (vùng miền, châu lục, khám phá, đã xem)
   -------------------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-dark);
  white-space: nowrap;
  text-decoration: none !important;
  transition: background 0.2s, border-color 0.2s;
}

.chip:hover {
  border-color: var(--color-border-hover);
  background: var(--color-hover);
  color: var(--color-dark);
}

.weather-hero a.chip--hero {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.weather-hero a.chip--hero:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* --------------------------------------------------------------------------
   Tiêu đề khu vực + lưới thẻ địa điểm
   -------------------------------------------------------------------------- */

.home-section-head__note {
  margin: 0;
  font-size: 13.5px;
  color: var(--color-subtext);
}

.home-section-head__link {
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
}

.home-region-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-subtext);
}

.place-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.place-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-dark);
  text-decoration: none !important;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.place-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-hover);
  color: var(--color-dark);
}

.place-card__head {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.place-card__name {
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.place-card__sub {
  overflow: hidden;
  font-size: 12.5px;
  color: var(--color-subtext);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.place-card__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}

.place-card__icon {
  width: 44px;
  height: 44px;
}

.place-card__temp {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.place-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--color-subtext);
}

.place-card__pop {
  color: var(--color-primary);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Nổi bật hôm nay — bảng top 5
   -------------------------------------------------------------------------- */

.leaderboard {
  height: 100%;
  padding: 18px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.leaderboard__title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
}

.leaderboard__title a {
  color: var(--color-dark);
  text-decoration: none;
}

.leaderboard__list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rank;
}

.leaderboard__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--color-border-soft);
  counter-increment: rank;
}

.leaderboard__item::before {
  content: counter(rank);
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-hover);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
  color: var(--color-primary);
}

.leaderboard__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
  color: var(--color-dark);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.leaderboard__value {
  flex: none;
  font-weight: 700;
}

/* Khám phá thêm: các ô cao bằng nhau */
.content-panel.h-100 {
  height: 100%;
  margin-bottom: 0;
}

@media (max-width: 575px) {
  .place-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .place-card {
    padding: 12px;
  }

  .place-card__temp {
    font-size: 22px;
  }

  .place-card__icon {
    width: 38px;
    height: 38px;
  }
}

.chip__sub {
  margin-left: 4px;
  font-weight: 400;
  color: var(--color-subtext);
}

.place-card__na {
  font-size: 13px;
  color: var(--color-subtext);
}

/* --------------------------------------------------------------------------
   Trang châu lục: bảng chi tiết thu gọn, số thành phố mỗi nước
   -------------------------------------------------------------------------- */

.home-details > summary {
  display: inline-block;
  padding: 8px 0;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
}

.home-details[open] > summary {
  margin-bottom: 12px;
}

.country-link__count {
  margin-left: auto;
  flex: none;
  font-size: 12px;
  color: var(--color-subtext);
}

/* --------------------------------------------------------------------------
   Trang chủ: châu lục (mở/đóng), tính năng, cách dùng
   -------------------------------------------------------------------------- */

.continent-list {
  display: grid;
  gap: 10px;
}

.continent-list__item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.continent-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.continent-list__head::-webkit-details-marker {
  display: none;
}

.continent-list__head::after {
  content: '▾';
  color: var(--color-subtext);
  transition: transform 0.2s;
}

.continent-list__item[open] .continent-list__head::after {
  transform: rotate(180deg);
}

.continent-list__name {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
}

.continent-list__count {
  font-size: 13.5px;
  color: var(--color-subtext);
}

.continent-list__body {
  padding: 0 18px 18px;
}

.continent-list__cta {
  display: inline-block;
  margin-bottom: 12px;
  font-weight: 600;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.feature-card {
  padding: 16px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.feature-card__icon {
  font-size: 24px;
}

.feature-card__title {
  margin: 6px 0 4px;
  font-size: 15.5px;
  font-weight: 700;
}

.feature-card__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.howto-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.howto-list li {
  position: relative;
  padding: 0 0 16px 46px;
  font-size: 15px;
  line-height: 1.55;
  counter-increment: step;
}

.howto-list li::before {
  content: counter(step);
  position: absolute;
  top: -2px;
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  font-weight: 700;
  line-height: 32px;
  text-align: center;
  color: #fff;
}

@media (max-width: 575px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Dải 7 ngày / theo giờ (trang quốc gia)
   -------------------------------------------------------------------------- */

.day-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.day-strip__item,
.hour-strip__item {
  padding: 12px 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-align: center;
}

.day-strip__name {
  font-size: 14px;
  font-weight: 700;
}

.day-strip__date,
.day-strip__pop,
.hour-strip__time,
.hour-strip__pop {
  font-size: 12.5px;
  color: var(--color-subtext);
}

.day-strip__item img,
.hour-strip__item img {
  display: block;
  margin: 6px auto;
}

.day-strip__temp {
  font-size: 15px;
}

.hour-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.hour-strip__item {
  flex: 0 0 74px;
}

.hour-strip__temp {
  font-size: 15px;
  font-weight: 700;
}

/* Danh sách thành phố A–Z */
.az-list__group + .az-list__group {
  margin-top: 14px;
}

.az-list__letter {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
}

.az-list__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.az-list__links a {
  font-size: 14.5px;
  color: var(--color-dark);
}

@media (max-width: 767px) {
  .day-strip {
    display: flex;
    overflow-x: auto;
  }

  .day-strip__item {
    flex: 0 0 96px;
  }
}
