/* ============================================================
   utility.css  ·  LAYER 3 (load after common.css)
   Shared by the utility pages the homepage/subpages don't need:
     · error pages   (.errpage)   — 404.html, 500.html
     · site search   (.srch)      — tim-kiem.html
     · apply modal   (.amodal)    — tuyen-dung*
     · sitemap       (.sitemap)   — sitemap.html
   2026-08-26: §3 CONTACT FORM (.cform/.cfact) và §4 THANK-YOU MODAL
   (.modal/.thanks) đã CHUYỂN sang common.css — khối form nay đóng cuối 10 trang
   nên không còn là "utility", xem ghi chú ở cuối common.css. .amodal (§4b dưới)
   vẫn tái sử dụng .modal/.field/.cform__row từ common.css.
   Every value comes from a token; classes are prefixed to stay out of
   the shared layer.  House rules: spacing over borders, 4/6/8 radius,
   hover = đổi màu hoặc sáng lên (không làm mờ), one green accent.
   ============================================================ */

/* ============================================================
   1. ERROR PAGES  (404 / 500)  ·  centred editorial hero
   Reuses .page-hero's warm band + glow idiom, but centres the column
   and blows the status code up as the focal element.
   ============================================================ */
.errpage{
  position:relative; isolation:isolate; overflow:hidden;
  min-height:clamp(560px, 84vh, 900px);
  display:grid; place-items:center;
  padding-top:calc(var(--head-h) + 14px + clamp(30px,5vw,64px));
  padding-bottom:clamp(56px,8vw,110px);
  background:linear-gradient(180deg, var(--eco) 0%, var(--eco-lite) 58%, var(--bg) 100%);
  text-align:center;
}
/* the standalone glow span is replaced by a glow centred on the number
   (.errpage__code::before) so it can never drift off-axis. */
.errpage__glow{display:none}
.errpage__inner{position:relative; z-index:1; max-width:820px; padding-inline:var(--gut); margin-inline:auto}

/* the big status code — OUTLINE display face (stroke, no fill) so the warm
   band shows through; the middle digit takes the single green accent.
   The soft brand glow lives on ::before, dead-centred behind the numerals. */
.errpage__code{
  position:relative; isolation:isolate; display:block;
  font-family:var(--font-display); font-weight:700; line-height:.9;
  font-size:clamp(120px, 26vw, 320px); letter-spacing:-.04em;
  color:transparent;
  -webkit-text-stroke:clamp(1.5px,.24vw,3px) var(--head);
  text-stroke:clamp(1.5px,.24vw,3px) var(--head);
}
.errpage__code::before{
  content:""; position:absolute; z-index:-1; top:50%; left:50%;
  transform:translate(-50%,-50%);
  width:clamp(340px,46vw,660px); aspect-ratio:1; border-radius:50%;
  background:var(--blob-green); filter:blur(16px); pointer-events:none;
  animation:errBreathe 7s var(--ease) infinite;
}
@keyframes errBreathe{
  0%,100%{ opacity:.7;  transform:translate(-50%,-50%) scale(1) }
  50%{     opacity:1;   transform:translate(-50%,-50%) scale(1.08) }
}
@media (prefers-reduced-motion:reduce){ .errpage__code::before{animation:none} }
.errpage__code .accent{-webkit-text-stroke-color:var(--green); text-stroke-color:var(--green)}

.errpage__eyebrow{margin-bottom:14px}
.errpage__title{
  margin-top:clamp(10px,1.4vw,18px);
  font-size:clamp(26px,3.4vw,40px); line-height:var(--lh-title); letter-spacing:-.02em;
  color:var(--head); max-width:none;   /* dùng trọn bề rộng inner → không xuống dòng gượng */
}
.errpage__lead{
  margin:clamp(14px,1.6vw,20px) auto 0; max-width:64ch;
  color:var(--muted); font-weight:500;
  font-size:clamp(16px,1.3vw,18px); line-height:1.7;
}
.errpage__actions{
  margin-top:clamp(26px,3vw,40px);
  display:flex; flex-wrap:wrap; gap:14px; justify-content:center;
}

/* ============================================================
   2. SITE SEARCH  (tim-kiem.html)  ·  one page: input + results
   ============================================================ */

