/* pp-mobile-v3.css — SHARED CSS MOBILE FIRST V3 (19/11/2026, ca dev dot 2 / F4).
   Dung chung cho: 17 trang tay + 16 trang con (qua childPage trong build-chuyen-muc.js)
   + trang bai (qua build-bai.js). Chi mobile-first, khong doi desktop.
   Breakpoint chuan: 480px (mobile nho) / 768px (mobile + tablet nho) / 1024px (tablet lon).
   - <=480px: luoi an toan nav (link >=44px).
   - <=768px: bottom nav hien, body chuan bi cho nav, cum nut noi doi len,
     moi scroll-margin-top ve 0 (scroll-padding-top la co che duy nhat o mobile).
   - <=1024px: du tru — chua co luat rieng; them o day khi can, khong rac vao file trang. */

/* (a) P3-05: luoi an toan anh toan cuc — anh khong thuoc class nao cung khong tran. */
img{max-width:100%;height:auto}

/* (b) Luoi an toan nav: du phong cho trang chua duoc F1/F3 nang (tai-khoan, dang-nhap,
   nghe-phap, privacy/about/contact/minh-bach, 4 trang moi, trang con, bai). */
@media (max-width:480px){
  .pg-nav a,.mn-nav a{min-height:44px;box-sizing:border-box}
}

