/*
Theme Name: Baothoitiet
Description: Website dự báo thời tiết 34 tỉnh thành Việt Nam
Author: BunnyDV.com
Version: 1.6.7
*/

/* Be Vietnam Pro is served locally by performance-head.php. */

span#ui-id-2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hiển thị viền cho bảng */
table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    border: 1px solid #ccc;
    padding: 8px 10px;
    text-align: left;
}

/* Tô nền nhẹ cho tiêu đề bảng */
table th {
    background: #f5f5f5;
    font-weight: 600;
}


.hero-padding-lg {
    padding-top: 5rem !important;
    padding-bottom: 5rem !important;
}
.expert-box {
    background: #f8faff;
    border-left: 4px solid #0061ff;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
	margin-top: 1.5rem;
}

.expert-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}.author-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #e9ecef;
    object-fit: cover;
}
/* Bọc menu */
.menu-item {
    position: relative;
}
/* Hiện dropdown khi hover */
.nav-item.dropdown:hover > .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Giữ menu đúng vị trí */
.nav-item.dropdown {
    position: relative;
}

/* Ẩn dropdown mặc định */
.dropdown-menu {
    display: none;
    margin-top: 0;
}


/* Nút bấm */
.menu-link {
    display: block;
    padding: .5rem 1rem;
    color: #0d6efd;
    text-decoration: none;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
}

/* Dropdown menu chính */
.region-dropdown {
    display: none;
    position: absolute;
    top: 100%;        /* ngay bên dưới nút */
    right: 0;         /* căn lề phải trùng với nút */
    transform: translateX(0);  /* không đẩy qua phải */
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    padding: 20px;
    z-index: 9999;
    border-radius: 12px;

    display: none;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 20px;
    min-width: 700px;
    text-align: center;
}

/* Hover để mở menu */
.menu-item:hover .region-dropdown {
    display: grid;
}

/* Nhóm khu vực */
.region-group {
    list-style: none;
}

/* Tiêu đề khu vực */
.region-title {
    display: block;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 8px;
    font-size: 15px;
}

.province-link {
    display: block;
    color: #333;
    padding: 7px 0;
    text-decoration: none;
    font-size: 14px;
    background-color: #f9f1e685;
    border-radius: 12px;
}

.province-link:hover {
    color: #007bff;
}

/* CSS cho màn hình điện thoại */
@media (max-width: 768px) {
  .region-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    width: 90vw;
    grid-template-columns: repeat(3, minmax(50px, 1fr));
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: none;
    transform: translate(-12%);
    min-width: 0;
    top: 45px !important;
  }

  .region-content {
    max-height: 100%;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .menu-item.active .region-dropdown {
    display: block;
  }
  
.weather-item {
    flex: 0 0 125px !important;
    background:  #ffffffbf!important;
    text-align: center;
    color: #000000;
    border-right: 1px solid #228caf;
    padding: 10px 5px;
    border-radius: 20px;
}
.weather-item-body img {
    max-width: 60px;
    height: auto; /* Thêm thuộc tính này để giữ nguyên tỉ lệ, giúp ảnh không bị méo */
}
  .custom-weather:nth-child(n+4) {
    display: none;
  }

  .col-xl-3.col-md-3.mb-2.card-post {
    width: 100% !important;
}


}

section.news-popular {
    margin-left: .75rem;
    margin-right: .75rem;
}

.child-page-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.child-page-menu li a {
    padding: 6px 12px;
    background-color: #eee;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
}
.child-page-menu li a.active {
    background-color: #007bff;
    color: white;
}
.ui-autocomplete {
   z-index: 9999 !important;
}


.rank-math-breadcrumb p {
    margin-bottom: 0 !important;
}

h1.card-title.bold {
    font-size: 20px;
    font-weight: bold;
}



@media (min-width: 576px) {
    .justify-content-sm-between {
        justify-content: space-between !important;
        align-items: center;
    }
}
html {
    margin-top: 0;
}


    .live-container {
      display: inline-flex;
      align-items: center;
      background-color: #d0e8ff;
      padding: 6px 12px;
      border-radius: 20px;
      max-height: max-content;
      gap: 5px;
      margin-right: 10px;
      color: #007bff;
      margin-bottom: 15px;
    }

    .live-dot {
      position: relative;
      width: 12px;
      height: 12px;
      background-color: #4CAF50;
      border-radius: 50%;
      margin-right: 8px;
    }

    .live-dot::after {
      content: "";
      position: absolute;
      top: 50%;
      left: 50%;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background-color: rgb(35 177 41);
      transform: translate(-50%, -50%) scale(1);
      animation: pulse 1.5s ease-out infinite;
    }

    @keyframes pulse {
      0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
      }
      100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
      }
    }
    .search-results {
    max-height: 300px;      /* chiều cao tối đa */
    overflow-y: auto;       /* bật cuộn dọc */
    overflow-x: hidden;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 9999;
}
.search-results::-webkit-scrollbar {
    width: 6px;
}
.search-results::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}
.ui-autocomplete {
    max-height: 300px;      /* chiều cao tối đa */
    overflow-y: auto;       /* cho phép cuộn dọc */
    overflow-x: hidden;     /* ẩn cuộn ngang */
    z-index: 9999 !important;
}
.ui-autocomplete {
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.ui-autocomplete {
    max-height: 40vh;
}
/* ===== HEADER ===== */


/* SEARCH */
.search-container {
    flex: 1;
    max-width: 520px;
}

.search-container form {
    display: flex;
    background: #fff;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #d1d5db;
}

.search-container input {
    border: none !important;
    outline: none !important;
    padding: 12px 18px;
    width: 100%;
    font-size: 14px;
    background: transparent;
}

.search-container button {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 0 22px;
    border-radius: 0 999px 999px 0;
    font-weight: 500;
    white-space: nowrap;
}

/* MENU PHẢI */
.nav-pills {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-pills .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ededed;
    font-size: 14px;
    color: black;
    justify-content: center;
}

.nav-pills .nav-link svg {
    width: 16px;
    height: 16px;
    fill: #2563eb;
}

/* Dropdown */
.dropdown-menu {
    border-radius: 12px;
    padding: 8px 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}


/* DÙNG CHUNG CHO H3 + H4 */
.item-link h3,
.item-link h4 {
    font-size: 15px;
    font-weight: 500;
    margin: 0;
}

.item-link h3 a,
.item-link h4 a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #111827;
    text-decoration: none;
}