/* --- the search bar: a big pill sitting under the page hero --- */
.srch__bar{
  position:relative; margin-top:clamp(22px,3vw,34px); max-width:640px;
}
.srch__form{
  display:flex; align-items:center; gap:12px;
  background:var(--white);
  border:1px solid var(--line); border-radius:var(--r-btn);
  padding:6px 6px 6px 22px;
  transition:border-color var(--t-2) var(--ease), box-shadow var(--t-2) var(--ease);
}
.srch__form:focus-within{
  border-color:var(--green);
  box-shadow:0 0 0 4px rgba(0,139,68,.08);
}
.srch__form .ico--search{width:20px; height:20px; color:var(--muted); flex:none}
.srch__input{
  flex:1; min-width:0; border:0; background:transparent;
  font-family:var(--font-body); font-size:clamp(16px,1.4vw,18px);
  font-weight:500; color:var(--ink); padding:14px 0;
}
.srch__input::placeholder{color:var(--muted); opacity:.8}
.srch__input:focus{outline:none}
.srch__submit{flex:none}          /* a .btn — inherits shell button styles */

/* --- the results head: "N kết quả cho …" --- */
.srch__meta{
  margin-top:clamp(30px,4vw,46px);
  font-size:15px; color:var(--muted); font-weight:500;
}
.srch__meta strong{color:var(--head); font-weight:700}

/* --- results list: quiet editorial rows, spacing not borders --- */
.srch__results{margin-top:22px; display:flex; flex-direction:column}
.shit{
  display:block; padding:clamp(20px,2.4vw,28px) 0;
  border-top:1px solid var(--line-light);
  transition:transform var(--t-2) var(--ease);
}
.shit:last-child{border-bottom:1px solid var(--line-light)}
.shit:hover{transform:translateX(6px)}
.shit__kicker{
  display:inline-block; margin-bottom:8px;
  font-size:12px; font-weight:700; letter-spacing:.1em; text-transform:uppercase;
  color:var(--green);
}
.shit__title{
  font-family:var(--font-display); font-weight:700;
  font-size:clamp(19px,1.9vw,24px); line-height:var(--lh-title); color:var(--head);
  display:inline-flex; align-items:center; gap:10px;
}
.shit:hover .shit__title{color:var(--green)}
.shit__title .ico{width:16px; height:16px; opacity:0; transform:translateX(-4px);
  transition:opacity var(--t-2) var(--ease), transform var(--t-2) var(--ease)}
.shit:hover .shit__title .ico{opacity:1; transform:translateX(0)}
.shit__desc{
  margin-top:8px; max-width:64ch; color:var(--ink-2);
  font-size:15.5px; line-height:1.7;
}
.shit__desc mark{
  background:var(--green-soft); color:var(--head);
  padding:.02em .18em; border-radius:var(--r-sm); font-weight:600;
}
.shit__url{
  margin-top:8px; font-size:13px; color:var(--muted); letter-spacing:.01em;
}

/* --- empty state: no results --- */
.srch__empty{
  margin-top:clamp(34px,4vw,52px); max-width:56ch; margin-inline:auto;   /* 09/09: hộp max-width trong cột canh giữa phải tự canh, text-align không đủ */
  padding:clamp(30px,4vw,48px); text-align:center;
  background:var(--card-cream); border-radius:var(--r-card);
}
.srch__empty-icon{
  width:56px; height:56px; margin:0 auto clamp(14px,1.6vw,20px);
  display:grid; place-items:center; border-radius:50%;
  background:var(--white); color:var(--muted);
}
.srch__empty-icon .ico{width:26px; height:26px}
.srch__empty h2{
  font-size:clamp(20px,2.2vw,26px); color:var(--head); letter-spacing:-.01em;
}
.srch__empty p{margin-top:10px; color:var(--muted); font-size:16px; line-height:1.7}
.srch__empty .srch__suggest{
  margin-top:22px; display:flex; flex-wrap:wrap; gap:10px; justify-content:center;
}
.srch__suggest a{
  font-size:13.5px; font-weight:600; color:var(--head);
  background:var(--white); padding:9px 16px; border-radius:var(--r-btn);
  transition:transform var(--t-1) var(--ease), color var(--t-1) var(--ease);
}
.srch__suggest a:hover{transform:translateY(var(--lift-1)); color:var(--green)}

/* the "start typing" resting state (before any query) */
.srch__hint{
  margin-top:clamp(34px,4vw,52px); color:var(--muted);
  font-size:16px; line-height:1.7; max-width:52ch;
}

/* --- RESTING STATE: chips phổ biến + lưới "Khám phá nhanh" ---
   Fills the page before any query so it never reads as an empty box. */
.srch__resting{margin-top:clamp(6px,1vw,10px)}

.srch__chips{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
  margin-top:clamp(16px,1.8vw,22px); max-width:640px;
}
.srch__chips-label{
  font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase;
  color:var(--muted); margin-right:2px;
}
.srch__chips a{
  font-size:13.5px; font-weight:600; color:var(--head);
  background:var(--white); padding:9px 16px; border-radius:var(--r-btn);
  box-shadow:inset 0 0 0 1px var(--line-light);
  transition:transform var(--t-1) var(--ease), color var(--t-1) var(--ease), box-shadow var(--t-1) var(--ease);
}
.srch__chips a:hover{transform:translateY(var(--lift-1)); color:var(--green); box-shadow:inset 0 0 0 1px var(--green-line)}