/* (d) Bottom nav — an tren desktop, chi hien <=768px. */
.pp-bottomnav{display:none}
@media (max-width:768px){
  .pp-bottomnav{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:1250;
    min-height:56px;padding-bottom:env(safe-area-inset-bottom);
    background:#fffdf6;border-top:1px solid #e3d3a8;
    box-shadow:0 -2px 12px rgba(40,26,8,.12)}
  .pp-bottomnav a,.pp-bottomnav span.pp-bn-tab{flex:1 1 0;display:flex;flex-direction:column;
    align-items:center;justify-content:center;gap:2px;min-height:56px;padding:6px 2px;
    text-decoration:none;color:#6b5a2e;font-size:11px;line-height:1.2;text-align:center}
  .pp-bottomnav .pp-bn-ico{font-size:20px;line-height:1}
  .pp-bottomnav .pp-bn-soon{font-size:10px;opacity:.8}
  .pp-bottomnav a.pp-bn-active{color:#8a0f0f;font-weight:800;
    box-shadow:inset 0 3px 0 #b98a1e}
  .pp-bottomnav .pp-bn-disabled{opacity:.5;pointer-events:none;cursor:default}

  /* (e) Footer khong bi nav che — chi khi JS da inject nav (body.pp-has-bottomnav). */
  body.pp-has-bottomnav{padding-bottom:76px}

  /* (f) Doi cum nut noi + badge skin len tren chieu cao nav (76px). Specificity
     html body #id thang luat #id inline trong trang (ke ca khi <style> me dung sau). */
  html body #ppoFloatCluster{bottom:calc(76px + 12px)}
  html body #ppSkinBadge{bottom:calc(76px + 16px)}

  /* (g) Override mobile: moi scroll-margin-top cua PP-146 ve 0 o <=768px.
     scroll-padding-top la co che duy nhat o mobile (tranh cong don margin+padding:
     #bai-dai tung ha canh o 590px = 240 margin + 350 padding).
     Specificity body+selector thang luat #id/.class goc bat ke thu tu stylesheet
     (quan trong cho trang con: extractStyles dung SAU link shared CSS). */
  body .bt-tool,body .homnay-sec,body .xinxam-sec,body #bangvang,body #scene3dWrap,
  body .bt-result,body .buddha-panel,body .buddha-detail,body #boitoan,
  body #sanchung,body #noi-bat,body #bai-dai,body [id^="nhom-"],body #tat-ca,
  body .pp-podcast-home,body #nsnReader,
  body #laso,body #ngaytot,body #vanmenh,body #luan-bien-so,body #luan-day-so,
  body #luanlaso,body #vanhan,body #tuong,body #hoptuoi,body #phongthuy,
  body #huongnha,body #mohang,body #hoagiai,
  body .nc-body h2,body .nc-body h3,body .nc-body h4{scroll-margin-top:0}
}

/* (h) TUNE scroll-padding-top theo chieu cao header DO THAT — CAP NHAT ca menu-gon 19/11:
   header dinh sau khi gon menu chi con ~56-62px (do that bang CDP sau sua) o moi co <=768px
   (truoc day: trang muc 335px @320 / 286px @390-480 / 251px @768; trang chu nav 282px @390).
   Gia tri chot 76px = 62 + 14 (gap). Desktop giu 120px (luat nay chi <=768px).
   Cac luat tier cu (350/300/265/290/85) da BO — neu header lai cao len thi do lai roi sua so nay. */
@media (max-width:768px){html:root{scroll-padding-top:76px}}

/* (i) MENU GON — header dinh chi giu logo + nut hamburger (ca menu-gon 19/11).
   Nguyen nhan: nav 282px @390 (7-8 link xep 4 hang 48px + hang tai khoan) + bottom nav
   62px = 344px ~ 49% viewport @700 — Tho bao menu chiem nua man hinh (do CDP probe-menu-before).
   Co che: mac dinh an link + khoi tai khoan, chi hien brand + nut burger (JS chen vao nav/header);
   bam burger them class .pp-nav-open vao nav/header -> hien panel tha xuong (link + tai khoan).
   Bam link trong panel / bam ra ngoai / Esc -> dong. Khong xoa link/noi dung nao.
   Specificity "html body ..." thang luat <style> trong trang (trang con copy <style> me SAU link shared). */
.pp-burger{display:none}
@media (max-width:768px){
  .pp-burger{display:inline-flex;align-items:center;justify-content:center;flex:none;
    width:44px;height:44px;margin-left:auto;padding:0;border:1px solid #e5d5a8;border-radius:10px;
    background:#fff8e6;color:#93392a;font-size:20px;line-height:1;cursor:pointer}
  .pp-burger:focus-visible{outline:3px solid #b98a1e;outline-offset:2px}

  /* --- Trang chu: nav.mn-nav (1 hang: brand + burger; mo: link 2 cot + tai khoan) --- */
  html body nav.mn-nav{flex-wrap:nowrap}
  html body nav.mn-nav a.mn-link,html body nav.mn-nav .acct{display:none}
  html body nav.mn-nav.pp-nav-open{flex-wrap:wrap}
  html body nav.mn-nav.pp-nav-open a.mn-link{display:inline-block;flex:1 1 calc(50% - 3px)}
  html body nav.mn-nav.pp-nav-open .acct{display:flex;flex:1 1 100%;order:3}

  /* --- Trang muc/con: header.pg-header (1 hang: brand + burger; mo: nav + tai khoan) --- */
  html body header.pg-header{flex-wrap:nowrap}
  html body header.pg-header nav.pg-nav,html body header.pg-header .pg-auth-in,html body header.pg-header .pg-auth-out{display:none}
  html body header.pg-header.pp-nav-open{flex-wrap:wrap}
  html body header.pg-header.pp-nav-open nav.pg-nav{display:flex;flex:1 1 100%}
  html body header.pg-header.pp-nav-open .pg-auth-in,html body header.pg-header.pp-nav-open .pg-auth-out{display:flex;flex:1 1 100%;order:3}
}
/* ::before chen hang (flex-basis:100%) cua trang chi co tac dung khi menu MO;
   khi dong + nowrap no se day brand/burger tran ngang — tat khi chua mo (chi <=480px, noi luat goc ton tai). */
@media (max-width:480px){
  html body nav.mn-nav:not(.pp-nav-open)::before,html body header.pg-header:not(.pp-nav-open)::before{content:none}
}
