/* ==========================================================================
   wp.css — chỉ những gì WordPress thêm vào mà bản layout tĩnh không có.
   Nạp SAU các file layout/*.css. Không sửa giao diện gốc ở đây.
   ========================================================================== */

/* Thanh admin (chỉ khi đăng nhập): đẩy header dính xuống dưới thanh admin */
.admin-bar header.nav { top: 32px; }
@media (max-width: 782px) { .admin-bar header.nav { top: 0; } }

/* Header when scrolled, desktop — client decision (2026-09-29), overriding
   shell.css §1: instead of a white pill around the menu only, the whole row
   (logo, menu, VI/EN, button) sits in one floating rounded pill, with the page
   still visible around it. The header itself stays transparent. Phones keep
   shell.css's full white bar (≤1040px), which the burger menu opens from. */
@media (min-width: 1041px) {
  /* Header keeps its 78px in the flow, so the shorter pill never makes the page jump;
     transform (not margin, which collapses through the header) drops it off the top edge. */
  header.nav { min-height: 78px; }
  header.nav .wrap {
    border-radius: 999px;
    transition: background var(--dur-base), box-shadow var(--dur-base), height var(--dur-base), transform var(--dur-base);
  }
  header.nav.solid .wrap {
    height: 62px;
    transform: translateY(10px);
    background: rgba(255, 255, 255, .8);
    box-shadow: 0 6px 22px rgba(18, 60, 25, .10), 0 1px 3px rgba(18, 60, 25, .06);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    backdrop-filter: saturate(160%) blur(10px);
  }
  header.nav.solid menu { background: transparent; box-shadow: none; }
}


/* Trang Địa điểm — tách nguyên văn từ <style> của template/destinations.html */
#dia-diem .s-head h2 { line-height: 1.4; margin-bottom: 1rem; }
#dia-diem .s-head h2 em { white-space: nowrap; }
.post-type-archive-destination .dest .cap .serif { font-size: 1.2rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dest .cap small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: .25rem; }
a.dest { display: block; text-decoration: none; color: inherit; cursor: pointer; }

/* Phân trang — cùng hình dáng với nút lọc (.chip) */
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: var(--space-7); }
.pager .page-numbers { min-width: 42px; height: 42px; padding: 0 .9rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill); border: 1px solid var(--color-line); background: #fff; color: var(--color-body);
  font-size: var(--fs-small); font-weight: var(--fw-semibold); transition: all var(--dur-fast); }
.pager a.page-numbers:hover { border-color: var(--green-400); color: var(--green-700); }
.pager .page-numbers.current { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.pager .page-numbers.dots { border: 0; background: none; }

/* Trạng thái rỗng (lọc không ra kết quả) */
.empty-state { text-align: center; padding: var(--space-7) var(--space-5); background: #fff; border: 1px dashed var(--color-line); border-radius: var(--radius-lg); color: var(--color-muted); }
.empty-state .btn { margin-top: var(--space-4); }

/* Form: ô nội dung nhiều dòng giống ô nhập của layout */
.inp textarea { width: 100%; min-height: 110px; padding: .75rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--color-line);
  background: var(--sand-50); color: var(--color-ink); font-family: var(--font-ui); font-size: inherit; resize: vertical; }
.inp input:focus, .inp select:focus, .inp textarea:focus { outline: 2px solid var(--green-400); outline-offset: 1px; }
.inp.is-invalid input, .inp.is-invalid select, .inp.is-invalid textarea { border-color: #d64545; background: #fff6f6; }
.inp .err { display: block; margin-top: .3rem; font-size: var(--fs-caption); color: #c03333; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.2rem; }
.form-actions .btn[disabled] { opacity: .65; cursor: progress; }
.form-status { font-size: var(--fs-small); margin: 0; }
.form-status:empty { display: none; }
.form-status.ok { color: var(--green-700); font-weight: var(--fw-semibold); }
.form-status.err { color: #c03333; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.tabs .tab { background: none; border-left: 0; border-right: 0; border-top: 0; font-family: inherit; }
.searchbar .f .v input { width: 100%; border: 0; background: transparent; font: inherit; color: inherit; padding: 0; outline: 0; }
.bookcard .embed-slot { margin-top: var(--space-4); }

/* Nội dung bài viết (Cẩm nang / Tin tức / trang chính sách) */
.prose > *:first-child { margin-top: 0; }
.prose a { color: var(--green-700); font-weight: var(--fw-semibold); text-decoration: underline; text-underline-offset: 2px; }
.prose figure { margin: 1.2em 0; }
.prose figcaption { font-size: var(--fs-caption); color: var(--color-muted); text-align: center; margin-top: .4rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: var(--fs-small); }
.prose th, .prose td { border: 1px solid var(--color-line); padding: .6rem .8rem; text-align: left; }
.post-meta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .9rem; color: rgba(255, 255, 255, .9); font-size: var(--fs-small); }
.post-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.side-posts { display: flex; flex-direction: column; gap: 1rem; }
.side-posts a { display: grid; grid-template-columns: 84px 1fr; gap: .8rem; align-items: center; color: var(--color-ink); font-weight: var(--fw-semibold); font-size: var(--fs-small); line-height: 1.35; }
.side-posts img { width: 84px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); }
.side-posts small { display: block; color: var(--color-muted); font-weight: 400; margin-top: .2rem; }

/* Video (thư viện, trang chủ, giới thiệu): khung phát nổi */
.video-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 1rem; background: rgba(8, 20, 12, .82); }
.video-modal[hidden] { display: none; }
.video-modal .vm-box { position: relative; width: min(960px, 100%); aspect-ratio: 16/9; background: #000; border-radius: var(--radius-lg); overflow: hidden; }
.video-modal iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-modal .vm-close { position: absolute; top: -46px; right: 0; width: 38px; height: 38px; border-radius: 50%; border: 0; background: #fff; color: var(--color-ink); display: grid; place-items: center; cursor: pointer; }
.video-tile button { cursor: pointer; }

/* Ảnh lớn (bấm vào ảnh thư viện) */
.lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 1rem; background: rgba(8, 20, 12, .9); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1200px, 100%); max-height: 86vh; width: auto; height: auto; border-radius: var(--radius-md); }
.lightbox button { position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: var(--color-ink); display: grid; place-items: center; cursor: pointer; }
.lightbox .lb-close { top: 1rem; right: 1rem; }
.lightbox .lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }

/* Link chính sách dưới cùng footer (layout để chữ thường, giờ là link thật) */
.fb-outro footer.site .bottom .legal a { display: inline; padding: 0; font-size: inherit; color: inherit; }
.fb-outro footer.site .bottom .legal a:hover { color: var(--orange-400); }
.fb-outro footer.site .bottom .legal a + a::before { content: " · "; color: rgba(255, 255, 255, .6); }

/* Chuyển ngôn ngữ VI / EN (thay cho span#lang tĩnh) */
.lang a { color: inherit; }
.lang a.is-active { font-weight: 700; }

/* 404 / tìm kiếm */
.search-form-inline { display: flex; gap: .6rem; max-width: 520px; margin: var(--space-5) auto 0; }
.search-form-inline input { flex: 1; min-width: 0; padding: .75rem 1rem; border-radius: var(--radius-pill); border: 1px solid var(--color-line); background: #fff; font: inherit; }

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

/* Tổng quan tour / địa điểm: nội dung từ ô soạn thảo, cùng kiểu đoạn văn của layout */
.detail-overview p { color: var(--color-body); font-size: var(--fs-body-lg); line-height: 1.75; margin-bottom: .8em; }
.detail-overview p:last-child { margin-bottom: 0; }
.detail-overview ul { color: var(--color-body); padding-left: 1.2rem; }
.side a[href*="ngay="]:hover span:first-child { color: var(--green-700); }

/* Nút <button class="btn"> dùng font trang như <a class="btn"> của layout */
button.btn { font-family: inherit; cursor: pointer; }
/* Ô "Nội dung" ở form liên hệ: layout đặt margin-top:1rem inline */
.inp-full { margin-top: 1rem; }
[hidden] { display: none !important; }
/* Câu chuyện (Giới thiệu): đoạn văn từ ô soạn thảo */
.story-body p { margin-bottom: var(--space-4); }
.story-body { margin-bottom: var(--space-6); }
/* Khối văn hoá (trang Tour): các đoạn cách nhau như layout, dòng in đậm cuối màu xanh */
.culture-body p + p { margin-top: 1rem; }
.culture-body p > strong:only-child { display: block; margin-top: .5rem; color: var(--green-700); }

/* Bản đồ trang chủ (mobile/tablet): ảnh của điểm luôn 16:10 dù ảnh tải lên dọc hay ngang */
@media (max-width: 1040px) {
  .fb-map .rt-blog img { aspect-ratio: 16 / 10 !important; object-fit: cover; }
}

/* WordPress prints width/height on every <img>. The layout CSS never sets
   height:auto, so an image outside a sized box would stretch to its height
   attribute. :where() keeps this at zero specificity: every layout rule
   (e.g. `.tcard .media img{height:100%}`) still wins over it. */
:where(img) { height: auto; }

/* Datacom flight plugin (template-parts/bookcard.php). It renders into the page,
   not an iframe, and themes itself with :root variables — re-point its blue
   palette at the site's green so the widget reads as part of the brand. */
#dtc-plugin {
  --pri-cl: var(--green-700);
  --pri-dark-cl: var(--orange-500);
  --sec-cl: var(--green-50);
  --sub-cl: var(--green-100);
  --light-primary-cl: rgba(57, 181, 74, 0.10);
  --light-blue-cl: var(--green-600);
  --sys-blue-cl: var(--green-600);
  --bue2-cl: var(--green-800);
  font-family: inherit;
}
@media (max-width: 640px) {
  /* Datacom lays its results out by VIEWPORT width, not by its box, so inside
     the padded card a 390px phone got a layout ~40px wider than the space and
     the "Chọn" button ran off screen. On the Flights page (the only place the
     results render) the card goes edge to edge on phones instead. */
  .page-template-template-flights .bookcard:has(#dtc-plugin) {
    margin-inline: calc(-1 * var(--space-5));
    padding: var(--space-4) 0;
    border-inline: 0;
    border-radius: 0;
  }
  .page-template-template-flights .bookcard:has(#dtc-plugin) .top { padding-inline: var(--space-4); }
}