/* explore grid */
.explore{margin-top:clamp(38px,5vw,60px)}
.explore__h{
  display:flex; align-items:baseline; gap:12px;
  font-size:clamp(19px,2vw,24px); color:var(--head); letter-spacing:-.01em;
  margin-bottom:clamp(18px,2vw,26px);
}
.explore__h small{font-family:var(--font-body); font-size:14px; font-weight:500; color:var(--muted)}
.explore__grid{
  display:grid; gap:clamp(14px,1.6vw,20px);
  grid-template-columns:repeat(3,1fr);
}
@media (max-width:900px){ .explore__grid{grid-template-columns:repeat(2,1fr)} }
@media (max-width:560px){ .explore__grid{grid-template-columns:1fr} }

.ecard{
  position:relative; display:flex; flex-direction:column;
  padding:clamp(22px,2.4vw,28px);
  background:var(--white); border-radius:var(--r-card);
  box-shadow:inset 0 0 0 1px var(--line-light);
  min-height:150px;
  transition:transform var(--t-2) var(--ease), box-shadow var(--t-2) var(--ease);
}
.ecard:hover{transform:translateY(var(--lift-2)); box-shadow:0 18px 40px -22px rgba(0,60,30,.35)}
.ecard__kicker{
  font-size:11.5px; font-weight:700; letter-spacing:.09em; text-transform:uppercase;
  color:var(--green); margin-bottom:9px;
}
.ecard__title{
  font-family:var(--font-display); font-weight:700;
  font-size:clamp(17px,1.6vw,20px); line-height:var(--lh-title); color:var(--head);
}
.ecard__desc{
  margin-top:9px; color:var(--muted); font-size:14px; line-height:1.6; flex:1;
}
.ecard__arw{
  width:18px; height:18px; margin-top:16px; color:var(--muted);
  transform:translateX(0); transition:transform var(--t-2) var(--ease), color var(--t-2) var(--ease);
}
.ecard:hover .ecard__arw{transform:translateX(6px); color:var(--green)}

/* ============================================================
   4b. APPLY MODAL  (.amodal)  ·  popup ứng tuyển (tuyen-dung*)
   Tái sử dụng khung .modal + .field/.cform__row; dialog rộng hơn,
   text trái, cuộn được khi màn thấp. Mở bằng .js-apply-open
   (main.js §initApplyForm) — form đính kèm CV, site tĩnh demo.
   ============================================================ */
.amodal__dialog{
  width:min(620px,100%); text-align:left;
  max-height:min(88svh,860px); overflow:auto; overscroll-behavior:contain;
  padding:clamp(26px,3.2vw,40px) clamp(22px,3vw,40px);
}
.amodal__dialog::before{display:none}   /* bỏ glow trung tâm — form cần mặt phẳng sạch */
.amodal__eyebrow{
  display:block; margin-bottom:10px;
  font-size:11px; font-weight:800; letter-spacing:.14em; text-transform:uppercase;
  color:var(--green);
}
.amodal__title{
  font-size:clamp(21px,2.4vw,27px); line-height:var(--lh-title); color:var(--head);
  letter-spacing:-.01em; padding-right:36px;
}
.amodal__title .js-apply-pos{color:var(--green)}
.amodal__lead{margin:10px 0 clamp(18px,2.2vw,26px); font-size:14.5px; line-height:1.65; color:var(--muted)}
.amodal__form .btn{width:100%; justify-content:center}
.amodal__form .field__area{min-height:104px}   /* modal thấp hơn trang — rút chiều cao lời nhắn */
/* vị trí ứng tuyển do nút mở popup prefill — readonly, nhìn "tĩnh" để khỏi tưởng nhập được */
.amodal__form .field__input[readonly]{
  background:var(--cream); color:var(--head); font-weight:600; cursor:default;
}
.amodal__form .field__input[readonly]:focus{border-color:var(--line); box-shadow:none; background:var(--cream)}