.item-link h3 a:hover,
.item-link h4 a:hover {
    color: #2563eb;
}

/* ICON ĐỊA ĐIỂM */
.item-link h3 a::before,
.item-link h4 a::before {
    content: "";
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%232563eb' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C8.1 2 5 5.1 5 9c0 5.3 7 13 7 13s7-7.7 7-13c0-3.9-3.1-7-7-7zm0 9.5c-1.4 0-2.5-1.1-2.5-2.5S10.6 6.5 12 6.5s2.5 1.1 2.5 2.5S13.4 11.5 12 11.5z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    display: inline-block;
}

.ui-autocomplete::-webkit-scrollbar {
    width: 4px;
}

.ui-autocomplete::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.25);
    border-radius: 20px;
}
.ui-autocomplete {
    max-height: 240px;
    overflow-y: auto;
}



/* Click, keyboard and touch support for the province grid. */
.region-dropdown.show { display: grid; }
.search-container input:focus-visible, a:focus-visible, button:focus-visible {
    outline: 2px solid #174ea6 !important;
    outline-offset: 2px;
}

/* Readable text for the backgrounds flagged by the PageSpeed audit. */
.alert-primary .rank-math-breadcrumb a { color: #174ea6; text-decoration: underline; text-underline-offset: 2px; }
.live-container { color: #174ea6; }
.live-container span { color: inherit; }
.current-location { background-color: #24657b; }
.current-location .text-white-50,
.current-location .text-white,
.current-location .overview-caption-item { color: #fff !important; opacity: 1; }
.bg-light .text-muted, .analysis-section .text-muted { color: #58616a !important; }
/* Same reserved space before and after opening the interactive map. */
.weather-map { position:relative; width:100%; min-height:380px; border-radius:8px; overflow:hidden; background:#e8f3f7; }
.weather-map-open { min-height:380px; padding:28px; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:16px; color:#174b60; text-align:center; background:linear-gradient(135deg,#e8f3f7,#d4e9db); }
.weather-map-open:hover { color:#123b4b; }
.weather-map-open:focus-visible { outline:3px solid #174ea6; outline-offset:-5px; }
.weather-map-open svg { width:96px; height:96px; }
.weather-map-cta { display:inline-block; background:#174ea6; color:white; border-radius:24px; padding:12px 20px; font-weight:700; }
.weather-map iframe { display:block; width:100%; height:380px; border:0; }
.weather-chart-error { color:#772c18; padding:12px; border:1px solid currentColor; }

canvas { max-width:100%; aspect-ratio:2 / 1; }

.location-data-summary > .d-flex { flex-wrap:wrap; row-gap:8px; }
.location-data-summary .overview-caption { flex:1 1 140px; min-width:0; }
.location-data-summary .overview-caption-item { white-space:normal; overflow-wrap:anywhere; }

/* Autocomplete is an overlay: opening it never shifts page content. */
.weather-search-host{position:relative;flex:1 1 auto;min-width:0;display:flex}
.weather-search-host #searchInput{width:100%;min-width:0}
.weather-search-results{position:absolute;z-index:1050;top:100%;left:0;right:0;margin:0;padding:4px 0;max-height:320px;overflow-y:auto;list-style:none;background:#fff;color:#212529;border:1px solid #adb5bd;border-radius:4px;box-shadow:0 4px 12px #0002}
.weather-search-results[hidden]{display:none}
.weather-search-results [role=option]{padding:10px 14px;cursor:pointer;overflow-wrap:anywhere}
.weather-search-results [role=option]:hover,.weather-search-results [aria-selected=true]{background:#e7f1ff;color:#174ea6}

.weather-search-host .visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}

/* Reserve icon advance width before its font arrives. */
.bi::before{width:1em;text-align:center}

/* Full location/day headings wrap safely in both daily-card layouts. */
.forecast-day-heading{white-space:normal;overflow-wrap:anywhere;line-height:1.5}
.weather-summary-title.forecast-day-summary{flex-wrap:wrap;min-width:0}
.summary-day.forecast-day-heading{flex:0 0 100%;min-width:0;max-width:100%;padding-right:0;margin-bottom:8px;white-space:normal}

/* Mobile first paint uses device fonts: no text-font request or late font swap. */
@media(max-width:767.98px){
html.weather-page body,html.weather-page body *{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}
.custom-logo-link{display:inline-flex;align-items:center;width:150px;height:50px;flex:0 0 150px}
.custom-logo-link .custom-logo{width:150px!important;height:50px!important;object-fit:contain;aspect-ratio:3/1}
.weather-summary-title.forecast-day-summary{gap:8px 0}
.summary-day.forecast-day-heading{margin-bottom:0}
}

/* Keep autocomplete outside the rounded input clipping area. */
.search-container form{position:relative;overflow:visible}
.search-container .weather-search-host{position:static}

/* Skip rendering distant cards until they approach the viewport. */
@media(max-width:767.98px){html.weather-page main .card.mt-3{content-visibility:auto;contain-intrinsic-size:auto 400px}.bi::before{height:1em;line-height:1;overflow:hidden}}