/* trường đính kèm CV — hộp nét đứt, click cả vùng để chọn tệp */
.afile input[type="file"]{
  position:absolute; width:1px; height:1px; opacity:0; overflow:hidden;
  clip-path:inset(50%); white-space:nowrap;
}
.afile__box{
  position:relative;
  display:flex; align-items:center; gap:14px;
  border:1.5px dashed rgba(0,92,46,.35); border-radius:var(--r);
  background:var(--bg); padding:13px 16px; cursor:pointer;
  transition:border-color var(--t-2) var(--ease), background var(--t-2) var(--ease), box-shadow var(--t-2) var(--ease);
}
.afile__box:hover{border-color:var(--green); background:var(--green-soft)}
.afile input[type="file"]:focus-visible + .afile__box{
  border-color:var(--green); box-shadow:0 0 0 4px rgba(0,139,68,.12);
}
.afile.has-file .afile__box{border-style:solid; border-color:var(--green); background:var(--white)}
.field.is-error .afile__box{border-color:var(--red); box-shadow:0 0 0 4px rgba(235,28,36,.07)}
.afile__ico{
  flex:none; width:42px; height:42px; border-radius:50%;
  display:grid; place-items:center;
  background:var(--green); color:#fff;
}
.afile__ico svg{width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round}
.afile__meta{min-width:0}
.afile__name{
  display:block; font-size:14.5px; font-weight:700; color:var(--head);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.afile__hint{display:block; margin-top:2px; font-size:12.5px; color:var(--muted)}

/* ============================================================
   5. SITEMAP  (.sitemap)  ·  sitemap.html
   Lưới nhóm link nhiều cột — trước đây .sitemap__grid chưa có style
   nên cả trang dồn 1 cột sát mép trái.
   ============================================================ */
.sitemap__grid{
  display:grid; grid-template-columns:repeat(3,1fr);
  gap:clamp(30px,4vw,54px) clamp(24px,3.4vw,48px);
  max-width:980px;
}
.sitemap__grid .headline--sm{font-size:clamp(17px,1.7vw,21px)}
.sitemap__grid ul{list-style:none; margin:14px 0 0; padding:0; display:grid; gap:9px}
.sitemap__grid a{
  color:var(--ink-2); font-weight:600; font-size:14.5px; text-decoration:none;
  transition:color var(--t-1) var(--ease);
}
.sitemap__grid a:hover{color:var(--green)}
/* cấp 3 của cây (IA 2026-07-22): Feed/Farm/Food, Định kỳ/Bất thường… — thụt vào
   sau mục cha, gạch dọc mảnh làm chỉ dẫn phân cấp thay vì bullet. */
.sitemap__grid .sitemap__sub{
  margin:7px 0 2px; padding-left:12px; gap:6px;
  border-left:1px solid color-mix(in srgb, var(--green) 22%, transparent);
}
.sitemap__grid .sitemap__sub a{font-size:14px; opacity:.82}
@media (max-width:860px){.sitemap__grid{grid-template-columns:repeat(2,1fr)}}
@media (max-width:480px){.sitemap__grid{grid-template-columns:1fr}}

/* ===== Bản đồ trụ sở (Liên hệ) — dải map full-bleed + thẻ địa chỉ nổi ===== */
.lh-map{position:relative; line-height:0}
.lh-map iframe{width:100%; height:clamp(360px,44vw,540px); border:0; display:block}
.lh-map__card{
  position:absolute; z-index:2; top:50%; left:clamp(16px,6vw,84px); transform:translateY(-50%);
  width:min(360px,84vw); line-height:1.5;
  background:var(--white); border-radius:var(--r-lg);
  padding:clamp(22px,2.4vw,30px);
  box-shadow:0 30px 60px -28px rgba(4,40,20,.4);
}
.lh-map__eyebrow{display:block; text-transform:uppercase; letter-spacing:.14em; font-size:11.5px; font-weight:800; color:var(--green)}
.lh-map__title{display:block; margin-top:8px; font-family:var(--font-display); font-weight:700; color:var(--head); font-size:clamp(19px,1.8vw,23px); line-height:var(--lh-title)}
.lh-map__addr{margin-top:10px; color:var(--ink-2); font-size:15px}
.lh-map__dir{margin-top:18px}
@media (max-width:640px){
  .lh-map{display:flex; flex-direction:column}
  .lh-map__card{position:static; transform:none; width:auto; margin:0 auto; border-radius:0}
  .lh-map iframe{height:320px; order:2}
}

/* Khoảng hở dưới .headline khi sau nó là một khối nội dung (không phải câu dẫn).
   .headline tự nó margin:0 (reset h1-h4), nên phải khai tường minh. */
.headline--gap{margin-bottom:var(--gap-block)}

/* 09/09/2026 (rà trang con, chuẩn home): tablet dọc không khoá min-height theo vh —
   .errpage 84vh trên 768×1024 tạo ~860px trống. */
@media (min-width:561px) and (max-width:1024px) and (orientation:portrait){
  .errpage{min-height:clamp(420px,60vh,640px)}
}
